version 0.2.7, plugin system, multiuser plugin for zeroproxies, reworked imports, cookie parse, stats moved to plugin, usermanager class, dont generate site auth on listing, multiline notifications, allow server side prompt from user, update script keep plugins disabled status
This commit is contained in:
parent
3b8d49207e
commit
78f97dcbe8
26 changed files with 789 additions and 308 deletions
26
update.py
26
update.py
|
@ -16,15 +16,41 @@ def update():
|
|||
if not buff: break
|
||||
data.write(buff)
|
||||
print ".",
|
||||
print "Downloaded."
|
||||
|
||||
# Checking plugins
|
||||
plugins_enabled = []
|
||||
plugins_disabled = []
|
||||
if os.path.isdir("plugins"):
|
||||
for dir in os.listdir("plugins"):
|
||||
if dir.startswith("disabled-"):
|
||||
plugins_disabled.append(dir.replace("disabled-", ""))
|
||||
else:
|
||||
plugins_enabled.append(dir)
|
||||
print "Plugins:", plugins_enabled, plugins_disabled
|
||||
|
||||
|
||||
print "Extracting...",
|
||||
zip = zipfile.ZipFile(data)
|
||||
for inner_path in zip.namelist():
|
||||
inner_path = inner_path.replace("\\", "/") # Make sure we have unix path
|
||||
print ".",
|
||||
dest_path = inner_path.replace("ZeroNet-master/", "")
|
||||
if not dest_path: continue
|
||||
|
||||
|
||||
# Keep plugin disabled/enabled status
|
||||
match = re.match("plugins/([^/]+)", dest_path)
|
||||
if match:
|
||||
plugin_name = match.group(1).replace("disabled-","")
|
||||
if plugin_name in plugins_enabled: # Plugin was enabled
|
||||
dest_path = dest_path.replace("plugins/disabled-"+plugin_name, "plugins/"+plugin_name)
|
||||
else: # Plugin was disabled
|
||||
dest_path = dest_path.replace("plugins/"+plugin_name, "plugins/disabled-"+plugin_name)
|
||||
print "P",
|
||||
|
||||
dest_dir = os.path.dirname(dest_path)
|
||||
|
||||
if dest_dir and not os.path.isdir(dest_dir):
|
||||
os.makedirs(dest_dir)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue