bug 1361037, unsupport compare-dirs, r=flod
We'll add back support for simple "all files for locale are here"
directories in some other way. Remove the old way for now.
MozReview-Commit-ID: 951JpiZb5Mq
--- a/compare_locales/commands.py
+++ b/compare_locales/commands.py
@@ -4,17 +4,17 @@
'Commands exposed to commandlines'
import logging
from argparse import ArgumentParser
from compare_locales import version
from compare_locales.paths import EnumerateApp
-from compare_locales.compare import compareApp, compareDirs
+from compare_locales.compare import compareApp
class BaseCommand(object):
"""Base class for compare-locales commands.
This handles command line parsing, and general sugar for setuptools
entry_points.
"""
@@ -109,26 +109,8 @@ Be careful to specify the right merge di
app.reference = args.reference
try:
observer = compareApp(app, merge_stage=args.merge,
clobber=args.clobber)
except (OSError, IOError), exc:
print "FAIL: " + str(exc)
self.parser.exit(2)
return observer
-
-
-class CompareDirs(BaseCommand):
- """Check the localization status of a directory tree.
-The first argument is a path to the reference data,the second is the
-localization to be tested."""
-
- def get_parser(self):
- parser = super(CompareDirs, self).get_parser()
- parser.add_argument('reference')
- parser.add_argument('localization')
- self.add_data_argument(parser)
- return parser
-
- def handle(self, args):
- observer = compareDirs(args.reference, args.localization,
- merge_stage=args.merge)
- return observer
--- a/compare_locales/compare.py
+++ b/compare_locales/compare.py
@@ -607,26 +607,8 @@ def compareApp(app, other_observer=None,
if clobber:
# if clobber, remove the stage for the module if it exists
clobberdir = os.path.join(locale_merge, module)
if os.path.exists(clobberdir):
shutil.rmtree(clobberdir)
print "clobbered " + clobberdir
dir_comp.compareWith(localization)
return comparer.observer
-
-
-def compareDirs(reference, locale, other_observer=None, merge_stage=None):
- '''Compare reference and locale dir.
-
- Optional arguments are:
- - other_observer. A object implementing
- notify(category, _file, data)
- The return values of that callback are ignored.
- '''
- comparer = ContentComparer()
- if other_observer is not None:
- comparer.add_observer(other_observer)
- comparer.set_merge_stage(merge_stage)
- dir_comp = DirectoryCompare(paths.EnumerateDir(reference))
- dir_comp.setWatcher(comparer)
- dir_comp.compareWith(paths.EnumerateDir(locale))
- return comparer.observer
--- a/setup.py
+++ b/setup.py
@@ -34,15 +34,14 @@ setup(name="compare-locales",
author="Axel Hecht",
author_email="axel@mozilla.com",
description=DOCSTRINGS[0],
long_description="\n".join(DOCSTRINGS[2:]),
license="MPL 2.0",
classifiers=CLASSIFIERS.split("\n"),
platforms=["any"],
entry_points={'console_scripts': [
- 'compare-locales = compare_locales.commands:CompareLocales.call',
- 'compare-dirs = compare_locales.commands:CompareDirs.call']},
+ 'compare-locales = compare_locales.commands:CompareLocales.call']},
packages=['compare_locales', 'compare_locales.tests'],
package_data={
'compare_locales.tests': ['data/*.properties', 'data/*.dtd']
},
test_suite='compare_locales.tests')