Procházet zdrojové kódy

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

Roland Haroutiounian před 9 roky
rodič
revize
867ad023be
2 změnil soubory, kde provedl 11 přidání a 11 odebrání
  1. 3
    4
      EditorialModel/classtypes.py
  2. 8
    7
      EditorialModel/fields.py

+ 3
- 4
EditorialModel/classtypes.py Zobrazit soubor

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

+ 8
- 7
EditorialModel/fields.py Zobrazit soubor

@@ -1,14 +1,15 @@
1 1
 #-*- coding: utf-8 -*-
2 2
 
3 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 14
 ## EmField (Class)
14 15
 #
@@ -110,4 +111,4 @@ class EmField(EmComponent):
110 111
         # res = conn.execute(req)
111 112
         # row = res.fetchone()
112 113
         #</SQL>
113
-        # return EmClass(row['class_id'])
114
+        # return EmClass(row['class_id'])

Loading…
Zrušit
Uložit