def setUp(self): self.db = Controller.get_db() self.nyc_loc_id = 501 self.submission_type = "web" self.user_id = 1 self.email = "*****@*****.**" self.phone = "2155551234"
def registerExtenderCallbacks(self, callbacks): self.__logger.debug('registerExtenderCallbacks. START') try: #callbacks.registerMenuItem("Dis/Enable burpstrike...", BurpStrikeMenuItem()) #callbacks.registerMenuItem("De/Activate all plugins...", BurpStrikeMenuItem()) # for m in Facade().get_plugins().names(): # callbacks.registerMenuItem("Send to %s" % m, BurpStrikeMenuItem()) self.__logger.info('* setting burp callbacks in facade') Facade().mCallBacks = callbacks self.__logger.debug('* initializating controller') Facade().controller = Controller() self.__logger.debug('* initializating jobman') Facade().jman = JobMan() Facade().jman.start() self.__logger.debug('* initializating ui') cw = ConsoleWorker() cw.start() except Exception, e: traceback.print_exc(file=sys.stdout) Facade().formatExceptionInfo("registerExtenderCallbacks")
def on_startup(self): opreferencesd = Controller.object("/org/freesmartphone/Preferences") self.preferences = opreferencesd.GetService("phone") address = self.preferences.GetValue("bt-headset-address") self.headset.setAddress(address) self.bus.add_signal_receiver(self.on_preferences_changed, 'Notify', 'org.freesmartphone.Preferences.Service', 'org.freesmartphone.opreferencesd', '/org/freesmartphone/Preferences/phone')
def update(self): """Enable the rules that need to be""" logger.info("Updating the rules") # First we need to get the 'enabled-rules' value from the 'rules' preference service try: prefs = Controller.object("/org/freesmartphone/Preferences") except KeyError: # preferences service not online logger.warning( "Can't access /org/freesmartphone/Preferences. Rules will be limited." ) # FIXME can we do something (limited) without preferences or not? return False rules_prefs = prefs.GetService("rules") enabled_rules = rules_prefs.GetValue("enabled-rules") enabled_rules = [str(x) for x in enabled_rules] for rule in self.rules: if rule.name in enabled_rules: rule.enable() else: rule.disable() return False
def test_SupportedLanguagesIsAsExpected(self): # Yeah, I'm hitting the file system. Deal with it. controller = Controller() langs = controller.get_supported_languages() self.assertEqual(langs, {'en_TEST': 'L33t'})
def test_SupportedLanguagesIsAsExpected(self): # Yeah, I'm hitting the file system. Deal with it. controller = Controller() langs = controller.get_supported_languages() self.assertEqual(langs, {'en_TEST':'L33t'})
def setUp(self): self.db = Controller.get_db()