mirror of
https://github.com/fergalmoran/picard.git
synced 2026-03-06 05:23:59 +00:00
Merge branch 'sophist_fix_plugin_install' of git://github.com/Sophist-UK/picard into Sophist-UK-sophist_fix_plugin_install
Conflicts: NEWS.txt
This commit is contained in:
1
NEWS.txt
1
NEWS.txt
@@ -7,6 +7,7 @@
|
||||
* A new tag, musicbrainz_releasetrackid, containing the MusicBrainz Track MBID
|
||||
introduced in the May 2013 schema change release, is now written to files.
|
||||
* Add %_recordingtitle% (PICARD-515)
|
||||
* Fix plugin install bugs (PICARD-444)
|
||||
|
||||
Version 1.2 - 2013-03-30
|
||||
* Picard now requires at least Python 2.6
|
||||
|
||||
@@ -25,6 +25,7 @@ import picard.plugins
|
||||
import traceback
|
||||
from picard import config, log
|
||||
from picard.const import USER_PLUGIN_DIR
|
||||
from picard.util import os_path_samefile
|
||||
|
||||
|
||||
_suffixes = [s[0] for s in imp.get_suffixes()]
|
||||
@@ -195,7 +196,7 @@ class PluginManager(QtCore.QObject):
|
||||
if plugin_name:
|
||||
try:
|
||||
dest_exists = os.path.exists(dest)
|
||||
same_file = os.path.samefile(path, dest) if dest_exists else False
|
||||
same_file = os_path_samefile(path, dest) if dest_exists else False
|
||||
if os.path.isfile(path) and not (dest_exists and same_file):
|
||||
shutil.copy(path, dest)
|
||||
elif os.path.isdir(path) and not same_file:
|
||||
|
||||
@@ -22,6 +22,7 @@ import os.path
|
||||
import sys
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from picard import config
|
||||
from picard.const import USER_PLUGIN_DIR
|
||||
from picard.util import encode_filename
|
||||
from picard.ui.options import OptionsPage, register_options_page
|
||||
from picard.ui.ui_options_plugins import Ui_PluginsOptionsPage
|
||||
@@ -135,7 +136,7 @@ class PluginsOptionsPage(OptionsPage):
|
||||
def install_plugin(self, path):
|
||||
path = encode_filename(path)
|
||||
file = os.path.basename(path)
|
||||
dest = os.path.join(self.tagger.user_plugin_dir, file)
|
||||
dest = os.path.join(USER_PLUGIN_DIR, file)
|
||||
if os.path.exists(dest):
|
||||
msgbox = QtGui.QMessageBox(self)
|
||||
msgbox.setText("A plugin named %s is already installed." % file)
|
||||
@@ -147,7 +148,7 @@ class PluginsOptionsPage(OptionsPage):
|
||||
self.tagger.pluginmanager.install_plugin(path, dest)
|
||||
|
||||
def open_plugin_dir(self):
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl(self.loader % self.tagger.user_plugin_dir, QtCore.QUrl.TolerantMode))
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl(self.loader % USER_PLUGIN_DIR, QtCore.QUrl.TolerantMode))
|
||||
|
||||
def open_plugin_site(self):
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl("http://musicbrainz.org/doc/Picard_Plugins", QtCore.QUrl.TolerantMode))
|
||||
|
||||
@@ -400,3 +400,12 @@ def tracknum_from_filename(base_filename):
|
||||
if numbers:
|
||||
return numbers[0]
|
||||
return -1
|
||||
|
||||
# Provide os.path.samefile equivalent which is missing in Python under Windows
|
||||
if sys.platform == 'win32':
|
||||
def os_path_samefile(p1, p2):
|
||||
ap1 = os.path.abspath(p1)
|
||||
ap2 = os.path.abspath(p2)
|
||||
return ap1 == ap2
|
||||
else:
|
||||
os_path_samefile = os.path.samefile
|
||||
|
||||
Reference in New Issue
Block a user