mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] autopep8
This commit is contained in:
parent
5fc5d3b6ca
commit
b754bdef53
1 changed files with 16 additions and 12 deletions
|
@ -49,8 +49,10 @@ def hook_add(app, file):
|
||||||
path, filename = os.path.split(file)
|
path, filename = os.path.split(file)
|
||||||
priority, action = _extract_filename_parts(filename)
|
priority, action = _extract_filename_parts(filename)
|
||||||
|
|
||||||
try: os.listdir(custom_hook_folder + action)
|
try:
|
||||||
except OSError: os.makedirs(custom_hook_folder + action)
|
os.listdir(custom_hook_folder + action)
|
||||||
|
except OSError:
|
||||||
|
os.makedirs(custom_hook_folder + action)
|
||||||
|
|
||||||
finalpath = custom_hook_folder + action + '/' + priority + '-' + app
|
finalpath = custom_hook_folder + action + '/' + priority + '-' + app
|
||||||
os.system('cp %s %s' % (file, finalpath))
|
os.system('cp %s %s' % (file, finalpath))
|
||||||
|
@ -72,7 +74,8 @@ def hook_remove(app):
|
||||||
for script in os.listdir(custom_hook_folder + action):
|
for script in os.listdir(custom_hook_folder + action):
|
||||||
if script.endswith(app):
|
if script.endswith(app):
|
||||||
os.remove(custom_hook_folder + action + '/' + script)
|
os.remove(custom_hook_folder + action + '/' + script)
|
||||||
except OSError: pass
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def hook_info(action, name):
|
def hook_info(action, name):
|
||||||
|
@ -164,6 +167,7 @@ def hook_list(action, list_by='name', show_info=False):
|
||||||
else:
|
else:
|
||||||
if list_by == 'name':
|
if list_by == 'name':
|
||||||
result = set()
|
result = set()
|
||||||
|
|
||||||
def _append_hook(d, priority, name, path):
|
def _append_hook(d, priority, name, path):
|
||||||
# Add only the name
|
# Add only the name
|
||||||
d.add(name)
|
d.add(name)
|
||||||
|
|
Loading…
Add table
Reference in a new issue