Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
sort files to be captioned by filename
Browse files Browse the repository at this point in the history
  • Loading branch information
TomConlin committed Jun 17, 2017
1 parent 759479d commit e2c487e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions utils/fcaption
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,16 @@ class MainWindow(QtGui.QMainWindow):

# main application
def expand_dir(path):
for root, dirs, files in os.walk(path):
for tmp in files:
if tmp[0] == '.': continue
tmp = os.path.join(root, tmp)
ext = os.path.splitext(tmp)[1]
if ext: ext = ext[1:].lower()
if ext in FILE_EXT:
yield tmp
for root, dirs, files in os.walk(path, topdown=True):
if files is not None:
files.sort()
for tmp in files:
if tmp[0] == '.': continue
tmp = os.path.join(root, tmp)
ext = os.path.splitext(tmp)[1]
if ext: ext = ext[1:].lower()
if ext in FILE_EXT:
yield tmp


class Application(QtGui.QApplication):
Expand Down

0 comments on commit e2c487e

Please sign in to comment.