Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MongoDBProxy
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
OpenEdx
MongoDBProxy
Commits
22912847
Commit
22912847
authored
Jun 10, 2013
by
Michael Cetrulo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compact EXECUTABLE_MONGO_METHODS
parent
f580ed27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
mongodb_proxy.py
+12
-8
No files found.
mongodb_proxy.py
View file @
22912847
...
@@ -2,14 +2,18 @@
...
@@ -2,14 +2,18 @@
import
time
import
time
import
pymongo
import
pymongo
def
get_methods
(
obj
):
def
get_methods
(
*
objs
):
attrs
=
(
attr
for
attr
in
dir
(
obj
))
return
set
(
attrs
=
(
attr
for
attr
in
attrs
if
not
attr
.
startswith
(
'_'
))
attr
return
set
([
attr
for
attr
in
attrs
if
hasattr
(
getattr
(
obj
,
attr
),
'__call__'
)])
for
obj
in
objs
for
attr
in
dir
(
obj
)
EXECUTABLE_MONGO_METHODS
=
get_methods
(
pymongo
.
collection
.
Collection
)
if
not
attr
.
startswith
(
'_'
)
EXECUTABLE_MONGO_METHODS
.
update
(
get_methods
(
pymongo
.
Connection
))
and
hasattr
(
getattr
(
obj
,
attr
),
'__call__'
)
EXECUTABLE_MONGO_METHODS
.
update
(
get_methods
(
pymongo
))
)
EXECUTABLE_MONGO_METHODS
=
get_methods
(
pymongo
.
collection
.
Collection
,
pymongo
.
Connection
,
pymongo
)
def
safe_mongocall
(
call
):
def
safe_mongocall
(
call
):
...
...
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