mirror of
https://github.com/AsgardEternal/DiscordWhitelist.git
synced 2024-12-28 21:19:14 -06:00
update to include "extgrps" folder in grp name search
This commit is contained in:
parent
c9c4aca402
commit
27359ff29f
@ -1,4 +1,5 @@
|
||||
import http.server
|
||||
import os
|
||||
import socketserver
|
||||
from urllib.parse import urlparse
|
||||
from urllib.parse import parse_qs
|
||||
@ -15,13 +16,19 @@ class serveRA(http.server.SimpleHTTPRequestHandler):
|
||||
query = parse_qs(urlparse(self.path).query)
|
||||
if 'grpName' in query:
|
||||
grpName = query['grpName'][0]
|
||||
grpfile = "./"
|
||||
if os.path.exists(f"./wlgrps/{grpName}.cfg"):
|
||||
grpfile += f"wlgrps/{grpName}.cfg"
|
||||
elif os.path.exists(f"./extgrps/{grpName}.cfg"):
|
||||
grpfile += f"extgrps/{grpName}.cfg"
|
||||
else:
|
||||
print("could not find admins file!", file=stderr)
|
||||
try:
|
||||
file = open(f"./wlgrps/{grpName}.cfg", 'rb')
|
||||
file = open(grpfile, 'rb')
|
||||
self.copyfile(file, self.wfile)
|
||||
file.close()
|
||||
except:
|
||||
print('failed to open file!', file=stderr)
|
||||
return
|
||||
self.copyfile(file, self.wfile)
|
||||
file.close()
|
||||
return
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user