Browse Source

Adds types hints

Adrien Panay 7 years ago
parent
commit
3d5301b7c7
2 changed files with 2 additions and 2 deletions
  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 View File

874
         item.revision_type = ActionDescription.EDITION
874
         item.revision_type = ActionDescription.EDITION
875
         return item
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
         item.owner = self._user
878
         item.owner = self._user
879
         item.file_name = new_filename
879
         item.file_name = new_filename
880
         item.file_mimetype = new_mimetype
880
         item.file_mimetype = new_mimetype

+ 1 - 1
tracim/tracim/lib/webdav/sql_resources.py View File

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