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


Python ParallelTask.daemon方法代码示例

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


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

示例1: _start_managing

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
    def _start_managing(self):
        """
        Start managing applications passed via argv.
        """
        managing = False

        if self._nsargs.install:
            dependency = self._nsargs.install
            task = ParallelTask(
                self._avc.install, dependency)
            task.name = "AppInstall-%s" % (dependency,)
            task.daemon = True
            task.start()
            managing = True

        if self._nsargs.remove:
            dependency = self._nsargs.remove
            task = ParallelTask(
                self._avc.remove, dependency)
            task.name = "AppRemove-%s" % (dependency,)
            task.daemon = True
            task.start()
            managing = True

        if self._nsargs.package:
            path = self._nsargs.package.name
            self._nsargs.package.close() # no need, unfortunately
            task = ParallelTask(
                self._avc.install_package, path)
            task.name = "AppInstallPackage-%s" % (path,)
            task.daemon = True
            task.start()
            managing = True

        return managing
开发者ID:dMaggot,项目名称:entropy,代码行数:37,代码来源:rigo_app.py

示例2: launch_package_manager

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
 def launch_package_manager(self, *data, **kwargs):
     args = ["/usr/bin/rigo"]
     if kwargs.get("other_args"):
         args += kwargs["other_args"]
     task = ParallelTask(subprocess.call, args)
     task.daemon = True
     task.start()
开发者ID:Sabayon,项目名称:entropy,代码行数:9,代码来源:interfaces.py

示例3: _diff_handler

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
        def _diff_handler(path):
            try:
                if path == "":
                    sem_data['res'] = False
                    return

                if not const_file_writable(path):
                    sem_data['res'] = False
                    return

                proc = open_editor(path)
                if proc is None:
                    self._ignore_remove(path)
                    sem_data['res'] = False
                    return

                task = ParallelTask(proc.wait)
                task.name = "Diff-%s" % (self,)
                task.daemon = True
                task.start()
                sem_data['res'] = True

            except Exception as exc:
                sem_data['exc'] = exc
            finally:
                sem_data['sem'].release()
开发者ID:Sabayon,项目名称:entropy,代码行数:28,代码来源:configupdate.py

示例4: _vote_submit

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
 def _vote_submit(self, app, username, vote):
     """
     Do the actual vote submit.
     """
     task = ParallelTask(self._vote_submit_thread_body, app, username, vote)
     task.name = "VoteSubmitThreadBody"
     task.daemon = True
     task.start()
开发者ID:prescott66,项目名称:entropy,代码行数:10,代码来源:application.py

示例5: setup

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
 def setup(self):
     """
     Reimplemented from NotificationViewController.
     """
     th = ParallelTask(self.__check_connectivity)
     th.daemon = True
     th.name = "CheckConnectivity"
     th.start()
开发者ID:dMaggot,项目名称:entropy,代码行数:10,代码来源:notifications.py

示例6: _comment_submit

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
 def _comment_submit(self, app, username, text):
     """
     Actual Comment submit to Web Service.
     Here we arrive from the MainThread.
     """
     task = ParallelTask(self._comment_submit_thread_body, app, username, text)
     task.name = "CommentSubmitThreadBody"
     task.daemon = True
     task.start()
开发者ID:prescott66,项目名称:entropy,代码行数:11,代码来源:application.py

示例7: _on_remove_comment

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
 def _on_remove_comment(self, widget):
     """
     We are requested to remove this comment, spawn the request.
     """
     self.hide()
     task = ParallelTask(self._remove_comment)
     task.name = "RemoveComment{%s}" % (self._comment,)
     task.daemon = True
     task.start()
     return True
开发者ID:Sabayon,项目名称:entropy,代码行数:12,代码来源:comments.py

示例8: open_url

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
def open_url(url):
    """
    Open the given URL using xdg-open
    """
    def _open_url(url):
        subprocess.call(["xdg-open", url])
    task = ParallelTask(_open_url, url)
    task.name = "UrlOpen"
    task.daemon = True
    task.start()
开发者ID:B-Rich,项目名称:entropy,代码行数:12,代码来源:utils.py

示例9: _on_application_activated

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
 def _on_application_activated(self, avc, app):
     """
     Event received from Gtk widgets requesting us to load package
     information. Once we're done loading the shit, we just emit
     'application-show' and let others do the UI switch.
     """
     self._visible = True
     self._last_app = app
     task = ParallelTask(self.__application_activate, app)
     task.name = "ApplicationActivate"
     task.daemon = True
     task.start()
