misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
cf146a54ee
commit
3f785ee06a
@ -168,10 +168,11 @@ class Handler(BaseHTTPRequestHandler):
|
|||||||
self._image()
|
self._image()
|
||||||
|
|
||||||
elif self.path.startswith('/plugins'):
|
elif self.path.startswith('/plugins'):
|
||||||
plugin_from_path = re.match(r'\/plugins\/([^\/]+)(\/.*)?', self.path)
|
matches = re.match(r'\/plugins\/([^\/]+)(\/.*)?', self.path)
|
||||||
if plugin_from_path:
|
if matches:
|
||||||
plugin_name = plugin_from_path.groups()[0]
|
groups = matches.groups()
|
||||||
right_path = plugin_from_path.groups()[1] if len(plugin_from_path.groups()) == 2 else None
|
plugin_name = groups[0]
|
||||||
|
right_path = groups[1] if len(groups) == 2 else None
|
||||||
plugins.one(plugin_name, 'webhook', right_path)
|
plugins.one(plugin_name, 'webhook', right_path)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user