Bläddra i källkod

Better comments

Guénaël Muller 7 år sedan
förälder
incheckning
5416aff358

+ 4 - 4
tracim/config.py Visa fil

87
             '',
87
             '',
88
         )
88
         )
89
 
89
 
90
-        # TODO - G.M - 26-03-2018 - These params seems deprecated for tracimv2,
90
+        # TODO - G.M - 26-03-2018 - [Cleanup] These params seems deprecated for tracimv2,
91
         # Verify this
91
         # Verify this
92
         #
92
         #
93
         # self.WEBSITE_HOME_TITLE_COLOR = settings.get(
93
         # self.WEBSITE_HOME_TITLE_COLOR = settings.get(
138
             '604800',
138
             '604800',
139
         ))
139
         ))
140
 
140
 
141
-        # TODO - G.M - 27-03-2018 - Restore email config
141
+        # TODO - G.M - 27-03-2018 - [Email] Restore email config
142
         ###
142
         ###
143
         # EMAIL related stuff (notification, reply)
143
         # EMAIL related stuff (notification, reply)
144
         ###
144
         ###
312
         # WSGIDAV (Webdav server)
312
         # WSGIDAV (Webdav server)
313
         ###
313
         ###
314
 
314
 
315
-        # TODO - G.M - 27-03-2018 - Restore wsgidav config
315
+        # TODO - G.M - 27-03-2018 - [WebDav] Restore wsgidav config
316
         #self.WSGIDAV_CONFIG_PATH = settings.get(
316
         #self.WSGIDAV_CONFIG_PATH = settings.get(
317
         #    'wsgidav.config_path',
317
         #    'wsgidav.config_path',
318
         #    'wsgidav.conf',
318
         #    'wsgidav.conf',
346
         # if not self.WSGIDAV_CLIENT_BASE_URL.endswith('/'):
346
         # if not self.WSGIDAV_CLIENT_BASE_URL.endswith('/'):
347
         #     self.WSGIDAV_CLIENT_BASE_URL += '/'
347
         #     self.WSGIDAV_CLIENT_BASE_URL += '/'
348
 
348
 
349
-        # TODO - G.M - 27-03-2018 - Restore radicale config
349
+        # TODO - G.M - 27-03-2018 - [Caldav] Restore radicale config
350
         ###
350
         ###
351
         # RADICALE (Caldav server)
351
         # RADICALE (Caldav server)
352
         ###
352
         ###

+ 1 - 1
tracim/fixtures/content.py Visa fil

1
-# TODO : Reenable this when API where availables
1
+# TODO : [LibContent] Reenable this when API where availables
2
 # # -*- coding: utf-8 -*-
2
 # # -*- coding: utf-8 -*-
3
 # from depot.io.utils import FileIntent
3
 # from depot.io.utils import FileIntent
4
 #
4
 #

+ 7 - 5
tracim/lib/user.py Visa fil

6
 
6
 
7
 from tracim.models.auth import User
7
 from tracim.models.auth import User
8
 
8
 
9
-# TODO - G.M -28-03-2018 - Check if "current user" stuff is always needed for tracimv2
9
+# TODO - G.M -28-03-2018 - [CurrentUser] Check if "current user" stuff is always needed for tracimv2
10
 # CURRENT_USER_WEB = 'WEB'
10
 # CURRENT_USER_WEB = 'WEB'
11
 # CURRENT_USER_WSGIDAV = 'WSGIDAV'
11
 # CURRENT_USER_WSGIDAV = 'WSGIDAV'
12
 
12
 
55
         if email and self._user and user.user_id==self._user.user_id:
55
         if email and self._user and user.user_id==self._user.user_id:
56
             pass
56
             pass
57
             # this is required for the _session to keep on being up-to-date
57
             # this is required for the _session to keep on being up-to-date
58
-            # TODO - G.M - 28-03-2018 - Check for pyramid equivalent
58
+            # TODO - G.M - 28-03-2018 - [CurrentUser] Check for pyramid equivalent
59
             # tg.request.identity['repoze.who.userid'] = email
59
             # tg.request.identity['repoze.who.userid'] = email
60
             # tg.auth_force_login(email)
60
             # tg.auth_force_login(email)
61
 
61
 
91
         :return:
91
         :return:
92
         """
92
         """
93
         # NOTE: Cyclic import
93
         # NOTE: Cyclic import
94
-        # TODO - G.M - 28-03-2018 - Reenable Calendar stuff
94
+        # TODO - G.M - 28-03-2018 - [Calendar] Reenable Calendar stuff
95
         #from tracim.lib.calendar import CalendarManager
95
         #from tracim.lib.calendar import CalendarManager
96
         #from tracim.model.organisational import UserCalendar
96
         #from tracim.model.organisational import UserCalendar
97
 
97
 
101
         self._session.flush()
101
         self._session.flush()
102
         transaction.commit()
102
         transaction.commit()
103
 
103
 
