Browse Source

[ClassTypes et Fields] Mise en commentaire des imports obsolètes et conformité pep8/pylint

Roland Haroutiounian 9 years ago
parent
commit
867ad023be
2 changed files with 11 additions and 11 deletions
  1. 3
    4
      EditorialModel/classtypes.py
  2. 8
    7
      EditorialModel/fields.py

+ 3
- 4
EditorialModel/classtypes.py View File

23
 #       - 'attach' : what type of superior a type can have
23
 #       - 'attach' : what type of superior a type can have
24
 #            - 'classtype' a type can have superiors of the same classtype
24
 #            - 'classtype' a type can have superiors of the same classtype
25
 #            - 'type'      a type can only have superiors of the same type
25
 #            - 'type'      a type can only have superiors of the same type
26
-#       - automatic : possible superiors 
26
+#       - automatic : possible superiors
27
 #            - False : possible superiors must be defined
27
 #            - False : possible superiors must be defined
28
 #            - True  : possible superiors can not be defined, they will be enforced by the ME automatically
28
 #            - True  : possible superiors can not be defined, they will be enforced by the ME automatically
29
 #       - maxdepth : maximum depth
29
 #       - maxdepth : maximum depth
86
     @staticmethod
86
     @staticmethod
87
     def natures(classtype_name):
87
     def natures(classtype_name):
88
         if not isinstance(classtype_name, str):
88
         if not isinstance(classtype_name, str):
89
-            raise TypeError("Excepted <class str> but got "+str(type(classtype_name)))
89
+            raise TypeError("Excepted <class str> but got %s" % str(type(classtype_name)))
90
         try:
90
         try:
91
             classtype = getattr(EmClassType, classtype_name)
91
             classtype = getattr(EmClassType, classtype_name)
92
         except AttributeError:
92
         except AttributeError:
93
-            raise AttributeError("Unknown classtype : '"+classtype_name+"'")
93
+            raise AttributeError("Unknown classtype : '%s'" % classtype_name)
94
         return classtype['hierarchy'].keys()
94
         return classtype['hierarchy'].keys()
95
-

+ 8
- 7
EditorialModel/fields.py View File

1
 #-*- coding: utf-8 -*-
1
 #-*- coding: utf-8 -*-
2
 
2
 
3
 from EditorialModel.components import EmComponent
3
 from EditorialModel.components import EmComponent
4
-from EditorialModel.fieldtypes import EmField_boolean, EmField_char, EmField_integer, EmField_icon, get_field_type
5
-from EditorialModel.fieldgroups import EmFieldGroup
6
-from EditorialModel.classes import EmClass
4
+from EditorialModel.fieldtypes import EmField_boolean, EmField_char, EmField_integer, EmField_icon  # , get_field_type
5
+# from EditorialModel.fieldgroups import EmFieldGroup
6
+# from EditorialModel.classes import EmClass
7
 
7
 
8
-from Database import sqlutils
9
-from Database.sqlalter import DropColumn, AddColumn
8
+# from Database import sqlutils
9
+# from Database.sqlalter import DropColumn, AddColumn
10
+
11
+# import sqlalchemy as sql
10
 
12
 
11
-import sqlalchemy as sql
12
 
13
 
13
 ## EmField (Class)
14
 ## EmField (Class)
14
 #
15
 #
110
         # res = conn.execute(req)
111
         # res = conn.execute(req)
111
         # row = res.fetchone()
112
         # row = res.fetchone()
112
         #</SQL>
113
         #</SQL>
113
-        # return EmClass(row['class_id'])
114
+        # return EmClass(row['class_id'])

Loading…
Cancel
Save