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


Python settings.py方法代码示例

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


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

示例1: get_app

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def get_app(config=None):
    """App factory.

    :param config: configuration that can override config from `settings.py`
    :return: a new SuperdeskEve app instance
    """
    if config is None:
        config = {}

    config['APP_ABSPATH'] = os.path.abspath(os.path.dirname(__file__))

    for key in dir(settings):
        if key.isupper():
            config.setdefault(key, getattr(settings, key))

    app = superdesk_app(config)
    return app 
开发者ID:superdesk,项目名称:superdesk,代码行数:19,代码来源:app.py

示例2: load_tools

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def load_tools(self, command_line_object):
        # Load all tools within the Tools folder
        # (Evasion, Ordnance, Pillage, etc.)
        for name in glob.glob('tools/*/tool.py'):
            if name.endswith(".py") and ("__init__" not in name):
                module = helpers.load_module(name)
                self.imported_tools[name] = module.Tools(
                    command_line_object)
        return 
开发者ID:Veil-Framework,项目名称:Veil,代码行数:11,代码来源:orchestra.py

示例3: options_veil

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def options_veil(self):
        print( " [i] Veil configuration file: /etc/veil/settings.py" )
        for i in dir(settings):
            if i.startswith('_'): continue
            print( " [i] {0}: {1}".format( i , eval( 'settings.' + str(i) )))
        input( '\n\nOptions shown. Press enter to continue' )
        return

    # Self update framework 
开发者ID:Veil-Framework,项目名称:Veil,代码行数:11,代码来源:orchestra.py

示例4: config_veil

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def config_veil(self):
        if settings.OPERATING_SYSTEM == "Kali":
            if os.path.exists("/usr/share/veil/config/update-config.py"):
                os.system('cd /usr/share/veil/config/; ./update-config.py')
            else:
                print("\n [!] ERROR: Kali is missing %s\n" % ("/usr/share/veil/config/update-config.py"))
                os.system('cd ./config/; ./update-config.py')
        else:
            os.system('cd ./config/; ./update-config.py')
        input('\n\nVeil has reconfigured, press enter to continue')
        return 
开发者ID:Veil-Framework,项目名称:Veil,代码行数:13,代码来源:orchestra.py

示例5: load_payloads

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def load_payloads(self, cli_args):
        for x in range(1, 5):
            for name in glob.glob(join("tools/evasion/payloads/" + "*/" * x,'[!_]*.py')):
                if name.endswith(".py") and ("__init__" not in name):
                    module = helpers.load_module(name)
                    self.active_payloads[name.replace('tools/evasion/payloads/', '')] = module.PayloadModule(cli_args)
        return 
开发者ID:Veil-Framework,项目名称:Veil,代码行数:9,代码来源:tool.py

示例6: validate_ip

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def validate_ip(val_ip):
    # This came from (Mult-line link for pep8 compliance)
    # http://python-iptools.googlecode.com/svn-history/r4
    # /trunk/iptools/__init__.py
    ip_re = re.compile(r'^(\d{1,3}\.){0,3}\d{1,3}$')
    if ip_re.match(val_ip):
        quads = (int(q) for q in val_ip.split('.'))
        for q in quads:
            if q > 255:
                return False
        return True
    return False 
开发者ID:Veil-Framework,项目名称:Veil,代码行数:14,代码来源:ordnance_helpers.py

示例7: index

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def index():

    # If they have pressed the refresh link remove the error and success messages
    if(request.args.get('action') == "refresh"):
        session.pop('ErrorMessage', None)
        session.pop('SuccessMessage', None)
        session.pop('fuelType', None)
        session.pop('LockinPrice', None)
        try:
            # Regenerate our locked in prices
            functions.lockedPrices()
        except:
            # If there was an error, lets just move on.
            pass

    # If the environmental variable DEVICE_ID is empty or is not set at all
    if(os.getenv('DEVICE_ID', settings.DEVICE_ID) in [None,"changethis",""]):
        # Set the device id to a randomly generated one
        DEVICE_ID = ''.join(random.choice('0123456789abcdef') for i in range(16))
    else:
        # Otherwise we set the it to the one set in settings.py
        DEVICE_ID = os.getenv('DEVICE_ID', settings.DEVICE_ID)

    # Set the session max price for the auto locker
    session['max_price'] = config['General']['max_price']

    # Get the cheapest fuel price to show on the automatic lock in page
    fuelPrice = functions.cheapestFuelAll()

    return render_template('price.html',device_id=DEVICE_ID) 
开发者ID:freyta,项目名称:7Eleven-Python,代码行数:32,代码来源:app.py

示例8: generate_awl

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def generate_awl(self):

        ip = subprocess.getoutput("ip a").split("\n")[8][9:].split('/')[0]
        for name in sorted(self.active_payloads.keys()):
            os.system("python3 /opt/GreatSCT/GreatSCT.py --ip {0} --port 443 -t Bypass -p {1}".format(ip, name)) 
开发者ID:GreatSCT,项目名称:GreatSCT,代码行数:7,代码来源:Tool.py

示例9: load_payloads

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def load_payloads(self, cli_args):
        for x in range(1, 5):
            for name in glob.glob(join("Tools/Bypass/payloads/" + "*/" * x,'[!_]*.py')):
                if name.endswith(".py") and ("__init__" not in name):
                    loaded_payloads = imp.load_source(
                        name.replace("/", ".").rstrip('.py'), name)
                    self.active_payloads[name.replace('Tools/Bypass/payloads/', '')] = loaded_payloads.PayloadModule(cli_args)
        return 
开发者ID:GreatSCT,项目名称:GreatSCT,代码行数:10,代码来源:Tool.py

示例10: _load_cookies

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def _load_cookies():
    """
    从设置中解析cookies
    :return: dict
    """
    if settings.COOKIES == 'AUTO':
        with WeiboBrowser() as weibo:
            return weibo.get_cookies()
    assert settings.COOKIES, '请在`settings.py`中粘贴cookies'
    return dict([l.split('=', 1) for l in settings.COOKIES.split('; ')]) 
开发者ID:Lodour,项目名称:Weibo-Album-Crawler,代码行数:12,代码来源:api.py

示例11: format_vcenter_conn

# 需要导入模块: import settings [as 别名]
# 或者: from settings import py [as 别名]
def format_vcenter_conn(conn):
    """
    Formats :param conn: into the expected connection string for vCenter.

    This supports the use of per-host credentials without breaking previous
    deployments during upgrade.

    :param conn: vCenter host connection details provided in settings.py
    :type conn: dict
    :returns: A dictionary containing the host details and credentials
    :rtype: dict
    """
    try:
        if bool(conn["USER"] != "" and conn["PASS"] != ""):
            log.debug(
                "Host specific vCenter credentials provided for '%s'.",
                conn["HOST"]
                )
        else:
            log.debug(
                "Host specific vCenter credentials are not defined for '%s'.",
                conn["HOST"]
                )
            conn["USER"], conn["PASS"] = settings.VC_USER, settings.VC_PASS
    except KeyError:
        log.debug(
            "Host specific vCenter credential key missing for '%s'. Falling "
            "back to global.", conn["HOST"]
            )
        conn["USER"], conn["PASS"] = settings.VC_USER, settings.VC_PASS
    return conn 
开发者ID:synackray,项目名称:vcenter-netbox-sync,代码行数:33,代码来源:run.py


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