本文整理汇总了Python中State.State.to_string方法的典型用法代码示例。如果您正苦于以下问题:Python State.to_string方法的具体用法?Python State.to_string怎么用?Python State.to_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类State.State
的用法示例。
在下文中一共展示了State.to_string方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from State import State [as 别名]
# 或者: from State.State import to_string [as 别名]
#.........这里部分代码省略.........
if not (options.daemon or options.once or options.showall):
universe.verbose = True
show_notes = False
state = State(generate=True, localonly=True)
if not state.is_valid(localonly=True):
report(colour.red + 'Problem generating state' + colour.end)
sys.exit(1)
# Show as a tree
#if False:
# #state.aiyo.show_tree(notes=show_notes, activeonly=True)
# state.aiyo.show_tree(notes=show_notes, availableonly=True)
state.active.show(show_notes=show_notes, wait_separate=True, priority_only=options.priorityonly, inbox_only=options.inboxonly)
state.aiyo.show_error(show_notes=show_notes)
# Need to contact caldav server
if options.daemon or options.once or options.showall:
from time import sleep
from datetime import timedelta
state_previous = State(load=True)
#if not state_previous.is_valid():
# report(colour.red + 'Problem loading state' + colour.end)
# sys.exit(1)
if options.showall:
state = State(generate=True)
if not state.is_valid():
report(colour.red + 'Problem generating state' + colour.end)
sys.exit(1)
state.aiyo.show_tree()
if state_previous.is_valid():
report('-- STATE PREVIOUS')
report(state_previous.to_string())
report('-- STATE')
report(state.to_string())
sys.exit()
if not state_previous.is_valid():
report(colour.blue+'No previous state found, saving current state and continuing'+colour.end)
state = State(generate=True)
if not state.is_valid():
report(colour.red + 'Problem generating state' + colour.end)
sys.exit(1)
state.save()
state_previous = State(load=True)
if not state_previous.is_valid():
report(colour.red + 'Problem loading state' + colour.end)
sys.exit(1)
if not state_previous.is_valid():
error('State generation and save error, exiting')
sys.exit()
#for t in state_previous.caldav.events:
# report(' ' + t.name + ' | ' + t.parents[0])
#sys.exit()
def task_props(state, state_previous, name, pre):
ap = ''
a = ''
cp = ''
c = ''
try:
a = state.active.find_tasks_by_name(name=name)[0]
except: pass
try: