Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
f1122a60
Commit
f1122a60
authored
Apr 10, 2013
by
Ilias Tsitsimpis
Browse files
snf-django-lib: PEP-8 style fixes
parent
5ff5b2d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
snf-django-lib/snf_django/lib/api/__init__.py
View file @
f1122a60
...
...
@@ -197,8 +197,7 @@ def render_fault(request, fault):
else
:
d
=
{
fault
.
name
:
{
"code"
:
fault
.
code
,
"message"
:
fault
.
message
,
"details"
:
fault
.
details
}
}
"details"
:
fault
.
details
}}
data
=
json
.
dumps
(
d
)
response
=
HttpResponse
(
data
,
status
=
fault
.
code
)
...
...
snf-django-lib/snf_django/lib/api/parsedate.py
View file @
f1122a60
# Copyright (c) Django Software Foundation and individual contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
#
# Redistribution and use in source and binary forms, with or without
#
modification,
are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
#
# 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.
#
# 3. Neither the name of Django nor the names of its contributors may be
used
# to endorse or promote products derived from this software without
#
# 3. Neither the name of Django nor the names of its contributors may be
#
used
to endorse or promote products derived from this software without
# specific prior written permission.
#
# 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.
#
# 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.
import
re
import
datetime
...
...
@@ -41,6 +41,7 @@ RFC1123_DATE = re.compile(r'^\w{3}, %s %s %s %s GMT$' % (__D, __M, __Y, __T))
RFC850_DATE
=
re
.
compile
(
r
'^\w{6,9}, %s-%s-%s %s GMT$'
%
(
__D
,
__M
,
__Y2
,
__T
))
ASCTIME_DATE
=
re
.
compile
(
r
'^\w{3} %s %s %s %s$'
%
(
__M
,
__D2
,
__T
,
__Y
))
def
parse_http_date
(
date
):
"""
Parses a date format as specified by HTTP RFC2616 section 3.3.1.
...
...
@@ -77,6 +78,7 @@ def parse_http_date(date):
except
Exception
:
raise
ValueError
(
"%r is not a valid date"
%
date
)
def
parse_http_date_safe
(
date
):
"""
Same as parse_http_date, but returns None if the input is invalid.
...
...
snf-django-lib/snf_django/lib/astakos.py
View file @
f1122a60
...
...
@@ -237,7 +237,7 @@ class UserCache(object):
self
.
astakos_token
=
astakos_token
self
.
astakos_url
=
astakos_url
self
.
user_catalog_url
=
astakos_url
.
replace
(
"im/authenticate"
,
"service/api/user_catalogs"
)
"service/api/user_catalogs"
)
self
.
users
=
{}
self
.
split
=
split
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment