diff --git a/setup.py b/setup.py index b3b23b7..0cd7ce3 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup setup( - name='EWS', - packages=['ews'], + name='WSME', + packages=['wsme'], install_requires=['webob'], ) diff --git a/ews/__init__.py b/wsme/__init__.py similarity index 53% rename from ews/__init__.py rename to wsme/__init__.py index f3a36e8..7e2625c 100644 --- a/ews/__init__.py +++ b/wsme/__init__.py @@ -1,2 +1 @@ from controller import * -from wsgiapp import * diff --git a/ews/controller.py b/wsme/controller.py similarity index 90% rename from ews/controller.py rename to wsme/controller.py index 04202ba..1293dd0 100644 --- a/ews/controller.py +++ b/wsme/controller.py @@ -9,8 +9,8 @@ def scan_api(controller, path=[]): if name.startswith('_'): continue a = getattr(controller, name) - if hasattr(a, '_ews_definition'): - yield path, a._ews_definition + if hasattr(a, '_wsme_definition'): + yield path, a._wsme_definition else: for i in scan_api(a, path + [name]): yield i @@ -32,10 +32,10 @@ class FunctionDefinition(object): @classmethod def get(cls, func): - fd = getattr(func, '_ews_definition', None) + fd = getattr(func, '_wsme_definition', None) if fd is None: fd = FunctionDefinition(func.__name__) - func._ews_definition = fd + func._wsme_definition = fd return fd @@ -88,8 +88,8 @@ class WSRoot(object): def _handle_request(self, request): protocol = None - if 'ewsproto' in request.params: - protocol = self.protocols[request.params['ewsproto']] + if 'wsmeproto' in request.params: + protocol = self.protocols[request.params['wsmeproto']] else: for p in self.protocols.values(): if p.accept(self, request): diff --git a/ews/rest.py b/wsme/rest.py similarity index 100% rename from ews/rest.py rename to wsme/rest.py diff --git a/ews/restjson.py b/wsme/restjson.py similarity index 100% rename from ews/restjson.py rename to wsme/restjson.py diff --git a/ews/restxml.py b/wsme/restxml.py similarity index 100% rename from ews/restxml.py rename to wsme/restxml.py diff --git a/ews/soap.py b/wsme/soap.py similarity index 100% rename from ews/soap.py rename to wsme/soap.py diff --git a/ews/tests/__init__.py b/wsme/tests/__init__.py similarity index 100% rename from ews/tests/__init__.py rename to wsme/tests/__init__.py diff --git a/ews/tests/test_controller.py b/wsme/tests/test_controller.py similarity index 86% rename from ews/tests/test_controller.py rename to wsme/tests/test_controller.py index e5cfd3c..2f1b062 100644 --- a/ews/tests/test_controller.py +++ b/wsme/tests/test_controller.py @@ -3,8 +3,8 @@ import webob from webob.dec import wsgify import webtest -from ews import * -from ews.controller import scan_api +from wsme import * +from wsme.controller import scan_api class DummyProtocol(object): name = 'dummy' @@ -34,7 +34,7 @@ class TestController(unittest.TestCase): def getint(self): return 1 - assert MyWS.getint._ews_definition.return_type == int + assert MyWS.getint._wsme_definition.return_type == int def test_validate(self): class MyWS(object): @@ -43,7 +43,7 @@ class TestController(unittest.TestCase): def add(self, a, b, c=0): return a + b + c - args = MyWS.add._ews_definition.arguments + args = MyWS.add._wsme_definition.arguments assert args[0].name == 'a' assert args[0].datatype == int @@ -62,9 +62,9 @@ class TestController(unittest.TestCase): def test_register_protocol(self): p = DummyProtocol() - import ews.controller - ews.controller.register_protocol(p) - assert ews.controller.registered_protocols['dummy'] == p + import wsme.controller + wsme.controller.register_protocol(p) + assert wsme.controller.registered_protocols['dummy'] == p r = WSRoot() assert r.protocols['dummy'] @@ -103,7 +103,7 @@ class TestController(unittest.TestCase): assert p.lastroot == r assert p.hits == 1 - res = app.get('/?ewsproto=dummy') + res = app.get('/?wsmeproto=dummy') assert p.lastreq.path == '/' assert p.lastroot == r