File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111setup (
1212 name = "watch_path" ,
13- version = "0.0.7 " ,
13+ version = "0.0.8 " ,
1414 author = "S0AndS0" ,
1515 author_email = "[email protected] " ,
1616 description = "Simple wrapper for `os.stat`, calls callback function time-stamp changes" ,
2020 packages = find_packages (),
2121 entry_points = {
2222 'console_scripts' : [
23- 'watch_path = watch_path.cli'
23+ 'watch_path = watch_path.cli:main '
2424 ],
2525 },
2626 classifiers = [
Original file line number Diff line number Diff line change @@ -91,19 +91,23 @@ def subprocess_callback(**kwargs):
9191decode = args .get ('decode' )
9292
9393
94- try :
95- for callback_results in path_watcher :
96- if callback_results :
97- if args .get ('verbose' ) > 0 :
98- print ("callback_results['returncode'] ->" , callback_results ['returncode' ])
99- print ("callback_results['stdout']..." )
100-
101- if decode :
102- print (callback_results ['stdout' ].decode (decode ))
103- else :
104- print (callback_results ['stdout' ])
105-
106- sleep (args .get ('sleep' , 1.0 ))
107-
108- except KeyboardInterrupt :
109- print ('Stopping watcher and exiting...' )
94+ def main (args ):
95+ try :
96+ for callback_results in path_watcher :
97+ if callback_results :
98+ if args .get ('verbose' ) > 0 :
99+ print ("callback_results['returncode'] ->" , callback_results ['returncode' ])
100+ print ("callback_results['stdout']..." )
101+
102+ if decode :
103+ print (callback_results ['stdout' ].decode (decode ))
104+ else :
105+ print (callback_results ['stdout' ])
106+
107+ sleep (args .get ('sleep' , 1.0 ))
108+
109+ except KeyboardInterrupt :
110+ print ('Stopping watcher and exiting...' )
111+
112+
113+ main (args )
You can’t perform that action at this time.
0 commit comments