def index(self): """ Render the Help & Info page """ t = PageTemplate(rh=self, filename='config.mako') try: import pwd app_user = pwd.getpwuid(os.getuid()).pw_name except ImportError: try: import getpass app_user = getpass.getuser() except StandardError: app_user = '******' try: import locale app_locale = locale.getdefaultlocale() except StandardError: app_locale = 'Unknown', 'Unknown' try: import ssl ssl_version = ssl.OPENSSL_VERSION except StandardError: ssl_version = 'Unknown' app_version = '' if app.VERSION_NOTIFY: updater = CheckVersion().updater if updater: app_version = updater.get_cur_version() main_db_con = db.DBConnection() cur_branch_major_db_version, cur_branch_minor_db_version = main_db_con.checkDBVersion( ) return t.render( submenu=self.ConfigMenu(), title='Medusa Configuration', header='Medusa Configuration', topmenu='config', app_user=app_user, app_locale=app_locale, ssl_version=ssl_version, app_version=app_version, cur_branch_major_db_version=cur_branch_major_db_version, cur_branch_minor_db_version=cur_branch_minor_db_version)
def submit_errors(self): """Create an issue in medusa issue tracker.""" results = self.issue_submitter.submit_github_issue(CheckVersion()) for submitter_result, issue_id in results: submitter_notification = ui.notifications.error if issue_id is None else ui.notifications.message submitter_notification(submitter_result) return self.redirect('/errorlogs/')
def change_GIT_PATH(): """ Recreate the version_check scheduler when GIT_PATH is changed. Force a run to clear or set any error messages. """ app.version_check_scheduler = None app.version_check_scheduler = scheduler.Scheduler( CheckVersion(), cycleTime=datetime.timedelta(hours=app.UPDATE_FREQUENCY), threadName="CHECKVERSION", silent=False) app.version_check_scheduler.enable = True app.version_check_scheduler.start() app.version_check_scheduler.forceRun()
def version_checker(monkeypatch): target = CheckVersion() monkeypatch.setattr(target, 'need_update', lambda: False) return target