Permalink
Browse files

Moved/renamed 'type' package to 'model' package and updated imports a…

…nd references

Conflicts:

	src/soaplib/model/primitive.py
	src/soaplib/test/test_application.py
  • Loading branch information...
1 parent 8434e0d commit 8fb6dcc6526ca9cc1edaf10abe2adfa59e348936 @caustin caustin committed Oct 20, 2010
Showing with 129 additions and 130 deletions.
  1. +1 −1 MIGRATION.md
  2. +6 −6 doc/source/pages/binaryfiles.rst
  3. +5 −5 doc/source/pages/helloworld.rst
  4. +2 −2 doc/source/pages/hooks.rst
  5. +1 −1 doc/source/pages/message_api.rst
  6. +7 −7 doc/source/pages/serializer_api.rst
  7. +7 −7 doc/source/pages/serializers.rst
  8. +3 −3 doc/source/pages/usermanager.rst
  9. +2 −2 examples/async.py
  10. +3 −3 examples/binary.py
  11. +3 −3 examples/classserializer.py
  12. +3 −3 examples/hellotwisted.py
  13. +3 −3 examples/helloworld.py
  14. +4 −4 examples/helloworld_attach.py
  15. +3 −3 examples/hooks.py
  16. +2 −2 examples/override.py
  17. +2 −2 src/soaplib/_base.py
  18. +2 −2 src/soaplib/client/_base.py
  19. +1 −1 src/soaplib/mime.py
  20. 0 src/soaplib/{type → model}/__init__.py
  21. 0 src/soaplib/{type → model}/base.py
  22. +2 −2 src/soaplib/{type → model}/binary.py
  23. +5 −5 src/soaplib/{type → model}/clazz.py
  24. 0 src/soaplib/{type → model}/enum.py
  25. +1 −1 src/soaplib/{type → model}/exception.py
  26. +3 −4 src/soaplib/{type → model}/primitive.py
  27. +5 −5 src/soaplib/{type → model}/table.py
  28. +2 −2 src/soaplib/server/_base.py
  29. +2 −2 src/soaplib/server/wsgi.py
  30. +2 −2 src/soaplib/service.py
  31. +1 −1 src/soaplib/test/interop/_test_client_base.py
  32. +14 −14 src/soaplib/test/interop/server/_service.py
  33. +6 −6 src/soaplib/test/test_service.py
  34. +7 −7 src/soaplib/test/test_soap.py
  35. +1 −1 src/soaplib/test/type/test_binary.py
  36. +6 −6 src/soaplib/test/type/test_clazz.py
  37. +2 −2 src/soaplib/test/type/test_enum.py
  38. +3 −3 src/soaplib/test/type/test_include.py
  39. +7 −7 src/soaplib/test/type/test_primitive.py
