photofloat/scanner/main.py

24 lines
450 B
Python
Raw Normal View History

#!/usr/bin/env python2
2011-05-06 00:43:25 +02:00
from TreeWalker import TreeWalker
2011-05-23 11:25:45 +02:00
from CachePath import message
2012-08-22 17:10:56 +02:00
import sys
import os
2011-05-06 00:43:25 +02:00
def main():
2012-08-22 17:10:56 +02:00
reload(sys)
sys.setdefaultencoding("UTF-8")
if len(sys.argv) != 3:
print "usage: %s ALBUM_PATH CACHE_PATH" % sys.argv[0]
2011-05-06 00:43:25 +02:00
return
2011-05-23 11:25:45 +02:00
try:
os.umask(022)
2012-08-22 17:10:56 +02:00
TreeWalker(sys.argv[1], sys.argv[2])
2011-05-23 11:25:45 +02:00
except KeyboardInterrupt:
message("keyboard", "CTRL+C pressed, quitting.")
2012-08-22 17:10:56 +02:00
sys.exit(-97)
2011-05-06 00:43:25 +02:00
if __name__ == "__main__":
2012-08-22 17:10:56 +02:00
main()