forked from github.com/pypiserver
remove choose_server method, bottle already provides this using the "auto" server.
This commit is contained in:
parent
74ff96387c
commit
35e09a4469
@ -112,15 +112,6 @@ def server_static(filename):
|
|||||||
return static_file(filename, root=packages.root)
|
return static_file(filename, root=packages.root)
|
||||||
|
|
||||||
|
|
||||||
def choose_server():
|
|
||||||
for x in ["paste", "cherrypy", "twisted"]:
|
|
||||||
try:
|
|
||||||
__import__(x)
|
|
||||||
return x
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return "auto"
|
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print """pypiserver [-p PORT] [-r PACKAGES_DIR]
|
print """pypiserver [-p PORT] [-r PACKAGES_DIR]
|
||||||
start PyPI compatible package server on port PORT serving packages from PACKAGES_DIR
|
start PyPI compatible package server on port PORT serving packages from PACKAGES_DIR
|
||||||
@ -164,7 +155,7 @@ def main():
|
|||||||
sys.exit("error occured while trying to list %r: %s" % (root, err))
|
sys.exit("error occured while trying to list %r: %s" % (root, err))
|
||||||
|
|
||||||
packages = pkgset(root)
|
packages = pkgset(root)
|
||||||
server = server or choose_server()
|
server = server or "auto"
|
||||||
debug(True)
|
debug(True)
|
||||||
print "serving %r on %s:%s" % (root, host, port)
|
print "serving %r on %s:%s" % (root, host, port)
|
||||||
print
|
print
|
||||||
|
Loading…
Reference in New Issue
Block a user