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


Python ImportPlugin.initialize方法代码示例

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


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

示例1: initialize

# 需要导入模块: from plugins.imp import ImportPlugin [as 别名]
# 或者: from plugins.imp.ImportPlugin import initialize [as 别名]
    def initialize(self):
        if not IP.initialize(self):
            return False
        self.edit = False
        self.tempfiles = TempFileCleanup()

        # try requests cache if available
        try:
            import requests_cache
            requests_cache.install_cache('kodi_cache')
        except:
            pass

        return True
开发者ID:pld-linux,项目名称:griffith,代码行数:16,代码来源:Kodi.py

示例2: initialize

# 需要导入模块: from plugins.imp import ImportPlugin [as 别名]
# 或者: from plugins.imp.ImportPlugin import initialize [as 别名]
    def initialize(self):
        if not IP.initialize(self):
            return False
        # glade
        gf = os.path.join(self.locations['glade'], 'importcsv.glade')
        # try to open the glade file
        try:
            self.gtk = gtk.glade.XML(gf)
        except:
            log.info("Glade-file %s can not be loaded.", gf)
            return False
        # open gtk window
        self.gtk.get_widget('d_import').set_transient_for(self.widgets['window'])

        # simple string lists
        self.tv_csv = self.gtk.get_widget('tv_csv')
        self.tv_assigned = self.gtk.get_widget('tv_assigned')
        self.tv_griffith = self.gtk.get_widget('tv_griffith')

        # 1st list
        self.ls_csv = gtk.ListStore(str)
        self.tv_csv.set_model(self.ls_csv)
        renderer = gtk.CellRendererText()
        column = gtk.TreeViewColumn("none", renderer, text=0)
        self.tv_csv.append_column(column)

        # 2nd list
        self.ls_griffith = gtk.ListStore(str, str)
        self.tv_griffith.set_model(self.ls_griffith)
        renderer = gtk.CellRendererText()
        column = gtk.TreeViewColumn("none", renderer, text=0)
        column.set_visible(False)
        self.tv_griffith.append_column(column)
        column = gtk.TreeViewColumn("none", renderer, text=1)
        self.tv_griffith.append_column(column)
        self.set_griffith_fields()

        # 3rd list
        self.ls_assigned = gtk.ListStore(str, str, str)
        self.tv_assigned.set_model(self.ls_assigned)
        renderer = gtk.CellRendererText()
        column = gtk.TreeViewColumn("none", renderer, text=0)
        self.tv_assigned.append_column(column)
        # add the columns for internal information handling and hide them
        column = gtk.TreeViewColumn("none", renderer, text=1)
        column.set_visible(False)
        self.tv_assigned.append_column(column)
        column = gtk.TreeViewColumn("none", renderer, text=2)
        column.set_visible(False)
        self.tv_assigned.append_column(column)

        # hide tabs
        self.nb_pages = self.gtk.get_widget('nb_pages')
        self.nb_pages.get_nth_page(1).hide()
        self.nb_pages.connect("switch-page", self._on_page_changed)

        # Events
        # Buttons
        self.b_cancel = self.gtk.get_widget("b_cancel")
        self.b_cancel.connect("clicked", self._clicked)

        self.b_next = self.gtk.get_widget("b_next")
        self.b_next.connect("clicked", self._clicked)

        self.b_back = self.gtk.get_widget("b_back")
        self.b_back.connect("clicked", self._clicked)

        self.b_add = self.gtk.get_widget("b_add")
        self.b_add.connect("clicked", self._clicked)

        self.b_del = self.gtk.get_widget("b_del")
        self.b_del.connect("clicked", self._clicked)

        # Treeviews
        self.tv_griffith.connect("row_activated", self._on_row_activated)
        self.tv_griffith.connect("cursor_changed", self._on_cursor_changed)
        self.tv_csv.connect("row_activated", self._on_row_activated)
        self.tv_csv.connect("cursor_changed", self._on_cursor_changed)
        self.tv_assigned.connect("cursor_changed", self._on_cursor_changed)

        self.gtk.get_widget('e_lineterminator').set_active(0)

        self.selected_griffith = None
        self.selected_csv = None
        self.current_csv_row = 0
        self.csv_header = None
        return True
开发者ID:BackupTheBerlios,项目名称:griffith-svn,代码行数:89,代码来源:CSV.py

示例3: initialize

# 需要导入模块: from plugins.imp import ImportPlugin [as 别名]
# 或者: from plugins.imp.ImportPlugin import initialize [as 别名]
 def initialize(self):
     if not IP.initialize(self):
         return False
     self.edit = False
     return True
开发者ID:BackupTheBerlios,项目名称:griffith-svn,代码行数:7,代码来源:AllMyMovies.py


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