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


Python update.check_update方法代码示例

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


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

示例1: start_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def start_update(self):
        """Check for update and download and install new workflow file.

        .. versionadded:: 1.9

        See :ref:`guide-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :returns: ``True`` if an update is available and will be
            installed, else ``False``

        """
        import update

        github_slug = self._update_settings['github_slug']
        # version = self._update_settings['version']
        version = str(self.version)

        if not update.check_update(github_slug, version, self.prereleases):
            return False

        from background import run_in_background

        # update.py is adjacent to this file
        update_script = os.path.join(os.path.dirname(__file__),
                                     b'update.py')

        cmd = ['/usr/bin/python', update_script, 'install', github_slug,
               version]

        if self.prereleases:
            cmd.append('--prereleases')

        self.logger.debug('downloading update ...')
        run_in_background('__workflow_update_install', cmd)

        return True

    ####################################################################
    # Keychain password storage methods
    #################################################################### 
开发者ID:TKkk-iOSer,项目名称:wechat-alfred-workflow,代码行数:43,代码来源:workflow.py

示例2: start_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def start_update(self):
        """Check for update and download and install new workflow file.

        .. versionadded:: 1.9

        See :ref:`guide-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :returns: ``True`` if an update is available and will be
            installed, else ``False``

        """
        import update

        repo = self._update_settings['github_slug']
        # version = self._update_settings['version']
        version = str(self.version)

        if not update.check_update(repo, version, self.prereleases):
            return False

        from background import run_in_background

        # update.py is adjacent to this file
        update_script = os.path.join(os.path.dirname(__file__),
                                     b'update.py')

        cmd = ['/usr/bin/python', update_script, 'install', repo, version]

        if self.prereleases:
            cmd.append('--prereleases')

        self.logger.debug('downloading update ...')
        run_in_background('__workflow_update_install', cmd)

        return True

    ####################################################################
    # Keychain password storage methods
    #################################################################### 
开发者ID:danielecook,项目名称:gist-alfred,代码行数:42,代码来源:workflow.py

示例3: start_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def start_update(self):
        """Check for update and download and install new workflow file.

        .. versionadded:: 1.9

        See :ref:`manual-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :returns: ``True`` if an update is available and will be
            installed, else ``False``

        """
        import update

        github_slug = self._update_settings['github_slug']
        # version = self._update_settings['version']
        version = str(self.version)

        if not update.check_update(github_slug, version, self.prereleases):
            return False

        from background import run_in_background

        # update.py is adjacent to this file
        update_script = os.path.join(os.path.dirname(__file__),
                                     b'update.py')

        cmd = ['/usr/bin/python', update_script, 'install', github_slug,
               version]

        if self.prereleases:
            cmd.append('--prereleases')

        self.logger.debug('Downloading update ...')
        run_in_background('__workflow_update_install', cmd)

        return True

    ####################################################################
    # Keychain password storage methods
    #################################################################### 
开发者ID:ecbrodie,项目名称:pomodoro-alfred,代码行数:43,代码来源:workflow.py

示例4: start_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def start_update(self):
        """Check for update and download and install new workflow file.

        .. versionadded:: 1.9

        See :ref:`guide-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :returns: ``True`` if an update is available and will be
            installed, else ``False``

        """
        import update

        github_slug = self._update_settings['github_slug']
        # version = self._update_settings['version']
        version = str(self.version)

        if not update.check_update(github_slug, version, self.prereleases):
            return False

        from background import run_in_background

        # update.py is adjacent to this file
        update_script = os.path.join(os.path.dirname(__file__),
                                     b'update.py')

        cmd = ['/usr/bin/python', update_script, 'install', github_slug,
               version]

        if self.prereleases:
            cmd.append('--prereleases')

        self.logger.debug('Downloading update ...')
        run_in_background('__workflow_update_install', cmd)

        return True

    ####################################################################
    # Keychain password storage methods
    #################################################################### 
