Ignore:
Timestamp:
18 Nov 2014, 11:37:28 (10 years ago)
Author:
Henrik Bettermann
Message:

pep8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/customer.py

    r11964 r11985  
    4646RE_CUSTID_NON_NUM = re.compile('[^\d]+')
    4747
     48
    4849class Customer(grok.Container):
    4950    """This is a customer container for the various objects
     
    7677            'password'] = passwordmanager.encodePassword(password)
    7778        self.temp_password['user'] = user
    78         self.temp_password['timestamp'] = datetime.utcnow() # offset-naive datetime
     79        self.temp_password['timestamp'] = datetime.utcnow()  # offset-naive datetime
    7980
    8081    def getTempPassword(self):
    8182        """Check if a temporary password has been set and if it
    82         is not expired. 
     83        is not expired.
    8384
    8485        Return the temporary password if valid,
     
    147148Customer = attrs_to_fields(Customer)
    148149
     150
    149151class CustomerFactory(grok.GlobalUtility):
    150152    """A factory for customers.
     
    160162    def getInterfaces(self):
    161163        return implementedBy(Customer)
     164
    162165
    163166@grok.subscribe(ICustomer, grok.IObjectAddedEvent)
     
    177180        IWorkflowInfo(customer).fireTransition('create')
    178181    return
     182
    179183
    180184def path_from_custid(customer_id):
     
    215219    return folder_name
    216220
     221
    217222def move_customer_files(customer, del_dir):
    218223    """Move files belonging to `customer` to `del_dir`.
     
    242247    return
    243248
     249
    244250def update_customer_deletion_csvs(customer, del_dir):
    245251    """Update deletion CSV files with data from customer.
     
    262268
    263269        # append a deletion timestamp on each data row
    264         timestamp = str(now().replace(microsecond=0)) # store UTC timestamp
     270        timestamp = str(now().replace(microsecond=0))  # store UTC timestamp
    265271        for num, row in enumerate(csv_data[1:-1]):
    266272            csv_data[num+1] = csv_data[num+1] + ',' + timestamp
     
    276282            open(csv_path, 'a').write('\r\n'.join(csv_data[1:]))
    277283    return
     284
    278285
    279286@grok.subscribe(ICustomer, grok.IObjectRemovedEvent)
     
    320327CUSTOMER_FILE_STORE_NAME = 'file-customer'
    321328
     329
    322330class CustomerFileNameChooser(grok.Adapter):
    323331    """A file id chooser for :class:`Customer` objects.
     
    410418        # call super method to ensure that any old files with
    411419        # different filename extension are deleted.
    412         file, path, file_obj =  super(
     420        file, path, file_obj = super(
    413421            CustomerFileStoreHandler, self).createFile(
    414422            store, root,  filename, file_id, file)
Note: See TracChangeset for help on using the changeset viewer.