当前位置: 首页>>代码示例>>Python>>正文


Python config.password方法代码示例

本文整理汇总了Python中config.password方法的典型用法代码示例。如果您正苦于以下问题:Python config.password方法的具体用法?Python config.password怎么用?Python config.password使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在config的用法示例。


在下文中一共展示了config.password方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: rules_login

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def rules_login():
    if session.get('username'):
        return redirect(url_for('rules_modify'))
    else:
        if request.method=='GET':
            return render_template('rules_login.html')
        else:
            username = request.form.get('username')
            password = request.form.get('password')
            print(username,password)
            if [password,username] in user_list:
                session['username'] = username#登陆成功设置session
                session.permanent = True#
                app.permanent_session_lifetime = timedelta(minutes=10)#设置session到期时间
                return redirect(url_for('rules_modify'))
            else:
                return render_template('rules_login.html') 
开发者ID:oooldtoy,项目名称:SSTAP_ip_crawl_tool,代码行数:19,代码来源:web_server.py

示例2: parse_configs

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def parse_configs():
    env = Env()
    env.read_env()

    config.battle_bot_module = env("BATTLE_BOT", 'safest')
    config.save_replay = env.bool("SAVE_REPLAY", config.save_replay)
    config.use_relative_weights = env.bool("USE_RELATIVE_WEIGHTS", config.use_relative_weights)
    config.gambit_exe_path = env("GAMBIT_PATH", config.gambit_exe_path)
    config.search_depth = int(env("MAX_SEARCH_DEPTH", config.search_depth))
    config.greeting_message = env("GREETING_MESSAGE", config.greeting_message)
    config.battle_ending_message = env("BATTLE_OVER_MESSAGE", config.battle_ending_message)
    config.websocket_uri = env("WEBSOCKET_URI", "sim.smogon.com:8000")
    config.username = env("PS_USERNAME")
    config.password = env("PS_PASSWORD", "")
    config.bot_mode = env("BOT_MODE")
    config.team_name = env("TEAM_NAME", None)
    config.pokemon_mode = env("POKEMON_MODE", constants.DEFAULT_MODE)
    config.run_count = int(env("RUN_COUNT", 1))

    if config.bot_mode == constants.CHALLENGE_USER:
        config.user_to_challenge = env("USER_TO_CHALLENGE")
    init_logging(env("LOG_LEVEL", "DEBUG")) 
开发者ID:pmariglia,项目名称:showdown,代码行数:24,代码来源:run.py

示例3: generateURL

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def generateURL(self, username, password, uhash, php, **kwargs):
        if not kwargs:
            jsonString = {"": ""}
        else:
            jsonString = kwargs
        currentTimeMillis = str(self.getTime())
        jsonString.update({'time': currentTimeMillis, 'uhash': uhash, 'user': username, 'pass': password})
        jsonString = json.dumps(jsonString, separators=(',', ':'))
        a = self.generateUser(jsonString)
        a2 = self.md5hash(str(len(jsonString)) + self.md5hash(currentTimeMillis))
        str5 = username + self.md5hash(self.md5hash(password))
        str6 = self.md5hash(currentTimeMillis + jsonString)
        a3 = self.md5hash(self.secret + self.md5hash(self.md5hash(self.generateUser(a2))))
        str9 = self.md5hash(a3 + self.generateUser(str5))
        str7 = self.generateUser(str6)
        str8 = self.md5hash(self.md5hash(a3 + self.md5hash(self.md5hash(str9) + str7) + str9 + self.md5hash(str7)))
        return self.url + php + "?user=" + a + "&pass=" + str8 
开发者ID:OlympicCode,项目名称:vHackXTBot-Python,代码行数:19,代码来源:utils.py

示例4: send_email

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def send_email(strTo):
    strFrom = config.fromaddr
    msgRoot = MIMEMultipart('related')
    msgRoot['Subject'] = 'Thanks for your ticket'
    msgRoot['From'] = strFrom
    msgRoot['To'] = strTo

    #Add text message to the MIME object
    msgRoot.preamble = 'This is a multi-part message in MIME format.'
    msgAlternative = MIMEMultipart('alternative')
    msgRoot.attach(msgAlternative)
    msgText = MIMEText('This is the alternative plain text message.')
    msgAlternative.attach(msgText)
    msgText = MIMEText('Hi there, <br><br>Thanks for your query with us today.'
                       ' You can look at our <a href="https://google.com">FAQs</a>'
                       ' and we shall get back to you soon.<br><br>'
                       'Thanks,<br>Support Team<br><br><img src="cid:image1">', 'html')
    msgAlternative.attach(msgText)

    #Add logo image to the auto response
    fp = open('google.png', 'rb')
    msgImage = MIMEImage(fp.read())
    fp.close()
    msgImage.add_header('Content-ID', '<image1>')
    msgRoot.attach(msgImage)

    #Start SMTO Server and respond to the customer
    import smtplib
    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.starttls()
    server.login(config.fromaddr, config.password)
    server.sendmail(config.fromaddr, config.toaddr, msgRoot.as_string())
    server.quit()

#Infinite loop to read the inbox for new emails 
#every 60 seconds (1 minute) 
开发者ID:PacktPublishing,项目名称:Automate-it,代码行数:38,代码来源:support.py

示例5: setUpClass

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def setUpClass(cls):
        cls.device = EOS(config.hostname, config.username, config.password, config.use_ssl)
        cls.device.open() 
开发者ID:spotify,项目名称:pyeos,代码行数:5,代码来源:TestEOS.py

示例6: __init__

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def __init__(self, config):
        # Prepare the connection to the server
        self.oerp = oerplib.OERP(config.host, protocol=config.protocol, port=config.port)

        # Login (the object returned is a browsable record)
        user = self.oerp.login(config.user, config.password, config.db_name) 
开发者ID:iw3hxn,项目名称:LibrERP,代码行数:8,代码来源:conftest.py

示例7: setUpClass

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def setUpClass(cls):
        cls.device = FortiOS(config.vm_ip, vdom='test_vdom', username=config.username, password=config.password)
        cls.device.open()

        with open(config.config_file_1, 'r') as f:
            cls.config_1 = f.readlines()
        with open(config.config_file_2, 'r') as f:
            cls.config_2 = f.readlines() 
开发者ID:spotify,项目名称:pyfg,代码行数:10,代码来源:TestFortiOS.py

示例8: reddit_setup

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def reddit_setup(self):
        print "Logging in"
        r = praw.Reddit("Sidebar livestream updater for /r/{} by /u/andygmb ".format(subreddit))
        r.login(username=username, password=password, disable_warning=True)
        sub = r.get_subreddit(subreddit)
        return r, sub 
开发者ID:Andygmb,项目名称:twitchy_the_bot,代码行数:8,代码来源:twitchy.py

示例9: showdown

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def showdown():
    parse_configs()

    apply_mods(config.pokemon_mode)

    original_pokedex = deepcopy(pokedex)
    original_move_json = deepcopy(all_move_json)

    ps_websocket_client = await PSWebsocketClient.create(config.username, config.password, config.websocket_uri)
    await ps_websocket_client.login()

    battles_run = 0
    wins = 0
    losses = 0
    while True:
        team = load_team(config.team_name)
        if config.bot_mode == constants.CHALLENGE_USER:
            await ps_websocket_client.challenge_user(config.user_to_challenge, config.pokemon_mode, team)
        elif config.bot_mode == constants.ACCEPT_CHALLENGE:
            await ps_websocket_client.accept_challenge(config.pokemon_mode, team)
        elif config.bot_mode == constants.SEARCH_LADDER:
            await ps_websocket_client.search_for_match(config.pokemon_mode, team)
        else:
            raise ValueError("Invalid Bot Mode")

        winner = await pokemon_battle(ps_websocket_client, config.pokemon_mode)

        if winner == config.username:
            wins += 1
        else:
            losses += 1

        logger.info("W: {}\tL: {}".format(wins, losses))

        check_dictionaries_are_unmodified(original_pokedex, original_move_json)

        battles_run += 1
        if battles_run >= config.run_count:
            break 
开发者ID:pmariglia,项目名称:showdown,代码行数:41,代码来源:run.py

示例10: __init__

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def __init__(self):
        self.secret = "aeffI"
        self.url = "https://api.vhack.cc/v/16/"
        self.username = config.user
        self.password = config.password
        self.user_agent = "" 
开发者ID:OlympicCode,项目名称:vHackXTBot-Python,代码行数:8,代码来源:utils.py

