本文整理汇总了Python中twext.python.filepath.CachingFilePath.makedirs方法的典型用法代码示例。如果您正苦于以下问题:Python CachingFilePath.makedirs方法的具体用法?Python CachingFilePath.makedirs怎么用?Python CachingFilePath.makedirs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twext.python.filepath.CachingFilePath
的用法示例。
在下文中一共展示了CachingFilePath.makedirs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from twext.python.filepath import CachingFilePath [as 别名]
# 或者: from twext.python.filepath.CachingFilePath import makedirs [as 别名]
def setUp(self):
tempDir = FilePath(self.mktemp())
tempDir.makedirs()
tempFile = tempDir.child("test")
tempFile.touch()
self.propertyStore = self.propertyStore1 = PropertyStore("user01", "user01", lambda : tempFile)
self.propertyStore2 = PropertyStore("user02", "user01", lambda : tempFile)
示例2: test_copy
# 需要导入模块: from twext.python.filepath import CachingFilePath [as 别名]
# 或者: from twext.python.filepath.CachingFilePath import makedirs [as 别名]
def test_copy(self):
tempDir = FilePath(self.mktemp())
tempDir.makedirs()
tempFile1 = tempDir.child("test1")
tempFile1.touch()
tempFile2 = tempDir.child("test2")
tempFile2.touch()
# Existing store
store1_user1 = PropertyStore("user01", lambda : tempFile1)
store1_user2 = PropertyStore("user01", lambda : tempFile1)
store1_user2._setPerUserUID("user02")
# New store
store2_user1 = PropertyStore("user01", lambda : tempFile2)
store2_user2 = PropertyStore("user01", lambda : tempFile2)
store2_user2._setPerUserUID("user02")
# Populate current store with data
class DummyProperty1(WebDAVTextElement):
namespace = "http://calendarserver.org/ns/"
name = "dummy1"
class DummyProperty2(WebDAVTextElement):
namespace = "http://calendarserver.org/ns/"
name = "dummy2"
class DummyProperty3(WebDAVTextElement):
namespace = "http://calendarserver.org/ns/"
name = "dummy3"
props_user1 = (
DummyProperty1.fromString("value1-user1"),
DummyProperty2.fromString("value2-user1"),
)
props_user2 = (
DummyProperty1.fromString("value1-user2"),
DummyProperty3.fromString("value3-user2"),
)
for prop in props_user1:
store1_user1[PropertyName.fromElement(prop)] = prop
for prop in props_user2:
store1_user2[PropertyName.fromElement(prop)] = prop
store1_user1.flush()
store1_user2.flush()
# Do copy and check results
store2_user1.copyAllProperties(store1_user1)
store2_user1.flush()
self.assertEqual(store1_user1.attrs.items(), store2_user1.attrs.items())
self.assertEqual(store1_user2.attrs.items(), store2_user2.attrs.items())
示例3: setUp
# 需要导入模块: from twext.python.filepath import CachingFilePath [as 别名]
# 或者: from twext.python.filepath.CachingFilePath import makedirs [as 别名]
def setUp(self):
tempDir = FilePath(self.mktemp())
tempDir.makedirs()
tempFile = tempDir.child("test")
tempFile.touch()
self.propertyStore = PropertyStore("user01", lambda : tempFile)
self.propertyStore1 = self.propertyStore
self.propertyStore2 = PropertyStore("user01", lambda : tempFile)
self.propertyStore2._setPerUserUID("user02")
self.propertyStore2._setProxyUID("user02")
self.propertyStore3 = PropertyStore("user01", lambda : tempFile)
self.propertyStore3._setProxyUID("user03")
self.propertyStore4 = PropertyStore("user01", lambda : tempFile)
self.propertyStore4._setPerUserUID("user02")
self.propertyStore4._setProxyUID("user04")