本文整理匯總了Python中moments.path.Path.create_journal方法的典型用法代碼示例。如果您正苦於以下問題:Python Path.create_journal方法的具體用法?Python Path.create_journal怎麽用?Python Path.create_journal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類moments.path.Path
的用法示例。
在下文中一共展示了Path.create_journal方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from moments.path import Path [as 別名]
# 或者: from moments.path.Path import create_journal [as 別名]
def main():
path = ''
recurse = False
#full_path = True
full_path = False
if len(sys.argv) > 1:
if sys.argv[1] in ['--help','help'] or len(sys.argv) < 2:
usage()
path = sys.argv[1]
if len(sys.argv) > 2 and sys.argv[2] == "recurse":
recurse = True
if not path:
print("No path")
exit()
#node = make_node(path, relative=False)
node = Path(path).load()
j = node.create_journal(full_path=full_path)
## #node.scan_directory()
## node.scan_filetypes()
## #print node.images
## #app.sources = node.images
## j = moments.journal.Journal()
## for i in node.images:
## #e = moments.moment.Moment()
## created = moments.timestamp.Timestamp(i.datetime())
## tags = [ 'image', 'capture', 'camera' ]
## data = str(i.path)
## #j.update_entry(e)
## j.make_entry(data, tags, created)
## print j
## #j.sort_entries("reverse-chronological")
## #l = Log(filename)
## #j.to_file('temp.txt')
#j.to_file('temp.txt', sort="reverse-chronological")
#j.to_file('temp.txt', sort="chronological")
if recurse:
for dpath in node.directories:
d = dpath.load()
j = d.create_journal(full_path=full_path)