Просмотр исходного кода

Change find_available_file_name into private method

Guillaume Ayoub 9 лет назад
Родитель
Сommit
71be1a56b8
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      radicale/storage.py

+ 3 - 3
radicale/storage.py

@@ -347,7 +347,7 @@ class Collection(BaseCollection):
                 path, self.storage_encoding, mode).open() as fd:
                 path, self.storage_encoding, mode).open() as fd:
             yield fd
             yield fd
 
 
-    def find_available_file_name(self):
+    def _find_available_file_name(self):
         # Prevent infinite loop
         # Prevent infinite loop
         for _ in range(10000):
         for _ in range(10000):
             file_name = hex(getrandbits(32))[2:]
             file_name = hex(getrandbits(32))[2:]
@@ -430,13 +430,13 @@ class Collection(BaseCollection):
                     for item in items:
                     for item in items:
                         new_collection.add(item)
                         new_collection.add(item)
                     self.upload(
                     self.upload(
-                        self.find_available_file_name(), new_collection)
+                        self._find_available_file_name(), new_collection)
 
 
         elif tag == "VCARD":
         elif tag == "VCARD":
             self.set_meta("tag", "VADDRESSBOOK")
             self.set_meta("tag", "VADDRESSBOOK")
             if collection:
             if collection:
                 for card in collection:
                 for card in collection:
-                    self.upload(self.find_available_file_name(), card)
+                    self.upload(self._find_available_file_name(), card)
 
 
         return self
         return self