104
+        # TODO - G.M - 28-03-2018 - [Calendar] Reenable Calendar stuff
104
         # calendar_manager = CalendarManager(created_user)
105
         # calendar_manager = CalendarManager(created_user)
105
         # calendar_manager.create_then_remove_fake_event(
106
         # calendar_manager.create_then_remove_fake_event(
106
         #     calendar_class=UserCalendar,
107
         #     calendar_class=UserCalendar,
108
         # )
109
         # )
109
 
110
 
110
 
111
 
112
+# TODO - G.M - 28-03-2018 - [CurrentUser] Check for pyramid equivalent
111
 # class CurrentUserGetterInterface(object):
113
 # class CurrentUserGetterInterface(object):
112
 #     def get_current_user(self) -> typing.Union[None, User]:
114
 #     def get_current_user(self) -> typing.Union[None, User]:
113
 #         raise NotImplementedError()
115
 #         raise NotImplementedError()
117
 #     def __init__(self) -> None:
119
 #     def __init__(self) -> None:
118
 #         self.api = UserApi(None)
120
 #         self.api = UserApi(None)
119
 
121
 
120
-# TODO - G.M - 28-03-2018 - Check for pyramid equivalent
122
+
121
 # class WebCurrentUserGetter(BaseCurrentUserGetter):
123
 # class WebCurrentUserGetter(BaseCurrentUserGetter):
122
 #     def get_current_user(self) -> typing.Union[None, User]:
124
 #     def get_current_user(self) -> typing.Union[None, User]:
123
 #         # HACK - D.A. - 2015-09-02
125
 #         # HACK - D.A. - 2015-09-02
132
 #
134
 #
133
 #         return None
135
 #         return None
134
 
136
 
135
-# TODO - G.M - 28-03-2018 - Reenable Webdav stuff
137
+# TODO - G.M - 28-03-2018 - [Webdav] Reenable Webdav stuff
136
 # class WsgidavCurrentUserGetter(BaseCurrentUserGetter):
138
 # class WsgidavCurrentUserGetter(BaseCurrentUserGetter):
137
 #     def get_current_user(self) -> typing.Union[None, User]:
139
 #     def get_current_user(self) -> typing.Union[None, User]:
138
 #         if hasattr(cherrypy.request, 'current_user_email'):
140
 #         if hasattr(cherrypy.request, 'current_user_email'):

+ 1 - 1
tracim/models/auth.py Visa fil

156
             profile_id = max(group.group_id for group in self.groups)
156
             profile_id = max(group.group_id for group in self.groups)
157
         return Profile(profile_id)
157
         return Profile(profile_id)
158
 
158
 
159
-    # TODO - G-M - 27-03-2018 - Check about calendar code
159
+    # TODO - G-M - 27-03-2018 - [Calendar] Check about calendar code
160
     # @property
160
     # @property
161
     # def calendar_url(self) -> str:
161
     # def calendar_url(self) -> str:
162
     #     # TODO - 20160531 - Bastien: Cyclic import if import in top of file
162
     #     # TODO - 20160531 - Bastien: Cyclic import if import in top of file

+ 2 - 3
tracim/models/data.py Visa fil

86
 
86
 
87
         return contents
87
         return contents
88
 
88
 
89
-    # TODO - G-M - 27-03-2018 - Check about calendar code
89
+    # TODO - G-M - 27-03-2018 - [Calendar] Check about calendar code
90
     # @property
90
     # @property
91
     # def calendar_url(self) -> str:
91
     # def calendar_url(self) -> str:
92
     #     # TODO - 20160531 - Bastien: Cyclic import if import in top of file
92
     #     # TODO - 20160531 - Bastien: Cyclic import if import in top of file
1365
 
1365
 
1366
         label = content.get_label()
1366
         label = content.get_label()
1367
         if content.type==ContentType.Comment:
1367
         if content.type==ContentType.Comment:
1368
-            # todo :voir le _('.... si le _ est utile
1368
+            # TODO :  28-03-2018 [i18n] Internationalize this ?
1369
             label = ('<strong>{}</strong> wrote:').format(content.owner.get_display_name())
1369
             label = ('<strong>{}</strong> wrote:').format(content.owner.get_display_name())
1370
 
1370
 