开发者ID:fniephaus,项目名称:alfred-dropbox,代码行数:43,代码来源:workflow.py

示例5: check_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def check_update(self, force=False):
        """Call update script if it's time to check for a new release.

        .. versionadded:: 1.9

        The update script will be run in the background, so it won't
        interfere in the execution of your workflow.

        See :ref:`guide-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :param force: Force update check
        :type force: ``Boolean``

        """
        frequency = self._update_settings.get('frequency',
                                              DEFAULT_UPDATE_FREQUENCY)

        if not force and not self.settings.get('__workflow_autoupdate', True):
            self.logger.debug('Auto update turned off by user')
            return

        # Check for new version if it's time
        if (force or not self.cached_data_fresh(
                '__workflow_update_status', frequency * 86400)):

            github_slug = self._update_settings['github_slug']
            # version = self._update_settings['version']
            version = str(self.version)

            from background import run_in_background

            # update.py is adjacent to this file
            update_script = os.path.join(os.path.dirname(__file__),
                                         b'update.py')

            cmd = ['/usr/bin/python', update_script, 'check', github_slug,
                   version]

            if self.prereleases:
                cmd.append('--prereleases')

            self.logger.info('checking for update ...')

            run_in_background('__workflow_update_check', cmd)

        else:
            self.logger.debug('update check not due') 
开发者ID:TKkk-iOSer,项目名称:wechat-alfred-workflow,代码行数:50,代码来源:workflow.py

示例6: check_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def check_update(self, force=False):
        """Call update script if it's time to check for a new release.

        .. versionadded:: 1.9

        The update script will be run in the background, so it won't
        interfere in the execution of your workflow.

        See :ref:`guide-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :param force: Force update check
        :type force: ``Boolean``

        """
        key = '__workflow_latest_version'
        frequency = self._update_settings.get('frequency',
                                              DEFAULT_UPDATE_FREQUENCY)

        if not force and not self.settings.get('__workflow_autoupdate', True):
            self.logger.debug('Auto update turned off by user')
            return

        # Check for new version if it's time
        if (force or not self.cached_data_fresh(key, frequency * 86400)):

            repo = self._update_settings['github_slug']
            # version = self._update_settings['version']
            version = str(self.version)

            from background import run_in_background

            # update.py is adjacent to this file
            update_script = os.path.join(os.path.dirname(__file__),
                                         b'update.py')

            cmd = ['/usr/bin/python', update_script, 'check', repo, version]

            if self.prereleases:
                cmd.append('--prereleases')

            self.logger.info('checking for update ...')

            run_in_background('__workflow_update_check', cmd)

        else:
            self.logger.debug('update check not due') 
开发者ID:danielecook,项目名称:gist-alfred,代码行数:49,代码来源:workflow.py

示例7: check_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def check_update(self, force=False):
        """Call update script if it's time to check for a new release

        .. versionadded:: 1.9

        The update script will be run in the background, so it won't
        interfere in the execution of your workflow.

        See :ref:`manual-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :param force: Force update check
        :type force: ``Boolean``

        """

        frequency = self._update_settings.get('frequency',
                                              DEFAULT_UPDATE_FREQUENCY)

        if not force and not self.settings.get('__workflow_autoupdate', True):
            self.logger.debug('Auto update turned off by user')
            return

        # Check for new version if it's time
        if (force or not self.cached_data_fresh(
                '__workflow_update_status', frequency * 86400)):

            github_slug = self._update_settings['github_slug']
            # version = self._update_settings['version']
            version = str(self.version)

            from background import run_in_background

            # update.py is adjacent to this file
            update_script = os.path.join(os.path.dirname(__file__),
                                         b'update.py')

            cmd = ['/usr/bin/python', update_script, 'check', github_slug,
                   version]

            if self.prereleases:
                cmd.append('--prereleases')

            self.logger.info('Checking for update ...')

            run_in_background('__workflow_update_check', cmd)

        else:
            self.logger.debug('Update check not due') 
