FileTools



Latest version

Released:

FIT File Tools A collection of useful tools for manipulating FIT files.

  1. What is it XL-FileTools provides a bunch of functions for files, grouped in three categories: Another interesting feature of XL-FileTools is preview mode. You can see what's gonna happen before doing it for real.
  2. The fit file repair tool which I have developed helps you to repair corrupted FIT files and rescue your valuable data. The main features are: import of (corrupted) FIT, TCX and HRM files export as FIT, TCX or HRM file.
  3. Tools to help setup fcl for a grid project. Setup with setup mu2e source an offline setup.sh script setup mu2etools generatefcl. A project may consist of several grid submissions, and each of those submissions may have many jobs.
  4. Download XL-FileTools - Perform various file operations such as listing with custom sets of details, copying and moving, and rename based on hash values or custom parameters.

File Tools Meaning

file processing tools

FileTools

Project description

This is still very much in progress. Don't use it :-)

  • Documentation: https://filetools.readthedocs.io
  • Source: https://github.com/wingechr/filetools
  • Package: https://pypi.org/project/filetools

Filetools Extension

FileTools

Release historyRelease notifications | RSS feed

0.0.5

0.0.4

0.0.2

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for filetools, version 0.0.5
Filename, sizeFile typePython versionUpload dateHashes
Filename, size filetools-0.0.5.tar.gz (1.5 kB) File type Source Python version None Upload dateHashes
Close

Hashes for filetools-0.0.5.tar.gz

