def _CreateLoggedInSession(args):
    if args.save_session:
        if not args.save_session_to:
            args.save_session_to = 'session.bin'

    if args.save_session_to:
        args.save_session = True

    use_session_file = args.save_session or args.save_session_to
    if not use_session_file:
        if not args.username or not args.password:
            _RequireLoginCredentialsExit()

        return login.Login(args.username, args.password)

    session_file = pathlib.Path(args.save_session_to)
    if session_file.is_file():
        with open(session_file, 'rb') as f:
            session = requests.Session()
            session.cookies.update(pickle.load(f))
            return session

    if not args.username or not args.password:
        _RequireLoginCredentialsExit()
    return login.Login(args.username, args.password)
Exemple #2
0
 def login(self, name):
     if name:
         new_conn = login.Login(name, softboot=True)
     else:
         new_conn = login.Login()
     new_conn.sock = self
     new_conn.sock.owner = new_conn
     if not name:
         new_conn.greeting()
         comm.wiznet(f"Accepting connection from: {new_conn.sock.host}")
     else:
         new_conn.interp = new_conn.character_login
         new_conn.interp()
    def action(self):
        login_MDEcli = login.Login(self.tenantId, self.appId, self.appSecret)
        aadToken = login_MDEcli.login()

        with open(self.filename, newline='') as csvfile:
            data = csv.DictReader(csvfile)
            for item in data:
                try:
                    url = f"https://api.securitycenter.microsoft.com/api/machines/{item[self.column].strip()}/{self.url}"
                    headers = {
                        'Content-Type': 'application/json',
                        'Accept': 'application/json',
                        'Authorization': "Bearer " + aadToken
                    }

                    data = str(json.dumps(self.body)).encode("utf-8")

                    req = urllib.request.Request(url=url,
                                                 data=data,
                                                 headers=headers)
                    response = urllib.request.urlopen(req)
                    jsonResponse = json.loads(response.read())

                    computerDnsName = jsonResponse['computerDnsName']
                    print(f'{self.url} started on {computerDnsName}')

                except Exception as e:
                    print(f'Someting went wrong:{e}')
 def See_shoppingCart_2(self):
     login.Login()
     url = CONFIG.Url() + '/api/small/cart/list.jhtml'
     params = {
         'unionId':
         CONFIG.Unionid(),
         'supplierId':
         supplier.Supplier_id().Supplier_platform_zhiying()[0]['id'],
         'shopId':
         '3212',
         'supplierType':
         supplier.Supplier_id().Supplier_platform_zhiying()[0]
         ['supplierType'],
         'relationId':
         supplier.Supplier_id().Supplier_platform_zhiying()[0]
         ['relationId'],
         'types':
         'platform',
         'supplyType':
         supplier.Supplier_id().Supplier_platform_zhiying()[0]
         ['supplierType']
     }
     xx = requests.get(url, params)
     if xx.status_code == 200:
         if xx.json()['msg'] == '成功':
             goodsList = xx.json()
             return '直营店-平台-直营型订单购物车获取成功', goodsList
         else:
             return '[×] 直营店-平台-直营型订单购物车出现异常 %s' % xx.xx.json()['msg']
     else:
         return '[×] 直营店-平台-直营型订单购物车出现异常 %s' % xx.status_code
    def __init__(self, master=None):
        super().__init__(master)
        self.master = master
    
        # Create login window
        login_window = login.Login(root)
        
        # Create Notebook and Tabs
        tab_names = ['Communication Interface Configuration', 'HDMI Configuration', 'Register Control', 'Terminal']
        nb = ttk.Notebook(root)
        nb.pack(expand=1, fill=BOTH)
        tabs = nbtb.create_tabs(nb, tab_names)
        
        # Create Menu Bar
        menu.Menubar(root)
        
        # Fill Terminal Tab
        ter = terminal.Terminal(tabs, tab_names.index('Terminal'))
     
        # Fill Driver Configuration Tab
        dri = communicationInterface.CommunicationInterface(nb, tabs, tab_names, ter)

        # Fill HDMI Configuration Tab
        hdmi.HDMI(nb, tabs, tab_names.index('HDMI Configuration'), ter)

        # Fill Register Control Tab
        registers.Registers(tabs, tab_names.index('Register Control'))
Exemple #6
0
def main():
    global driver
    print("running script...")
    driver = webdriver.Chrome(
        "C://Program Files (x86)/Google/Chrome/Application/chrome.exe")
    l = login.Login(driver, username, password)
    l.signin()
