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


Python config.VERSION属性代码示例

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


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

示例1: Init

# 需要导入模块: import config [as 别名]
# 或者: from config import VERSION [as 别名]
def Init(self):
        self._CanvasHWND = self._Screen._CanvasHWND
        self._Width =  self._Screen._Width
        self._Height = self._Screen._Height

        self._ConfirmPage = UpdateConfirmPage()
        self._ConfirmPage._Screen = self._Screen
        self._ConfirmPage._Name  = "Update Confirm"
        self._ConfirmPage._Parent = self
        self._ConfirmPage.Init()

        it = {}
        it["key"] = "version"
        it["label"] = "Version"
        it["value"] = config.VERSION
        self._AList["version"] = it
        
        self.GenList() 
开发者ID:clockworkpi,项目名称:launcher,代码行数:20,代码来源:__init__.py

示例2: register_extensions

# 需要导入模块: import config [as 别名]
# 或者: from config import VERSION [as 别名]
def register_extensions(app):
    db.init_app(app)
    executor.init_app(app)
    basic_auth.init_app(app)

    @app.before_request
    def enable_form_raw_cache():
        # Workaround to allow unparsed request body to be be read from cache
        # This is required to validate a signature on webhooks
        # This MUST go before Sentry integration as sentry triggers form parsing
        if not config.IS_TEST and (
                request.path.startswith('/api/v1/slack/') or request.path.startswith('/api/v1/poli_payments_webhook/')):
            if request.content_length > 1024 * 1024:  # 1mb
                # Payload too large
                return make_response(jsonify({'message': 'Payload too large'})), 413
            request.get_data(parse_form_data=False, cache=True)

    # limiter.init_app(app)

    CORS(app, resources={r"/api/*": {"origins": "*"}})

    celery_app.conf.update(app.config)
    if not config.IS_TEST:
        sentry_sdk.init(app.config['SENTRY_SERVER_DSN'], integrations=[FlaskIntegration()], release=config.VERSION)

    print('celery joined on {} at {}'.format(
        app.config['REDIS_URL'], datetime.utcnow())) 
开发者ID:teamsempo,项目名称:SempoBlockchain,代码行数:29,代码来源:__init__.py

示例3: nodeinfo

# 需要导入模块: import config [as 别名]
# 或者: from config import VERSION [as 别名]
def nodeinfo() -> Any:
    """NodeInfo endpoint."""
    q = {
        "box": Box.OUTBOX.value,
        "meta.deleted": False,
        "type": {"$in": [ap.ActivityType.CREATE.value, ap.ActivityType.ANNOUNCE.value]},
    }

    out = {
        "version": "2.1",
        "software": {
            "name": "microblogpub",
            "version": config.VERSION,
            "repository": "https://github.com/tsileo/microblog.pub",
        },
        "protocols": ["activitypub"],
        "services": {"inbound": [], "outbound": []},
        "openRegistrations": False,
        "usage": {"users": {"total": 1}, "localPosts": DB.activities.count(q)},
        "metadata": {
            "nodeName": f"@{config.USERNAME}@{config.DOMAIN}",
            "version": config.VERSION,
            "versionDate": config.VERSION_DATE,
        },
    }

    return jsonify(
        out,
        "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.1#",
    ) 
开发者ID:tsileo,项目名称:microblog.pub,代码行数:32,代码来源:well_known.py

示例4: CheckUpdate

# 需要导入模块: import config [as 别名]
# 或者: from config import VERSION [as 别名]
def CheckUpdate(self):
        global LauncherLoc
        self._Screen._MsgBox.SetText("CheckingUpdate")
        self._Screen._MsgBox.Draw()
        self._Screen.SwapAndShow()

        try:
            r = requests.get(config.UPDATE_URL, verify=False, timeout=8)
        except:
            print("requests get error")
            return
        else:
            if r.status_code == requests.codes.ok:
                try:
                    json_ = r.json()

                    if "version" in json_ and "updatepath" in json_ and "md5sum" in json_:
                        if config.VERSION != json_["version"]:
                            
                            self._ConfirmPage._URL = json_["updatepath"]
                            self._ConfirmPage._MD5 = json_["md5sum"]
                            self._ConfirmPage._GIT = False
                            
                            self._Screen.PushPage(self._ConfirmPage)
                            
                            self._Screen.Draw()
                            self._ConfirmPage.SnapMsg(MyLangManager.Tr("ConfirmUpdateToFQ") % json_["version"] )
                            self._Screen.SwapAndShow()
                            
                    elif "gitversion" in json_: ### just use git to  run update
                        cur_dir = os.getcwd()
                        os.chdir(LauncherLoc)
                        current_git_version = get_git_revision_short_hash()
                        current_git_version = current_git_version.strip("\n")
                        current_git_version = current_git_version.strip("\t")
                        os.chdir(cur_dir)
                        if current_git_version != json_["gitversion"]:
                            self._ConfirmPage._URL = None
                            self._ConfirmPage._MD5 = None
                            self._ConfirmPage._GIT = True
                            self._ConfirmPage._Version = json_["gitversion"]
                            
                            self._Screen.PushPage(self._ConfirmPage)
                            
                            self._Screen.Draw()
                            self._ConfirmPage.SnapMsg(MyLangManager.Tr("UpdateToFQ") % json_["gitversion"] )
                            self._Screen.SwapAndShow()
                        else:
                            self._Screen.Draw()
                            self._Screen._MsgBox.SetText("LauncherIsUpToDate")
                            self._Screen._MsgBox.Draw()
                            self._Screen.SwapAndShow()
                            pygame.time.delay(765)
                            
                    return True
                except Exception, e:
                    print("r.json() error %s" % str(e))
                
            else: 
开发者ID:clockworkpi,项目名称:launcher,代码行数:61,代码来源:__init__.py


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