Hashes for filetools-0.0.5.tar.gz
AlgorithmHash digest
SHA2569097e3fe44b514f6937e1a71c3cb7332512f8d291c16f9bbdc86c81c0932d164
MD5fa4c13e6ad9af0571f72ec58a48f2765
BLAKE2-2566d17cbe4ea7a16c37b44906acaa7c2609b1558bf47d5e4e5faa0d23efcec2cee
    • Field Summary

      Fields
      Modifier and TypeField and Description
      static StringDATA_FOLDER_NAME
      static StringDEVICE_FILE_SUFFIX
      Suffix of the device part files
      static StringDEVICE_FOLDER_NAME
      static int[]emptyIntArray
      Static empty array to save on memory
      static short[]emptyShortArray
      static String[]emptyStringArray
      Static empty array to save on memory
      static StringHDI_PRIMITIVES_FILE_NAME
      File name of the EDIF library containing all Uniprims -- Will be removed in 2019.2
      static StringIMAGES_FOLDER_NAME
      static StringJARS_FOLDER_NAME
      Java library folder name
      static StringPART_DB_PATH
      static StringPART_DUMP_FILE_NAME
      File name created from Vivado for all supported parts for RapidWright
      static StringPYTHON_FOLDER_NAME
      static StringRAPIDWRIGHT_VARIABLE_NAME
      Environment Variable Name which points to the RapidWright project on disk
      static StringTCL_FOLDER_NAME
      static StringUNISIM_DATA_FILE_NAME
      File name of the UnisimManager initialization data file (replaced HDI_PRIMITIVES_FILE_NAME and VALID_CELL_PLACEMENTS_FILE_NAME)
      static String[]UNPACK_FOLDERS
      Supporting data folders packed in standalone jars of RapidWright
      static StringVALID_CELL_PLACEMENTS_FILE_NAME
      File name of containing a kryo compressed map of valid cell placements per family type -- Will be removed in 2019.2
    • Constructor Summary

      Constructors
      Constructor and Description
      FileTools()
    • Method Summary

      All MethodsStatic MethodsConcrete MethodsDeprecated Methods
      Modifier and TypeMethod and Description
      static booleancheckIfRapidWrightResourceExists(String name)
      Checks if a particular RapidWright file or jar resource exists.
      static voidclose(InputStream is)
      static voidclose(ZipFile zip)
      static booleancopyFile(String src, String dst)
      Copies a file from one location (src) to another (dst).
      static booleancopyFolder(String srcDirectoryPath, String dstDirectoryPath, boolean recursive)
      Copies a folder and its files from the path defined in srcDirectoryPath to a new folder at dstDirectoryPath.
      static booleancopyFolderContents(String src, String dst, boolean recursive)
      Copies the folder contents of the folder specified by src to folder specified as dst.
      static booleancygwinInstalled()
      static booleandeleteFile(String fileName)
      Delete the file/folder in the file system called fileName
      static booleandeleteFolder(String folderName)
      Delete the folder and recursively files and folders below
      static booleandeleteFolderContents(String path)
      Deletes everything in the directory given by path, but does not delete the folder itself.
      static voiderrorIfFileDoesNotExist(String fileName)
      Convenience assertion to assert that a file exists
      static List<String>execCommandGetOutput(boolean includeError, String... command)
      Runs the provided command (arguments must be separate) and gathers the standard output followed by the standard error.
      static booleanfolderCheck(String name)
      static List<FamilyType>getAvailableFamilies()
      This method returns an ArrayList of family types currently supported
      static List<String>getAvailableParts(FamilyType type)
      Checks for all device files present in the current RapidWright family path and returns a list of strings of those part names available to be used by the tool within the specified family.
      static ArrayList<String>getCommandOutput(String[] command)
      Generic method to run a command in the current shell and return its standard output and standard error
      static FilenameFiltergetDCPFilenameFilter()
      Gets a filename filter for DCP files (ends with .dcp).
      static StringgetDeviceFolderResourceName()
      static StringgetDeviceResourceName(Part part)
      static StringgetDirectorySeparator()
      Gets and returns the file separator character for the given OS
      static FilenameFiltergetEDNFilenameFilter()
      Gets a filename filter for EDN files (ends with .edn).
      static FilenameFiltergetFilenameFilter(String matches)
      Creates a custom filename filter that uses the provided matches string on the name of the file (not the path).
      static longgetFileSize(String fileName)
      static InputStreamgetHDIPrimitivesResourceStream()
      Deprecated.
      static InputStreamgetInputStreamFromZipOrDcpFile(String zipOrDcpFileName, String fileEndsWith)
      static com.esotericsoftware.kryo.KryogetKryoInstance()
      static List<String>getLastNLinesFromTextFile(String fileName, int n)
      Gets the last n number of lines from a text file and returns them.
      static ArrayList<String>getLinesFromInputStream(InputStream in)
      static ArrayList<String>getLinesFromTextFile(String fileName)
      This is a simple method that will read in a text file and put each line in a string and put all the lines in an ArrayList.
      static StringgetOSName()
      static InputStreamgetPartDumpResourceStream()
      Gets an input stream to the file containing a CSV file of valid parts for RapidWright.
      static StringgetPartFolderResourceName(FamilyType familyType)
      Gets and returns the path of the folder where the family type resides.
      static StringgetPartFolderResourceName(Part part)
      Gets and returns the path of the folder where the part files resides for deviceName.
      static BufferedReadergetProperInputStream(String fileName)
      Creates a BufferedReader that reads an input file and determines based on file extension (*.gz) if the file is gzipped or not.
      static BufferedWritergetProperOutputStream(String fileName)
      Creates a new BufferedWriter that will either write out text or a gzipped compressed version of text based on the file extension (*.gz -> gzipped, all others target an uncompressed output.
      static StringgetRapidWrightPath()
      Gets and returns the value of the environment variable RAPIDWRIGHT_PATH.
      static StringgetRapidWrightResourceFileName(String name)
      Finds and returns a file name that can be read for the corresponding RapidWright resource.
      static InputStreamgetRapidWrightResourceInputStream(String name)
      Identifies the proper location for a RapidWright data resource and returns an opened InputStream to that resource.
      static StringgetTimeString()
      This method will get and return the current time as a string formatted in the same way used in most Xilinx report and XDL files.
      static StringgetUniqueProcessAndHostID()
      static InputStreamgetUnisimDataResourceStream()
      Gets an input stream to the file containing valid cell placements of the hdi primitives.
      static com.esotericsoftware.kryo.unsafe.UnsafeInputgetUnsafeInputStream(InputStream in)
      static com.esotericsoftware.kryo.unsafe.UnsafeInputgetUnsafeInputStream(String fileName)
      static com.esotericsoftware.kryo.unsafe.UnsafeOutputgetUnsafeOutputStream(OutputStream os)
      static com.esotericsoftware.kryo.unsafe.UnsafeOutputgetUnsafeOutputStream(String fileName)
      static InputStreamgetValidCellPlacementsResourceStream()
      static StringgetVivadoPath()
      Gets the full path to the vivado executable if it is set in the PATH environment variable.
      static booleanisDataBinary(InputStream is)
      static booleanisExecutableOnPath(String execName)
      Checks if a particular executable is available on the current path
      static booleanisFileBinary(String fileName)
      Uses a similar algorithm to diff to determine if the file is a binary file by looking at the first 4k bytes to see if there are any null characters.
      static booleanisFileNewer(String fileName1, String fileName2)
      static booleanisVivadoCompatible()
      Checks that Vivado is on current PATH and returns true if RapidWright should be compatible with the version of vivado available.
      static booleanisVivadoOnPath()
      Checks if vivado is available on current PATH (uses unix 'which' or windows 'where').
      static booleanisWindows()
      static ObjectloadFromFile(String fileName)
      static voidmain(String[] args)
      static booleanmakeDir(String dirName)
      Creates a directory in the current path called dirName.
      static booleanmakeDirs(String dirName)
      Creates a directory in the current path called dirName.
      static HashMap<String,Integer>readHashMap(com.esotericsoftware.kryo.unsafe.UnsafeInput dis, Integer[] allInts)
      static int[]readIntArray(com.esotericsoftware.kryo.unsafe.UnsafeInput dis)
      static <T> TreadObjectFromKryoFile(InputStream in, Class<T> c)
      static ObjectreadObjectFromKryoFile(String fileName)
      static <T> TreadObjectFromKryoFile(String fileName, Class<T> c)
      static short[]readShortArray(com.esotericsoftware.kryo.unsafe.UnsafeInput dis)
      static StringreadString(DataInputStream dis)
      static String[]readStringArray(com.esotericsoftware.kryo.unsafe.UnsafeInput dis)
      static StringremoveFileExtension(String fileName)
      Takes a file name and removes everything after the last '.' inclusive
      static booleanrenameFile(String oldFileName, String newFileName)
      static IntegerrunCommand(List<String> command, String logFileName)
      A generic method to run a command from the system command line.
      static IntegerrunCommand(String command, boolean verbose)
      A generic method to run a command from the system command line.
      static booleansaveToFile(Object o, String fileName)
      Serialize the Object o to a the file specified by fileName.
      static booleanunPackSupportingJarData()
      Used for unpacking data files inside a standalone jar to be used for regular use by RapidWright.
      static voidunzipFile(String zipFileName, String destDirectory)
      static booleanwriteHashMap(com.esotericsoftware.kryo.unsafe.UnsafeOutput dos, HashMap<String,Integer> map)
      static booleanwriteIntArray(com.esotericsoftware.kryo.unsafe.UnsafeOutput dos, int[] intArray)
      static voidwriteLinesToTextFile(List<String> lines, String fileName)
      This is a simple method that writes the elements of an ArrayList of Strings into lines in the text file fileName.
      static voidwriteObjectToKryoFile(String fileName, Object o)
      static voidwriteObjectToKryoFile(String fileName, Object o, boolean writeClass)
      static booleanwriteShortArray(com.esotericsoftware.kryo.unsafe.UnsafeOutput dos, short[] intArray)
      static booleanwriteString(DataOutputStream dos, String str)
      static booleanwriteStringArray(com.esotericsoftware.kryo.unsafe.UnsafeOutput dos, String[] stringArray)
      static voidwriteStringToTextFile(String text, String fileName)
      This is a simple method that writes a String to a file and adds a new line.
      • Methods inherited from class Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait