2015-01-12 19:11:35 +01:00
|
|
|
#!/usr/bin/env python
|
2015-01-12 02:03:45 +01:00
|
|
|
|
2015-01-26 20:09:49 +01:00
|
|
|
def main():
|
2015-03-19 21:19:14 +01:00
|
|
|
print " - Starging ZeroNet..."
|
2015-02-20 01:37:12 +01:00
|
|
|
try:
|
|
|
|
from src import main
|
|
|
|
main.start()
|
|
|
|
if main.update_after_shutdown: # Updater
|
|
|
|
import update, sys, os, gc
|
|
|
|
# Update
|
|
|
|
update.update()
|
|
|
|
|
|
|
|
# Close log files
|
|
|
|
logger = sys.modules["src.main"].logging.getLogger()
|
|
|
|
|
|
|
|
for handler in logger.handlers[:]:
|
|
|
|
handler.flush()
|
|
|
|
handler.close()
|
|
|
|
logger.removeHandler(handler)
|
|
|
|
|
|
|
|
except Exception, err: # Prevent closing
|
|
|
|
import traceback
|
|
|
|
traceback.print_exc()
|
|
|
|
raw_input("-- Error happened, press enter to close --")
|
|
|
|
|
|
|
|
if main.update_after_shutdown: # Updater
|
|
|
|
# Restart
|
|
|
|
gc.collect() # Garbage collect
|
|
|
|
print "Restarting..."
|
|
|
|
args = sys.argv[:]
|
|
|
|
args.insert(0, sys.executable)
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
args = ['"%s"' % arg for arg in args]
|
|
|
|
os.execv(sys.executable, args)
|
|
|
|
print "Bye."
|
2015-01-26 20:09:49 +01:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2015-02-20 01:37:12 +01:00
|
|
|
main()
|
version 0.2.4, peerPing and peerGetFile commands, old content update bugfix, new network code and protocol, connection share between sites, connection reuse, dont retry bad file more than 3 times in 20 min, multi threaded include file download, shuffle peers before publish, simple internal stats page, dont retry on failed peers, more than 10 peers publish bugfix
2015-02-23 23:33:31 +01:00
|
|
|
|