diff --git a/plugins/BlocklistImport/__init__.py b/plugins/BlocklistImport/__init__.py index 1e32c87f6..df47f586d 100644 --- a/plugins/BlocklistImport/__init__.py +++ b/plugins/BlocklistImport/__init__.py @@ -34,6 +34,7 @@ import urllib, deluge.common, deluge.pref from peerguardian import PGReader, PGException from text import TextReader, GZMuleReader, PGZip from ui import GTKConfig, GTKProgress +import os.path # List of formats supported. This is used to generate the UI list and # specify the reader class. The last entry is for storage by the UI. @@ -55,9 +56,9 @@ class BlocklistImport: self.gtkprog = GTKProgress(self) self.nimported = 0 - self.blockfile = deluge.common.CONFIG_DIR + "/blocklist.cache" + self.blockfile = os.path.join(deluge.common.CONFIG_DIR, "blocklist.cache") - conffile = deluge.common.CONFIG_DIR + "/blocklist.conf" + conffile = os.path.join(deluge.common.CONFIG_DIR, "blocklist.conf") self.config = deluge.pref.Preferences(filename=conffile, global_defaults=False) self.config.load() diff --git a/plugins/DesiredRatio/__init__.py b/plugins/DesiredRatio/__init__.py index 9c168be22..29c011899 100644 --- a/plugins/DesiredRatio/__init__.py +++ b/plugins/DesiredRatio/__init__.py @@ -37,6 +37,7 @@ DEFAULT_PREFS = { import deluge import gtk, gtk.glade +import os.path class DesiredRatio: @@ -48,7 +49,7 @@ class DesiredRatio: self.callback_ids = [] # Setup preferences - self.config = deluge.pref.Preferences(filename=deluge.common.CONFIG_DIR + "/desired_ratio.conf", global_defaults=False, defaults=DEFAULT_PREFS) + self.config = deluge.pref.Preferences(filename=os.path.join(deluge.common.CONFIG_DIR, "desired_ratio.conf"), global_defaults=False, defaults=DEFAULT_PREFS) # Connect to events for the torrent menu so we know when to build and remove our sub-menu self.callback_ids.append(self.interface.torrent_menu.connect_after("realize", self.torrent_menu_show)) diff --git a/plugins/EventLogging/__init__.py b/plugins/EventLogging/__init__.py index 0c63da9f2..e3c16e121 100644 --- a/plugins/EventLogging/__init__.py +++ b/plugins/EventLogging/__init__.py @@ -52,6 +52,7 @@ def enable(core, interface): ### The Plugin ### import deluge import gtk +import os.path from EventLogging.tab_log import LogTabManager class EventLogging: @@ -61,7 +62,7 @@ class EventLogging: self.manager = core self.parent = interface # Create an options file and try to load existing Values - self.config_file = deluge.common.CONFIG_DIR + "/event_logging.conf" + self.config_file = os.path.join(deluge.common.CONFIG_DIR, "event_logging.conf") self.config = deluge.pref.Preferences(self.config_file, False) try: self.config.load() @@ -69,7 +70,7 @@ class EventLogging: # File does not exist pass self.dialog_initialize = True - self.glade = gtk.glade.XML(path + "/event_logging_preferences.glade") + self.glade = gtk.glade.XML(os.path.join(path, "event_logging_preferences.glade")) self.dialog = self.glade.get_widget("dialog") self.dialog.set_position(gtk.WIN_POS_CENTER) self.glade.signal_autoconnect({ diff --git a/plugins/ExtraStats/__init__.py b/plugins/ExtraStats/__init__.py index 8aa0478dc..7f1e99ac1 100644 --- a/plugins/ExtraStats/__init__.py +++ b/plugins/ExtraStats/__init__.py @@ -57,7 +57,7 @@ class ExtraStats: print "Loading ExtraStats plugin..." self.manager = core # Create an options file and try to load existing Values - self.config_file = deluge.common.CONFIG_DIR + "/extra_stats.conf" + self.config_file = os.path.join(deluge.common.CONFIG_DIR, "extra_stats.conf") self.config = deluge.pref.Preferences(self.config_file, False, {'enable_downloaded': True, 'enable_uploaded': True, @@ -70,7 +70,7 @@ class ExtraStats: except IOError: # File does not exist pass - self.glade = gtk.glade.XML(path + "/stats_preferences.glade") + self.glade = gtk.glade.XML(os.path.join(path, "stats_preferences.glade")) self.dialog = self.glade.get_widget("dialog") self.dialog.set_position(gtk.WIN_POS_CENTER) self.glade.signal_autoconnect({ diff --git a/plugins/FlexRSS/plugin.py b/plugins/FlexRSS/plugin.py index 8b2fed292..25cbce735 100644 --- a/plugins/FlexRSS/plugin.py +++ b/plugins/FlexRSS/plugin.py @@ -1145,7 +1145,7 @@ class plugin_FlexRSS: def configure_ui_show_toolbar_button(self): if self.toolbar_button == None: import gtk - import os + import os.path icon = gtk.Image() icon.set_from_file(os.path.join(self.path, "FlexRSS.png")) diff --git a/plugins/MoveTorrent/__init__.py b/plugins/MoveTorrent/__init__.py index e4efcc34a..e0c1021ef 100644 --- a/plugins/MoveTorrent/__init__.py +++ b/plugins/MoveTorrent/__init__.py @@ -37,10 +37,10 @@ def enable(core, interface): import deluge from deluge import dialogs import gtk -import os +import os.path DEFAULT_PREFS = { - "default_finished_path": os.path.expanduser("~/"), + "default_finished_path": os.path.expanduser("~"), "enable_move_completed": False } @@ -55,7 +55,7 @@ class movetorrentMenu: self.dialogs = deluge.dialogs self.core.connect_event(self.core.constants['EVENT_STORAGE_MOVED'], self.handle_event) self.core.connect_event(self.core.constants['EVENT_FINISHED'], self.handle_event) - self.glade = gtk.glade.XML(path + "/movetorrent.glade") + self.glade = gtk.glade.XML(os.path.join(path, "movetorrent.glade")) self.glade.signal_autoconnect({ 'dialog_ok': self.dialog_ok, 'dialog_cancel': self.dialog_cancel @@ -63,7 +63,7 @@ class movetorrentMenu: self.dialog = self.glade.get_widget("dialog") self.dialog.set_position(gtk.WIN_POS_CENTER) - self.config_file = deluge.common.CONFIG_DIR + "/move_torrent.conf" + self.config_file = os.path.join(deluge.common.CONFIG_DIR, "move_torrent.conf") self.config = deluge.pref.Preferences(self.config_file, global_defaults=False, defaults=DEFAULT_PREFS) try: self.config.load() @@ -99,7 +99,6 @@ class movetorrentMenu: self.core.move_storage(unique_id, path) def configure(self, window): - import os.path try: self.glade.get_widget("chk_move_completed").set_active(self.config.get("enable_move_completed")) self.glade.get_widget("finished_path_button").set_filename(self.config.get("default_finished_path")) diff --git a/plugins/NetworkGraph/__init__.py b/plugins/NetworkGraph/__init__.py index 24d933327..59abf9a0d 100644 --- a/plugins/NetworkGraph/__init__.py +++ b/plugins/NetworkGraph/__init__.py @@ -48,6 +48,7 @@ from NetworkGraph.tab_graph import GraphTabManager import gtk import deluge +import os.path class NetworkGraph: def __init__(self, path, core, interface): @@ -55,7 +56,7 @@ class NetworkGraph: self.location = path self.manager = core self.dialog_initialize = True - self.glade = gtk.glade.XML(path + "/graph_preferences.glade") + self.glade = gtk.glade.XML(os.path.join(path, "graph_preferences.glade")) self.dialog = self.glade.get_widget("dialog") self.glade.signal_autoconnect({ 'on_Reset_Download_released' : self.reset_download, @@ -64,7 +65,7 @@ class NetworkGraph: 'on_button_ok_pressed': self.ok_pressed }) - self.config_file = deluge.common.CONFIG_DIR + "/graph.conf" + self.config_file = os.path.join(deluge.common.CONFIG_DIR, "graph.conf") self.config = deluge.pref.Preferences(self.config_file, False) try: self.config.load() diff --git a/plugins/Scheduler/plugin.py b/plugins/Scheduler/plugin.py index 3a35072fe..d64e3a9f9 100644 --- a/plugins/Scheduler/plugin.py +++ b/plugins/Scheduler/plugin.py @@ -1,4 +1,5 @@ import deluge.common, deluge.pref, gtk, copy, pickle, time +import os.path class plugin_Scheduler: def __init__(self, path, deluge_core, deluge_interface): @@ -7,7 +8,7 @@ class plugin_Scheduler: self.interface = deluge_interface self.days = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] - self.conf_file = deluge.common.CONFIG_DIR + "/scheduler.conf" + self.conf_file = os.path.join(deluge.common.CONFIG_DIR, "scheduler.conf") self.config = deluge.pref.Preferences() self.button_state_temp = [[0] * 7 for dummy in xrange(24)] self.status = -1 diff --git a/plugins/SpeedLimiter/__init__.py b/plugins/SpeedLimiter/__init__.py index d6e414db4..49f7cc0d1 100644 --- a/plugins/SpeedLimiter/__init__.py +++ b/plugins/SpeedLimiter/__init__.py @@ -36,6 +36,7 @@ DEFAULT_PREFS = { import deluge import gtk, gtk.glade +import os.path class DesiredSpeed: @@ -47,7 +48,7 @@ class DesiredSpeed: self.set_down_speeds = {} self.callback_ids = [] - self.config = deluge.pref.Preferences(filename=deluge.common.CONFIG_DIR + "/desired_speed.conf", global_defaults=False, defaults=DEFAULT_PREFS) + self.config = deluge.pref.Preferences(filename=os.path.join(deluge.common.CONFIG_DIR, "desired_speed.conf"), global_defaults=False, defaults=DEFAULT_PREFS) self.callback_ids.append(self.interface.torrent_menu.connect_after("realize", self.torrent_menu_show)) self.callback_ids.append(self.interface.torrent_menu.connect("show", self.torrent_menu_show)) diff --git a/plugins/TorrentCreator/__init__.py b/plugins/TorrentCreator/__init__.py index 8ad62fae7..2167b3b19 100644 --- a/plugins/TorrentCreator/__init__.py +++ b/plugins/TorrentCreator/__init__.py @@ -33,6 +33,7 @@ def enable(core, interface): import deluge import gtk, gtk.glade +import os.path class TorrentCreator: @@ -79,7 +80,7 @@ class TorrentCreator: def new_torrent_clicked(self, widget, data=None): # Show the torrent creator dialog - self.glade = gtk.glade.XML(self.path + "/torrentcreator.glade") + self.glade = gtk.glade.XML(os.path.join(self.path, "torrentcreator.glade")) self.dialog = self.glade.get_widget("torrentcreator") self.glade.get_widget("piece_size_combobox").set_active(3) diff --git a/plugins/TorrentFiles/__init__.py b/plugins/TorrentFiles/__init__.py index a9e391726..6a5509d04 100644 --- a/plugins/TorrentFiles/__init__.py +++ b/plugins/TorrentFiles/__init__.py @@ -49,13 +49,14 @@ import gtk import deluge from TorrentFiles.tab_files import FilesTabManager +import os.path class TorrentFiles: def __init__(self, path, core, interface): print "Loading TorrentFiles plugin..." self.parent = interface self.manager = core - config_file = deluge.common.CONFIG_DIR + "/files.conf" + config_file = os.path.join(deluge.common.CONFIG_DIR, "files.conf") self.config = deluge.pref.Preferences(config_file, False, defaults={'file_viewer': 'xdg-open'}) try: @@ -64,7 +65,7 @@ class TorrentFiles: # File does not exist pass - self.glade = gtk.glade.XML(path + "/files_preferences.glade") + self.glade = gtk.glade.XML(os.path.join(path, "files_preferences.glade")) self.dialog = self.glade.get_widget("dialog") self.glade.signal_autoconnect({ 'on_button_cancel_clicked': self.on_button_cancel_clicked, diff --git a/plugins/TorrentNotification/__init__.py b/plugins/TorrentNotification/__init__.py index abcf68f57..1ee4625d1 100644 --- a/plugins/TorrentNotification/__init__.py +++ b/plugins/TorrentNotification/__init__.py @@ -34,6 +34,7 @@ def enable(core, interface): import deluge import deluge.common import gtk +import os.path class TorrentNotification: @@ -48,7 +49,7 @@ class TorrentNotification: self.core.connect_event(self.core.constants['EVENT_FINISHED'], self.handle_event) # Create an options file and try to load existing Values - self.config_file = deluge.common.CONFIG_DIR + "/notification.conf" + self.config_file = os.path.join(deluge.common.CONFIG_DIR, "notification.conf") if deluge.common.windows_check(): self.config = deluge.pref.Preferences(self.config_file, False, defaults={'enable_tray_blink' : True, @@ -66,7 +67,7 @@ class TorrentNotification: except IOError: pass - self.glade = gtk.glade.XML(path + "/notification_preferences.glade") + self.glade = gtk.glade.XML(os.path.join(path, "notification_preferences.glade")) self.dialog = self.glade.get_widget("dialog") self.dialog.set_position(gtk.WIN_POS_CENTER) self.glade.signal_autoconnect({ @@ -117,7 +118,6 @@ class TorrentNotification: pass def configure(self, window): - import os.path self.glade.get_widget("chk_tray_blink").set_active(self.config.get("enable_tray_blink")) if deluge.common.windows_check(): self.glade.get_widget("chk_notification").set_active(False) @@ -155,7 +155,6 @@ class TorrentNotification: except: pass else: - import os.path import sys pygame.init() try: diff --git a/plugins/TorrentPeers/__init__.py b/plugins/TorrentPeers/__init__.py index 351ed8de7..5fdab548e 100644 --- a/plugins/TorrentPeers/__init__.py +++ b/plugins/TorrentPeers/__init__.py @@ -49,6 +49,7 @@ import gtk import deluge from TorrentPeers.tab_peers import PeersTabManager +import os.path class TorrentPeers: @@ -56,7 +57,7 @@ class TorrentPeers: print "Loading TorrentPeers plugin..." self.parent = interface self.manager = core - self.config_file = deluge.common.CONFIG_DIR + "/peers.conf" + self.config_file = os.path.join(deluge.common.CONFIG_DIR, "peers.conf") self.config = deluge.pref.Preferences(self.config_file, False, defaults={'enable_flags' : True, 'size_18' : True}) @@ -66,7 +67,7 @@ class TorrentPeers: # File does not exist pass self.dialog_initialize = True - self.glade = gtk.glade.XML(path + "/peers_preferences.glade") + self.glade = gtk.glade.XML(os.path.join(path, "peers_preferences.glade")) self.dialog = self.glade.get_widget("dialog") self.glade.signal_autoconnect({ 'toggle_ui': self.toggle_ui, diff --git a/plugins/TorrentSearch/__init__.py b/plugins/TorrentSearch/__init__.py deleted file mode 100644 index bd6f949f2..000000000 --- a/plugins/TorrentSearch/__init__.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# __init__.py -# -# Copyright (C) Marcos Pinto 2007 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, write to: -# The Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor -# Boston, MA 02110-1301, USA. -# -# In addition, as a special exception, the copyright holders give -# permission to link the code of portions of this program with the OpenSSL -# library. -# You must obey the GNU General Public License in all respects for all of -# the code used other than OpenSSL. If you modify file(s) with this -# exception, you may extend this exception to your version of the file(s), -# but you are not obligated to do so. If you do not wish to do so, delete -# this exception statement from your version. If you delete this exception -# statement from all source files in the program, then also delete it here. - -plugin_name = "Torrent Search" -plugin_author = "Zach Tibbitts" -plugin_version = "0.5" -plugin_description = _("A searchbar for torrent search engines") - - -def deluge_init(deluge_path): - global path - path = deluge_path - - -from TorrentSearch.plugin import plugin_Search - -def enable(core, interface): - global path - return plugin_Search(path, core, interface) diff --git a/plugins/TorrentSearch/plugin.py b/plugins/TorrentSearch/plugin.py deleted file mode 100644 index e6c83c7d6..000000000 --- a/plugins/TorrentSearch/plugin.py +++ /dev/null @@ -1,187 +0,0 @@ -# -*- coding: utf-8 -*- -# -# plugin.py -# -# Copyright (C) Marcos Pinto 2007 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, write to: -# The Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor -# Boston, MA 02110-1301, USA. -# -# In addition, as a special exception, the copyright holders give -# permission to link the code of portions of this program with the OpenSSL -# library. -# You must obey the GNU General Public License in all respects for all of -# the code used other than OpenSSL. If you modify file(s) with this -# exception, you may extend this exception to your version of the file(s), -# but you are not obligated to do so. If you do not wish to do so, delete -# this exception statement from your version. If you delete this exception -# statement from all source files in the program, then also delete it here. - - -class plugin_Search: - def __init__(self, path, deluge_core, deluge_interface): - import gtk, gtk.glade, os - import deluge.common, deluge.dgtk, deluge.pref - self.core = deluge_core - self.interface = deluge_interface - self.conf_file = deluge.common.CONFIG_DIR + "/search.conf" - if not os.path.isfile(self.conf_file): - f = open(self.conf_file, mode='w') - f.flush() - f.close() - glade = gtk.glade.XML(path + "/searchdlg.glade") - self.dlg = glade.get_widget("search_dialog") - # self.dlg.set_icon_from_file(deluge.common.get_pixmap("deluge32.png")) - self.view = glade.get_widget("search_view") - model = gtk.ListStore(str, str) - self.view.set_model(model) - deluge.dgtk.add_text_column(self.view, _("Name"), 0, width=80) - deluge.dgtk.add_text_column(self.view, _("Search String"), 1) - self.field_name = glade.get_widget("field_name") - self.field_search = glade.get_widget("field_search") - self.button_add = glade.get_widget("button_addsearch") - self.button_del = glade.get_widget("button_delsearch") - dic = { "add_clicked" : self.add_clicked, - "del_clicked" : self.del_clicked, - "row_clicked" : self.row_clicked, - "text_changed" : self.text_changed } - glade.signal_autoconnect(dic) - self.view.get_selection().set_select_function(self.row_clicked) - ### Note: All other plugins should use self.interface.toolbar - ### when adding items to the toolbar - self.se = '' - self.toolbar = self.interface.wtree.get_widget("tb_left") - self.engines = deluge.pref.Preferences(self.conf_file, False) - self.search_entry = gtk.Entry() - self.search_entry.connect("activate", self.torrent_search) - self.search_item = gtk.ToolItem() - self.search_item.add(self.search_entry) - self.search_icon = gtk.Image() - self.search_icon.set_from_stock(gtk.STOCK_FIND, gtk.ICON_SIZE_MENU) - self.menu_button = gtk.MenuToolButton(self.search_icon, _("Choose an Engine")) - self.menu_button.set_is_important(True) - self.menu_button.connect("clicked", self.torrent_search) - self.menu = gtk.Menu() - self.manage_item = gtk.ImageMenuItem(_("Manage Engines")) - self.image = gtk.Image() - self.image.set_from_stock(gtk.STOCK_PREFERENCES, gtk.ICON_SIZE_MENU) - self.manage_item.set_image(self.image) - self.manage_item.connect("activate", self.configure) - self.menu.add(self.manage_item) - self.menu_button.set_menu(self.menu) - self.toolbar.insert(self.search_item, -1) - self.toolbar.insert(self.menu_button, -1) - self.populate_search_menu() - self.toolbar.show_all() - self.search_item.show_all() - self.menu_button.show_all() - self.menu.show_all() - - def unload(self): - self.engines.save(self.conf_file) - self.toolbar.remove(self.search_item) - self.toolbar.remove(self.menu_button) - - def text_changed(self, args): - a = (self.field_name.get_text() != "") - b = (self.field_search.get_text() != "") - if(a and b): - self.button_add.set_sensitive(1) - else: - self.button_add.set_sensitive(0) - - def add_clicked(self, args): - self.view.get_model().append([self.field_name.get_text(), - self.field_search.get_text()]) - self.field_name.set_text("") - self.field_search.set_text("") - - def del_clicked(self, args): - (model, selection) = self.view.get_selection().get_selected() - model.remove(selection) - self.button_del.set_sensitive(0) - - def row_clicked(self, args): - self.button_del.set_sensitive(1) - return True - - def configure(self, widget=None): - import gtk, gtk.glade - from deluge import common - self.dlg.show_all() - model = self.view.get_model() - model.clear() - for name in self.engines.keys(): - self.view.get_model().append( (name, self.engines.get(name)) ) - self.button_add.set_sensitive(0) - self.button_del.set_sensitive(0) - result = self.dlg.run() - self.dlg.hide_all() - if result == 1: - self.engines.clear() - the_iter = model.get_iter_first() - while the_iter is not None: - self.engines.set(model.get_value(the_iter, 0), model.get_value(the_iter, 1)) - the_iter = model.iter_next(the_iter) - self.engines.save(self.conf_file) - self.populate_search_menu() - - - - def update(self): - pass - - def torrent_search(self, widget=None): - from deluge import common - print "Searching with engine", self.se - url = self.engines.get(self.se) - entry = self.search_entry.get_text() - print 'URL =', url - print 'Entry =', entry - entry = entry.replace(' ', '+') - print 'URL =', url - print 'Entry =', entry - url = url.replace('${query}', entry) - print 'URL =', url - print 'Entry =', entry - common.open_url_in_browser(url) - - def populate_search_menu(self): - import gtk - self.menu_button.set_label(_("Choose an Engine")) - for child in self.menu.get_children(): - self.menu.remove(child) - group = None - i = 0 - for engine in self.engines.keys(): - rmi = gtk.RadioMenuItem(None, engine) - rmi.eng_name = engine - rmi.connect("activate", self.select_search, rmi.eng_name) - if (group != None): - rmi.set_group(group) - else: - group = rmi - rmi.set_active(1) - self.menu.insert(rmi, i) - i = i + 1 - rmi.show() - self.menu.insert(self.manage_item, i) - self.menu.show() - - def select_search(self, menuitem, engine_string): - self.menu_button.set_label(_("Search ") + engine_string) - self.se = engine_string - diff --git a/plugins/TorrentSearch/searchdlg.glade b/plugins/TorrentSearch/searchdlg.glade deleted file mode 100644 index 9e409df5c..000000000 --- a/plugins/TorrentSearch/searchdlg.glade +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - 5 - Manage Search Plugins - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK - 2 - - - True - 4 - 4 - - - True - gtk-add - True - - - - - 2 - 3 - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - GTK_POLICY_AUTOMATIC - - - True - - - - - 4 - - - - - True - - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - - - - 1 - 4 - 2 - 3 - GTK_FILL - - - - - True - Name: - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - URL: - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - gtk-remove - True - - - - 3 - 4 - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - - - True - Add a new search engine by entering a Name and a URL. For Name, enter the name of the search engine to be used. For URL, enter the url of the seach page. The user's search query will replace any instance of ${query} in the URL. -For example, a Google search would be: -Name: Google -URL: http://www.google.com/search?q=${query} - True - - - - - True - Help - - - label_item - - - - - 4 - 3 - 4 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK - GTK_BUTTONBOX_END - - - True - gtk-cancel - True - - - - - True - gtk-ok - True - 1 - - - 1 - - - - - False - GTK_PACK_END - - - - - - diff --git a/plugins/WebSeed/__init__.py b/plugins/WebSeed/__init__.py index 7f9fab8d4..d71379490 100644 --- a/plugins/WebSeed/__init__.py +++ b/plugins/WebSeed/__init__.py @@ -33,7 +33,7 @@ def enable(core, interface): import deluge import gtk -import os +import os.path class webseedMenu: @@ -42,7 +42,7 @@ class webseedMenu: self.path = path self.core = core self.interface = interface - self.glade = gtk.glade.XML(path + "/webseed.glade") + self.glade = gtk.glade.XML(os.path.join(path, "webseed.glade")) self.dialog = self.glade.get_widget("dialog") # Add menu item to torrent context menu self.menuitem_image = gtk.Image() diff --git a/plugins/WebUi/__init__.py b/plugins/WebUi/__init__.py index 85f372757..d33df9a4a 100644 --- a/plugins/WebUi/__init__.py +++ b/plugins/WebUi/__init__.py @@ -97,7 +97,7 @@ class plugin_WebUi(object): if status[0] == 0: os.kill(int(status[1].split()[0]), 9) time.sleep(1) #safe time to wait for kill to finish. - self.config_file = deluge.common.CONFIG_DIR + "/webui.conf" + self.config_file = os.path.join(deluge.common.CONFIG_DIR, "webui.conf") self.config = deluge.pref.Preferences(self.config_file, False) try: self.config.load() @@ -162,7 +162,7 @@ class plugin_WebUi(object): else: print 'Start Webui(in process)..' - server_bin = os.path.dirname(__file__) + '/run_webserver' + server_bin = os.path.join(os.path.dirname(__file__), 'run_webserver') self.proc = Popen((server_bin,'env=0.5')) def kill_server(self):