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


Python GLSettings.check_directories方法代码示例

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


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

示例1: start_globaleaks

# 需要导入模块: from globaleaks.settings import GLSettings [as 别名]
# 或者: from globaleaks.settings.GLSettings import check_directories [as 别名]
    def start_globaleaks(self):
        try:
            GLSettings.fix_file_permissions()
            GLSettings.drop_privileges()
            GLSettings.check_directories()

            # Check presence of an existing database and eventually perform its migration
            check = check_db_files()
            if check == -1:
                 self._reactor.stop()
            elif check == 0:
                yield init_db()
            else:
                yield update_version()
                yield init_appdata()

            yield clean_untracked_files()

            yield refresh_memory_variables()

            if GLSettings.cmdline_options:
                yield apply_cmdline_options()

            self.start_asynchronous_jobs()

            log.msg("GLBackend is now running")
            for ip in GLSettings.bind_addresses:
                log.msg("Visit http://%s:%d to interact with me" % (ip, GLSettings.bind_port))

            for host in GLSettings.accepted_hosts:
                if host not in GLSettings.bind_addresses:
                    log.msg("Visit http://%s:%d to interact with me" % (host, GLSettings.bind_port))

            for other in GLSettings.configured_hosts:
                if other:
                    log.msg("Visit %s to interact with me" % other)

            log.msg("Remind: GlobaLeaks is not accessible from other URLs, this is strictly enforced")
            log.msg("Check documentation in https://github.com/globaleaks/GlobaLeaks/wiki/ for special enhancement")

        except Exception as excep:
            log.err("ERROR: Cannot start GlobaLeaks; please manual check the error.")
            log.err("EXCEPTION: %s" % excep)
            self._reactor.stop()
开发者ID:corvolino,项目名称:GlobaLeaks,代码行数:46,代码来源:runner.py

示例2: start_globaleaks

# 需要导入模块: from globaleaks.settings import GLSettings [as 别名]
# 或者: from globaleaks.settings.GLSettings import check_directories [as 别名]
    def start_globaleaks(self):
        try:
            GLSettings.fix_file_permissions()
            GLSettings.drop_privileges()
            GLSettings.check_directories()

            GLSettings.orm_tp.start()
            self._reactor.addSystemEventTrigger('after', 'shutdown', GLSettings.orm_tp.stop)

            if GLSettings.initialize_db:
                yield init_db()

            yield clean_untracked_files()

            yield refresh_memory_variables()

            self.start_asynchronous_jobs()

        except Exception as excep:
            log.err("ERROR: Cannot start GlobaLeaks; please manually check the error.")
            log.err("EXCEPTION: %s" % excep)
            self._reactor.stop()
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:24,代码来源:runner.py

示例3: start_globaleaks

# 需要导入模块: from globaleaks.settings import GLSettings [as 别名]
# 或者: from globaleaks.settings.GLSettings import check_directories [as 别名]
    def start_globaleaks(self):
        try:
            GLSettings.fix_file_permissions()
            GLSettings.drop_privileges()
            GLSettings.check_directories()

            if GLSettings.initialize_db:
                yield init_db()
            else:
                yield update_version()
                yield init_appdata()

            yield clean_untracked_files()

            yield refresh_memory_variables()

            self.start_asynchronous_jobs()

        except Exception as excep:
            log.err("ERROR: Cannot start GlobaLeaks; please manual check the error.")
            log.err("EXCEPTION: %s" % excep)
            self._reactor.stop()
开发者ID:anticorruzione,项目名称:openwhistleblowing,代码行数:24,代码来源:runner.py

示例4: globaleaks_start

# 需要导入模块: from globaleaks.settings import GLSettings [as 别名]
# 或者: from globaleaks.settings.GLSettings import check_directories [as 别名]
def globaleaks_start():
    GLSettings.fix_file_permissions()
    GLSettings.drop_privileges()
    GLSettings.check_directories()

    if not GLSettings.accepted_hosts:
        log.err("Missing a list of hosts usable to contact GLBackend, abort")
        return False

    d = create_tables()

    d.addCallback(clean_untracked_files)

    @d.addCallback
    @defer.inlineCallbacks
    def cb(res):
        start_asynchronous()
        yield import_memory_variables()
        tor_configured_hosts = yield apply_cli_options()

        log.msg("GLBackend is now running")
        for ip in GLSettings.bind_addresses:
            log.msg("Visit http://%s:%d to interact with me" % (ip, GLSettings.bind_port))

        for host in GLSettings.accepted_hosts:
            if host not in GLSettings.bind_addresses:
                log.msg("Visit http://%s:%d to interact with me" % (host, GLSettings.bind_port))

        if tor_configured_hosts:
            for other in tor_configured_hosts:
                if other:
                    log.msg("Visit %s to interact with me" % other)

        log.msg("Remind: GlobaLeaks is not accessible from other URLs, this is strictly enforced")
        log.msg("Check documentation in https://github.com/globaleaks/GlobaLeaks/wiki/ for special enhancement")

    return True
开发者ID:nsfw,项目名称:GlobaLeaks,代码行数:39,代码来源:runner.py


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