Esempio n. 1
0
 def load_files(cls):
     for dirname, dirnames, filenames in os.walk(SHARED_PATH):
         for filename in filenames:
             path = dirname + "/" + filename
             md5 = hashing.encode_md5(hashing.calculate_md5_for_file_path(path))
             file = File(dirname, filename, md5)
             FILES.append(file)
Esempio n. 2
0
 def load_my_files(cls):
     for dirname, dirnames, filenames in os.walk(SHARED_PATH):
         for filename in filenames:
             path = dirname + "/" + filename
             md5 = hashing.encode_md5(hashing.calculate_md5_for_file_path(path))
             file = None
             if UsersManager.is_super_node():
                 file = File(path, filename, md5, "0"*16)
             else:
                 file = File(path, filename, md5, UsersManager.get_my_session_id)
             cls.shared_files().append(file)