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


Python MediaDB.isloaded方法代码示例

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


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

示例1: __init__

# 需要导入模块: from library import MediaDB [as 别名]
# 或者: from library.MediaDB import isloaded [as 别名]
 def __init__(self):
     FetchManager.__init__(self, DBQuery("local"))
     
     if MediaDB.isloaded():
         self.__on_db_loaded(MediaDB)
     else:    
         self.autoconnect(MediaDB, "loaded", self.__on_db_loaded)
开发者ID:WilliamRen,项目名称:deepin-music-player,代码行数:9,代码来源:cover_download.py

示例2: __init__

# 需要导入模块: from library import MediaDB [as 别名]
# 或者: from library.MediaDB import isloaded [as 别名]
 def __init__(self):
     Browser.__init__(self, DBQuery(self._type))
     
     if MediaDB.isloaded():
         self.__on_db_loaded(MediaDB)
     else:    
         self.autoconnect(MediaDB, "loaded", self.__on_db_loaded)
开发者ID:andy071001,项目名称:deepin-music-player,代码行数:9,代码来源:browser.py

示例3: __init__

# 需要导入模块: from library import MediaDB [as 别名]
# 或者: from library.MediaDB import isloaded [as 别名]
 def __init__(self):
     gobject.GObject.__init__(self)
     self.__volumes = set()
     
     if dbus_imported:
         try:
             self.bus = dbus.SystemBus()
         except:    
             self.bus = None
             
     if dbus_imported and self.bus and check_dbus(self.bus, "org.freedesktop.UDisks"):
         self.dbus_udisks = True
         self.udisks_object = self.bus.get_object("org.freedesktop.UDisks", "/org/freedesktop/UDisks")
         self.udisks_interface = dbus.Interface(self.udisks_object, "org.freedesktop.UDisks")
         
         if MediaDB.isloaded():
             self.__connect_to_db()
         else:    
             MediaDB.connect("loaded", self.__connect_to_db)
     else:        
         self.dbus_udisks = False
         self.logdebug("No UDisks support")
开发者ID:WilliamRen,项目名称:deepin-music-player,代码行数:24,代码来源:udisks.py

示例4: __init__

# 需要导入模块: from library import MediaDB [as 别名]
# 或者: from library.MediaDB import isloaded [as 别名]
    def __init__(self):
        '''Init.'''
        gtk.VBox.__init__(self)

        # Init catagory list.
        self.category_list = CategoryView()
        setattr(self.category_list, "save_to_library", self.save_to_library)
        self.category_list.draw_mask = self.draw_category_list_mask
        self.category_list.connect("single-click-item", self.on_category_single_click)
        self.category_list.connect("right-press-items", self.on_category_right_press)
        self.category_list.set_size_request(CATEGROYLIST_WIDTH, -1)

        del self.category_list.keymap["Delete"]

        # Init SearchEntry.
        self.entry_box = SearchEntry("")
        self.entry_box.entry.connect("changed", self.search_cb)
        self.entry_box.set_no_show_all(True)
        entry_align = gtk.Alignment()
        entry_align.set(0, 0, 1, 1)
        entry_align.set_padding(2, 0, 10, 10)
        entry_align.add(self.entry_box)
        entry_align.connect("expose-event", self.expose_entry_mask)

        # Init toolbar.
        self.toolbar_box = gtk.HBox(spacing=45)
        self.search_button = self.__create_simple_toggle_button("search", self.show_text_entry,
                                                                _("Search in Current Playlist"))

        self.__create_simple_button("list", self.popup_list_menu, _("Playlist Operations"))
        self.__create_simple_button("add", self.popup_add_menu, _("Add"))

        self.playmode_button = PlaymodeButton(config.get("setting", "loop_mode", "list_mode").split("_")[0])
        Tooltip.text(self.playmode_button, _("Playback mode"))
        self.playmode_button.connect("button-press-event", self.popup_sort_menu)
        self.toolbar_box.pack_start(self.playmode_button, False, False)
        self.__create_simple_button("delete", self.popup_delete_menu, _("Delete"))
        toolbar_align = gtk.Alignment()
        toolbar_align.set_padding(6, 6, 28, 0)
        toolbar_align.add(self.toolbar_box)
        toolbar_align.connect("expose-event", self.expose_toolbar_mask)

        self.right_box = gtk.VBox()
        self.right_box.connect("size-allocate", self.on_right_box_size_allocate)
        self.list_paned = HPaned(handle_color=app_theme.get_color("panedHandler"), enable_drag=True)
        self.list_paned.pack1(self.category_list, True, True)
        self.list_paned.pack2(self.right_box, True, False)
        bottom_box = gtk.VBox()
        bottom_box.set_size_request(-1, 22)
        self.pack_start(self.list_paned, True, True)
        self.pack_start(entry_align, False, False)
        self.pack_start(toolbar_align, False, True)

        # Current
        self.current_playlist = None
        self.search_time_source = 0
        self.current_item = None
        self.search_flag = False
        self.cache_items = None
        self.delete_source_id = None
        self.drag_source_id = None
        self.menu_source_id = None
        self.song_notify_id = None
        self.detail_menu = None
        self.save_flag = False

        if MediaDB.isloaded():
            self.__on_db_loaded(MediaDB)
        else:
            MediaDB.connect("loaded", self.__on_db_loaded)

        Player.connect("loaded", self.__on_player_loaded)
        Dispatcher.connect("play-song", self.__play_and_add)
        Dispatcher.connect("add-songs", self.__add_songs_to_list)
        Dispatcher.connect("new-cd-playlist", self.__new_audiocd_playlist)
        Dispatcher.connect("del-cd-playlist", self.delete_audiocd_list)
        Dispatcher.connect("save-current-list", self.save_current_playlist)
        config.connect("config-changed", self.on_config_changed)
开发者ID:linuxmint17,项目名称:deepin-music,代码行数:80,代码来源:playlist.py


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