Changeset 6124
- Timestamp:
- 17 May 2011, 23:41:45 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py
r5467 r6124 124 124 for x in self._entries: 125 125 yield x 126 126 127 127 def getAccessCode(self, ac_id): 128 128 """Get the AccessCode with ID ``ac_id`` or ``KeyError``. … … 173 173 ac._invalidation_date = datetime.now() 174 174 self.disabled_num += 1 175 175 176 176 def enable(self, ac_id): 177 177 """(Re-)enable the AC with ID ``ac_id``. … … 296 296 self.addBatch(batch) 297 297 return batch 298 298 299 299 def getNum(self, prefix): 300 300 """Get next unused num for given prefix. … … 311 311 for filename in sorted(os.listdir(path)): 312 312 yield filename 313 313 314 314 def reimport(self, filename, creator=u'UNKNOWN'): 315 315 """Reimport a batch given in CSV file. … … 364 364 continue 365 365 return None 366 366 367 367 def disable(self, ac_id, user_id): 368 368 """Disable the AC with ID ``ac_id``. … … 389 389 return 390 390 391 391 392 392 class AccessCodePlugin(grok.GlobalUtility): 393 393 grok.name('accesscodes') … … 414 414 415 415 An access code here is a string like ``PUDE-1-1234567890``. 416 416 417 417 Returns ``None`` if the given code cannot be found. 418 418 … … 430 430 if batch is None: 431 431 return None 432 432 433 433 try: 434 434 code = batch.getAccessCode(access_code)
Note: See TracChangeset for help on using the changeset viewer.