From 59e0a22ed3397238f13909793a0f3cdf8eb27da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Fri, 2 Dec 2016 10:15:46 +0800 Subject: [PATCH] Added the "Everything is in sync" message instead of nothing when everything is in sync. --- oobsync.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/oobsync.py b/oobsync.py index 6657827..da22d52 100755 --- a/oobsync.py +++ b/oobsync.py @@ -130,6 +130,7 @@ def read_in_source_dir(projdir): def update_source_dir(projdir, modules): """ Updates the source macros. """ curmods = {} + is_in_sync = True for entry in os.listdir(projdir): path = os.path.join(projdir, entry) if os.path.isfile(path) and entry.lower().endswith(".vb"): @@ -142,6 +143,7 @@ def update_source_dir(projdir, modules): f.write(modules[modname]) f.close() print >> sys.stderr, modname + ".vb added." + is_in_sync = False else: path = os.path.join(projdir, curmods[modname]) f = open(path, "r+") @@ -149,12 +151,16 @@ def update_source_dir(projdir, modules): f.seek(0) f.write(modules[modname]) print >> sys.stderr, curmods[modname] + " updated." + is_in_sync = False f.close() for modname in sorted(curmods.keys()): if modname not in modules: path = os.path.join(projdir, curmods[modname]) os.remove(path) print >> sys.stderr, curmods[modname] + " removed." + is_in_sync = False + if is_in_sync: + print >> sys.stderr, "Everything is in sync." return @@ -197,6 +203,8 @@ def update_basic_modules(libraries, libname, modules, oo): print >> sys.stderr, "Module " + modname + " removed." if libraries.isModified(): libraries.storeLibraries() + else: + print >> sys.stderr, "Everything is in sync." return