def app(self): """ Gets the application path from the site configuration. If the path is not configured, attempts to guess the path from the sytem path environment variable. """ try: app_path = getattr(self.settings, 'app') except AttributeError: app_path = self.executable_name # Honour the PATH environment variable. if app_path is not None and not os.path.isabs(app_path): app_path = discover_executable(app_path, self.site.sitepath) if app_path is None: raise HydeException(self.executable_not_found_message) app = File(app_path) if not app.exists: raise HydeException(self.executable_not_found_message) return app
def app(self): """ Gets the application path from the site configuration. If the path is not configured, attempts to guess the path from the sytem path environment variable. """ try: app_path = getattr(self.settings, 'app') except AttributeError: app_path = self.executable_name # Honour the PATH environment variable. if app_path is not None and not os.path.isabs(app_path): app_path = discover_executable(app_path, self.site.sitepath) if app_path is None: raise self.template.exception_class( self.executable_not_found_message) app = File(app_path) if not app.exists: raise self.template.exception_class( self.executable_not_found_message) return app