本文整理汇总了Python中Session.Session.addFiles方法的典型用法代码示例。如果您正苦于以下问题:Python Session.addFiles方法的具体用法?Python Session.addFiles怎么用?Python Session.addFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session.Session
的用法示例。
在下文中一共展示了Session.addFiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: folderAdd
# 需要导入模块: from Session import Session [as 别名]
# 或者: from Session.Session import addFiles [as 别名]
def folderAdd(self, folderObject):
"""
each time one adds a new FileWalker object it triggers
a new session that is stored using the unique FileWalker
name
"""
if isinstance(folderObject, FileWalker):
# clone list of classes and create new
thisSession = Session(folderObject.name, folderObject.path, self.classes)
# iterate over all files
thisSession.addFiles(folderObject)
# append the completed session to the list
self.sessions.append(thisSession)
print "add Folder: %s" % folderObject.name
else:
return NotImplemented
return True
示例2: TestSequence
# 需要导入模块: from Session import Session [as 别名]
# 或者: from Session.Session import addFiles [as 别名]
class TestSequence(unittest.TestCase):
def setUp(self):
class1 = FileClass('documents', ['.pdf', '.doc'])
class2 = FileClass('C-code', ['.c', '.h', '.py'])
self.session = Session('testSession', './', [class1, class2])
pass
def tearDown(self):
pass
def test_constructor(self):
self.assertEqual(2, len(self.session.classes))
print self.session
def test_addingFiles(self):
self.folder = FileWalker('AimValley TITAN', '/Users/bastian/Jobb/Transmode/R21-EDU/Software/AIMVALLEY-Titan-R1_03_00-LD3.0-20121119/av-Titan-r1_03_00-ld3.0-121119')
self.assertTrue(self.session.addFiles(self.folder))
print self.session