コード例 #1
0
 def _iterate_files(self, content):
     files = []
     if 'files' in content:
         for file_info in content['files']:
             f = DataFile(self.client, pathJoin(self.path, file_info['filename']))
             f.set_attributes(file_info)
             files.append(f)
     return files
コード例 #2
0
 def _iterate_directories(self, content):
     directories = []
     if 'folders' in content:
         for dir_info in content['folders']:
             d = DataDirectory(self.client, pathJoin(self.path, dir_info['name']))
             d.set_attributes(dir_info)
             directories.append(d)
     return directories
コード例 #3
0
 def dir(self, name):
     return DataDirectory(self.client, pathJoin(self.path, name))
コード例 #4
0
 def file(self, name):
     return DataFile(self.client, pathJoin(self.path, name))
コード例 #5
0
 def file(self, name):
     return ModelFile(self.client, pathJoin(self.path, name))
コード例 #6
0
ファイル: utiltest.py プロジェクト: qihe1126/algmarket-python
 def test_pathJoin(self):
     self.assertEqual('/a/b/c/d', pathJoin('/a/b/c/', 'd'))
     self.assertEqual('/a/b/c/d', pathJoin('/a/b/c', 'd'))
     self.assertEqual('/a//b/c///d', pathJoin('/a//b/c//', '/d'))