From 371426a08e7c18ed27f490d51839e9e3f55b65f5 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 13 Jul 2010 08:08:18 +0200 Subject: [PATCH] Adapted codebase to the hsutil/hscommon split and the hsmedia --> hsaudiotag rename. --- README | 5 +++-- build.py | 6 +++--- cocoa/me/dg_cocoa.py | 4 ++-- cocoa/se/dg_cocoa.py | 2 +- core/app.py | 4 ++-- core/app_cocoa.py | 8 ++++---- core/app_cocoa_inter.py | 2 +- core/engine.py | 2 +- core/gui/base.py | 2 +- core/gui/problem_dialog.py | 2 +- core/gui/problem_table.py | 2 +- core/results.py | 4 ++-- core/scanner.py | 3 ++- core/tests/app_test.py | 2 +- core/tests/engine_test.py | 2 +- core/tests/scanner_test.py | 3 ++- core_me/app_cocoa.py | 2 +- core_me/fs.py | 2 +- core_pe/app_cocoa.py | 4 ++-- core_pe/matchbase.py | 2 +- core_se/app_cocoa.py | 2 +- package.py | 8 +++----- qt/base/app.py | 2 +- run.py | 2 +- 24 files changed, 39 insertions(+), 38 deletions(-) diff --git a/README b/README index 62fbe064..b5c0eaaf 100644 --- a/README +++ b/README @@ -12,9 +12,8 @@ This package contains the source for dupeGuru. To learns how to build it, refer There are also other sub-folder that comes from external repositories (automatically checked out with svn:externals): -- hsutil: A collection of helpers used across HS applications. +- hscommon: A collection of helpers used across HS applications. - hsdocgen: An ad-hoc document generation used across HS project (used for help files) -- hsmedia: A library to read audio file metadata, used in dupeGuru ME. - cocoalib: A collection of helpers used across Cocoa UI codebases of HS applications. - qtlib: A collection of helpers used across Qt UI codebases of HS applications. @@ -28,6 +27,8 @@ General dependencies - Python 2.6 (http://www.python.org) - Send2Trash (http://hg.hardcoded.net/send2trash) +- hsutil (http://hg.hardcoded.net/hsutil) +- hsaudiotag (for ME) (http://hg.hardcoded.net/hsaudiotag) - lxml, to read and write XML files. (http://codespeak.net/lxml/) - Mako, to generate help files. (http://www.makotemplates.org/) - PyYaml, for help files and the build system. (http://pyyaml.org/) diff --git a/build.py b/build.py index 3c9fcef7..201166ac 100644 --- a/build.py +++ b/build.py @@ -16,7 +16,7 @@ from setuptools import setup import yaml from hsdocgen import generate_help, filters -from hsutil.build import add_to_pythonpath, print_and_do, build_all_qt_ui, copy_packages +from hscommon.build import add_to_pythonpath, print_and_do, build_all_qt_ui, copy_packages def build_cocoa(edition, dev, help_destpath): if not dev: @@ -30,10 +30,10 @@ def build_cocoa(edition, dev, help_destpath): if not dev: specific_packages = { 'se': ['core_se'], - 'me': ['core_me', 'hsmedia'], + 'me': ['core_me'], 'pe': ['core_pe'], }[edition] - copy_packages(['core', 'hsutil'] + specific_packages, 'build') + copy_packages(['core', 'hscommon'] + specific_packages, 'build') cocoa_project_path = 'cocoa/{0}'.format(edition) shutil.copy(op.join(cocoa_project_path, 'dg_cocoa.py'), 'build') os.chdir('build') diff --git a/cocoa/me/dg_cocoa.py b/cocoa/me/dg_cocoa.py index cd9d07ef..17494466 100644 --- a/cocoa/me/dg_cocoa.py +++ b/cocoa/me/dg_cocoa.py @@ -4,7 +4,7 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/hs_license -from hsutil.cocoa import signature +from hscommon.cocoa import signature from core.app_cocoa_inter import PyDupeGuruBase, PyDetailsPanel from core_me.app_cocoa import DupeGuruME @@ -13,7 +13,7 @@ from core.scanner import (SCAN_TYPE_FILENAME, SCAN_TYPE_FIELDS, SCAN_TYPE_FIELDS # Fix py2app imports which chokes on relative imports and other stuff from core_me import app_cocoa, data, fs, scanner -from hsmedia import aiff, flac, genres, id3v1, id3v2, mp4, mpeg, ogg, wma +from hsaudiotag import aiff, flac, genres, id3v1, id3v2, mp4, mpeg, ogg, wma from lxml import etree, _elementpath import gzip diff --git a/cocoa/se/dg_cocoa.py b/cocoa/se/dg_cocoa.py index d50dc1f5..940b7588 100644 --- a/cocoa/se/dg_cocoa.py +++ b/cocoa/se/dg_cocoa.py @@ -4,7 +4,7 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/hs_license -from hsutil.cocoa import signature +from hscommon.cocoa import signature from core import scanner from core.app_cocoa_inter import PyDupeGuruBase, PyDetailsPanel diff --git a/core/app.py b/core/app.py index 5f1996a4..4cae1136 100644 --- a/core/app.py +++ b/core/app.py @@ -15,11 +15,11 @@ import subprocess import re from send2trash import send2trash +from hscommon.reg import RegistrableApplication, RegistrationRequired +from hscommon.notify import Broadcaster from hsutil import io, files from hsutil.path import Path -from hsutil.reg import RegistrableApplication, RegistrationRequired from hsutil.misc import flatten, first -from hsutil.notify import Broadcaster from hsutil.str import escape from . import directories, results, scanner, export, fs diff --git a/core/app_cocoa.py b/core/app_cocoa.py index d1ea28b9..40886808 100644 --- a/core/app_cocoa.py +++ b/core/app_cocoa.py @@ -9,12 +9,12 @@ import logging import os.path as op -from hsutil import cocoa, job -from hsutil.cocoa import install_exception_hook -from hsutil.cocoa.objcmin import (NSNotificationCenter, NSUserDefaults, +from hscommon import cocoa, job +from hscommon.cocoa import install_exception_hook +from hscommon.cocoa.objcmin import (NSNotificationCenter, NSUserDefaults, NSSearchPathForDirectoriesInDomains, NSApplicationSupportDirectory, NSUserDomainMask, NSWorkspace) -from hsutil.reg import RegistrationRequired +from hscommon.reg import RegistrationRequired from . import app diff --git a/core/app_cocoa_inter.py b/core/app_cocoa_inter.py index b5e166eb..75ba44c6 100644 --- a/core/app_cocoa_inter.py +++ b/core/app_cocoa_inter.py @@ -9,7 +9,7 @@ # Common interface for all editions' dg_cocoa unit. -from hsutil.cocoa.inter import signature, PyTable, PyOutline, PyGUIObject, PyRegistrable +from hscommon.cocoa.inter import signature, PyTable, PyOutline, PyGUIObject, PyRegistrable from .gui.details_panel import DetailsPanel from .gui.directory_tree import DirectoryTree diff --git a/core/engine.py b/core/engine.py index 039f030e..9d758b98 100644 --- a/core/engine.py +++ b/core/engine.py @@ -16,7 +16,7 @@ from unicodedata import normalize from hsutil.misc import flatten from hsutil.str import multi_replace -from hsutil import job +from hscommon import job (WEIGHT_WORDS, MATCH_SIMILAR_WORDS, diff --git a/core/gui/base.py b/core/gui/base.py index b19f21d1..f162b423 100644 --- a/core/gui/base.py +++ b/core/gui/base.py @@ -7,7 +7,7 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/hs_license -from hsutil.notify import Listener +from hscommon.notify import Listener class GUIObject(Listener): def __init__(self, view, app): diff --git a/core/gui/problem_dialog.py b/core/gui/problem_dialog.py index 055e8974..38cc8cc7 100644 --- a/core/gui/problem_dialog.py +++ b/core/gui/problem_dialog.py @@ -7,7 +7,7 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/hs_license -from hsutil.notify import Broadcaster +from hscommon.notify import Broadcaster from .base import GUIObject diff --git a/core/gui/problem_table.py b/core/gui/problem_table.py index ac60a30d..981fc46f 100644 --- a/core/gui/problem_table.py +++ b/core/gui/problem_table.py @@ -7,7 +7,7 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/hs_license -from hsutil.notify import Listener +from hscommon.notify import Listener from hsgui.table import GUITable, Row class ProblemTable(GUITable, Listener): diff --git a/core/results.py b/core/results.py index aacf8f3d..500141b2 100644 --- a/core/results.py +++ b/core/results.py @@ -11,8 +11,8 @@ import re from lxml import etree from . import engine -from hsutil.job import nulljob -from hsutil.markable import Markable +from hscommon.job import nulljob +from hscommon.markable import Markable from hsutil.misc import flatten, nonone from hsutil.str import format_size from hsutil.files import FileOrPath diff --git a/core/scanner.py b/core/scanner.py index d663cf40..e9d739ca 100644 --- a/core/scanner.py +++ b/core/scanner.py @@ -9,7 +9,8 @@ import logging -from hsutil import job, io +from hscommon import job +from hsutil import io from hsutil.misc import dedupe from hsutil.str import get_file_ext, rem_file_ext diff --git a/core/tests/app_test.py b/core/tests/app_test.py index 70533b83..6a1ffbc0 100644 --- a/core/tests/app_test.py +++ b/core/tests/app_test.py @@ -16,7 +16,7 @@ from hsutil import io from hsutil.path import Path from hsutil.decorators import log_calls import hsutil.files -from hsutil.job import nulljob +from hscommon.job import nulljob from . import data from .results_test import GetTestGroups diff --git a/core/tests/engine_test.py b/core/tests/engine_test.py index d372ce39..450cca1e 100644 --- a/core/tests/engine_test.py +++ b/core/tests/engine_test.py @@ -10,7 +10,7 @@ import sys from nose.tools import eq_ -from hsutil import job +from hscommon import job from hsutil.decorators import log_calls from hsutil.misc import first from hsutil.testcase import TestCase diff --git a/core/tests/scanner_test.py b/core/tests/scanner_test.py index 0b03bbc4..8b44aff2 100644 --- a/core/tests/scanner_test.py +++ b/core/tests/scanner_test.py @@ -8,7 +8,8 @@ from nose.tools import eq_ -from hsutil import job, io +from hscommon import job +from hsutil import io from hsutil.path import Path from hsutil.testcase import TestCase diff --git a/core_me/app_cocoa.py b/core_me/app_cocoa.py index fb57e1ef..b5f84d3e 100644 --- a/core_me/app_cocoa.py +++ b/core_me/app_cocoa.py @@ -10,7 +10,7 @@ import logging from appscript import app, k, CommandError import time -from hsutil.cocoa import as_fetch +from hscommon.cocoa import as_fetch from core.app_cocoa import JOBID2TITLE, DupeGuru as DupeGuruBase diff --git a/core_me/fs.py b/core_me/fs.py index cfd56540..5a7d9cf8 100644 --- a/core_me/fs.py +++ b/core_me/fs.py @@ -7,7 +7,7 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/hs_license -from hsmedia import mpeg, wma, mp4, ogg, flac, aiff +from hsaudiotag import mpeg, wma, mp4, ogg, flac, aiff from hsutil.str import get_file_ext from core import fs diff --git a/core_pe/app_cocoa.py b/core_pe/app_cocoa.py index 076960a5..b5db330c 100644 --- a/core_pe/app_cocoa.py +++ b/core_pe/app_cocoa.py @@ -15,8 +15,8 @@ from appscript import app, k, CommandError from hsutil import io from hsutil.str import get_file_ext from hsutil.path import Path -from hsutil.cocoa import as_fetch -from hsutil.cocoa.objcmin import NSUserDefaults, NSURL +from hscommon.cocoa import as_fetch +from hscommon.cocoa.objcmin import NSUserDefaults, NSURL from core import fs from core import app_cocoa, directories diff --git a/core_pe/matchbase.py b/core_pe/matchbase.py index 3bc32d1b..4808dcd9 100644 --- a/core_pe/matchbase.py +++ b/core_pe/matchbase.py @@ -10,7 +10,7 @@ import logging import multiprocessing from collections import defaultdict, deque -from hsutil import job +from hscommon import job from core.engine import Match from .block import avgdiff, DifferentBlockCountError, NoBlocksError diff --git a/core_se/app_cocoa.py b/core_se/app_cocoa.py index d7b474ff..551ec872 100644 --- a/core_se/app_cocoa.py +++ b/core_se/app_cocoa.py @@ -12,7 +12,7 @@ import logging from hsutil import io from hsutil.path import Path -from hsutil.cocoa.objcmin import NSWorkspace +from hscommon.cocoa.objcmin import NSWorkspace from core import fs from core.app_cocoa import DupeGuru as DupeGuruBase diff --git a/package.py b/package.py index 2acadc9d..c916768d 100644 --- a/package.py +++ b/package.py @@ -15,7 +15,7 @@ import shutil import yaml -from hsutil.build import (build_dmg, add_to_pythonpath, print_and_do, copy_packages, +from hscommon.build import (build_dmg, add_to_pythonpath, print_and_do, copy_packages, build_debian_changelog, copy_qt_plugins) def package_cocoa(edition): @@ -84,11 +84,9 @@ def package_debian(edition): help_src = ed('help_{0}') os.makedirs(destpath) shutil.copytree(ed('qt/{0}'), srcpath) - packages = ['hsutil', 'hsgui', 'core', ed('core_{0}'), 'qtlib', 'qt/base'] - if edition == 'me': - packages.append('hsmedia') + packages = ['hscommon', 'hsgui', 'core', ed('core_{0}'), 'qtlib', 'qt/base'] copy_packages(packages, srcpath) - # We also have to copy the Send2Trash package + # We also have to copy the Send2Trash, hsutil and hsaudiotag package import send2trash pkg_path = op.dirname(send2trash.__file__) shutil.copytree(pkg_path, op.join(srcpath, 'send2trash')) diff --git a/qt/base/app.py b/qt/base/app.py index e45599a4..bcc8b275 100644 --- a/qt/base/app.py +++ b/qt/base/app.py @@ -16,7 +16,7 @@ from PyQt4.QtCore import QTimer, QObject, QCoreApplication, QUrl, SIGNAL from PyQt4.QtGui import QDesktopServices, QFileDialog, QDialog, QMessageBox from hsutil import job -from hsutil.reg import RegistrationRequired +from hscommon.reg import RegistrationRequired from core.app import DupeGuru as DupeGuruBase, JOB_SCAN, JOB_LOAD, JOB_MOVE, JOB_COPY, JOB_DELETE diff --git a/run.py b/run.py index 09a1350e..babd5c10 100644 --- a/run.py +++ b/run.py @@ -13,7 +13,7 @@ import os.path as op import yaml -from hsutil.build import add_to_pythonpath +from hscommon.build import add_to_pythonpath def main(): conf = yaml.load(open('conf.yaml'))