Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

Commit 6f873db

Browse files
author
Clinton Blackburn
committed
Initial commit of middleware
Extracted basic functionality from edx-platform.
0 parents  commit 6f873db

File tree

14 files changed

+1234
-0
lines changed

14 files changed

+1234
-0
lines changed

.gitignore

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
bin/
12+
build/
13+
develop-eggs/
14+
dist/
15+
eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
25+
# Installer logs
26+
pip-log.txt
27+
pip-delete-this-directory.txt
28+
29+
# Unit test / coverage reports
30+
htmlcov/
31+
.tox/
32+
.coverage
33+
.cache
34+
nosetests.xml
35+
coverage.xml
36+
37+
# Translations
38+
*.mo
39+
40+
# Mr Developer
41+
.mr.developer.cfg
42+
.project
43+
.pydevproject
44+
45+
# Rope
46+
.ropeproject
47+
48+
# Django stuff:
49+
*.log
50+
*.pot
51+
52+
# Sphinx documentation
53+
docs/_build/
54+
55+
# Sqlite Database
56+
57+
*.db
58+
59+
60+
.idea/

.pep8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[pep8]
2+
ignore=E501
3+
max_line_length=80
4+
exclude=settings

.pylintrc

Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
[MASTER]
2+
3+
# Specify a configuration file.
4+
#rcfile=
5+
6+
# Python code to execute, usually for sys.path manipulation such as
7+
# pygtk.require().
8+
#init-hook=''
9+
10+
# Profiled execution.
11+
profile=no
12+
13+
# Add files or directories to the blacklist. They should be base names, not
14+
# paths.
15+
ignore=CVS, migrations, settings
16+
17+
# Pickle collected data for later comparisons.
18+
persistent=yes
19+
20+
# List of plugins (as comma separated values of python modules names) to load,
21+
# usually to register additional checkers.
22+
load-plugins=
23+
24+
[MESSAGES CONTROL]
25+
26+
# Enable the message, report, category or checker with the given id(s). You can
27+
# either give multiple identifier separated by comma (,) or put this option
28+
# multiple time.
29+
#enable=
30+
31+
# Disable the message, report, category or checker with the given id(s). You
32+
# can either give multiple identifier separated by comma (,) or put this option
33+
# multiple time (only on the command line, not in the configuration file where
34+
# it should appear only once).
35+
disable=
36+
# Never going to use these
37+
# I0011: Locally disabling W0232
38+
# W0141: Used builtin function 'map'
39+
# W0142: Used * or ** magic
40+
# R0921: Abstract class not referenced
41+
# R0922: Abstract class is only referenced 1 times
42+
I0011,W0141,W0142,R0921,R0922,
43+
44+
# Django makes classes that trigger these
45+
# W0232: Class has no __init__ method
46+
W0232,
47+
48+
# Might use these when the code is in better shape
49+
# C0302: Too many lines in module
50+
# R0201: Method could be a function
51+
# R0901: Too many ancestors
52+
# R0902: Too many instance attributes
53+
# R0903: Too few public methods (1/2)
54+
# R0904: Too many public methods
55+
# R0911: Too many return statements
56+
# R0912: Too many branches
57+
# R0913: Too many arguments
58+
# R0914: Too many local variables
59+
C0302,R0201,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,
60+
# W0511: TODOs etc
61+
W0511,
62+
# E1103: maybe no member
63+
E1103,
64+
# C0111: missing docstring (handled by pep257)
65+
C0111,
66+
67+
# We can decide if names are invalid on our own
68+
invalid-name,
69+
70+
[REPORTS]
71+
72+
# Set the output format. Available formats are text, parseable, colorized, msvs
73+
# (visual studio) and html
74+
output-format=text
75+
76+
# Include message's id in output
77+
include-ids=yes
78+
79+
# Put messages in a separate file for each module / package specified on the
80+
# command line instead of printing them on stdout. Reports (if any) will be
81+
# written in a file name "pylint_global.[txt|html]".
82+
files-output=no
83+
84+
# Tells whether to display a full report or only the messages
85+
reports=no
86+
87+
# Python expression which should return a note less than 10 (10 is the highest
88+
# note). You have access to the variables errors warning, statement which
89+
# respectively contain the number of errors / warnings messages and the total
90+
# number of statements analyzed. This is used by the global evaluation report
91+
# (RP0004).
92+
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
93+
94+
# Add a comment according to your evaluation note. This is used by the global
95+
# evaluation report (RP0004).
96+
comment=no
97+
98+
99+
[TYPECHECK]
100+
101+
# Tells whether missing members accessed in mixin class should be ignored. A
102+
# mixin class is detected if its name ends with "mixin" (case insensitive).
103+
ignore-mixin-members=yes
104+
105+
# List of classes names for which member attributes should not be checked
106+
# (useful for classes with attributes dynamically set).
107+
ignored-classes=SQLObject
108+
109+
# When zope mode is activated, add a predefined set of Zope acquired attributes
110+
# to generated-members.
111+
zope=no
112+
113+
# List of members which are set dynamically and missed by pylint inference
114+
# system, and so shouldn't trigger E0201 when accessed. Python regular
115+
# expressions are accepted.
116+
generated-members=
117+
REQUEST,
118+
acl_users,
119+
aq_parent,
120+
objects,
121+
DoesNotExist,
122+
can_read,
123+
can_write,
124+
get_url,
125+
size,
126+
content,
127+
status_code,
128+
# For factory_boy factories
129+
create
130+
131+
132+
[BASIC]
133+
134+
# Required attributes for module, separated by a comma
135+
required-attributes=
136+
137+
# List of builtins function names that should not be used, separated by a comma
138+
bad-functions=map,filter,apply,input
139+
140+
# Regular expression which should only match correct module names
141+
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
142+
143+
# Regular expression which should only match correct module level names
144+
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns)$
145+
146+
# Regular expression which should only match correct class names
147+
class-rgx=[A-Z_][a-zA-Z0-9]+$
148+
149+
# Regular expression which should only match correct function names
150+
function-rgx=[a-z_][a-z0-9_]{2,30}$
151+
152+
# Regular expression which should only match correct method names
153+
method-rgx=([a-z_][a-z0-9_]{2,60}|setUp|set[Uu]pClass|tearDown|tear[Dd]ownClass|assert[A-Z]\w*)$
154+
155+
# Regular expression which should only match correct instance attribute names
156+
attr-rgx=[a-z_][a-z0-9_]{2,30}$
157+
158+
# Regular expression which should only match correct argument names
159+
argument-rgx=[a-z_][a-z0-9_]{2,30}$
160+
161+
# Regular expression which should only match correct variable names
162+
variable-rgx=[a-z_][a-z0-9_]{2,30}$
163+
164+
# Regular expression which should only match correct list comprehension /
165+
# generator expression variable names
166+
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
167+
168+
# Good variable names which should always be accepted, separated by a comma
169+
good-names=i,j,k,ex,Run,_
170+
171+
# Bad variable names which should always be refused, separated by a comma
172+
bad-names=foo,bar,baz,toto,tutu,tata
173+
174+
# Regular expression which should only match functions or classes name which do
175+
# not require a docstring
176+
no-docstring-rgx=__.*__|test_.*|setUp|tearDown
177+
178+
179+
[MISCELLANEOUS]
180+
181+
# List of note tags to take in consideration, separated by a comma.
182+
notes=FIXME,XXX,TODO
183+
184+
185+
[FORMAT]
186+
187+
# Maximum number of characters on a single line.
188+
max-line-length=120
189+
190+
# Maximum number of lines in a module
191+
max-module-lines=1000
192+
193+
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
194+
# tab).
195+
indent-string=' '
196+
197+
198+
[SIMILARITIES]
199+
200+
# Minimum lines number of a similarity.
201+
min-similarity-lines=4
202+
203+
# Ignore comments when computing similarities.
204+
ignore-comments=yes
205+
206+
# Ignore docstrings when computing similarities.
207+
ignore-docstrings=yes
208+
209+
210+
[VARIABLES]
211+
212+
# Tells whether we should check for unused import in __init__ files.
213+
init-import=no
214+
215+
# A regular expression matching the beginning of the name of dummy variables
216+
# (i.e. not used).
217+
dummy-variables-rgx=_|dummy|unused|.*_unused
218+
219+
# List of additional names supposed to be defined in builtins. Remember that
220+
# you should avoid to define new builtins when possible.
221+
additional-builtins=
222+
223+
224+
[IMPORTS]
225+
226+
# Deprecated modules which should not be used, separated by a comma
227+
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
228+
229+
# Create a graph of every (i.e. internal and external) dependencies in the
230+
# given file (report RP0402 must not be disabled)
231+
import-graph=
232+
233+
# Create a graph of external dependencies in the given file (report RP0402 must
234+
# not be disabled)
235+
ext-import-graph=
236+
237+
# Create a graph of internal dependencies in the given file (report RP0402 must
238+
# not be disabled)
239+
int-import-graph=
240+
241+
242+
[DESIGN]
243+
244+
# Maximum number of arguments for function / method
245+
max-args=5
246+
247+
# Argument names that match this expression will be ignored. Default to name
248+
# with leading underscore
249+
ignored-argument-names=_.*
250+
251+
# Maximum number of locals for function / method body
252+
max-locals=15
253+
254+
# Maximum number of return / yield for function / method body
255+
max-returns=6
256+
257+
# Maximum number of branch for function / method body
258+
max-branchs=12
259+
260+
# Maximum number of statements in function / method body
261+
max-statements=50
262+
263+
# Maximum number of parents for a class (see R0901).
264+
max-parents=7
265+
266+
# Maximum number of attributes for a class (see R0902).
267+
max-attributes=7
268+
269+
# Minimum number of public methods for a class (see R0903).
270+
min-public-methods=2
271+
272+
# Maximum number of public methods for a class (see R0904).
273+
max-public-methods=20
274+
275+
276+
[CLASSES]
277+
278+
# List of interface methods to ignore, separated by a comma. This is used for
279+
# instance to not check methods defines in Zope's Interface base class.
280+
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
281+
282+
# List of method names used to declare (i.e. assign) instance attributes.
283+
defining-attr-methods=__init__,__new__,setUp
284+
285+
# List of valid names for the first argument in a class method.
286+
valid-classmethod-first-arg=cls
287+
288+
289+
[EXCEPTIONS]
290+
291+
# Exceptions that will emit a warning when being caught. Defaults to
292+
# "Exception"
293+
overgeneral-exceptions=Exception

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clinton Blackburn <[email protected]>

0 commit comments

Comments
 (0)