All Samples(297) | Call(267) | Derive(0) | Import(30)
Return tuple of base classes (including cls) in method resolution order.
def getmro(cls):
"Return tuple of base classes (including cls) in method resolution order."
if hasattr(cls, "__mro__"):
return cls.__mro__
else:
result = []
_searchbases(cls, result)
return tuple(result)
from Products.DocFinderTab.config import FILTER_ROLES # DFT
from Products.DocFinderTab.config import FILTER_METHODS # DFT
from inspect import isclass, ismethod, \
isfunction, ismethoddescriptor, \
getmro, \
getargspec, formatargspec, \
def _getMro(class_):
'''*class_* s method resolution order (cached).'''
mro= _MROCache.get(class_)
if mro is None:
mro= _MROCache[class_]= getmro(class_)
return mro
src/f/l/flioops-HEAD/py/trunk/basics.py flioops(Download)
# Basic Object Oriented Features. from oop.dbc import method_requires, method_ensures from inspect import isclass, getmro, ismethod import types __metaclass__= type
def __init__(self, cls, inst):
self.__self__, self.__self_class__, = \
inst, inst.__class__
lst= list(getmro(inst.__class__))
self.__lst__= lst[lst.index(cls)+ 1:]
@method_ensures('hasattr(self, attrnm)')
src/z/a/zamboni-lib-HEAD/lib/python/werkzeug/contrib/jsrouting.py zamboni-lib(Download)
def dumps(*args):
raise RuntimeError('simplejson required for jsrouting')
from inspect import getmro
from werkzeug.templates import Template
from werkzeug.routing import NumberConverter
def js_to_url_function(converter):
"""Get the JavaScript converter function from a rule."""
if hasattr(converter, 'js_to_url_function'):
data = converter.js_to_url_function()
else:
for cls in getmro(type(converter)):
if cls in js_to_url_functions:
src/w/e/webnest-HEAD/env/lib/python2.6/site-packages/werkzeug/contrib/jsrouting.py webnest(Download)
def dumps(*args):
raise RuntimeError('simplejson required for jsrouting')
from inspect import getmro
from werkzeug.templates import Template
from werkzeug.routing import NumberConverter
def js_to_url_function(converter):
"""Get the JavaScript converter function from a rule."""
if hasattr(converter, 'js_to_url_function'):
data = converter.js_to_url_function()
else:
for cls in getmro(type(converter)):
if cls in js_to_url_functions:
src/s/y/sympy-old-HEAD/sympy/core/sympify.py sympy-old(Download)
"""sympify -- convert objects SymPy internal format""" from types import NoneType from inspect import getmro from core import BasicMeta
try:
return converter[cls](a)
except KeyError:
for superclass in getmro(cls):
try:
return converter[superclass](a)
except KeyError:
src/p/y/pythonedinburgh-HEAD/werkzeug/contrib/jsrouting.py pythonedinburgh(Download)
def dumps(*args):
raise RuntimeError('simplejson required for jsrouting')
from inspect import getmro
from werkzeug.templates import Template
from werkzeug.routing import NumberConverter
def js_to_url_function(converter):
"""Get the JavaScript converter function from a rule."""
if hasattr(converter, 'js_to_url_function'):
data = converter.js_to_url_function()
else:
for cls in getmro(type(converter)):
if cls in js_to_url_functions:
src/u/l/uliweb-HEAD/uliweb/lib/werkzeug/contrib/jsrouting.py uliweb(Download)
def dumps(*args):
raise RuntimeErrr('simplejson required for jsrouting')
from inspect import getmro
from werkzeug.minitmpl import Template
from werkzeug.routing import NumberConverter
def js_to_url_function(converter):
"""Get the JavaScript converter function from a rule."""
if hasattr(converter, 'js_to_url_function'):
data = converter.js_to_url_function()
else:
for cls in getmro(type(converter)):
if cls in js_to_url_functions:
src/b/a/banyanims-HEAD/trunk/dependencies/zope-instance-2.7.4-0/Products/Archetypes/utils.py banyanims(Download)
import sys import os, os.path import socket from random import random, randint from time import time from inspect import getargs, getmro from md5 import md5
def mergeSecurity(klass):
# This method looks into all the base classes and tries to
# merge the security declarations into the current class.
# Not needed in normal circumstances, but useful for debugging.
bases = list(getmro(klass))
bases.reverse()
security = _getSecurity(klass)
src/b/a/banyanims-HEAD/dependencies/zope-instance-2.7.4-0/Products/Archetypes/utils.py banyanims(Download)
import sys import os, os.path import socket from random import random, randint from time import time from inspect import getargs, getmro from md5 import md5
def mergeSecurity(klass):
# This method looks into all the base classes and tries to
# merge the security declarations into the current class.
# Not needed in normal circumstances, but useful for debugging.
bases = list(getmro(klass))
bases.reverse()
security = _getSecurity(klass)
src/p/u/pug-HEAD/pug/code_storage/CodeStorageExporter.py pug(Download)
"Functions for implementing export of python code" import time from inspect import isclass, getmro from pug.code_storage.constants import _INDENT, _STORE_UNICODE
if storageDict['is_class'] and \
(obj.__class__.__name__ == storageDict['name']):
cls = obj.__class__
mro = getmro(cls)
obj_class = mro[1]
import_module = mro[1].__module__
else:
1 | 2 | 3 Next