Exemple #7
0
    def test(self):
        self.driver = webdriver.Chrome('/Users/bzhuang/Downloads/chromedriver')
        self.driver.get(
            "https://ec2-35-173-243-186.compute-1.amazonaws.com/login")

        loginn = login.Login(self.driver)
        loginn.login(self.user_type)
        time.sleep(1)

        # story = addStory.Story(self.driver)
        # story.makeStory(self.user_type)

        # catalog1 = catalog.Catalog(self.driver)
        # catalog1.catalog(self.user_type)

        # subbed = subscribe.Subscribe(self.driver)
        # subbed.sub(self.user_type)

        feature = testFeatures.Features(self.driver)
        # feature.hide_story(self.user_type)
        # feature.feature_story(self.user_type)
        # feature.edit_story(self.user_type)
        feature.modify_featured(self.driver)

        self.driver.find_element_by_link_text('LOGOUT').click()
        time.sleep(2)
    def system(self):
        if self.usr[0] == '':
            usr_info = login.Login()
            if usr_info.LoginScreen():
                self.usr[0] = 0
                self.usr[1] = usr_info.user_check
                print('self.usr : '******'mainView')
            #usr.status 에 mainView에서 받아온 상태값을 저장
            self.usr[0] = MainView()
            pass

        if self.usr[0] == 1:
            print('game start')
            pass

        if self.usr[0] == 2:
            print('game help')
            pass

        if self.usr[0] == 3:
            print('game setting')
            pass
Exemple #9
0
def Add_shop_affiliate(): # 创建加盟店
    login.Login() # 初始化登陆
    url = CONFIG.Url()+'/api/small/shop/add.jhtml'
    params = {
            'unionId': CONFIG.Unionid(),  # unionid
            'shopType': 'affiliate',      # 门店类型 affiliate,加盟;direct 直营
            'name': '加盟店'+time.strftime('%Y%m%d-%H%M%S'),
            'userName': '******',
            'areaId': '800',
            'address': 'address',
            'ids': '',
            'receiverTel': '13800000000',
            'businessCategoryId': '42',
            'startManageTime': '12:00',
            'endManageTime': '12:01',
            'longitude': '121',
            'latitude': '31'}
    request_add_shop_affiliate = requests.post(url, params)
    if request_add_shop_affiliate.status_code != 200:
        return '[×] 创建加盟门店接口异常-->%s' % request_add_shop_affiliate.status_code
    else :
        if request_add_shop_affiliate.json()['code'] != '0': # 根据code确认是否创建成功,0成功,其他则失败
            return '[×] %s_加盟门店创建失败,创建的门店名称:%s'%(request_add_shop_affiliate.json(), params['name'])
        else:
            shop_list = view_shop.View_shop_name()[1] # 获取门店接口,判断门店是否存在于门店列表
              # params = {'name': '又乐'} # 测试数据,写死的不存在的门店名称
            if params['name'] in shop_list:
                return '加盟门店创建成功', params['name']
            else:
                return '[×] 加盟门店创建失败,创建的加盟门店在列表中不存在_创建的加盟店名称:%s_门店列表:%s'% (params['name'],shop_list)
Exemple #10
0
def main():
    Choose = input('''
	==============================================
                    欢迎光临南非波波小屋!
	==============================================
			[1]注册   [2]登录   [3]退出
	请选择相应指令:''').strip()
    if Choose == '':
        print("指令不能为空,请输入正确指令!")
    else:
        if Choose.isdigit():
            Choose = int(Choose)
            if Choose >= 1 and Choose <= 3:
                if Choose == 1:
                    addusers.AddUsers()
                if Choose == 2:
                    login.Login()
                if Choose == 3:
                    print("欢迎下次光临南非波波小屋!")
                    time.sleep(1)
                    sys.exit(0)
            else:
                print("你输入的指令已超出范围,请按照系统指令进行输入!")
        else:
            print("请输入正确的指令,指令为整数型数字!")
Exemple #11
0
 def set_up(self):
     st = setup.Setup()
     lg = login.Login()
     lg.set_driver(st.driver)
     driver = lg.login_action('admin', 'admin')
     driver.find_element_by_link_text('※ 缺陷跟踪 ※').click()
     return driver
