瀏覽代碼

Trying to get `abserver` to install automatically

master
Pete Shadbolt 8 年之前
父節點
當前提交
6763052d4f
共有 2 個檔案被更改,包括 13 行新增1 行删除
  1. +4
    -1
      bin/abpserver
  2. +9
    -0
      setup.py

abp/server.py → bin/abpserver 查看文件

@@ -1,3 +1,4 @@
#!/usr/bin/python
from websocket_server import WebsocketServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
from BaseHTTPServer import HTTPServer
@@ -5,9 +6,11 @@ from SocketServer import ThreadingMixIn
import os, sys, threading
import webbrowser
import argparse
import abp

clients = []


def new_message(client, server, message):
print "Received update from client {}.".format(client["id"])
server.send_message_to_all(message)
@@ -29,7 +32,7 @@ if __name__ == '__main__':
args = parser.parse_args()

# Change to the right working dir
where = os.path.join(sys.path[0], "../static")
where = os.path.join(os.path.dirname(abp.__path__[0]), "static")
os.chdir(where)

# Start the HTTP server

+ 9
- 0
setup.py 查看文件

@@ -1,4 +1,11 @@
from setuptools import setup, find_packages
from glob import glob
from os import path

APPNAME = "abp"
STATIC = glob("static/*.*")+glob("static/img/*.*")+glob("static/scripts/*.*")
appdata = path.expanduser(path.join("~", "." + APPNAME))
print appdata

setup(
name = "abp",
@@ -9,5 +16,7 @@ setup(
description = "Port of C++ due to Simon Anders and Hans J Briegel",
keywords = "quantum",
setup_requires = ["numpy"],
scripts = ["bin/abpserver"],
install_requires = ["numpy", "networkx", "tqdm", "websocket-client", "websocket-server"],
data_files = [("static", STATIC)]
)

Loading…
取消
儲存