def do_ok(self): log.debug("Starting sessions...") for i in self.sessions: if session.sessions.has_key(i) == True: continue s = session.vkSession(i) s.get_configuration() session.sessions[i] = s self.new_sessions[i] = s
def manage_new_account(self, *args, **kwargs): if self.view.new_account_dialog() == widgetUtils.YES: location = (str(time.time())[-6:]) log.debug("Creating session in the %s path" % (location,)) s = session.vkSession(location) path = paths.config_path(location) if not os.path.exists(path): log.debug("Creating %s path" % (paths.config_path(path),)) os.mkdir(path) s.get_configuration() self.get_authorisation(s) self.sessions.append(location) self.view.add_new_session_to_list()
def fill_list(self): log.debug("Filling the session list...") for i in os.listdir(paths.config_path()): if os.path.isdir(paths.config_path(i)): log.debug("Adding session %s" % (i,)) strconfig = "%s/session.conf" % (paths.config_path(i)) config_test = Configuration(strconfig) name = config_test["vk"]["user"] if name != "" and config_test["vk"]["password"] != "": self.session = i s = session.vkSession(self.session) s.get_configuration() session.sessions[self.session] = s
def manage_new_account(self): if view.new_account_dialog() == widgetUtils.YES: location = (str(time.time())[-6:]) log.debug("Creating session in the %s path" % (location,)) s = session.vkSession(location) path = paths.config_path(location) if not os.path.exists(path): log.debug("Creating %s path" % (paths.config_path(path),)) os.mkdir(path) s.get_configuration() self.get_authorisation(s) session.sessions[location] = s else: sys.exit()