Browse Source

add cleanup comments + better import

Guénaël Muller 6 years ago
parent
commit
d9d215cc03
1 changed files with 16 additions and 3 deletions
  1. 16 3
      tracim/lib/core/content.py

+ 16 - 3
tracim/lib/core/content.py View File

@@ -46,13 +46,14 @@ from tracim.models.data import RevisionReadStatus
46 46
 from tracim.models.data import UserRoleInWorkspace
47 47
 from tracim.models.data import Workspace
48 48
 from tracim.lib.utils.translation import fake_translator as _
49
-from tracim.models.context_models import RevisionInContext, \
50
-    PreviewAllowedDim
49
+from tracim.models.context_models import RevisionInContext
50
+from tracim.models.context_models import PreviewAllowedDim
51 51
 from tracim.models.context_models import ContentInContext
52 52
 
53 53
 __author__ = 'damien'
54 54
 
55 55
 
56
+# TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
56 57
 def compare_content_for_sorting_by_type_and_name(
57 58
         content1: Content,
58 59
         content2: Content
@@ -91,7 +92,7 @@ def compare_content_for_sorting_by_type_and_name(
91 92
         else:
92 93
             return 0
93 94
 
94
-
95
+# TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
95 96
 def compare_tree_items_for_sorting_by_type_and_name(
96 97
         item1: NodeTreeItem,
97 98
         item2: NodeTreeItem
@@ -196,6 +197,7 @@ class ContentApi(object):
196 197
         return self._session.query(Content)\
197 198
             .join(ContentRevisionRO, self._get_revision_join())
198 199
 
200
+    # TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
199 201
     @classmethod
200 202
     def sort_tree_items(
201 203
         cls,
@@ -211,6 +213,7 @@ class ContentApi(object):
211 213
 
212 214
         return content_list
213 215
 
216
+    # TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
214 217
     @classmethod
215 218
     def sort_content(
216 219
         cls,
@@ -645,6 +648,7 @@ class ContentApi(object):
645 648
             )\
646 649
             .one()
647 650
 
651
+    # TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
648 652
     def get_folder_with_workspace_path_labels(
649 653
             self,
650 654
             path_labels: [str],
@@ -776,6 +780,9 @@ class ContentApi(object):
776 780
         return pdf_preview_path
777 781
 
778 782
     def get_jpg_preview_allowed_dim(self) -> PreviewAllowedDim:
783
+        """
784
+        Get jpg preview allowed dimensions and strict bool param.
785
+        """
779 786
         return PreviewAllowedDim(
780 787
             self._config.PREVIEW_JPG_RESTRICTED_DIMS,
781 788
             self._config.PREVIEW_JPG_ALLOWED_DIMS,
@@ -887,6 +894,7 @@ class ContentApi(object):
887 894
 
888 895
         return resultset.all()
889 896
 
897
+    # TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
890 898
     def get_all_without_exception(self, content_type: str, workspace: Workspace=None) -> typing.List[Content]:
891 899
         assert content_type is not None# DYN_REMOVE
892 900
 
@@ -1340,6 +1348,7 @@ class ContentApi(object):
1340 1348
 
1341 1349
         return ContentType.sorted(content_types)
1342 1350
 
1351
+    # TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
1343 1352
     def exclude_unavailable(
1344 1353
         self,
1345 1354
         contents: typing.List[Content],
@@ -1353,6 +1362,7 @@ class ContentApi(object):
1353 1362
                 contents.remove(content)
1354 1363
         return contents
1355 1364
 
1365
+    # TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
1356 1366
     def content_under_deleted(self, content: Content) -> bool:
1357 1367
         if content.parent:
1358 1368
             if content.parent.is_deleted:
@@ -1361,6 +1371,7 @@ class ContentApi(object):
1361 1371
                 return self.content_under_deleted(content.parent)
1362 1372
         return False
1363 1373
 
1374
+    # TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
1364 1375
     def content_under_archived(self, content: Content) -> bool:
1365 1376
         if content.parent:
1366 1377
             if content.parent.is_archived:
@@ -1369,6 +1380,7 @@ class ContentApi(object):
1369 1380
                 return self.content_under_archived(content.parent)
1370 1381
         return False
1371 1382
 
1383
+    # TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
1372 1384
     def find_one_by_unique_property(
1373 1385
             self,
1374 1386
             property_name: str,
@@ -1397,6 +1409,7 @@ class ContentApi(object):
1397 1409
         )
1398 1410
         return query.one()
1399 1411
 
1412
+    # TODO - G.M - 2018-07-24 - [Cleanup] Is this method already needed ?
1400 1413
     def generate_folder_label(
1401 1414
             self,
1402 1415
             workspace: Workspace,