开发者ID:dMaggot,项目名称:entropy,代码行数:14,代码来源:application.py

示例10: _on_license_activate

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
 def _on_license_activate(self, widget, uri):
     """
     License link clicked.
     """
     license_apps = self._licenses.get(uri)
     if not license_apps:
         return True
     task = ParallelTask(self._show_license, uri, license_apps)
     task.name = "ShowLicense"
     task.daemon = True
     task.start()
     return True
开发者ID:Heather,项目名称:entropy,代码行数:14,代码来源:notifications.py

示例11: _on_reload_state

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
 def _on_reload_state(self, srv, app, daemon_action, app_outcome=None):
     """
     Reload Application state due to a transaction event.
     """
     if not self._visible:
         return
     last_app = self._last_app
     if last_app is not None:
         app = last_app
     task = ParallelTask(self._reload_application_state, app)
     task.daemon = True
     task.name = "OnReloadAppState"
     task.start()
开发者ID:dMaggot,项目名称:entropy,代码行数:15,代码来源:application.py

示例12: add_downloads

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
    def add_downloads(self):
        """
        Add downloads stats for package.
        """
        try:
            repository_id = self._get_repository_id()
            self._validate_repository_id(repository_id)
        except AttributeError:
            return self._generic_invalid_request()

        try:
            package_names = self._get_package_names()
        except AttributeError:
            return self._generic_invalid_request()

        # validate branch
        branch = (request.params.get('branch') or "").strip()
        if not branch:
            return self._generic_invalid_request()
        if not entropy.tools.validate_branch_name(branch):
            return self._generic_invalid_request()

        # validate release_string
        release_string = (request.params.get('release_string') or "").strip()
        if not release_string:
            return self._generic_invalid_request()
        if not entropy.tools.is_valid_string(release_string):
            return self._generic_invalid_request()

        # validate hw_hash
        hw_hash = (request.params.get('hw_hash') or "").strip()
        if not hw_hash:
            return self._generic_invalid_request()
        if not entropy.tools.is_valid_string(hw_hash):
            return self._generic_invalid_request()

        ip_addr = self._get_ip_address(request)

        task = ParallelTask(
            self._add_downloads,
            package_names, branch,
            release_string, hw_hash, ip_addr)
        task.name = "AddDownloadsThread"
        task.daemon = True
        task.start()

        response = self._api_base_response(
            WebService.WEB_SERVICE_RESPONSE_CODE_OK)
        response['r'] = True
        return self._service_render(response)
开发者ID:Sabayon,项目名称:packages-website,代码行数:52,代码来源:service.py

示例13: _on_source_edit

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
    def _on_source_edit(self, widget, path, cu):
        """
        Source File Edit request.
        """
        const_debug_write(__name__, "Confc: _on_source_edit: %s" % (cu,))
        def _edit():
            if not cu.edit():
                def _notify():
                    msg = "%s: <i>%s</i>" % (
                        _("Cannot <b>edit</b> configuration file"),
                        cu.source(),)
                    self._notify_error(msg)
                GLib.idle_add(_notify)

        task = ParallelTask(_edit)
        task.name = "OnSourceEdit"
        task.daemon = True
        task.start()
开发者ID:Sabayon,项目名称:entropy,代码行数:20,代码来源:confupdate.py

示例14: load

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
    def load(self):
        """
        Request a content (re)load.
        """
        const_debug_write(__name__, "GroupVC: load() called")

        def _load():
            groups = self._service.groups()
            objs = []
            for identifier, data in groups.items():
                group = Group(self._avc, identifier, data["name"], data["description"], data["categories"])
                objs.append(group)
            self.set_many_safe(objs)

        task = ParallelTask(_load)
        task.name = "OnGroupLoadRequest"
        task.daemon = True
        task.start()
开发者ID:Enlik,项目名称:entropy,代码行数:20,代码来源:group.py

示例15: load

# 需要导入模块: from entropy.misc import ParallelTask [as 别名]
# 或者: from entropy.misc.ParallelTask import daemon [as 别名]
    def load(self):
        """
        Request a content (re)load.
        """
        const_debug_write(__name__, "RepoVC: load() called")

        def _load():
            repositories = self._service.list_repositories()
            objs = []
            for repository_id, description, enabled in repositories:
                obj = Repository(repository_id, description, enabled)
                objs.append(obj)
            self.set_many_safe(objs)

        task = ParallelTask(_load)
        task.name = "OnRepositoryLoadRequest"
        task.daemon = True
        task.start()
开发者ID:Enlik,项目名称:entropy,代码行数:20,代码来源:repository.py


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