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


Python EEFileUtils.remove方法代码示例

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


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

示例1: default

# 需要导入模块: from ee.core.fileutils import EEFileUtils [as 别名]
# 或者: from ee.core.fileutils.EEFileUtils import remove [as 别名]

#.........这里部分代码省略.........
                    else:
                        Log.info(self, "PHP 7.0 is not installed")

            if self.app.pargs.hhvm:
                if EEAptGet.is_installed(self, 'hhvm'):
                    apt_packages = apt_packages + EEVariables.ee_hhvm
                else:
                    Log.info(self, "HHVM is not installed")

            if self.app.pargs.mysql:
                if EEAptGet.is_installed(self, 'mariadb-server'):
                    apt_packages = apt_packages + EEVariables.ee_mysql
                else:
                    Log.info(self, "MariaDB is not installed")

            if self.app.pargs.postfix:
                if EEAptGet.is_installed(self, 'postfix'):
                    apt_packages = apt_packages + EEVariables.ee_postfix
                else:
                    Log.info(self, "Postfix is not installed")

            if self.app.pargs.redis:
                if EEAptGet.is_installed(self, 'redis-server'):
                    apt_packages = apt_packages + EEVariables.ee_redis
                else:
                    Log.info(self, "Redis is not installed")

            if self.app.pargs.wpcli:
                if os.path.isfile('/usr/bin/wp'):
                    packages = packages + [["https://github.com/wp-cli/wp-cli/"
                                            "releases/download/v{0}/"
                                            "wp-cli-{0}.phar"
                                            "".format(EEVariables.ee_wp_cli),
                                            "/usr/bin/wp",
                                            "WP-CLI"]]
                else:
                    Log.info(self, "WPCLI is not installed with EasyEngine")

            if self.app.pargs.mailscanner:
                if EEAptGet.is_installed(self, 'amavisd-new'):
                    apt_packages = (apt_packages + EEVariables.ee_mailscanner)
                else:
                    Log.info(self, "MailScanner is not installed")

            if len(packages) or len(apt_packages):

                Log.info(self, "During package update process non nginx-cached"
                         " parts of your site may remain down")
                # Check prompt
                if (not self.app.pargs.no_prompt):
                    start_upgrade = input("Do you want to continue:[y/N]")
                    if start_upgrade != "Y" and start_upgrade != "y":
                        Log.error(self, "Not starting package update")

                Log.info(self, "Updating packages, please wait...")
                if len(apt_packages):
                    # apt-get update
                    EEAptGet.update(self)
                    # Update packages
                    EEAptGet.install(self, apt_packages)

                    # Post Actions after package updates
                    if (set(EEVariables.ee_nginx).issubset(set(apt_packages))):
                        EEService.restart_service(self, 'nginx')
                    if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'):
                        if set(EEVariables.ee_php).issubset(set(apt_packages)):
                            EEService.restart_service(self, 'php5-fpm')
                    else:
                        if set(EEVariables.ee_php5_6).issubset(set(apt_packages)):
                            EEService.restart_service(self, 'php5.6-fpm')
                        if set(EEVariables.ee_php7_0).issubset(set(apt_packages)):
                            EEService.restart_service(self, 'php7.0-fpm')
                    if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
                        EEService.restart_service(self, 'hhvm')
                    if set(EEVariables.ee_postfix).issubset(set(apt_packages)):
                        EEService.restart_service(self, 'postfix')
                    if set(EEVariables.ee_mysql).issubset(set(apt_packages)):
                        EEService.restart_service(self, 'mysql')
                    if set(EEVariables.ee_mail).issubset(set(apt_packages)):
                        EEService.restart_service(self, 'dovecot')
                    if set(EEVariables.ee_redis).issubset(set(apt_packages)):
                        EEService.restart_service(self, 'redis-server')

                if len(packages):
                    if self.app.pargs.wpcli:
                        EEFileUtils.remove(self,['/usr/bin/wp'])

                    Log.debug(self, "Downloading following: {0}".format(packages))
                    EEDownload.download(self, packages)

                    if self.app.pargs.wpcli:
                        EEFileUtils.chmod(self, "/usr/bin/wp", 0o775)

                Log.info(self, "Successfully updated packages")

        # PHP 5.6 to 5.6
        elif (self.app.pargs.php56):
            self.upgrade_php56()
        else:
            self.app.args.print_help()
开发者ID:aalsmile,项目名称:easyengine,代码行数:104,代码来源:stack_upgrade.py


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