Exemple #12
0
class See:

    login.Login()

    def PlatfromOrder(self):
        url = CONFIG.Url() + '/api/small/order/orderList.jhtml'
        params = {
            'unionId': CONFIG.Unionid(),
            'searchProperty': 'sn',  # ??
            'searchValue': '',  # 搜索时传入订单号
            'status': '',  # 订单状态tab
            'pageNumber': 1,  # 分页,可不填,默认为1
            'pageSize': 20  # 分页显示的条数,可不填,默认为10
        }
        xx = requests.get(url, params)
        return xx.json()['data']['orders']

    def LocalOrder(self):
        url = CONFIG.Url() + '/api/small/order/localOrderList.jhtml'
        params = {
            'unionId': CONFIG.Unionid(),
            'searchProperty': 'sn',  # ??
            'searchValue': '',  # 搜索时传入订单号
            'status': '',  # 订单状态tab
            'pageNumber': 1,  # 分页,可不填,默认为1
            'pageSize': 20  # 分页显示的条数,可不填,默认为10
        }
        xx = requests.get(url, params)
        return xx.json()['data']['orders']
    def __init__(self):

        QtCore.QObject.__init__(self)
        self.config = config.Config()
        self.login = False
        self.loginTime = None

        print('_______strp1_________')
        self.processEvents()
        self.queryCore = queryCore.Core(self)
        self.processEvents()
        print('_______strp2_________')
        self.db = db.Db()
        storage = readStorage.Storage()
        self.storageData = storage.readCommentSetting()
        self.config.updateSequenceDateFromStorage(self.storageData)
        self.config.set('stations', station.getStations())
        self.onBooking = False
        print('_______strp3_________')

        app = QtGui.QApplication(sys.argv)

        print('_______strp4_________')
        #login
        autoLogin = False
        try:
            self.processEvents()
            print('_______strp5_________')
            if self.getLoginData()['username'] == self.getPersonalDetail(
            )['username']:
                self.processEvents()
                autoLogin = True
        except Exception:
            pass
        print('_______strp6_________')

        if not autoLogin:
            print('_______strp7_________')
            self.processEvents()
            lg = login.Login(self)
            self.processEvents()
        print('_______strp8_________')
        if autoLogin or lg.exec_():
            if not autoLogin:
                self.processEvents()
                if not lg.getLogin():
                    return
            print('_______strp9_________')
            self.processEvents()
            self.getPersonalContacts()
            self.processEvents()
            print('_______strp10_________')
            main = mainWindow.MainWindow(self)
            main.setWindowIcon(QtGui.QIcon("images/favorite.ico"))
            main.show()

            self.keepAlive = KeepAlive(self, self.config.get('keepAliveTime'))
            self.keepAlive.setDaemon(True)
            self.keepAlive.start()
        sys.exit(app.exec_())
Exemple #14
0
 def __init__(self, driver, role):
     page.Page.__init__(self, driver)
     user_login = login.Login(self.driver)
     user_login.login(role)
     self.find(order_ele.PENDING_LIST_BUTTON, sleep=True).click()
     self.find(order_ele.ORDER_DETAIL_BUTTON, sleep=True).click()
     time.sleep(10)
 def See_shoppingCart_8(self):
     login.Login()
     url = CONFIG.Url() + '/api/small/cart/list.jhtml'
     params = {
         'unionId':
         CONFIG.Unionid(),
         'supplierId':
         supplier.Supplier_id().Supplier_local_jiameng_shop()[0]['id'],
         'shopId':
         '3214',
         'supplierType':
         supplier.Supplier_id().Supplier_local_jiameng_shop()[0]
         ['supplierType'],
         'relationId':
         supplier.Supplier_id().Supplier_local_jiameng_shop()[0]
         ['relationId'],
         'types':
         'local',
         'supplyType':
         supplier.Supplier_id().Supplier_local_jiameng_shop()[0]
         ['supplierType']
     }
     xx = requests.get(url, params)
     if xx.status_code == 200:
         if xx.json()['msg'] == '成功':
             goodsList = xx.json()
             return '加盟店-本地-本地供应商订单购物车获取成功', goodsList
         else:
             return '[×] 加盟店-本地-本地供应商订单购物车出现异常 %s' % xx.xx.json()['msg']
     else:
         return '[×] 加盟店-本地-本地供应商订单购物车出现异常 %s' % xx.status_code
Exemple #16
0
def LoginBilibili(msg, QQ):
    import login
    import time
    a = login.Login()
    if msg == '#御坂登录':
        base = a.newlogin()
        POST.UserMsg(msg='请在150秒内使用哔哩哔哩客户端扫描登录二维码',
                     to=QQ,
                     picurl=0,
                     picbase=base)
        print(QQ)
        for _ in range(150):
            text = a.chaxunlogin()
            if text == 'Not Logined':
                #print('没登录')
                pass
            else:
                POST.UserMsg(msg='登录成功', to=QQ, picurl=0, picbase=0)
                csrf = text['csrf']
                cookie = text['sessdata']
                try:
                    sql.write(
                        f'insert into bilibili(QQ,csrf,cookie) values("{QQ}","{csrf}","{cookie}");'
                    )
                except:
                    pass
                break
            time.sleep(1)
