bug 1361037, unsupport compare-dirs, r=flod
authorAxel Hecht <axel@pike.org>
Mon, 01 May 2017 17:23:05 +0200
changeset 219 402b3a8246cdc5c53a887379d252c22b099a7d62
parent 218 3cccc81dc8dc926cd4abf61218e70bce1f52ae0a
child 220 c6f6afe9a93898d66606889d5aa1a42aa580240d
push id47
push useraxel@mozilla.com
push dateFri, 19 May 2017 17:46:33 +0000
reviewersflod
bugs1361037
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
compare_locales/commands.py
compare_locales/compare.py
setup.py
--- 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')