示例11: requestString

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def requestString(self, username, password, uhash, php, **kwargs):
        logger.debug("Request: {}".format(php))
        self.user_agent = self.generateUA(username + password)
        time.sleep(0.3)
        t = None
        i = 0
        while t is None:
            if i > 10:
                exit(0)
            try:
                req = urllib2.Request(self.generateURL(username, password, uhash, php, **kwargs))
                req.add_header('User-agent', self.user_agent)
                r = urllib2.urlopen(req, context=ssl._create_unverified_context(), timeout=15)
                t = r.read()
                logger.debug("Response:\n{}\n".format(t))
                if t == "5":
                    logger.info("Check your Internet.")
                elif t == "8":
                    logger.info("User/Password wrong!")
                elif t == "10":
                    logger.info("API is updated.")
                elif t == "15":
                    logger.info("You are Banned sorry :(")
                elif t == "99":
                    logger.info("Server is down for Maintenance, please be patient.")
                return t
            except urllib2.URLError as e:
                logger.error('Error: {}'.format(e))
                logger.info('Timeout while requesting "{}"'.format(php))
                time.sleep(1 + i)
            except Exception as e:
                logger.error('Error: {}'.format(e))
                logger.info("Blocked, trying again. Delaying {0} seconds".format(i))
                time.sleep(1 + i)
            i += 1 
开发者ID:OlympicCode,项目名称:vHackXTBot-Python,代码行数:37,代码来源:utils.py

示例12: requestStringNoWait

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def requestStringNoWait(self, username, password, uhash, php, **kwargs):
        self.user_agent = self.generateUA(username + password)
        for i1 in range(0, 10):
            try:
                req = urllib2.Request(self.generateURL(username, password, uhash, php, **kwargs))
                req.add_header('User-agent', self.user_agent)
                r = urllib2.urlopen(req, context=ssl._create_unverified_context(), timeout=15)
                t = r.read()
                # print i1
                return t
            except Exception as e:
                logger.error('Error: {}'.format(e))
                time.sleep(1)
        return "null" 
开发者ID:OlympicCode,项目名称:vHackXTBot-Python,代码行数:16,代码来源:utils.py

示例13: requestArray

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def requestArray(self, username, password, uhash, php, **kwargs):
        temp = self.requestString(username, password, uhash, php, **kwargs)
        if temp != "null":
            return self.parse(temp)
        else:
            return [] 
开发者ID:OlympicCode,项目名称:vHackXTBot-Python,代码行数:8,代码来源:utils.py

示例14: removespy

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def removespy(self):
        response = self.ut.requestArray(self.username, self.password, self.uhash, "vh_removeSpyware.php")
        return response 
开发者ID:OlympicCode,项目名称:vHackXTBot-Python,代码行数:5,代码来源:player.py

示例15: _init

# 需要导入模块: import config [as 别名]
# 或者: from config import password [as 别名]
def _init(self):
        """
        {"id":"924198","money":"14501972","ip":"83.58.131.20",
        "inet":"10","hdd":"10","cpu":"10","ram":"14","fw":"256","av":"410","sdk":"580","ipsp":"50","spam":"71","scan":"436","adw":"76",
        "actadw":"","netcoins":"5550","energy":"212286963","score":"10015",
        "urmail":"1","active":"1","elo":"2880","clusterID":null,"position":null,"syslog":null,
        "lastcmsg":"0","rank":32022,"event":"3","bonus":"0","mystery":"0","vipleft":"OFF",
        "hash":"91ec5ed746dfedc0a750d896a4e615c4",
        "uhash":"9832f717079f8664109ac9854846e753282c72cdf42fe33fb33c734923e1931c","use":"0",
        "tournamentActive":"2","boost":"294","actspyware":"0","tos":"1","unreadmsg":"0"}
        :return:
        """
        data = self.ut.requestString(self.username, self.password, self.uhash, "vh_update.php")
        if len(data) == 1:
            logging.warn('Username and password entered in config.py?')
            sys.exit()
        try:
            j = json.loads(data)
            self.setmoney(j['money'])
            self.ip = j['ip']
            self.score = j['score']
            self.netcoins = j['netcoins']
            self.localspyware = j['actspyware']
            self.rank = j['rank']
            self.boosters = j['boost']
            self.remotespyware = j['actadw']
            self.email = int(j['urmail'])
            self.uhash = str(j['uhash'])
            logger.info("\n Your profile :\n\n Your IP: {0}, Your Score:  {1}, Your netcoins {2}, \n Your rank: {3}, Your Booster: {4}, Active Spyware {5} \n\n".format(j['ip'], j['score'], j['netcoins'], j['rank'], j['boost'], j['actspyware']))
        except:
            exit() 
开发者ID:OlympicCode,项目名称:vHackXTBot-Python,代码行数:33,代码来源:player.py


注:本文中的config.password方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。