Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r245 r246 4 4 * Added RPM packages 5 5 * Added a favicon to the server 6 * Don't clean out status labels when restarting server 7 * Don't check for system compatibility of Libnotify 8 * Cleaning of the code to try to be at least more compatible with PEP-8 6 9 * Simplified and improved Makefile 7 * Cleaning of the code to try to be at least more compatible with PEP-88 * Dont clean out status labels when restarting server9 10 10 11 0.2.1: -
trunk/console.py
r241 r246 129 129 Constructor for console output handler 130 130 131 @type itaka globals: module132 @param itaka globals: Configuration module globals131 @type itaka_globals: module 132 @param itaka_globals: Configuration module globals 133 133 """ 134 134 135 135 self.itaka_globals = itaka_globals 136 136 if self.itaka_globals.console_verbosity['normal']: 137 BaseMessage(_('Itaka %s starting') % ( itakaglobals.version))137 BaseMessage(_('Itaka %s starting') % (self.itaka_globals.__version__)) 138 138 139 def __del__(self):140 """141 Destructor142 """143 144 if self.itaka_globals.console_verbosity['normal']:145 BaseMessage(_('Itaka shutting down'))146 147 139 def message(self, message): 148 140 """ -
trunk/server.py
r245 r246 200 200 self.add_child_to_resource('root', '', self.root) 201 201 self.add_child_to_resource('root', 'screenshot', ScreenshotResource(self.gui, self.authresource)) 202 self.add_child_to_resource('root', 'favicon.ico', IconResource(self.gui, self.authresource)) 202 self.add_child_to_resource('root', 'favicon.ico', FileResource(self.gui, self.authresource, os.path.join(self.itaka_globals.image_dir, 'favicon.ico'), 'image/x-icon')) 203 203 204 self.create_site(self.root) 204 205 … … 454 455 return self.data 455 456 456 class IconResource(resource.Resource):457 class FileResource(resource.Resource): 457 458 """ 458 Handle server requests and call for favicon.ico459 """ 460 461 def __init__(self, gui_instance, auth_instance ):459 Generic handler for file resources 460 """ 461 462 def __init__(self, gui_instance, auth_instance, path, type): 462 463 """ 463 464 Constructor … … 468 469 @type auth_instance: AuthenticatedResource 469 470 @param auth_instance: An instance of our L{AuthenticatedResource} class 471 472 @type path: string 473 @param path: The path to the file to be served 474 475 @type type: str 476 @param type: The MIME-type to bepassed to Content-Type 470 477 """ 471 478 … … 474 481 self.itaka_globals = self.gui.itaka_globals 475 482 483 self.type = type 484 self.data = open(path, 'rb').read() 485 self.size = str(os.stat(path).st_size) 486 476 487 def render_GET(self, request): 477 488 """ … … 484 495 self.configuration = self.gui.configuration 485 496 self.request = request 486 self.type = 'image/x-icon'487 self.file = os.path.join(self.itaka_globals.image_dir, 'favicon.ico')488 self.data = open(self.file, 'rb').read()489 self.size = str(os.stat(self.file).st_size)490 497 491 498 if self.configuration['server']['authentication']: -
trunk/uigtk.py
r244 r246 1214 1214 1215 1215 if self.server.listening(): 1216 self.console.message(_('Shutting down server'))1217 1216 self.server.stop_server() 1218 del self.console1219 else:1220 # Console goodbye!1221 if hasattr(self, 'console'):1222 del self.console1223 1217 1224 1218 # Remove stale screenshot and quit … … 1229 1223 del self.status_icon 1230 1224 1225 self.console.message(_('Itaka shutting down')) 1231 1226 gtk.main_quit() 1232 1227
Note: See TracChangeset
for help on using the changeset viewer.

