import_sccprofile.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:sc-controller 作者: kozec 项目源码 文件源码
def import_scc(self, filename):
        """
        Imports simple, single-file scc-profile.
        Just loads it, checks for shell() actions and asks user to enter name.
        """
        files = self.builder.get_object("lstImportPackage")
        # Load profile
        profile = Profile(GuiActionParser())
        try:
            profile.load(filename)
        except Exception, e:
            # Profile cannot be parsed. Display error message and let user to quit
            # Error message reuses page from VDF import, because they are
            # basically the same
            log.error(e)
            self.error(str(e))
            return

        name = ".".join(os.path.split(filename)[-1].split(".")[0:-1])
        files.clear()
        o = GObject.GObject()
        o.obj = profile
        files.append(( 2, name, name, _("(profile)"), o ))

        self.check_shell_commands()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号