1371
         return VirtualEvent(id=content.content_id,
1371
         return VirtualEvent(id=content.content_id,
1397
         self.content = content
1397
         self.content = content
1398
         self.ref_object = ref_object
1398
         self.ref_object = ref_object
1399
 
1399
 
1400
-        # todo moi ? print(type)
1401
         assert hasattr(type, 'id')
1400
         assert hasattr(type, 'id')
1402
         assert hasattr(type, 'css')
1401
         assert hasattr(type, 'css')
1403
         assert hasattr(type, 'icon')
1402
         assert hasattr(type, 'icon')

+ 1 - 1
tracim/models/meta.py Visa fil

7
 NAMING_CONVENTION = {
7
 NAMING_CONVENTION = {
8
     "ix": "ix_%(column_0_label)s",
8
     "ix": "ix_%(column_0_label)s",
9
     "uq": "uq_%(table_name)s_%(column_0_name)s",
9
     "uq": "uq_%(table_name)s_%(column_0_name)s",
10
-    # TODO - G.M - 28-03-2018 - Convert database to allow naming convention
10
+    # TODO - G.M - 28-03-2018 - [Database] Convert database to allow naming convention
11
     # for ck contraint.
11
     # for ck contraint.
12
     # "ck": "ck_%(table_name)s_%(constraint_name)s",
12
     # "ck": "ck_%(table_name)s_%(constraint_name)s",
13
     "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
13
     "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",

+ 1 - 1
tracim/models/mymodel.py Visa fil

7
 
7
 
8
 from .meta import DeclarativeBase
8
 from .meta import DeclarativeBase
9
 
9
 
10
-
10
+# TODO - G.M - 28-03-2018 - [Cleanup] Remove this example Model
11
 class MyModel(DeclarativeBase):
11
 class MyModel(DeclarativeBase):
12
     __tablename__ = 'models'
12
     __tablename__ = 'models'
13
     id = Column(Integer, primary_key=True)
13
     id = Column(Integer, primary_key=True)

+ 1 - 1
tracim/scripts/initializedb.py Visa fil

37
     DeclarativeBase.metadata.create_all(engine)
37
     DeclarativeBase.metadata.create_all(engine)
38
 
38
 
39
     session_factory = get_session_factory(engine)
39
     session_factory = get_session_factory(engine)
40
-
40
+    # TODO - G.M - 28-03-2018 - [Cleanup] Remove code related to example
41
     with transaction.manager:
41
     with transaction.manager:
42
         dbsession = get_tm_session(session_factory, transaction.manager)
42
         dbsession = get_tm_session(session_factory, transaction.manager)
43
 
43
 

+ 1 - 0
tracim/templates/404.jinja2 Visa fil

1
+<!-- TODO - G.M - 28-03-2018 - [Cleanup] Replace this example template -->
1
 {% extends "layout.jinja2" %}
2
 {% extends "layout.jinja2" %}
2
 
3
 
3
 {% block content %}
4
 {% block content %}

+ 1 - 0
tracim/templates/layout.jinja2 Visa fil

1
+<!-- TODO - G.M - 28-03-2018 - [Cleanup] Remove this example template -->
1
 <!DOCTYPE html>
2
 <!DOCTYPE html>
2
 <html lang="{{request.locale_name}}">
3
 <html lang="{{request.locale_name}}">
3
   <head>
4
   <head>

+ 1 - 0
tracim/templates/mytemplate.jinja2 Visa fil

1
+<!-- TODO - G.M - 28-03-2018 - [Cleanup] Remove this example template -->
1
 {% extends "layout.jinja2" %}
2
 {% extends "layout.jinja2" %}
2
 
3
 
3
 {% block content %}
4
 {% block content %}

+ 1 - 1
tracim/tests/models/test_content.py Visa fil

27
         content1 = self.test_create()
27
         content1 = self.test_create()
28
         content1.description = 'FOO'  # Raise ContentRevisionUpdateError because revision can't be updated
28
         content1.description = 'FOO'  # Raise ContentRevisionUpdateError because revision can't be updated
29
 
29
 
30
-    # TODO - G.M - 28-03-2018 - Reenable this test when libContent is available
30
+    # TODO - G.M - 28-03-2018 - [libContent] Reenable this test when libContent is available
31
     # def test_query(self):
31
     # def test_query(self):
32
     #     content1 = self.test_create()
32
     #     content1 = self.test_create()
33
     #     with new_revision(content1):
33
     #     with new_revision(content1):

+ 1 - 1
tracim/tests/models/test_content_revision.py Visa fil

36
             dict_repr.pop(key_to_remove, None)
36
             dict_repr.pop(key_to_remove, None)
37
         return dict_repr
37
         return dict_repr
38
 
38
 
39
-    # TODO - G.M - 28-03-2018 - Reenable this test
39
+    # TODO - G.M - 28-03-2018 - [libContent] Reenable this test
40
     # def test_new_revision(self):
40
     # def test_new_revision(self):
41
     #     admin = self._session.query(User).filter(User.email == 'admin@admin.admin').one()
41
     #     admin = self._session.query(User).filter(User.email == 'admin@admin.admin').one()
42
     #     workspace = self._create_workspace_and_test(name='workspace_1', user=admin)
42
     #     workspace = self._create_workspace_and_test(name='workspace_1', user=admin)

+ 1 - 1
tracim/translation.py Visa fil

1
 
1
 
2
-# TODO - G.M - 27-03-2018 - Reconnect true internationalization
2
+# TODO - G.M - 27-03-2018 - [i18n] Reconnect true internationalization
3
 def fake_translator(text: str):
3
 def fake_translator(text: str):
4
     return text
4
     return text