Selaa lähdekoodia

Adds types hints

Adrien Panay 7 vuotta sitten
vanhempi
commit
3d5301b7c7
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1 1
      tracim/tracim/lib/content.py
  2. 1 1
      tracim/tracim/lib/webdav/sql_resources.py

+ 1 - 1
tracim/tracim/lib/content.py Näytä tiedosto

@@ -874,7 +874,7 @@ class ContentApi(object):
874 874
         item.revision_type = ActionDescription.EDITION
875 875
         return item
876 876
 
877
-    def update_file_data(self, item: Content, new_filename: str, new_mimetype: str, new_content) -> Content:
877
+    def update_file_data(self, item: Content, new_filename: str, new_mimetype: str, new_content: bytes) -> Content:
878 878
         item.owner = self._user
879 879
         item.file_name = new_filename
880 880
         item.file_mimetype = new_mimetype

+ 1 - 1
tracim/tracim/lib/webdav/sql_resources.py Näytä tiedosto

@@ -897,7 +897,7 @@ class File(DAVNonCollection):
897 897
     def getLastModified(self) -> float:
898 898
         return mktime(self.content.updated.timetuple())
899 899
 
900
-    def getContent(self):
900
+    def getContent(self) -> typing.BinaryIO:
901 901
         filestream = compat.BytesIO()
902 902
         filestream.write(self.content.depot_file.file.read())
903 903
         filestream.seek(0)