rev126, Renamed disable_openssl to use_openssl, Renamed modified Peer command to listModified
This commit is contained in:
parent
099fe575a0
commit
34b7cb0292
5 changed files with 15 additions and 8 deletions
|
@ -4,7 +4,7 @@ import ConfigParser
|
|||
class Config(object):
|
||||
def __init__(self):
|
||||
self.version = "0.2.9"
|
||||
self.rev = 125
|
||||
self.rev = 126
|
||||
self.parser = self.createArguments()
|
||||
argv = sys.argv[:] # Copy command line arguments
|
||||
argv = self.parseConfig(argv) # Add arguments from config file
|
||||
|
@ -29,9 +29,9 @@ class Config(object):
|
|||
else:
|
||||
coffeescript = None
|
||||
if sys.platform.startswith("Darwin"): # For some reasons openssl doesnt works on mac yet (https://github.com/HelloZeroNet/ZeroNet/issues/94)
|
||||
disable_openssl = True
|
||||
use_openssl = False
|
||||
else:
|
||||
disable_openssl = False
|
||||
use_openssl = True
|
||||
|
||||
# Create parser
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
|
@ -105,9 +105,9 @@ class Config(object):
|
|||
parser.add_argument('--fileserver_ip', help='FileServer bind address', default="*", metavar='ip')
|
||||
parser.add_argument('--fileserver_port',help='FileServer bind port', default=15441, type=int, metavar='port')
|
||||
parser.add_argument('--disable_zeromq', help='Disable compatibility with old clients', action='store_true')
|
||||
parser.add_argument('--disable_openssl',help='Disable usage of OpenSSL liblary', type='bool', choices=[True, False], default=disable_openssl)
|
||||
parser.add_argument('--disable_udp', help='Disable UDP connections', action='store_true')
|
||||
parser.add_argument('--proxy', help='Socks proxy address', metavar='ip:port')
|
||||
parser.add_argument('--use_openssl', help='Use OpenSSL liblary for speedup', type='bool', choices=[True, False], default=use_openssl)
|
||||
parser.add_argument('--ip_external', help='External ip (tested on start if None)', metavar='ip')
|
||||
|
||||
parser.add_argument('--coffeescript_compiler', help='Coffeescript compiler for developing', default=coffeescript, metavar='executable_path')
|
||||
|
|
|
@ -5,7 +5,7 @@ from Config import config
|
|||
|
||||
# Try to load openssl
|
||||
try:
|
||||
if config.disable_openssl: raise Exception("Disabled by config")
|
||||
if not config.use_openssl: raise Exception("Disabled by config")
|
||||
from lib.opensslVerify import opensslVerify
|
||||
logging.info("OpenSSL loaded, version: %s" % opensslVerify.openssl_version)
|
||||
except Exception, err:
|
||||
|
|
|
@ -55,8 +55,8 @@ class FileRequest(object):
|
|||
|
||||
elif cmd == "pex":
|
||||
self.actionPex(params)
|
||||
elif cmd == "modified":
|
||||
self.actionModified(params)
|
||||
elif cmd == "listModified":
|
||||
self.actionListModified(params)
|
||||
elif cmd == "ping":
|
||||
self.actionPing()
|
||||
else:
|
||||
|
@ -163,7 +163,7 @@ class FileRequest(object):
|
|||
|
||||
|
||||
# Get modified content.json files since
|
||||
def actionModified(self, params):
|
||||
def actionListModified(self, params):
|
||||
site = self.sites.get(params["site"])
|
||||
if not site or not site.settings["serving"]: # Site unknown or not serving
|
||||
self.response({"error": "Unknown site"})
|
||||
|
|
|
@ -171,6 +171,13 @@ class Peer(object):
|
|||
return added
|
||||
|
||||
|
||||
# List modified files since the date
|
||||
# Return: {inner_path: modification date,...}
|
||||
def listModified(self, since):
|
||||
response = self.request("listModified", {"since": since})
|
||||
return response
|
||||
|
||||
|
||||
# Stop and remove from site
|
||||
def remove(self):
|
||||
self.log("Removing peer...Connection error: %s, Hash failed: %s" % (self.connection_error, self.hash_failed))
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue