Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
99430113
Commit
99430113
authored
Mar 23, 2015
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pre-existing pylint violations
parent
a8473505
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
5 deletions
+14
-5
openedx/core/lib/django_test_client_utils.py
+9
-4
openedx/core/lib/logsettings.py
+2
-0
openedx/core/lib/rooted_paths.py
+2
-0
openedx/core/lib/tempdir.py
+1
-1
No files found.
openedx/core/lib/django_test_client_utils.py
View file @
99430113
...
...
@@ -2,6 +2,9 @@
This file includes the monkey-patch for requests' PATCH method, as we are using
older version of django that does not contains the PATCH method in its test client.
"""
# pylint: disable=protected-access
from
__future__
import
unicode_literals
from
urlparse
import
urlparse
...
...
@@ -13,11 +16,13 @@ BOUNDARY = 'BoUnDaRyStRiNg'
MULTIPART_CONTENT
=
'multipart/form-data; boundary=
%
s'
%
BOUNDARY
def
request_factory_patch
(
self
,
path
,
data
=
{}
,
content_type
=
MULTIPART_CONTENT
,
**
extra
):
def
request_factory_patch
(
self
,
path
,
data
=
None
,
content_type
=
MULTIPART_CONTENT
,
**
extra
):
"""
Construct a PATCH request.
"""
patch_data
=
self
.
_encode_data
(
data
,
content_type
)
# pylint: disable=invalid-name
patch_data
=
self
.
_encode_data
(
data
or
{},
content_type
)
parsed
=
urlparse
(
path
)
r
=
{
...
...
@@ -32,11 +37,11 @@ def request_factory_patch(self, path, data={}, content_type=MULTIPART_CONTENT, *
return
self
.
request
(
**
r
)
def
client_patch
(
self
,
path
,
data
=
{}
,
content_type
=
MULTIPART_CONTENT
,
follow
=
False
,
**
extra
):
def
client_patch
(
self
,
path
,
data
=
None
,
content_type
=
MULTIPART_CONTENT
,
follow
=
False
,
**
extra
):
"""
Send a resource to the server using PATCH.
"""
response
=
super
(
Client
,
self
)
.
patch
(
path
,
data
=
data
,
content_type
=
content_type
,
**
extra
)
response
=
super
(
Client
,
self
)
.
patch
(
path
,
data
=
data
or
{}
,
content_type
=
content_type
,
**
extra
)
if
follow
:
response
=
self
.
_handle_redirects
(
response
,
**
extra
)
return
response
...
...
openedx/core/lib/logsettings.py
View file @
99430113
"""Get log settings."""
import
os
import
platform
import
sys
...
...
openedx/core/lib/rooted_paths.py
View file @
99430113
"""Provides rooted_glob, for finding relative glob paths in another director."""
import
glob2
...
...
openedx/core/lib/tempdir.py
View file @
99430113
...
...
@@ -6,7 +6,7 @@ import shutil
import
tempfile
def
mkdtemp_clean
(
suffix
=
""
,
prefix
=
"tmp"
,
dir
=
None
):
def
mkdtemp_clean
(
suffix
=
""
,
prefix
=
"tmp"
,
dir
=
None
):
# pylint: disable=redefined-builtin
"""Just like mkdtemp, but the directory will be deleted when the process ends."""
the_dir
=
tempfile
.
mkdtemp
(
suffix
=
suffix
,
prefix
=
prefix
,
dir
=
dir
)
atexit
.
register
(
cleanup_tempdir
,
the_dir
)
...
...
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