rev193, Msgpack 0.3.x not supported, Dont display pyfilesystem error
This commit is contained in:
parent
40698c1ac7
commit
e08b153732
3 changed files with 8 additions and 2 deletions
|
@ -4,7 +4,7 @@ import ConfigParser
|
||||||
class Config(object):
|
class Config(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.version = "0.3.0"
|
self.version = "0.3.0"
|
||||||
self.rev = 188
|
self.rev = 193
|
||||||
self.parser = self.createArguments()
|
self.parser = self.createArguments()
|
||||||
argv = sys.argv[:] # Copy command line arguments
|
argv = sys.argv[:] # Copy command line arguments
|
||||||
argv = self.parseConfig(argv) # Add arguments from config file
|
argv = self.parseConfig(argv) # Add arguments from config file
|
||||||
|
|
|
@ -28,6 +28,12 @@ class ConnectionServer:
|
||||||
|
|
||||||
self.peer_id = "-ZN0"+config.version.replace(".", "")+"-"+''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(12)) # Bittorrent style peerid
|
self.peer_id = "-ZN0"+config.version.replace(".", "")+"-"+''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(12)) # Bittorrent style peerid
|
||||||
|
|
||||||
|
# Check msgpack version
|
||||||
|
if msgpack.version[0] == 0 and msgpack.version[1] < 4:
|
||||||
|
self.log.error("Error: Too old msgpack version: %s (>0.4.0 required), please update using `sudo pip install msgpack-python --upgrade`" % str(msgpack.version))
|
||||||
|
import sys
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
if port: # Listen server on a port
|
if port: # Listen server on a port
|
||||||
self.pool = Pool(1000) # do not accept more than 1000 connections
|
self.pool = Pool(1000) # do not accept more than 1000 connections
|
||||||
self.stream_server = StreamServer((ip.replace("*", ""), port), self.handleIncomingConnection, spawn=self.pool, backlog=100)
|
self.stream_server = StreamServer((ip.replace("*", ""), port), self.handleIncomingConnection, spawn=self.pool, backlog=100)
|
||||||
|
|
|
@ -7,8 +7,8 @@ if config.debug: # Only load pyfilesytem if using debug mode
|
||||||
from fs.osfs import OSFS
|
from fs.osfs import OSFS
|
||||||
pyfilesystem = OSFS("src")
|
pyfilesystem = OSFS("src")
|
||||||
pyfilesystem_plugins = OSFS("plugins")
|
pyfilesystem_plugins = OSFS("plugins")
|
||||||
|
logging.debug("Pyfilesystem detected, source code autoreload enabled")
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
logging.debug("%s: For autoreload please download pyfilesystem (https://code.google.com/p/pyfilesystem/) (only useful if you modifying ZeroNet source code)" % err)
|
|
||||||
pyfilesystem = False
|
pyfilesystem = False
|
||||||
else:
|
else:
|
||||||
pyfilesystem = False
|
pyfilesystem = False
|
||||||
|
|
Loading…
Reference in a new issue