diff --git a/files/rsync-queue b/files/rsync-queue index 1916dbe..e8bfa49 100755 --- a/files/rsync-queue +++ b/files/rsync-queue @@ -1,4 +1,5 @@ #!/usr/bin/python +# coding=UTF-8 import sys import os,time,datetime import sqlite3 @@ -115,7 +116,7 @@ def start_sync(options): (SRC,TGT)=sync if not SRC: return - print("Starting: #%d %s -> %s"%(i+1,SRC,TGT)) + print("Starting: #%d %s ─▶ %s"%(i+1,SRC,TGT)) syncopts=shlex.split(options.options) command=['rsync'] command.extend(syncopts) @@ -129,7 +130,7 @@ def start_sync(options): if '\n' in line: j+=1 if j%50==0: - line=line.replace("\n","\n#%d %s -> %s\n"%(i+1,SRC,TGT),1) + line=line.replace("\n","\n#%d/%d %s ─▶ %s\n"%(i+1,len(sync_list),SRC,TGT),1) j=1 sys.stdout.write(line) sys.stdout.flush() @@ -142,8 +143,8 @@ def start_sync(options): lines_iterator = iter(popen.stderr.readline, b"") for line in lines_iterator: sys.stdout.write(line) - print("FAILED: EC: %d, %s -> %s"%(popen.returncode,SRC,TGT)) - print("Finished: #%d %s -> %s"%(i+1,SRC,TGT)) + print("FAILED: EC: %d, %s ─▶ %s"%(popen.returncode,SRC,TGT)) + print("Finished: #%d %s ─▶ %s"%(i+1,SRC,TGT)) def main(): options=setup_options(); @@ -151,7 +152,7 @@ def main(): if not os.path.exists(options.sqlfile): createdb(options.sqlfile); if options.SRC!='' and options.TGT!='': - print("Adding: %s -> %s"%(options.SRC,options.TGT)) + print("Adding: %s ─▶ %s"%(options.SRC,options.TGT)) add(options) if options.clear: print("Clearing database") diff --git a/reporting/ansi.py b/reporting/ansi.py index 841ccb9..0d46c26 100644 --- a/reporting/ansi.py +++ b/reporting/ansi.py @@ -98,3 +98,6 @@ class code: return self.custom_match.sub('\033[\\2',s) def custom_nocolor(self,s): return self.custom_match.sub('',s) + + def get_keys(self): + return self.color_keys diff --git a/reporting/md_color.py b/reporting/md_color.py index 0b64904..793f5f0 100755 --- a/reporting/md_color.py +++ b/reporting/md_color.py @@ -11,14 +11,15 @@ __version__ = "0.2" ''' Rules modified from mistune project ''' def setup_options(): + bc=ansi.code() ''' Create command line options ''' usage=''' Markdown syntax color in ansi codes. Special syntaxes: - * Colors: insert string ${C}, where C is one of KRGBYMCWkrgbymcwSUZ - * Any ANSI control code: ${3A}, ${1;34;42m}, etc.. +Colors: insert string ${C}, where C is one of %s. +Any ANSI control code: ${3A}, ${1;34;42m}, etc.. -''' +'''%(" ".join(bc.get_keys())) parser=ArgumentParser(description=usage, epilog=__author__) diff --git a/reporting/src2ans b/reporting/src2ans index 261c778..2da80c8 100755 --- a/reporting/src2ans +++ b/reporting/src2ans @@ -32,9 +32,9 @@ def setup_options(): usage=''' Color notation renderer in ANSI codes Special syntaxes: - * Colors: insert string ${C}, where C is one of KRGBYMCWkrgbymcwSUZ + * Colors: insert string ${X}, where X is one of %s. -''' +'''%(" ".join(bc.get_keys())) parser=ArgumentParser(description=usage, formatter_class=argparse.RawDescriptionHelpFormatter,