From 6888cf95ec11e9bb2641555984d75833dd4bfd8c Mon Sep 17 00:00:00 2001 From: Bruce Eckel Date: Sun, 10 May 2015 18:41:41 -0700 Subject: [PATCH] moved ruler to betools --- Validate.py | 24 ++------------------ betools/__init__.py | 3 ++- betools/__pycache__/__init__.cpython-34.pyc | Bin 275 -> 0 bytes betools/__pycache__/cmdline.cpython-34.pyc | Bin 1509 -> 0 bytes betools/__pycache__/visitdir.cpython-34.pyc | Bin 513 -> 0 bytes betools/ruler.py | 18 +++++++++++++++ 6 files changed, 22 insertions(+), 23 deletions(-) delete mode 100644 betools/__pycache__/__init__.cpython-34.pyc delete mode 100644 betools/__pycache__/cmdline.cpython-34.pyc delete mode 100644 betools/__pycache__/visitdir.cpython-34.pyc create mode 100644 betools/ruler.py diff --git a/Validate.py b/Validate.py index fc02e15a..57718dec 100644 --- a/Validate.py +++ b/Validate.py @@ -10,7 +10,7 @@ import textwrap import os, sys, re import difflib from collections import defaultdict -from betools import CmdLine, visitDir +from betools import CmdLine, visitDir, ruler, head ############################################################################### @@ -204,26 +204,6 @@ class OutputTags: return iter(self.tags) -# def path_ends_with(fullPath, partialPath): -# path = list(reversed(fullPath.parts)) -# for i, part in enumerate(reversed(partialPath.parts)): -# if not part is path[i]: -# return False -# return True - -# Path.ends_with = path_ends_with # extension method to Path - -def ruler(arg=None, sep="_", print_=False, width=60): - if arg: - result = "[ {} ]".format(str(arg)).center(width, sep) + "\n" - else: - result = "".center(width, sep) + "\n" - if print_: - print(result) - else: - return result - -def head(arg=None, sep="_", width=60): ruler(arg, sep, True, width) class Result: """ @@ -317,7 +297,7 @@ def discoverOutputTags(): @CmdLine("f", "fillin") def fillInUnexcludedOutput(): """ - Find the files that aren't explicitly excluded AND have no OUTPUT:, show them and their output. + Find the files that aren't explicitly excluded AND have no 'Output:'. Show them and their output. """ results = [r for r in [Result.create(jfp) for jfp in RunFiles.base.rglob("*.java")] if r] assert len(results), "Must run runall.ps1 first" diff --git a/betools/__init__.py b/betools/__init__.py index 1067dd2e..2aedbf63 100644 --- a/betools/__init__.py +++ b/betools/__init__.py @@ -1,5 +1,6 @@ # https://github.com/pypa/sampleproject/blob/master/setup.py -__all__ = ["CmdLine", "visitDir"] +__all__ = ["CmdLine", "visitDir", "ruler", "head"] from betools.cmdline import CmdLine from betools.visitdir import visitDir +from betools.ruler import ruler, head diff --git a/betools/__pycache__/__init__.cpython-34.pyc b/betools/__pycache__/__init__.cpython-34.pyc deleted file mode 100644 index 007a58c767ad1910ca385fdc1b86f1c600a0c14e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 275 zcmaFI!^UJ1 zdW$_iJ~1aJK0b;+DYYa&Kc`qPIX5K-s1vL(N&qGbHYO#rs0gHSB|{M_kOC9G%$==b zLW@(2iesFLN|RG#T#E7wlJYBJ;^RX+y-ajdlk)SkW1z+W1vB$9OXB183My}L*yQG? Tl;)(`F$2viW&sjBi~@`RVr)as diff --git a/betools/__pycache__/cmdline.cpython-34.pyc b/betools/__pycache__/cmdline.cpython-34.pyc deleted file mode 100644 index c9fe20b8869f970836a972cf24fda068052a5837..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1509 zcmaJ>UvJz*5TCVu_Qi2R3W5lg2fqNas=HKG_@k=)DLKj?p@5WDAnVY|u{SwiY_Ge! z*DI&wh43Z#2)yxm{K^wAe1J+w%&hO)A|ck^+1Z_$-TnP$?7yO&@b6#0ee}Br@CUrq zT+~0st`igmK#Gz<;XuV8W$;DeLgB$Lxaz^R1F1u{lVq^E3MV3$Dl<~WSyAXXiyN_w zb6M9}Q;e#z5wUDdDVrGQF)n830=?9En<*{E;fWCO%$WA>!NGF59B0aubvDNMgQYmF zd@6u<1642#Ns|K4HH`E_R>@5cseQj_TqYM3>Wn)M#|DA7R&1 z6qgQM0&rBARZu!$9GJUs5r7_n@#t9G^=C9OYZ_S7m)7L0O%yVKxlcam%n;5=;vTQw zo-Ep`%rhf4bQ7(MS~MnJN>#*XRd%jd@BW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