View
@@ -3,7 +3,7 @@ From 1.0
- Hooks no longer get http environment parameter. You should remove that from your functions that override hook functions.
- Go to your source dirs and run the following commands, by replacing `.svn` with your preferred scm metadata dir:
- egrep -r 'soaplib.serializers' --exclude-dir=.svn . -l | xargs -n1 sed -i 's/soaplib.serializers/soaplib.type/g'
+ egrep -r 'soaplib.serializers' --exclude-dir=.svn . -l | xargs -n1 sed -i 's/soaplib.serializers/soaplib.model/g'
egrep -r 'soaplib.wsgi' --exclude-dir=.svn . -l | xargs -n1 sed -i 's/soaplib.wsgi/soaplib.server.wsgi/g'
From 0.8
@@ -7,7 +7,7 @@ string. Soaplib uses the 'Attachment' serializer to handle all encoding and
decoding of the binary data, and provieds some useful methods for dealing with
both in-memory and on-disk binary data. ::
- >>> from soaplib.type.binary import Attachment
+ >>> from soaplib.model.binary import Attachment
>>> from lxml import etree as et
>>> a = Attachment(data="this is my binary data")
>>> print et.tostring(Attachment.to_xml(a))
@@ -17,7 +17,7 @@ both in-memory and on-disk binary data. ::
If you want to return file with binary data, simply::
- >>> from soaplib.type.binary import Attachment
+ >>> from soaplib.model.binary import Attachment
>>> from lxml import etree as et
>>> a = Attachment(fileName="mydata")
>>> print et.tostring(Attachment.to_xml(a))
@@ -28,10 +28,10 @@ If you want to return file with binary data, simply::
An example service for archiving documents::
from soaplib.service import rpc, DefinitionBase
- from soaplib.type.primitive import String, Integer
- from soaplib.type.clazz import Array
- from soaplib.type.binary import Attachment
- from soaplib.pattern.server.wsgi import Application
+ from soaplib.model.primitive import String, Integer
+ from soaplib.model.clazz import Array
+ from soaplib.model.binary import Attachment
+ from soaplib.server.wsgi import Application
from tempfile import mkstemp
import os
@@ -10,9 +10,9 @@ Declaring a Soaplib Service
from soaplib.service import DefinitionBase
from soaplib.service import rpc,
- from soaplib.type.primitive import String, Integer
- from soaplib.type.clazz import Array
- from soaplib.pattern.server.wsgi import Application
+ from soaplib.model.primitive import String, Integer
+ from soaplib.model.clazz import Array
+ from soaplib.server.wsgi import Application
class HelloWorldService(SimpleWSGISoapApp):
@@ -42,8 +42,8 @@ data types it accepts and returns. ::
Import the type for this method (more on type later)::
- from soaplib.type.primitive import String, Integer
- from soaplib.type.clazz import Array
+ from soaplib.model.primitive import String, Integer
+ from soaplib.model.clazz import Array
Extending DefinitionBase is an easy way to create a soap service that can
be deployed as a WSGI application.::
@@ -47,8 +47,8 @@ request (soaplib.wsgi_soap.request) object to hold the data points for this
request. ::
from soaplib.service import rpc, DefinitionBase
- from soaplib.type.primitive import String, Integer
- from soaplib.type.clazz import Array
+ from soaplib.model.primitive import String, Integer
+ from soaplib.model.clazz import Array
from time import time
@@ -8,7 +8,7 @@ programatically. The Message object follows the to_xml/from_xml usage pattern as
the type. ::
>>> from soaplib.soap import Message
- >>> from soaplib.type.primitive import *
+ >>> from soaplib.model.primitive import *
>>> import cElementTree as et
>>> message = Message('myFunction',[('a',String),('b',Integer),('c',Float)])
>>> print et.tostring(message.to_xml('a',13,3.14))
@@ -7,31 +7,31 @@ common datatypes generally needed.
Base
----
-.. automodule:: soaplib.type.base
+.. automodule:: soaplib.model.base
:members:
:undoc-members:
:inherited-members:
Binary
------
-.. automodule:: soaplib.type.binary
+.. automodule:: soaplib.model.binary
:members:
:undoc-members:
:inherited-members:
:show-inheritance:
Clazz
------
-.. automodule:: soaplib.type.clazz
+.. automodule:: soaplib.model.clazz
:members:
:undoc-members:
:inherited-members:
:show-inheritance:
Enum
-----
-.. automodule:: soaplib.type.enum
+.. automodule:: soaplib.model.enum
:members:
:undoc-members:
:inherited-members:
@@ -40,7 +40,7 @@ Enum
Exception
---------
-.. automodule:: soaplib.type.exception
+.. automodule:: soaplib.model.exception
:members:
:undoc-members:
:inherited-members:
@@ -49,7 +49,7 @@ Exception
Primitive
---------
-.. automodule:: soaplib.type.primitive
+.. automodule:: soaplib.model.primitive
:members:
:undoc-members:
:inherited-members:
@@ -58,7 +58,7 @@ Primitive
Table
------
-.. automodule:: soaplib.type.table
+.. automodule:: soaplib.model.table
:members:
:undoc-members:
:inherited-members:
@@ -36,7 +36,7 @@ the proper internal type so it can properly (de)serialize the data. Arrays
are homogeneous, meaning that the data they hold are all of the same
type. For mixed typing or more dynamic data, use the Any type. ::
- >>> from soaplib.type.clazz import *
+ >>> from soaplib.model.clazz import *
>>> from soaplib.serialixers.primitives import String
>>> from lxml import etree
>>> parent = etree.Element("parent")
@@ -54,8 +54,8 @@ Class
-----
The `ClassSerializer` is used to define and serialize complex, nested structures.
- >>> from soaplib.type.primitive import *
- >>> from soaplib.type.clazz import *
+ >>> from soaplib.model.primitive import *
+ >>> from soaplib.model.clazz import *
>>> from lxml import etree
>>> class Permission(ClassSerializer):
... __namespace__ = "permission"
@@ -99,7 +99,7 @@ strings. Data in Attachment objects can be loaded manually, or read from file.
All encoding of the binary data is done just prior to the data being sent, and
decoding immediately upon receipt of the Attachment. ::
- >>> from soaplib.type.binary import Attachment
+ >>> from soaplib.model.binary import Attachment
>>> from lxml import etree
>>> a = Attachment(data='my binary data')
>>> parent = etree.Element('parent')
@@ -109,7 +109,7 @@ decoding immediately upon receipt of the Attachment. ::
<ns0:retval xmlns:ns0="tns">bXkgYmluYXJ5IGRhdGE=
</ns0:retval>
>>> print Attachment.from_xml(element)
- <soaplib.type.binary.Attachment object at 0x5c6d90>
+ <soaplib.model.binary.Attachment object at 0x5c6d90>
>>> print Attachment.from_xml(element).data
my binary data
>>> a2 = Attachment(fileName='test.data') # load from file
@@ -131,10 +131,10 @@ to/from dicts with lists instead of raw lxml.etree._Element objects.
Custom
------
Soaplib provides a very simple interface for writing custom type. Just
-inherit from soaplib.type.base.Base and override from_xml and to_xml and
+inherit from soaplib.model.base.Base and override from_xml and to_xml and
add_to_schema functions.::
- from soaplib.type.base import Base
+ from soaplib.model.base import Base
class MySerializer(Base):
@classmethod
@@ -5,11 +5,11 @@ User Manager
Lets try a more complicated example than just strings and integers!
The following is an extremely simple example using complex, nested data.::
- from soaplib.pattern.server.wsgi import Application
+ from soaplib.server.wsgi import Application
from soaplib.service import rpc
from soaplib.service import DefinitionBase
- from soaplib.type.primitive import String, Integer
- from soaplib.type.clazz import ClassSerializer, Array
+ from soaplib.model.primitive import String, Integer
+ from soaplib.model.clazz import ClassSerializer, Array
user_database = {}
userid_seq = 1
View
@@ -22,9 +22,9 @@
from soaplib.service import rpc, DefinitionBase
-from soaplib.type.primitive import String, Integer
+from soaplib.model.primitive import String, Integer
from soaplib.util import get_callback_info
-from soaplib.pattern.server.wsgi import Application
+from soaplib.server.wsgi import Application
'''
View
@@ -19,13 +19,13 @@
from soaplib.service import rpc, DefinitionBase
-from soaplib.type.primitive import String
-from soaplib.type.binary import Attachment
+from soaplib.model.primitive import String
+from soaplib.model.binary import Attachment
from tempfile import mkstemp
import os
-from soaplib.pattern.server.wsgi import Application
+from soaplib.server.wsgi import Application
class DocumentArchiver(DefinitionBase):
@@ -18,12 +18,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
#
-from soaplib.pattern.server.wsgi import Application
+from soaplib.server.wsgi import Application
from soaplib.service import rpc
from soaplib.service import DefinitionBase
-from soaplib.type.primitive import String, Integer
+from soaplib.model.primitive import String, Integer
-from soaplib.type.clazz import ClassSerializer, Array
+from soaplib.model.clazz import ClassSerializer, Array
'''
This example shows how to define and use complex structures
View
@@ -23,9 +23,9 @@
from soaplib.server import wsgi
from soaplib.service import DefinitionBase
from soaplib.service import rpc
-from soaplib.type.clazz import Array
-from soaplib.type.primitive import Integer
-from soaplib.type.primitive import String
+from soaplib.model.clazz import Array
+from soaplib.model.primitive import Integer
+from soaplib.model.primitive import String
'''
This is the HelloWorld example running in the twisted framework.
View
@@ -22,10 +22,10 @@
from soaplib.service import rpc
from soaplib.service import DefinitionBase
-from soaplib.type.primitive import String, Integer
+from soaplib.model.primitive import String, Integer
-from soaplib.pattern.server import wsgi
-from soaplib.type.clazz import Array
+from soaplib.server import wsgi
+from soaplib.model.clazz import Array
'''
This is a simple HelloWorld example to show the basics of writing
@@ -18,10 +18,10 @@
#
from soaplib.service import rpc, DefinitionBase
-from soaplib.type.primitive import String, Integer
-from soaplib.type.binary import Attachment
-from soaplib.type.clazz import Array
-from soaplib.pattern.server.wsgi import Application
+from soaplib.model.primitive import String, Integer
+from soaplib.model.binary import Attachment
+from soaplib.model.clazz import Array
+from soaplib.server.wsgi import Application
class HelloWorldService(DefinitionBase):
View
@@ -20,9 +20,9 @@
from time import time
from soaplib.service import rpc
-from soaplib.type.primitive import String, Integer, Array
-from soaplib.pattern.server.wsgi_soap import request
-from soaplib.pattern.server.wsgi_soap import SimpleWSGIApp
+from soaplib.model.primitive import String, Integer, Array
+from soaplib.server.wsgi_soap import request
+from soaplib.server.wsgi_soap import SimpleWSGIApp
'''
This example is an enhanced version of the HelloWorld example that
View
@@ -18,8 +18,8 @@
#
from soaplib.service import rpc, DefinitionBase
-from soaplib.type.primitive import String
-from soaplib.pattern.server.wsgi import Application
+from soaplib.model.primitive import String
+from soaplib.server.wsgi import Application
'''
View
@@ -30,7 +30,7 @@
import soaplib
-from soaplib.type.exception import Fault
+from soaplib.model.exception import Fault
from soaplib.util.odict import odict
HTTP_500 = '500 Internal server error'
@@ -530,7 +530,7 @@ def get_namespace_prefix(self, ns):
if ns == "__main__":
warnings.warn("Namespace is '__main__'", Warning )
- assert ns != "soaplib.type.base"
+ assert ns != "soaplib.model.base"
assert (isinstance(ns, str) or isinstance(ns, unicode)), ns
@@ -1,9 +1,9 @@
-from soaplib.type.exception import Fault
+from soaplib.model.exception import Fault
from lxml import etree
from soaplib import MethodContext
-from soaplib.type.primitive import string_encoding
+from soaplib.model.primitive import string_encoding
class Factory(object):
def __init__(self, app):
View
@@ -21,7 +21,7 @@
from email import message_from_string
# import soaplib stuff
-from soaplib.type.binary import Attachment
+from soaplib.model.binary import Attachment
import soaplib
File renamed without changes.
File renamed without changes.
@@ -20,8 +20,8 @@
import base64
import cStringIO
-from soaplib.type.base import Base
-from soaplib.type import nillable_value, nillable_element
+from soaplib.model.base import Base
+from soaplib.model import nillable_value, nillable_element
from lxml import etree
Oops, something went wrong.

0 comments on commit 8fb6dcc

Please sign in to comment.