refined work of previous commit
This commit is contained in:
		
							
								
								
									
										10
									
								
								coub-dl.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								coub-dl.py
									
									
									
									
									
								
							| @@ -32,15 +32,15 @@ class File(Enum): | |||||||
|     FRACTION = 3 |     FRACTION = 3 | ||||||
|     OUTPUT = 4 |     OUTPUT = 4 | ||||||
|  |  | ||||||
| def call_verbose(before_message=''): | def call_verbose(before_message='', after_message='Done!'): | ||||||
|     def wrap(f): |     def tag(f): | ||||||
|         @wraps(f) |         @wraps(f) | ||||||
|         def wrapper(*args, **kwargs): |         def wrapper(*args, **kwargs): | ||||||
|             print_opt(before_message+' ', end='', flush=True) |             print_opt(before_message, end='', flush=True) | ||||||
|             f(*args, **kwargs) |             f(*args, **kwargs) | ||||||
|             print_opt('Done!') |             print_opt(after_message) | ||||||
|         return wrapper |         return wrapper | ||||||
|     return wrap |     return tag | ||||||
|  |  | ||||||
| def print_opt(*args, **kwargs): | def print_opt(*args, **kwargs): | ||||||
|     if VERBOSE: |     if VERBOSE: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user