def __init__(self): self.driver = Launcher('*****@*****.**','zyxing,0513').login() self.driver.find_element_by_xpath('//input[@id="search-query"]').send_keys('lvleilei1') self.driver.find_element_by_xpath('//input[@id="search-query"]').send_keys(Keys.ENTER) time.sleep(10) self.driver.find_element_by_xpath('//ul[@class="AdaptiveFiltersBar-nav"]/li[3]/a').click() time.sleep(10) self.driver.find_element_by_xpath('//div[@class="Grid Grid--withGutter"]/div[1]/div/div/a').click() time.sleep(10) self.driver.find_element_by_xpath('//a[@data-nav="tweets_with_replies_toggle"]').click() time.sleep(10) self.api = Launcher('*****@*****.**','zyxing,0513').api()
def add_launchers(self): """Add a couple of launchers.""" launcher_size_x = 60 launcher_size_y = 20 self.launchers = [ Launcher(pos_x=self.max_x - launcher_size_x, size_x=launcher_size_x, pos_y=self.ground_y - 20, size_y=launcher_size_y), Launcher(pos_x=0, size_x=launcher_size_x, pos_y=self.ground_y - 20, size_y=launcher_size_y) ]
def launch_instances(host, start_port, instances): """Launch multiple instances of Fusion 360""" launcher = Launcher() for port in range(start_port, start_port + instances): print(f"Launching Fusion 360 instance: {host}:{port}") launcher.launch() time.sleep(5)
def main(): with open(os.path.join(SHARE, 'version')) as buf: tor_browser_launcher_version = buf.read().strip() print _('Tor Browser Launcher') print _('By Micah Lee, licensed under MIT') print _('version {0}').format(tor_browser_launcher_version) print 'https://github.com/micahflee/torbrowser-launcher' common = Common(tor_browser_launcher_version) # is torbrowser-launcher already running? tbl_pid = common.get_pid(common.paths['tbl_bin'], True) if tbl_pid: print _('Tor Browser Launcher is already running (pid {0}), bringing to front').format(tbl_pid) common.bring_window_to_front(tbl_pid) sys.exit() if '-settings' in sys.argv: # settings mode app = Settings(common) else: # launcher mode app = Launcher(common)
def main(): # parse arguments parser = argparse.ArgumentParser() parser.add_argument('--settings', action='store_true', dest='settings', help='Open Tor Browser Launcher settings') parser.add_argument('url', nargs='*', help='URL to load') args = parser.parse_args() settings = bool(args.settings) url_list = args.url # load the version and print the banner with open(os.path.join(SHARE, 'version')) as buf: tor_browser_launcher_version = buf.read().strip() print _('Tor Browser Launcher') print _('By Micah Lee, licensed under MIT') print _('version {0}').format(tor_browser_launcher_version) print 'https://github.com/micahflee/torbrowser-launcher' common = Common(tor_browser_launcher_version) if settings: # settings mode app = Settings(common) else: # launcher mode app = Launcher(common, url_list)
def execute(username, password): print "launcher start!!!!!!" launcher = Launcher(username, password) print "launcher end!!!!!!!!" driver = launcher.login() es = Es_fb() comment = Comment(username, password) list = comment.get_comment() comment.save('facebook_feedback_comment', 'text', list) friend = Friend(username, password) list = friend.get_friend() friend.save('facebook_feedback_friends', 'text', list) like = Like(username, password) list = like.get_like() like.save('facebook_feedback_like', 'text', list) mention = Mention(username, password) list = mention.get_mention() mention.save('facebook_feedback_at', 'text', list) message = Message(username, password) list = message.get_message() message.save('facebook_feedback_private', 'text', list) online = Online(username, password) share = Share(username, password) list = share.get_share() share.save('facebook_feedback_retweet', 'text', list)
def __init__(self, username, password): self.launcher = Launcher(username, password) self.driver = self.launcher.login() self.es = Es_fb() self.comment_list = self.launcher.get_comment_list() self.list = [] self.update_time = int(time.time())
def __init__(self, qApp): super(ApplicationWindow, self).__init__() self.ui = Ui_LauncherWindow() self.ui.setupUi(self) self.Launcher = Launcher() ### Import UI Fonts ### self.fontDB = QtGui.QFontDatabase() self.fontDB.addApplicationFont(":/fonts/fonts/Anton-Regular.ttf") self.fontDB.addApplicationFont(":/fonts/fonts/BowlbyOneSC-Regular.ttf") ### Set special case fonts ### self.ui.launcher_state.setFont(QtGui.QFont("Anton", 14)) self.ui.launcher_status.setFont(QtGui.QFont("Anton", 14)) self.ui.pushButton.setFont(QtGui.QFont("BowlbyOneSC", 12)) ### UI Globals ### self.counter = 0 self.complete_progress = 0 self.uName = False self.pWord = False # This is defined so that we can call back the UI from the main application self.APP = qApp # So we can implement hooks to control the UI self.Launcher.setUICallbacks(self) # Set the startup state of the UI self.setDefaultUI() # Attatch functions to buttons self.ui.pushButton.clicked.connect(self.setCredentials)
def startGame(self): # add the launcher to the window self.launcher = Launcher(self.win, Point(105, 75)) for target in self.targets: target.undraw() for bullet in self.bullets: bullet.undraw() # add a container to the store all the targets self.targets = [] # Add a container to store all the bullets self.bullets = [] # Initialise hit count to 0 self.hitCount = 0 # update score self.updateScore() # Undraw texts after restart self.gotext.undraw() self.infoText.undraw()
def __init__(self): self.fb = Launcher('18538728360', 'zyxing,0513') self.driver = self.fb.login() self.driver.find_element_by_xpath('//a[@title="个人主页"]').click() time.sleep(1) self.driver.find_element_by_xpath( '//ul[@id="u_jsonp_2_8"]/li[3]/a').click() time.sleep(1) self.driver.execute_script(""" (function () { var y = 0; var step = 100; window.scroll(0, 0); function f() { if (y < document.body.scrollHeight) { y += step; window.scroll(0, y); setTimeout(f, 150); } else { window.scroll(0, 0); document.title += "scroll-done"; } } setTimeout(f, 1500); })(); """) time.sleep(3) while True: if "scroll-done" in self.driver.title: break else: time.sleep(3) self.list = []
def __init__(self, username, password): self.launcher = Launcher(username, password) self.mention_list, self.driver, self.display = self.launcher.get_mention_list( ) self.es = Es_fb() self.list = [] self.update_time = int(time.time())
def __init__(self,username, password, consumer_key, consumer_secret, access_token, access_secret): self.launcher = Launcher(username, password, consumer_key, consumer_secret, access_token, access_secret) self.api = self.launcher.api() self.es = Es_twitter() self.list = [] self.root_uid = self.api.me() self.update_time = int(time.time())
def __init__( self ): #strat process xbmc.Monitor.__init__( self ) xbmc.log("eq: start PulesEqualizer service",xbmc.LOGDEBUG) self.server_sock = SocketCom("kodi") if not self.server_sock.is_server_running(): self.server_sock.start_func_server(self) else: self.server_sock = None launcher = Launcher("menu") launcher.start() self.sock = SocketCom("server") ps = PulseService() ps.start() self.sock.call_func("set","device",[self.get_device()]) while not self.abortRequested(): if self.waitForAbort( 10 ): break launcher.stop() ps.stop() if self.server_sock: self.server_sock.stop_server()
def __init__(self, username, password): self.launcher = Launcher(username, password) self.api = self.launcher.api() self.driver = self.launcher.login() self.driver.get('https://twitter.com/i/notifications') self.es = Es_twitter() self.lis = self.driver.find_elements_by_xpath( '//li[@data-item-type="activity"]') self.list = []
def __init__(self, username, password, consumer_key, consumer_secret, access_token, access_secret): self.launcher = Launcher(username, password, consumer_key, consumer_secret, access_token, access_secret) self.driver = self.launcher.login() self.es = Es_twitter() self.api = self.launcher.api() self.driver.get('https://twitter.com/i/notifications') time.sleep(2) self.lis = self.driver.find_elements_by_xpath('//li[@data-item-type="activity"]') self.list = [] self.update_time = int(time.time())
def __init__(self, username, password, current_ts, consumer_key, consumer_secret, access_token, access_secret, *args): self.launcher = Launcher(username, password, consumer_key, consumer_secret, access_token, access_secret) self.api = self.launcher.api() self.es = Es_twitter() self.list = [] self.update_time = int(time.time()) try: self.uid = args[0] except Exception as e: print "no uid"
def __init__(self, username, password, current_ts, *args): self.launcher = Launcher(username, password) self.api = self.launcher.api() self.es = Es_twitter() self.update_time = current_ts self.list = [] try: self.uid = args[0] except Exception as e: print "no uid"
def __launch_gym(self): """Launch the Fusion 360 Gym on the given host/port""" launcher = Launcher() self.p = launcher.launch() # We wait for Fusion to start responding to pings result = self.__wait_for_fusion() if result is False: # Fusion is awake but not responding so restart self.p.kill() self.p = None self.__launch_gym() else: return result
def __prepare_launcher(self): params = self.__prepare_params(self.params) executable = self.config["test"]["command"].split() + [ "-b", "--monitoring-backend", self.config["test"]["config"]["monitoring"], "--config-path", self.program_config ] self.__dump_params(dict(executable=" ".join(executable), **params)) self.__create_config(params) self.launcher = Launcher(executable, self.workdir, self.env, self.config)
def __init__(self): # create graphics window with a scale line at the bottom self.win = GraphWin("Projectile Animation", 640, 480) self.win.setCoords(-10, -10, 210, 155) Line(Point(-10, 0), Point(210, 0)).draw(self.win) for x in range(0, 210, 50): Text(Point(x, -7), str(x)).draw(self.win) Line(Point(x, 0), Point(x, 2)).draw(self.win) # add the launcher to the window self.launcher = Launcher(self.win) # start with an empty list of "live" shots self.shots = []
def __init__(self): self.program = Launcher() self.points_leaderboard = self.create_points_leaderboard() self.display_points_leaderboard() self.rebounds_leaderboard = self.create_rebounds_leaderboard() self.display_rebounds_leaderboard() self.assists_leaderboard = self.create_assists_leaderboard() self.display_assists_leaderboard() self.steals_leaderboard = self.create_steals_leaderboard() self.display_steals_leaderboard() self.blocks_leaderboard = self.create_blocks_leaderboard() self.display_blocks_leaderboard()
def __init__(self, username, password): self.launcher = Launcher(username, password) self.driver = self.launcher.login_mobile() time.sleep(2) self.driver.get('https://m.facebook.com/friends/center/friends') time.sleep(3) #加载更多 try: self.driver.find_element_by_xpath( '//div[@id="friends_center_main"]/div[2]/a').click() except: pass self.es = Es_fb() self.friends_list = [] self.current_ts = int(time.time()) self.update_time = self.current_ts
def launchExecutor(self, framework_id, info, executor_info, directory, resources): fid = framework_id.value eid = executor_info.executor_id.value logger.info("Launching %s (%s) in %s with resources %s for framework %s", eid, executor_info.command.value, directory, resources, fid) pid = os.fork() assert pid >= 0 if pid: logger.info("Forked executor at %d", pid) pinfo = ProcessInfo(framework_id, executor_info.executor_id, pid, directory) self.infos.setdefault(fid, {})[eid] = pinfo self.pids[pid] = pinfo self.slave.executorStarted(framework_id, executor_info.executor_id, pid) else: #pid = os.setsid() # copy UPID of slave launcher = Launcher(framework_id, executor_info.executor_id, executor_info.command, info.user, directory, self.slave) launcher.run()
def __init__(self): # create graphics window self.win = GraphWin("ARCADE V.0", 640, 480) self.win.setCoords(-10, -10, 210, 155) self.win.setBackground('black') # add the launcher to the window self.launcher = Launcher(self.win, Point(105, 75)) # add a container to the store all the targets self.targets = [] # Add a container to store all the bullets self.bullets = [] # Initialise hit count to 0 self.hitCount = 0 # Display score i.e hitCount in the window self.score = Text(Point(5, 152), "Hits: " + str(self.hitCount)) self.score.setSize(12) self.score.setTextColor('white') self.score.draw(self.win) # Set text to display on gameover self.gotext = Text(Point(105, 80), 'GAME OVER') self.gotext.setSize(36) self.gotext.setTextColor('red') self.infoText = Text(Point(105, 70), 'Press s restart and q to quit!') self.infoText.setSize(8) self.infoText.setTextColor('white') # Display info to play the game self.info = Text( Point(105, -3), 'Press Space or Enter or f to shoot. Press' + ' Up/Down arrow to move the shooter forward' + '/backward.\nPress > and < to rotate. ' + 'Press right/left key to slide horizontally.') self.info.setSize(6) self.info.setTextColor('white') self.info.draw(self.win)
def main(argv=None): """ Entry method for Chatflow analytics pipeline. """ if argv is None: argv = sys.argv try: try: opts, args = getopt.getopt(argv[1:], 'h', ['help', 'log=', 'start=', 'end=']) except getopt.error as err: raise Usage(err.msg) # Set default value for runtime settings. log_level = logging.WARNING # TODO: should read start start and end from optional options. start = datetime.now() - timedelta(days=1) end = datetime.now() for opt in opts: opt_key = opt[0] if opt_key == '-h' or opt_key == '--help': print(__doc__) return elif opt_key == '--log': log_level = getattr(logging, opt[1].upper(), None) if not isinstance(log_level, int): raise ValueError('Invalid log level: %s' % opt[1]) # Remove all handlers already associated with the root logger object. # Otherwise the basicConfig line below would not take effect. for handler in logging.root.handlers[:]: logging.root.removeHandler(handler) logging.basicConfig(format='%(asctime)s %(message)s', level=log_level) Launcher().start(start, end) except Usage as err: logging.error(err.msg) logging.error('for help use --help') return 2
def __init__(self, username, password): self.launcher = Launcher(username, password) self.driver = self.launcher.login() time.sleep(2) # 退出通知弹窗进入页面 try: self.driver.find_element_by_xpath('//div[@class="_n8 _3qx uiLayer _3qw"]').click() except: pass # # 进入个人主页 # self.driver.find_element_by_xpath('//a[@title="个人主页"]').click() # time.sleep(3) # # 退出通知弹窗进入页面 # try: # self.driver.find_element_by_xpath('//div[@class="_n8 _3qx uiLayer _3qw"]').click() # except: # pass # # 点击好友列表 # self.driver.find_element_by_xpath('//ul[@data-referrer="timeline_light_nav_top"]/li[3]/a').click() # time.sleep(3) # 进入好友请求页面 self.driver.get('https://www.facebook.com/friends/requests') time.sleep(3) # 退出通知弹窗进入页面 try: self.driver.find_element_by_xpath('//div[@class="_n8 _3qx uiLayer _3qw"]').click() except: pass #加载更多 length=100 for i in range(0,20): js="var q=document.documentElement.scrollTop="+str(length) self.driver.execute_script(js) time.sleep(1) length+=400 self.es = Es_fb() self.list = [] self.current_ts = int(time.time()) self.update_time = self.current_ts
def run(): parser = argparse.ArgumentParser() parser.add_argument( '-c', '--config', metavar='FILE', help="path to configuration file", default="~/gtlaunch.json", ) parser.add_argument( '-v', '--verbose', help="verbose output", action='store_true', ) parser.add_argument( '-V', '--version', action='version', version='%%(prog)s %s' % __version__, ) group = parser.add_mutually_exclusive_group(required=True) group.add_argument( '-l', '--list', help="list all projects", action='store_true', ) group.add_argument( dest='project', metavar='PROJECT', help="project label", nargs='?', ) args = parser.parse_args() try: launcher = Launcher(args) launcher.run() except LauncherError as e: print("Launcher error: {}".format(e)) sys.exit(1)
def __init__(self, qApp): super(ApplicationWindow, self).__init__() self.ui = Ui_LauncherWindow() self.ui.setupUi(self) self.Launcher = Launcher() ### UI Globals ### self.counter = 0 self.complete_progress = 0 self.uName = False self.pWord = False # This is defined so that we can call back the UI from the main application self.APP = qApp # So we can implement hooks to control the UI self.Launcher.setUICallbacks(self) # Set the startup state of the UI self.setDefaultUI() # Attatch functions to buttons self.ui.pushButton.clicked.connect(self.setCredentials)
def __init__(self, username, password): self.launcher = Launcher(username, password) self.driver, self.display = self.launcher.login() time.sleep(2) # 退出通知弹窗进入页面 try: self.driver.find_element_by_xpath( '//div[@class="_n8 _3qx uiLayer _3qw"]').click() except: pass self.driver.find_element_by_xpath('//a[@title="个人主页"]').click() time.sleep(3) # 退出通知弹窗进入页面 try: self.driver.find_element_by_xpath( '//div[@class="_n8 _3qx uiLayer _3qw"]').click() except: pass self.driver.find_element_by_xpath( '//ul[@data-referrer="timeline_light_nav_top"]/li[3]/a').click() time.sleep(3) # 退出通知弹窗进入页面 try: self.driver.find_element_by_xpath( '//div[@class="_n8 _3qx uiLayer _3qw"]').click() except: pass #加载更多 length = 100 for i in range(0, 50): js = "var q=document.documentElement.scrollTop=" + str(length) self.driver.execute_script(js) time.sleep(1) length += length self.es = Es_fb() self.list = [] self.current_ts = int(time.time()) self.update_time = self.current_ts
def run(self, problem_id, domain_template, problem_template, facts_pdkb, goals_pdkb): """ Execute the planner and return the parsed output. Before the planner is executed the pddl problem file is created dynamically by inserting the knowledge base (kb_files) and the current goals (goal_files) at the right location in the problem template. @param problem_id The id for the particular problem/domain set @param domain_template The path of the pddl domain template @param problem_template The name of the pddl problem template that contains special insertion marks @param facts_pdkb The fact files to be inserted in the pddl problem file @param goals_pdkb The goal files to be inserted in the pddl problem file """ # insert the PDKB files into the PDDL templates (domain_file, problem_file) = compile_PDKB_to_PDDL(problem_id, domain_template, problem_template, facts_pdkb, goals_pdkb) # launch the planner and redirect output to parser l = Launcher(domain_file, problem_file) l.launch() p = Parser(l.get_output()) if print_planner_output: print l.get_output() # return the parsed plan return p