Skip to content

Commit a59457b

Browse files
author
Michael Hrivnak
committed
initial commit
0 parents  commit a59457b

File tree

363 files changed

+50319
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+50319
-0
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See docs/sphinx/changelog.rst

LICENSE.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright (c) 2011 American Research Institute and individual contributors.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name of American Research Institute nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13+
14+

__init__.py

Whitespace-only changes.

celerybeat_test_settings.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# this is a settings file that we can pass to celerybeat for testing
2+
# it loads the usual one, and then overrides CELERYBEAT_SCHEDULE
3+
4+
import os
5+
PROJECT_ROOT=os.path.abspath(os.path.dirname(__file__))
6+
execfile(os.path.join(PROJECT_ROOT, 'settings.py'))
7+
8+
CELERYBEAT_SCHEDULE = {
9+
'expire_old_credentials' : {
10+
'task' : 'pr_services.tasks.expire_old_credentials',
11+
'schedule' : timedelta(seconds=1),
12+
},
13+
'remove_old_auth_tokens': {
14+
'task' : 'pr_services.tasks.remove_old_auth_tokens',
15+
'schedule' : timedelta(seconds=1),
16+
},
17+
'process_completed_sessions': {
18+
'task' : 'pr_services.tasks.process_completed_sessions',
19+
'schedule' : timedelta(seconds=1),
20+
},
21+
}

cmis_storage/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
3+
__all__ = ('WSDL_PATH',)
4+
5+
this_file_path = os.path.abspath(os.path.dirname(__file__))
6+
WSDL_PATH = os.path.join(this_file_path, 'wsdl')

cmis_storage/amara/__init__.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#Module amara
2+
3+
#all = ["parse", "parse_path", "pushbind", "pushdom", "__version__"]
4+
5+
RESERVED_URI = 'http://uche.ogbuji.net/tech/4suite/amara/reserved/'
6+
PI_BINDING = RESERVED_URI + 'pi-binding'
7+
8+
9+
import os
10+
11+
import binderytools
12+
import domtools
13+
14+
create_document = binderytools.create_document
15+
pushbind = binderytools.pushbind
16+
pushdom = domtools.pushdom
17+
18+
19+
# Convenience functions for parsing
20+
21+
def parse(source, uri=None, rules=None, binderobj=None, prefixes=None, validate=False, binding_classes=None):
22+
"""
23+
Convenience function for parsing XML. Use this function with a single
24+
argument, which is a string (not Unicode object), file-like object
25+
(stream), file path or URI.
26+
Returns a document binding object.
27+
28+
Only use this function to parse self-contained XML (i.e. not requiring
29+
access to any other resource). For example, do not use it for XML with
30+
external entities. If you get URI resolution errors, pass in a URI
31+
parameter.
32+
33+
uri - establish a base URI for the XML document entity being parsed,
34+
required if source is a string or stream containing XML that
35+
uses any external resources. If source is a path or URI, then
36+
this parameter, if given, is ignored
37+
rules - a list of bindery rule objects to fine-tune the binding
38+
binderobj - optional binder object to control binding details,
39+
the default is None, in which case a binder object
40+
will be created
41+
prefixes - dictionary mapping prefixes to namespace URIs
42+
the default is None
43+
validate - True to request DTD validaton by the underlying parser
44+
the default is False
45+
"""
46+
from Ft.Xml import InputSource
47+
from Ft.Lib import Uri, Uuid
48+
from Ft.Xml.Lib.XmlString import IsXml
49+
#if isinstance(source, InputSource.InputSource):
50+
# pass
51+
if hasattr(source, 'read'):
52+
return binderytools.bind_stream(
53+
source, uri=uri, rules=rules, binderobj=binderobj,
54+
prefixes=prefixes, validate=validate, binding_classes=binding_classes)
55+
elif IsXml(source):
56+
return binderytools.bind_string(
57+
source, uri=uri, rules=rules, binderobj=binderobj,
58+
prefixes=prefixes, validate=validate, binding_classes=binding_classes)
59+
elif Uri.IsAbsolute(source): #or not os.path.isfile(source):
60+
return binderytools.bind_uri(
61+
source, rules=rules, binderobj=binderobj,
62+
prefixes=prefixes, validate=validate, binding_classes=binding_classes)
63+
else:
64+
return binderytools.bind_file(
65+
source, rules=rules, binderobj=binderobj,
66+
prefixes=prefixes, validate=validate, binding_classes=binding_classes)
67+
68+
69+
#Need double layer of exception checking to support freeze utils
70+
#(In that case there would be setuptools at freeze time, but not run time)
71+
try:
72+
import pkg_resources
73+
try:
74+
__version__ = pkg_resources.get_distribution('Amara').version
75+
except pkg_resources.DistributionNotFound:
76+
from __config__ import VERSION as __version__
77+
except ImportError:
78+
from __config__ import VERSION as __version__
79+
80+

0 commit comments

Comments
 (0)