commit f426d485a8554a5065b11003ff6cbbb0a0305023
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2017-12-01T10:37:10Z |
| subject | Removed useless ArgumentRquired class |
commit f426d485a8554a5065b11003ff6cbbb0a0305023
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2017-12-01T10:37:10Z
Removed useless ArgumentRquired class
---
python/reg-rename.py | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/python/reg-rename.py b/python/reg-rename.py
index c48bfcf..43e95d2 100644
--- a/python/reg-rename.py
+++ b/python/reg-rename.py
@@ -29,7 +29,6 @@ parser.add_argument( "-t", action = "store_true", help = "Test without modifying
args = parser.parse_args()
-class ArgumentRequired( Exception ): pass
class InvalidArgument( Exception ): pass
class LevelLogger:
@@ -112,13 +111,14 @@ class RegReplace:
bb = "-\\|/"
bb_i = 0
for root, dirs, files in os.walk( path ):
+ sys.stdout.write( "\n" ) # Move down
+ sys.stdout.write( "\033[K" ) # Clear line
+ sys.stdout.write( "%s ... %s" % ( bb[ bb_i ], root ) )
+
actions = self._compile_actions( root, files )
- sys.stdout.write( "\n" )
- sys.stdout.write( "\033[K" )
- sys.stdout.write( "%s ... %s" % ( bb[ bb_i ], root ) )
- sys.stdout.write("\r")
- sys.stdout.write( "\033[F" )
+ sys.stdout.write("\r") # Goto line start
+ sys.stdout.write( "\033[F" ) # Move up
bb_i = bb_i + 1
if 3 < bb_i:
bb_i = 0
@@ -153,9 +153,6 @@ try:
includes = _compile_re( args.p )
excludes = _compile_re( args.e )
- if not args.d:
- raise ArgumentRequired( "-d" )
-
if args.t:
print( "** Test Mode" )