Esempio n. 1
0
 def test_sort_files_by_date_emptylist(self):
     sortedlist = filetools.sort_files_by_date([])
     assert not sortedlist
Esempio n. 2
0
 def test_sort_files_by_date_emptylist(self):
     sortedlist = filetools.sort_files_by_date([])
     assert not sortedlist
Esempio n. 3
0
import odysseus.filetools as filetools

dirname = 'datafiles'

# get all the names of files with extension .TIF, by default sorted by date
imgnames = filetools.get_files_in_dir(dirname)
print imgnames

# get all the names of python files
pythonnames = filetools.get_files_in_dir('..', globexpr='*.py', sort=False)
# sort files by date, newest first
pythonnames_sorted = filetools.sort_files_by_date(pythonnames,
                                                  newestfirst=True)

for pyname in pythonnames_sorted:
    print pyname
Esempio n. 4
0
import odysseus.filetools as filetools


dirname = 'datafiles'

# get all the names of files with extension .TIF, by default sorted by date
imgnames = filetools.get_files_in_dir(dirname)
print imgnames

# get all the names of python files
pythonnames = filetools.get_files_in_dir('..', globexpr='*.py', sort=False)
# sort files by date, newest first
pythonnames_sorted = filetools.sort_files_by_date(pythonnames, newestfirst=True)

for pyname in pythonnames_sorted:
    print pyname