Skip to content

dwickstrom/fileversioninger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileVersionInger Build Status

Did you look for a solution that allows you to append a file revision suffix to your file name, but couldn't find one?

suggest_new_filename('foo.txt')  # foo#001.txt

You can also provide a predicate function that allows you to for example query a database to see whether or not a given filename exists and subsequently not get that as a suggestion.

predicate = lambda a: True if in_database(a) else False

suggest_new_filename('foo.txt', predicate)  # foo#003.txt

Install

pip install fileversioninger

Run tests

virtualenv .venv
. .venv/bin/activate
pip install -r requirements.txt
nosetests