Adapted codebase to the hsutil/hscommon split and the hsmedia --> hsaudiotag rename.

This commit is contained in:
Virgil Dupras 2010-07-13 08:08:18 +02:00
parent 75eb005ba0
commit 371426a08e
24 changed files with 39 additions and 38 deletions

5
README
View File

@ -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 There are also other sub-folder that comes from external repositories (automatically checked out
with svn:externals): 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) - 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. - 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. - 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) - Python 2.6 (http://www.python.org)
- Send2Trash (http://hg.hardcoded.net/send2trash) - 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/) - lxml, to read and write XML files. (http://codespeak.net/lxml/)
- Mako, to generate help files. (http://www.makotemplates.org/) - Mako, to generate help files. (http://www.makotemplates.org/)
- PyYaml, for help files and the build system. (http://pyyaml.org/) - PyYaml, for help files and the build system. (http://pyyaml.org/)

View File

@ -16,7 +16,7 @@ from setuptools import setup
import yaml import yaml
from hsdocgen import generate_help, filters 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): def build_cocoa(edition, dev, help_destpath):
if not dev: if not dev:
@ -30,10 +30,10 @@ def build_cocoa(edition, dev, help_destpath):
if not dev: if not dev:
specific_packages = { specific_packages = {
'se': ['core_se'], 'se': ['core_se'],
'me': ['core_me', 'hsmedia'], 'me': ['core_me'],
'pe': ['core_pe'], 'pe': ['core_pe'],
}[edition] }[edition]
copy_packages(['core', 'hsutil'] + specific_packages, 'build') copy_packages(['core', 'hscommon'] + specific_packages, 'build')
cocoa_project_path = 'cocoa/{0}'.format(edition) cocoa_project_path = 'cocoa/{0}'.format(edition)
shutil.copy(op.join(cocoa_project_path, 'dg_cocoa.py'), 'build') shutil.copy(op.join(cocoa_project_path, 'dg_cocoa.py'), 'build')
os.chdir('build') os.chdir('build')

View File

@ -4,7 +4,7 @@
# which should be included with this package. The terms are also available at # which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/hs_license # 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.app_cocoa_inter import PyDupeGuruBase, PyDetailsPanel
from core_me.app_cocoa import DupeGuruME 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 # Fix py2app imports which chokes on relative imports and other stuff
from core_me import app_cocoa, data, fs, scanner 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 from lxml import etree, _elementpath
import gzip import gzip

View File

@ -4,7 +4,7 @@
# which should be included with this package. The terms are also available at # which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/hs_license # http://www.hardcoded.net/licenses/hs_license
from hsutil.cocoa import signature from hscommon.cocoa import signature
from core import scanner from core import scanner
from core.app_cocoa_inter import PyDupeGuruBase, PyDetailsPanel from core.app_cocoa_inter import PyDupeGuruBase, PyDetailsPanel

View File

@ -15,11 +15,11 @@ import subprocess
import re import re
from send2trash import send2trash from send2trash import send2trash
from hscommon.reg import RegistrableApplication, RegistrationRequired
from hscommon.notify import Broadcaster
from hsutil import io, files from hsutil import io, files
from hsutil.path import Path from hsutil.path import Path
from hsutil.reg import RegistrableApplication, RegistrationRequired
from hsutil.misc import flatten, first from hsutil.misc import flatten, first
from hsutil.notify import Broadcaster
from hsutil.str import escape from hsutil.str import escape
from . import directories, results, scanner, export, fs from . import directories, results, scanner, export, fs

View File

@ -9,12 +9,12 @@
import logging import logging
import os.path as op import os.path as op
from hsutil import cocoa, job from hscommon import cocoa, job
from hsutil.cocoa import install_exception_hook from hscommon.cocoa import install_exception_hook
from hsutil.cocoa.objcmin import (NSNotificationCenter, NSUserDefaults, from hscommon.cocoa.objcmin import (NSNotificationCenter, NSUserDefaults,
NSSearchPathForDirectoriesInDomains, NSApplicationSupportDirectory, NSUserDomainMask, NSSearchPathForDirectoriesInDomains, NSApplicationSupportDirectory, NSUserDomainMask,
NSWorkspace) NSWorkspace)
from hsutil.reg import RegistrationRequired from hscommon.reg import RegistrationRequired
from . import app from . import app

View File

@ -9,7 +9,7 @@
# Common interface for all editions' dg_cocoa unit. # 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.details_panel import DetailsPanel
from .gui.directory_tree import DirectoryTree from .gui.directory_tree import DirectoryTree

View File

@ -16,7 +16,7 @@ from unicodedata import normalize
from hsutil.misc import flatten from hsutil.misc import flatten
from hsutil.str import multi_replace from hsutil.str import multi_replace
from hsutil import job from hscommon import job
(WEIGHT_WORDS, (WEIGHT_WORDS,
MATCH_SIMILAR_WORDS, MATCH_SIMILAR_WORDS,

View File

@ -7,7 +7,7 @@
# which should be included with this package. The terms are also available at # which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/hs_license # http://www.hardcoded.net/licenses/hs_license
from hsutil.notify import Listener from hscommon.notify import Listener
class GUIObject(Listener): class GUIObject(Listener):
def __init__(self, view, app): def __init__(self, view, app):

View File

@ -7,7 +7,7 @@
# which should be included with this package. The terms are also available at # which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/hs_license # http://www.hardcoded.net/licenses/hs_license
from hsutil.notify import Broadcaster from hscommon.notify import Broadcaster
from .base import GUIObject from .base import GUIObject

View File

@ -7,7 +7,7 @@
# which should be included with this package. The terms are also available at # which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/hs_license # http://www.hardcoded.net/licenses/hs_license
from hsutil.notify import Listener from hscommon.notify import Listener
from hsgui.table import GUITable, Row from hsgui.table import GUITable, Row
class ProblemTable(GUITable, Listener): class ProblemTable(GUITable, Listener):

View File

@ -11,8 +11,8 @@ import re
from lxml import etree from lxml import etree
from . import engine from . import engine
from hsutil.job import nulljob from hscommon.job import nulljob
from hsutil.markable import Markable from hscommon.markable import Markable
from hsutil.misc import flatten, nonone from hsutil.misc import flatten, nonone
from hsutil.str import format_size from hsutil.str import format_size
from hsutil.files import FileOrPath from hsutil.files import FileOrPath

View File

@ -9,7 +9,8 @@
import logging import logging
from hsutil import job, io from hscommon import job
from hsutil import io
from hsutil.misc import dedupe from hsutil.misc import dedupe
from hsutil.str import get_file_ext, rem_file_ext from hsutil.str import get_file_ext, rem_file_ext

View File

@ -16,7 +16,7 @@ from hsutil import io
from hsutil.path import Path from hsutil.path import Path
from hsutil.decorators import log_calls from hsutil.decorators import log_calls
import hsutil.files import hsutil.files
from hsutil.job import nulljob from hscommon.job import nulljob
from . import data from . import data
from .results_test import GetTestGroups from .results_test import GetTestGroups

View File

@ -10,7 +10,7 @@ import sys
from nose.tools import eq_ from nose.tools import eq_
from hsutil import job from hscommon import job
from hsutil.decorators import log_calls from hsutil.decorators import log_calls
from hsutil.misc import first from hsutil.misc import first
from hsutil.testcase import TestCase from hsutil.testcase import TestCase

View File

@ -8,7 +8,8 @@
from nose.tools import eq_ 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.path import Path
from hsutil.testcase import TestCase from hsutil.testcase import TestCase

View File

@ -10,7 +10,7 @@ import logging
from appscript import app, k, CommandError from appscript import app, k, CommandError
import time import time
from hsutil.cocoa import as_fetch from hscommon.cocoa import as_fetch
from core.app_cocoa import JOBID2TITLE, DupeGuru as DupeGuruBase from core.app_cocoa import JOBID2TITLE, DupeGuru as DupeGuruBase

View File

@ -7,7 +7,7 @@
# which should be included with this package. The terms are also available at # which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/hs_license # 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 hsutil.str import get_file_ext
from core import fs from core import fs

View File

@ -15,8 +15,8 @@ from appscript import app, k, CommandError
from hsutil import io from hsutil import io
from hsutil.str import get_file_ext from hsutil.str import get_file_ext
from hsutil.path import Path from hsutil.path import Path
from hsutil.cocoa import as_fetch from hscommon.cocoa import as_fetch
from hsutil.cocoa.objcmin import NSUserDefaults, NSURL from hscommon.cocoa.objcmin import NSUserDefaults, NSURL
from core import fs from core import fs
from core import app_cocoa, directories from core import app_cocoa, directories

View File

@ -10,7 +10,7 @@ import logging
import multiprocessing import multiprocessing
from collections import defaultdict, deque from collections import defaultdict, deque
from hsutil import job from hscommon import job
from core.engine import Match from core.engine import Match
from .block import avgdiff, DifferentBlockCountError, NoBlocksError from .block import avgdiff, DifferentBlockCountError, NoBlocksError

View File

@ -12,7 +12,7 @@ import logging
from hsutil import io from hsutil import io
from hsutil.path import Path from hsutil.path import Path
from hsutil.cocoa.objcmin import NSWorkspace from hscommon.cocoa.objcmin import NSWorkspace
from core import fs from core import fs
from core.app_cocoa import DupeGuru as DupeGuruBase from core.app_cocoa import DupeGuru as DupeGuruBase

View File

@ -15,7 +15,7 @@ import shutil
import yaml 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) build_debian_changelog, copy_qt_plugins)
def package_cocoa(edition): def package_cocoa(edition):
@ -84,11 +84,9 @@ def package_debian(edition):
help_src = ed('help_{0}') help_src = ed('help_{0}')
os.makedirs(destpath) os.makedirs(destpath)
shutil.copytree(ed('qt/{0}'), srcpath) shutil.copytree(ed('qt/{0}'), srcpath)
packages = ['hsutil', 'hsgui', 'core', ed('core_{0}'), 'qtlib', 'qt/base'] packages = ['hscommon', 'hsgui', 'core', ed('core_{0}'), 'qtlib', 'qt/base']
if edition == 'me':
packages.append('hsmedia')
copy_packages(packages, srcpath) 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 import send2trash
pkg_path = op.dirname(send2trash.__file__) pkg_path = op.dirname(send2trash.__file__)
shutil.copytree(pkg_path, op.join(srcpath, 'send2trash')) shutil.copytree(pkg_path, op.join(srcpath, 'send2trash'))

View File

@ -16,7 +16,7 @@ from PyQt4.QtCore import QTimer, QObject, QCoreApplication, QUrl, SIGNAL
from PyQt4.QtGui import QDesktopServices, QFileDialog, QDialog, QMessageBox from PyQt4.QtGui import QDesktopServices, QFileDialog, QDialog, QMessageBox
from hsutil import job 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 from core.app import DupeGuru as DupeGuruBase, JOB_SCAN, JOB_LOAD, JOB_MOVE, JOB_COPY, JOB_DELETE

2
run.py
View File

@ -13,7 +13,7 @@ import os.path as op
import yaml import yaml
from hsutil.build import add_to_pythonpath from hscommon.build import add_to_pythonpath
def main(): def main():
conf = yaml.load(open('conf.yaml')) conf = yaml.load(open('conf.yaml'))