Exemple #17
0
def loginSite():
    global opener
    login.loginurl = "https://accounts.douban.com/login"
    douban = login.Login()
    username = "******"
    password = "******"
    douban.setLoginInfo(username, password)
    opener = douban.login()
Exemple #18
0
def main():
    global driver
    username = "******"
    password = "******"
    print('running scripts')
    driver = webdriver.Chrome('C:/Users/User/Desktop/Bluetown/chromedriver.exe')
    l = login.Login(driver, username, password)
    l.login()
Exemple #19
0
def main():
    global driver
    print("running script")
    #change the path to your chromedrived executable
    driver = webdriver.Chrome("PATH")
    for name in username["accounts"]:
        print("running with %s and %s" % (name["username"], name["password"]))
        l = login.Login(driver, name["username"], name["password"])
        l.signin()
Exemple #20
0
 def testLogin(self):
     try:
         time.sleep(10)
         login.Login(self.driver).userLogin(userName,passWord)
         time.sleep(6)
         if homePage.HomePage(self.driver).messageText() == u'消息':
             print u'用户登录QQ成功!'
     except Exception,e:
         print e.message
Exemple #21
0
 def control(self):
     log = login.Login()
     log.login_window()
     if log.authernticate == True:
         print("Login Successful")
     else:
         print("Login Failed")
     del log
     print("Got Our Control Back")
Exemple #22
0
def main():
    global driver
    print("running script...")
    driver = webdriver.Chrome(
        r"C:/Users/ankitaPC/AppData/Local\Temp/Temp1_chromedriver_win32.zip/chromedriver.exe"
    )

    l = login.Login(driver, username, password)
    print("helooooooooooo")
    l.signin()
Exemple #23
0
def main():
    global driver
    print('running script..')
    driver = webdriver.Chrome('C://Users/Ryan/Desktop/chromedriver.exe')
    l = login.Login(driver, username, password)
    l.signin()
    gp = getpages.Getpages(driver)
    refs = gp.get_followers()
    print(gp.get_num_flw())
    run_bot(refs, driver, gp)
Exemple #24
0
	def handle_accept(self):
		# accept() returns a (socket,addr) tuple. GS inherits from
		# asyncore.dispatcher which wants the socket as its argument, thus the
		# t=GS(self.accept()[0]) bit.
		l=login.Login()
		sock=GS(self.accept()[0],l)
		l.s=sock
		g.cl.append(sock)
		l.show_intro()
		return sock
Exemple #25
0
 def handle_accept(self):
     newconn = login.Login()
     connection, address = self.accept()
     sock = ConnSocket(connection, address)
     newconn.sock = sock
     newconn.sock.owner = newconn
     connlist.append(sock)
     newconn.greeting()
     comm.wiznet(f"Accepting connection from: {newconn.sock.host}")
     return sock
Exemple #26
0
def main():
    global driver
    print('running script..')
    driver = webdriver.Chrome(ChromeDriverManager().install())
    l = login.Login(driver, username, password)
    l.signin()
    gp = getpages.Getpages(driver)
    refs = gp.get_followers()
    print(gp.get_num_flw())
    run_bot(refs, driver, gp)
def main():
    global driver
    print('running script..')
    driver = webdriver.Chrome(
        'D://a1/software_installer/chromedriver_win32/chromedriver.exe')
    l = login.Login(driver, username, password)
    l.signin()
    print("login succeed...!")
    time.sleep(10)
    ga = getarticles.Getarticles(driver)
    ga.get_articles()
Exemple #28
0
 def test_search(self, paras, expected):
     st = setup.Setup()
     lg = login.Login()
     lg.set_driver(st.driver)
     driver = lg.login_action('admin', 'admin')
     driver.find_element_by_link_text('※ 缺陷跟踪 ※').click()
     re = defect.Defect()
     re.set_driver(driver)
     re.search(paras)
     time.sleep(2)
     driver.quit()
Exemple #29
0
def main():
    global driver
    print('running script...')
    driver = webdriver.Chrome()  #insert location of .exe file
    log = login.Login(driver, username, password)
    log.signin()
    driver.get(
        '')  #provide the link of the page whose followers are to be followed
    gp = getpages.Getpages(driver)
    refs = gp.get_followers()
    print(gp.get_num_flw())
    run_bot(refs, driver, gp)
Exemple #30
0
def main():
    #driver is a global variable
    global driver
    print('running script..')
    driver = webdriver.Chrome('D:\chromedriver.exe')
    l = login.Login(driver, username, password)
    #call the signin function to put username and password and click button signin
    l.signin()
    gp = getpages.Getpages(driver)
    refs = gp.get_followers()
    print(gp.get_num_flw())
    run_bot(refs, driver, gp)