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


Python Install_Log.reset方法代码示例

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


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

示例1: __safe_call__

# 需要导入模块: import Install_Log [as 别名]
# 或者: from Install_Log import reset [as 别名]
    def __safe_call__ (self):
        Install_Log.reset()
        Install_Log.log (".---------------------------------------------.")
        Install_Log.log ("| PLEASE, DO NOT EDIT OR REMOVE THIS LOG FILE |")
        Install_Log.log ("|                                             |")
        Install_Log.log ("| It contains useful information that         |")
        Install_Log.log ("| cherokee-admin might need in the future.    |")
        Install_Log.log (".---------------------------------------------.")
        Install_Log.log ("Retrieving package information...")

        # Check whether there are CTK.cfg changes to be saved
        changes = "01"[int(CTK.cfg.has_changed())]
        CTK.cfg['tmp!market!install!cfg_previous_changes'] = changes

        # Render a welcome message
        box = CTK.Box()
        box += CTK.RawHTML ('<h2>%s</h2>' %(_('Connecting to Cherokee Market')))
        box += CTK.RawHTML ('<h1>%s</h1>' %(_('Retrieving package information…')))
        box += CTK.RawHTML (js = CTK.DruidContent__JS_to_goto (box.id, URL_INSTALL_INIT_CHECK))

        # Dialog buttons
        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Cancel'))
        box += buttons

        return box.Render().toStr()
开发者ID:chetan,项目名称:cherokee,代码行数:28,代码来源:Install.py

示例2: __safe_call__

# 需要导入模块: import Install_Log [as 别名]
# 或者: from Install_Log import reset [as 别名]
    def __safe_call__(self):
        # Ensure the current UID has enough priviledges
        if not InstallUtil.current_UID_is_admin() and 0:
            box = CTK.Box()
            box += CTK.RawHTML("<h2>%s</h2>" % (_(NO_ROOT_H1)))
            box += CTK.RawHTML("<p>%s</p>" % (_(NO_ROOT_P1)))
            box += CTK.RawHTML("<p>%s</p>" % (_(NO_ROOT_P2)))

            buttons = CTK.DruidButtonsPanel()
            buttons += CTK.DruidButton_Close(_("Cancel"))
            box += buttons

            return box.Render().toStr()

        # Check the rest of pre-requisites
        index = Distro.Index()
        app_id = CTK.cfg.get_val("tmp!market!install!app!application_id")
        app = index.get_package(app_id, "software")

        inst = index.get_package(app_id, "installation")
        if "cherokee_min_ver" in inst:
            version = inst["cherokee_min_ver"]
            if version_cmp(VERSION, version) < 0:
                box = CTK.Box()
                box += CTK.RawHTML("<h2>%s</h2>" % (_(MIN_VER_H1)))
                box += CTK.RawHTML("<p>%s</p>" % (_(MIN_VER_P1) % (locals())))

                buttons = CTK.DruidButtonsPanel()
                buttons += CTK.DruidButton_Close(_("Cancel"))

                box += buttons
                return box.Render().toStr()

        # Init the log file
        Install_Log.reset()
        Install_Log.log(".---------------------------------------------.")
        Install_Log.log("| PLEASE, DO NOT EDIT OR REMOVE THIS LOG FILE |")
        Install_Log.log("|                                             |")
        Install_Log.log("| It contains useful information that         |")
        Install_Log.log("| cherokee-admin might need in the future.    |")
        Install_Log.log(".---------------------------------------------.")
        Install_Log.log("Retrieving package information...")

        # Check whether there are CTK.cfg changes to be saved
        changes = "01"[int(CTK.cfg.has_changed())]
        CTK.cfg["tmp!market!install!cfg_previous_changes"] = changes

        # Render a welcome message
        box = CTK.Box()
        box += CTK.RawHTML(js=CTK.DruidContent__JS_to_goto(box.id, URL_INSTALL_DOWNLOAD))

        return box.Render().toStr()
开发者ID:hikikomorime,项目名称:webserver,代码行数:54,代码来源:Install.py


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