Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Utilities

    twcommon 0.1.0

    Download button

    No screenshots available
    Downloads: 218  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Thomas Weholt | More programs
    GPL / FREE
    July 19th, 2010, 08:38 GMT
    ROOT / Utilities

     Read user reviews (0)  Refer to a friend  Subscribe

    twcommon description

    Commonly used utils

    Developer comments

    twcommon provides a collection snippets, pieces of code, stuff found on the net I use all the time.. Will grow over time.

    Currently it consists of:

    get_free_space(folder)

    Platform independant way to calculate free space.

    CheckTargetFilename(filename)

    It will check if there`s a filename by that name allready, and if so, return a new filename adding ~1 to the filename. For example if you want to write to /tmp/test.txt but that file allready exists, using CheckTargetFilename('/tmp/test.txt') will return /tmp/test~1.txt. If /tmp/test~1.txt allready exists the returned file will be /tmp/test~2.txt.

    humanize_bytes(size)

    Converts bytes to nearest kilobyte, megabyte, gigabyte etc.

    getWords(text, ignore_words = [], minsize = 2)

    Extracts words from a piece of text. It splits words based on spaces, change in char-case inside a text, numbers etc.

    generate_checksum(filename)

    Generates a hexdigest version of a SHA-512 checksum based on a file.

    parse_filedata(root_path, complete_filename)

    Returns a dictionary of filedata.

    dirwalk(dir, extensions_to_include = None)

    Directory walk, yielding filenames found. Can filter based on extensions.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    snippets collection | Python library | snippets | utils | code

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM