@@ -2242,15 +2242,16 @@ def run(self, func, text_errors=False):
2242
2242
# Call workflow's entry function/method within a try-except block
2243
2243
# to catch any errors and display an error message in Alfred
2244
2244
try :
2245
-
2246
2245
if self .version :
2247
- self .logger .debug ('workflow version: %s' , self .version )
2246
+ self .logger .debug ('---------- %s (%s) ----------' ,
2247
+ self .name , self .version )
2248
+ else :
2249
+ self .logger .debug ('---------- %s ----------' , self .name )
2248
2250
2249
2251
# Run update check if configured for self-updates.
2250
2252
# This call has to go in the `run` try-except block, as it will
2251
2253
# initialise `self.settings`, which will raise an exception
2252
2254
# if `settings.json` isn't valid.
2253
-
2254
2255
if self ._update_settings :
2255
2256
self .check_update ()
2256
2257
@@ -2273,7 +2274,7 @@ def run(self, func, text_errors=False):
2273
2274
self ._items = []
2274
2275
if self ._name :
2275
2276
name = self ._name
2276
- elif self ._bundleid :
2277
+ elif self ._bundleid : # pragma: no cover
2277
2278
name = self ._bundleid
2278
2279
else : # pragma: no cover
2279
2280
name = os .path .dirname (__file__ )
@@ -2284,7 +2285,7 @@ def run(self, func, text_errors=False):
2284
2285
return 1
2285
2286
2286
2287
finally :
2287
- self .logger .debug ('workflow finished in %0.3f seconds ' ,
2288
+ self .logger .debug ('---------- finished in %0.3fs ---------- ' ,
2288
2289
time .time () - start )
2289
2290
2290
2291
return 0
@@ -2522,12 +2523,12 @@ def check_update(self, force=False):
2522
2523
if self .prereleases :
2523
2524
cmd .append ('--prereleases' )
2524
2525
2525
- self .logger .info ('Checking for update ...' )
2526
+ self .logger .info ('checking for update ...' )
2526
2527
2527
2528
run_in_background ('__workflow_update_check' , cmd )
2528
2529
2529
2530
else :
2530
- self .logger .debug ('Update check not due' )
2531
+ self .logger .debug ('update check not due' )
2531
2532
2532
2533
def start_update (self ):
2533
2534
"""Check for update and download and install new workflow file.
@@ -2562,7 +2563,7 @@ def start_update(self):
2562
2563
if self .prereleases :
2563
2564
cmd .append ('--prereleases' )
2564
2565
2565
- self .logger .debug ('Downloading update ...' )
2566
+ self .logger .debug ('downloading update ...' )
2566
2567
run_in_background ('__workflow_update_install' , cmd )
2567
2568
2568
2569
return True
@@ -2596,14 +2597,14 @@ def save_password(self, account, password, service=None):
2596
2597
try :
2597
2598
self ._call_security ('add-generic-password' , service , account ,
2598
2599
'-w' , password )
2599
- self .logger .debug ('Saved password : %s:%s' , service , account )
2600
+ self .logger .debug ('saved password : %s:%s' , service , account )
2600
2601
2601
2602
except PasswordExists :
2602
- self .logger .debug ('Password exists : %s:%s' , service , account )
2603
+ self .logger .debug ('password exists : %s:%s' , service , account )
2603
2604
current_password = self .get_password (account , service )
2604
2605
2605
2606
if current_password == password :
2606
- self .logger .debug ('Password unchanged' )
2607
+ self .logger .debug ('password unchanged' )
2607
2608
2608
2609
else :
2609
2610
self .delete_password (account , service )
@@ -2646,7 +2647,7 @@ def get_password(self, account, service=None):
2646
2647
if h :
2647
2648
password = unicode (binascii .unhexlify (h ), 'utf-8' )
2648
2649
2649
- self .logger .debug ('Got password : %s:%s' , service , account )
2650
+ self .logger .debug ('got password : %s:%s' , service , account )
2650
2651
2651
2652
return password
2652
2653
@@ -2668,7 +2669,7 @@ def delete_password(self, account, service=None):
2668
2669
2669
2670
self ._call_security ('delete-generic-password' , service , account )
2670
2671
2671
- self .logger .debug ('Deleted password : %s:%s' , service , account )
2672
+ self .logger .debug ('deleted password : %s:%s' , service , account )
2672
2673
2673
2674
####################################################################
2674
2675
# Methods for workflow:* magic args
@@ -2812,7 +2813,7 @@ def clear_settings(self):
2812
2813
"""Delete workflow's :attr:`settings_path`."""
2813
2814
if os .path .exists (self .settings_path ):
2814
2815
os .unlink (self .settings_path )
2815
- self .logger .debug ('Deleted : %r' , self .settings_path )
2816
+ self .logger .debug ('deleted : %r' , self .settings_path )
2816
2817
2817
2818
def reset (self ):
2818
2819
"""Delete workflow settings, cache and data.
@@ -2949,7 +2950,7 @@ def _delete_directory_contents(self, dirpath, filter_func):
2949
2950
shutil .rmtree (path )
2950
2951
else :
2951
2952
os .unlink (path )
2952
- self .logger .debug ('Deleted : %r' , path )
2953
+ self .logger .debug ('deleted : %r' , path )
2953
2954
2954
2955
def _load_info_plist (self ):
2955
2956
"""Load workflow info from ``info.plist``."""
0 commit comments