cosmetic changes in sendmail.py - please the linter
[plcapi.git] / PLC / Methods / AddPCUType.py
index b6738fa..4b4bf65 100644 (file)
@@ -1,12 +1,11 @@
-# $Id#
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
 from PLC.PCUTypes import PCUType, PCUTypes
 from PLC.Auth import Auth
 
-can_update = lambda (field, value): field in \
-            ['model', 'name']  
+can_update = lambda field_value: field_value[0] in \
+             ['model', 'name']
 
 class AddPCUType(Method):
     """
@@ -17,20 +16,20 @@ class AddPCUType(Method):
 
     roles = ['admin']
 
-    pcu_type_fields = dict(filter(can_update, PCUType.fields.items()))
+    pcu_type_fields = dict(list(filter(can_update, list(PCUType.fields.items()))))
 
     accepts = [
         Auth(),
         pcu_type_fields
-       ]
+        ]
 
     returns = Parameter(int, 'New pcu_type_id (> 0) if successful')
 
-    
+
     def call(self, auth, pcu_type_fields):
-       pcu_type_fields = dict(filter(can_update, pcu_type_fields.items()))
+        pcu_type_fields = dict(list(filter(can_update, list(pcu_type_fields.items()))))
         pcu_type = PCUType(self.api, pcu_type_fields)
-       pcu_type.sync()
-       self.event_object = {'PCUType': [pcu_type['pcu_type_id']]}      
+        pcu_type.sync()
+        self.event_object = {'PCUType': [pcu_type['pcu_type_id']]}
 
         return pcu_type['pcu_type_id']