Changeset 13166 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 13 Jul 2015, 08:20:23 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r13133 r13166 291 291 292 292 def writeLogMessage(view, comment): 293 """Add an INFO message to the log file.293 """Add an INFO message to ``applicants.log``. 294 294 """ 295 295 … … 449 449 450 450 def writeLogMessage(view, comment): 451 """Add an INFO message to the log file.451 """Add an INFO message to ``applicants.log``. 452 452 """ 453 453 -
main/waeup.kofa/trunk/src/waeup/kofa/documents/interfaces.py
r13145 r13166 63 63 64 64 def writeLogMessage(view, message): 65 """ Write a view specific log message into main.log.65 """Add an INFO message to ``main.log``. 66 66 """ 67 67 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
r11254 r13166 39 39 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 40 40 41 def write_log_message(view, message):42 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','')43 view.context.loggerInfo(ob_class, message)44 return45 46 41 # Save function used for save methods in manager pages 47 42 def msave(view, **data): … … 54 49 view.flash(_('Form has been saved.')) 55 50 if fields_string: 56 write_log_message(view, 'saved: %s' % fields_string)51 view.context.writeLogMessage(view, 'saved: %s' % fields_string) 57 52 return 58 53 … … 146 141 for id in child_id: 147 142 deleted.append(id) 148 write_log_message(self, 'deleted: % s' % ', '.join(deleted))143 self.context.writeLogMessage(self, 'deleted: % s' % ', '.join(deleted)) 149 144 delSubobjects(self, redirect='@@manage', tab='2') 150 145 return … … 159 154 self.context.clearAllHostels() 160 155 self.flash(_('All hostels cleared.')) 161 write_log_message(self, 'all hostels cleared')156 self.context.writeLogMessage(self, 'all hostels cleared') 162 157 self.redirect(self.url(self.context, '@@manage')+'#tab2') 163 158 return … … 192 187 return 193 188 self.flash(_('Hostel created.')) 194 write_log_message(self, 'added: % s' % data['hostel_name'])189 self.context.writeLogMessage(self, 'added: % s' % data['hostel_name']) 195 190 self.redirect(self.url(self.context[hostel.hostel_id], 'index')) 196 191 return … … 254 249 mapping = {'a':removed, 'b':added, 'c':modified, 'd':modified_beds}) 255 250 self.flash(flash_message) 256 write_log_message(self, message)251 self.context.writeLogMessage(self, message) 257 252 self.redirect(self.url(self.context, '@@manage')+'#tab2') 258 253 return … … 284 279 self.flash(_('Successfully switched beds: ${a}', 285 280 mapping = {'a':m_translated})) 286 write_log_message(self, 'switched: %s' % message)281 self.context.writeLogMessage(self, 'switched: %s' % message) 287 282 self.redirect(self.url(self.context, '@@manage')+'#tab2') 288 283 return … … 308 303 self.flash(_('Successfully released beds: ${a}', 309 304 mapping = {'a':message})) 310 write_log_message(self, 'released: %s' % message)305 self.context.writeLogMessage(self, 'released: %s' % message) 311 306 self.redirect(self.url(self.context, '@@manage')+'#tab2') 312 307 else: … … 319 314 self.context.clearHostel() 320 315 self.flash(_('Hostel cleared.')) 321 write_log_message(self, 'cleared')316 self.context.writeLogMessage(self, 'cleared') 322 317 self.redirect(self.url(self.context, '@@manage')+'#tab2') 323 318 return -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/container.py
r13165 r13166 52 52 return 53 53 54 logger_name = 'waeup.kofa.${sitename}.hostels'55 logger_filename = 'hostels.log'56 57 def logger_info(self, ob_class, target, comment=None):58 """Get the logger's info method.59 """60 self.logger.info('%s - %s - %s' % (61 ob_class, target, comment))62 return63 64 def loggerInfo(self, ob_class, comment=None):65 target = self.__name__66 return self.logger_info(ob_class,target,comment)67 68 54 @property 69 55 def expired(self): … … 78 64 return False 79 65 66 logger_name = 'waeup.kofa.${sitename}.hostels' 67 logger_filename = 'hostels.log' 68 69 def writeLogMessage(self, view, message): 70 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 71 self.logger.info( 72 '%s - %s - %s' % (ob_class, self.__name__, message)) 73 return 74 80 75 HostelsContainer = attrs_to_fields(HostelsContainer) -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
r9701 r13166 37 37 grok.implements(IHostel) 38 38 grok.provides(IHostel) 39 40 def loggerInfo(self, ob_class, comment=None):41 target = self.__name__42 return grok.getSite()['hostels'].logger_info(ob_class,target,comment)43 39 44 40 @property … … 139 135 return removed_counter, added_counter, modified_counter, modified_beds 140 136 137 def writeLogMessage(self, view, message): 138 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 139 self.__parent__.logger.info( 140 '%s - %s - %s' % (ob_class, self.__name__, message)) 141 return 142 141 143 Hostel = attrs_to_fields(Hostel) 142 144 … … 268 270 return old_owner 269 271 270 def loggerInfo(self, ob_class, comment=None): 271 target = self.__name__ 272 return grok.getSite()['hostels'].logger_info(ob_class,target,comment) 272 def writeLogMessage(self, view, message): 273 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 274 self.__parent__.__parent__.logger.info( 275 '%s - %s - %s' % (ob_class, self.__name__, message)) 276 return 273 277 274 278 Bed = attrs_to_fields(Bed) -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
r13165 r13166 71 71 """ 72 72 73 def logger_info(ob_class, target, comment=None):74 """ Get the logger's info method.73 def writeLogMessage(view, message): 74 """Add an INFO message to ``hostels.log``. 75 75 """ 76 76 … … 80 80 81 81 bed_statistics = Attribute('Number of booked and total beds') 82 83 def loggerInfo(ob_class, comment):84 """Adds an INFO message to the log file85 """86 82 87 83 def clearHostel(): … … 211 207 raise Invalid(_('Bed categories overlap.')) 212 208 209 def writeLogMessage(view, message): 210 """Add an INFO message to ``hostels.log``. 211 """ 212 213 213 class IBed(IKofaObject): 214 214 """A base representation of beds. … … 216 216 217 217 coordinates = Attribute('The coordinates of the bed from bed_id') 218 219 def loggerInfo(ob_class, comment):220 """Adds an INFO message to the log file221 """222 218 223 219 def bookBed(student_id): … … 272 268 raise Invalid(_( 273 269 "This student resides in bed ${a}.", mapping = {'a':allocated_bed})) 270 271 def writeLogMessage(view, message): 272 """Add an INFO message to ``hostels.log``. 273 """ -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r13165 r13166 154 154 155 155 def writeLogMessage(view, message): 156 """ Write a view specific log message into students.log.156 """Add an INFO message to ``students.log``. 157 157 """ 158 158
Note: See TracChangeset for help on using the changeset viewer.