mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-06 16:44:06 +00:00
Refactor code
This commit is contained in:
@@ -20,10 +20,13 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
from picard import PICARD_APP_NAME
|
||||
|
||||
# Install gettext "noop" function in case const.py gets imported directly.
|
||||
import builtins
|
||||
builtins.__dict__['N_'] = lambda a: a
|
||||
|
||||
|
||||
# Config directory
|
||||
if sys.platform == "win32":
|
||||
USER_DIR = os.environ.get("APPDATA", "~\\Application Data")
|
||||
@@ -31,7 +34,7 @@ else:
|
||||
USER_DIR = os.environ.get("XDG_CONFIG_HOME", "~/.config")
|
||||
|
||||
USER_DIR = os.path.join(
|
||||
os.path.expanduser(USER_DIR), "MusicBrainz", "Picard Dev"
|
||||
os.path.expanduser(USER_DIR), "MusicBrainz", PICARD_APP_NAME
|
||||
)
|
||||
|
||||
USER_PLUGIN_DIR = os.path.join(USER_DIR, "plugins")
|
||||
|
||||
12
setup.py
12
setup.py
@@ -34,6 +34,10 @@ from distutils.dist import Distribution
|
||||
from distutils.spawn import find_executable
|
||||
from setuptools import setup, Command, Extension
|
||||
|
||||
|
||||
# Change to 'picard' when building for production
|
||||
PACKAGE_NAME = "picard_dev"
|
||||
|
||||
ext_modules = [
|
||||
Extension('picard.util._astrcmp', sources=['picard/util/_astrcmp.c']),
|
||||
]
|
||||
@@ -263,8 +267,8 @@ class picard_build(build):
|
||||
|
||||
def run(self):
|
||||
if 'bdist_nsis' not in sys.argv: # somebody shoot me please
|
||||
log.info('generating scripts/picard_dev from scripts/picard.in')
|
||||
generate_file('scripts/picard.in', 'scripts/picard_dev', {'localedir': self.localedir, 'autoupdate': not self.disable_autoupdate})
|
||||
log.info('generating scripts/%s from scripts/picard.in', PACKAGE_NAME)
|
||||
generate_file('scripts/picard.in', 'scripts/' + PACKAGE_NAME, {'localedir': self.localedir, 'autoupdate': not self.disable_autoupdate})
|
||||
build.run(self)
|
||||
|
||||
|
||||
@@ -640,7 +644,7 @@ def _picard_packages():
|
||||
|
||||
|
||||
args2 = {
|
||||
'name': 'picard_dev',
|
||||
'name': PACKAGE_NAME,
|
||||
'version': __version__,
|
||||
'description': 'The next generation MusicBrainz tagger',
|
||||
'url': 'https://picard.musicbrainz.org/',
|
||||
@@ -662,7 +666,7 @@ args2 = {
|
||||
'regen_pot_file': picard_regen_pot_file,
|
||||
'patch_version': picard_patch_version,
|
||||
},
|
||||
'scripts': ['scripts/picard_dev'],
|
||||
'scripts': ['scripts/' + PACKAGE_NAME],
|
||||
'install_requires': ['PyQt5', 'mutagen'],
|
||||
}
|
||||
args.update(args2)
|
||||
|
||||
Reference in New Issue
Block a user