diff --git a/p4Sync.py b/p4Sync.py index fb52b18..113422f 100644 --- a/p4Sync.py +++ b/p4Sync.py @@ -28,7 +28,7 @@ class P4Sync: ( options, args ) = parser.parse_args( args ) directory = normpath( options.directory if options.directory is not None else os.getcwd( ) ) - thread_count = options.thread_count if options.thread_count > 0 else multiprocessing.cpu_count( ) + options.thread_count + thread_count = int(options.thread_count if options.thread_count > 0 else multiprocessing.cpu_count( ) + options.thread_count) with Console( auto_flush_time=1 ) as c: with P4Workspace( directory ): @@ -42,8 +42,6 @@ class P4Sync: ('-f ' if options.force else '') + \ ("--parallel=threads=" + str(thread_count) + " " if thread_count > 1 else '') + \ os.path.join(directory, "...") - c.writeflush(thread_count) - c.writeflush(cmd) subprocess.check_output( cmd, shell=True ) except subprocess.CalledProcessError: pass