2013-04-29 11:05:09 +02:00
|
|
|
#!/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
|
2013-04-29 11:05:09 +02:00
|
|
|
import os
|
2011-05-06 00:43:25 +02:00
|
|
|
|
2018-11-30 01:28:24 +01:00
|
|
|
|
2011-05-06 00:43:25 +02:00
|
|
|
def main():
|
2018-11-30 01:28:24 +01:00
|
|
|
reload(sys)
|
|
|
|
sys.setdefaultencoding("UTF-8")
|
|
|
|
|
|
|
|
if len(sys.argv) != 3:
|
2018-12-05 01:10:40 +01:00
|
|
|
print("usage: %s ALBUM_PATH CACHE_PATH" % sys.argv[0])
|
2018-11-30 01:28:24 +01:00
|
|
|
return
|
|
|
|
|
|
|
|
try:
|
2018-12-05 01:10:40 +01:00
|
|
|
os.umask(0o22)
|
2018-11-30 01:28:24 +01:00
|
|
|
TreeWalker(sys.argv[1], sys.argv[2])
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
message("keyboard", "CTRL+C pressed, quitting.")
|
|
|
|
sys.exit(-97)
|
2012-08-22 17:10:56 +02:00
|
|
|
|
2011-05-06 00:43:25 +02:00
|
|
|
if __name__ == "__main__":
|
2018-11-30 01:28:24 +01:00
|
|
|
main()
|