File tree Expand file tree Collapse file tree 2 files changed +22
-18
lines changed Expand file tree Collapse file tree 2 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 10
10
11
11
setup (
12
12
name = "watch_path" ,
13
- version = "0.0.7 " ,
13
+ version = "0.0.8 " ,
14
14
author = "S0AndS0" ,
15
15
author_email = "StrangerThanBland@gmail.com" ,
16
16
description = "Simple wrapper for `os.stat`, calls callback function time-stamp changes" ,
20
20
packages = find_packages (),
21
21
entry_points = {
22
22
'console_scripts' : [
23
- 'watch_path = watch_path.cli'
23
+ 'watch_path = watch_path.cli:main '
24
24
],
25
25
},
26
26
classifiers = [
Original file line number Diff line number Diff line change @@ -91,19 +91,23 @@ def subprocess_callback(**kwargs):
91
91
decode = args .get ('decode' )
92
92
93
93
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