开发者ID:danielecook,项目名称:Quiver-alfred,代码行数:51,代码来源:workflow.py

示例8: start_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def start_update(self):
        """Check for update and download and install new workflow file

        .. versionadded:: 1.9

        See :ref:`manual-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :returns: ``True`` if an update is available and will be
            installed, else ``False``

        """

        import update

        github_slug = self._update_settings['github_slug']
        # version = self._update_settings['version']
        version = str(self.version)

        if not update.check_update(github_slug, version, self.prereleases):
            return False

        from background import run_in_background

        # update.py is adjacent to this file
        update_script = os.path.join(os.path.dirname(__file__),
                                     b'update.py')

        cmd = ['/usr/bin/python', update_script, 'install', github_slug,
               version]

        if self.prereleases:
            cmd.append('--prereleases')

        self.logger.debug('Downloading update ...')
        run_in_background('__workflow_update_install', cmd)

        return True

    ####################################################################
    # Keychain password storage methods
    #################################################################### 
开发者ID:danielecook,项目名称:Quiver-alfred,代码行数:44,代码来源:workflow.py

示例9: check_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def check_update(self, force=False):
        """Call update script if it's time to check for a new release.

        .. versionadded:: 1.9

        The update script will be run in the background, so it won't
        interfere in the execution of your workflow.

        See :ref:`manual-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :param force: Force update check
        :type force: ``Boolean``

        """
        frequency = self._update_settings.get('frequency',
                                              DEFAULT_UPDATE_FREQUENCY)

        if not force and not self.settings.get('__workflow_autoupdate', True):
            self.logger.debug('Auto update turned off by user')
            return

        # Check for new version if it's time
        if (force or not self.cached_data_fresh(
                '__workflow_update_status', frequency * 86400)):

            github_slug = self._update_settings['github_slug']
            # version = self._update_settings['version']
            version = str(self.version)

            from background import run_in_background

            # update.py is adjacent to this file
            update_script = os.path.join(os.path.dirname(__file__),
                                         b'update.py')

            cmd = ['/usr/bin/python', update_script, 'check', github_slug,
                   version]

            if self.prereleases:
                cmd.append('--prereleases')

            self.logger.info('Checking for update ...')

            run_in_background('__workflow_update_check', cmd)

        else:
            self.logger.debug('Update check not due') 
开发者ID:ecbrodie,项目名称:pomodoro-alfred,代码行数:50,代码来源:workflow.py

示例10: check_update

# 需要导入模块: import update [as 别名]
# 或者: from update import check_update [as 别名]
def check_update(self, force=False):
        """Call update script if it's time to check for a new release.

        .. versionadded:: 1.9

        The update script will be run in the background, so it won't
        interfere in the execution of your workflow.

        See :ref:`guide-updates` in the :ref:`user-manual` for detailed
        information on how to enable your workflow to update itself.

        :param force: Force update check
        :type force: ``Boolean``

        """
        frequency = self._update_settings.get('frequency',
                                              DEFAULT_UPDATE_FREQUENCY)

        if not force and not self.settings.get('__workflow_autoupdate', True):
            self.logger.debug('Auto update turned off by user')
            return

        # Check for new version if it's time
        if (force or not self.cached_data_fresh(
                '__workflow_update_status', frequency * 86400)):

            github_slug = self._update_settings['github_slug']
            # version = self._update_settings['version']
            version = str(self.version)

            from background import run_in_background

            # update.py is adjacent to this file
            update_script = os.path.join(os.path.dirname(__file__),
                                         b'update.py')

            cmd = ['/usr/bin/python', update_script, 'check', github_slug,
                   version]

            if self.prereleases:
                cmd.append('--prereleases')

            self.logger.info('Checking for update ...')

            run_in_background('__workflow_update_check', cmd)

        else:
            self.logger.debug('Update check not due') 
开发者ID:fniephaus,项目名称:alfred-dropbox,代码行数:50,代码来源:workflow.py


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