本文整理汇总了Python中pitz.project.Project.save_entities_to_yaml_files方法的典型用法代码示例。如果您正苦于以下问题:Python Project.save_entities_to_yaml_files方法的具体用法?Python Project.save_entities_to_yaml_files怎么用?Python Project.save_entities_to_yaml_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pitz.project.Project
的用法示例。
在下文中一共展示了Project.save_entities_to_yaml_files方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pitz_setup
# 需要导入模块: from pitz.project import Project [as 别名]
# 或者: from pitz.project.Project import save_entities_to_yaml_files [as 别名]
def pitz_setup():
"""
Start a new project
"""
p = optparse.OptionParser()
p.epilog = "Set up pitz"
p.add_option('--version', action='store_true',
help='show pitz version')
options, args = p.parse_args()
if options.version:
print_version()
return
dir = os.path.basename(os.getcwd())
project_name = raw_input(
"Project name (hit ENTER for %s): " % dir).strip()
if not project_name:
project_name = dir
pitzdir = mk_pitzdir()
proj = Project(pathname=pitzdir, title=project_name)
proj.to_yaml_file()
Status.setup_defaults(proj)
pw_name = pwd.getpwuid(os.getuid()).pw_name
name = raw_input("Your name (hit ENTER for %s): " % pw_name).strip()
if not name:
name = pw_name
person = Person(proj, title=name)
proj.save_entities_to_yaml_files()
print("All done!")
print("Run pitz-add-task to add a task, or run pitz-help for help.")
示例2: test_grep
# 需要导入模块: from pitz.project import Project [as 别名]
# 或者: from pitz.project.Project import save_entities_to_yaml_files [as 别名]
def test_grep():
p = Project("Bogus", pathname="/tmp")
e1 = Entity(title="bogus entity 1")
e2 = Entity(title="bogus entity 2")
p.append(e1)
p.append(e2)
p.save_entities_to_yaml_files()
g1 = p.grep('bogus entity 1')
assert e1 in g1
assert e2 not in g1
assert len(g1) == 1
g2 = p.grep('BOGUS ENTITY 1')
assert len(g2) == 0
g3 = p.grep('BOGUS ENTITY 1', ignore_case=True)
assert e1 in g3
assert e2 not in g3
assert len(g3) == 1
示例3: test_save_entities_1
# 需要导入模块: from pitz.project import Project [as 别名]
# 或者: from pitz.project.Project import save_entities_to_yaml_files [as 别名]
def test_save_entities_1():
p = Project("Bogus")
p.save_entities_to_yaml_files('nonexistent directory')
示例4: test_html_then_pickle
# 需要导入模块: from pitz.project import Project [as 别名]
# 或者: from pitz.project.Project import save_entities_to_yaml_files [as 别名]
def test_html_then_pickle(self):
p = Project(pathname='/tmp')
p.to_html('/tmp')
p.save_entities_to_yaml_files()