[mod] autopep8

This commit is contained in:
Laurent Peuch 2016-05-13 04:27:26 +02:00
parent 5fc5d3b6ca
commit b754bdef53

View file

@ -49,8 +49,10 @@ def hook_add(app, file):
path, filename = os.path.split(file)
priority, action = _extract_filename_parts(filename)
try: os.listdir(custom_hook_folder + action)
except OSError: os.makedirs(custom_hook_folder + action)
try:
os.listdir(custom_hook_folder + action)
except OSError:
os.makedirs(custom_hook_folder + action)
finalpath = custom_hook_folder + action + '/' + priority + '-' + app
os.system('cp %s %s' % (file, finalpath))
@ -72,7 +74,8 @@ def hook_remove(app):
for script in os.listdir(custom_hook_folder + action):
if script.endswith(app):
os.remove(custom_hook_folder + action + '/' + script)
except OSError: pass
except OSError:
pass
def hook_info(action, name):
@ -164,6 +167,7 @@ def hook_list(action, list_by='name', show_info=False):
else:
if list_by == 'name':
result = set()
def _append_hook(d, priority, name, path):
# Add only the name
d.add(name)