All Samples(413) | Call(87) | Derive(0) | Import(326)
classobj(name, bases, dict) Create a class object. The name must be a string; the second argument a tuple of classes, and the third a dictionary.
src/e/v/eventghost-HEAD/trunk/plugins/ZoomPlayer/__init__.py eventghost(Download)
import socket import asyncore import threading from types import ClassType class Text:
group = self.AddGroup('Navigational Commands')
for className, descr, scancode in NV_ACTIONS:
clsAttributes = dict(name=descr, value=scancode)
cls = ClassType(className, (NvAction,), clsAttributes)
group.AddAction(cls)
group = self.AddGroup('Regular Functions')
for className, descr in FN_ACTIONS:
clsAttributes = dict(
name=className[2:],
description=descr,
value=className
)
cls = ClassType(className, (FnAction,), clsAttributes)
description=descr,
value=className
)
cls = ClassType(className, (ExAction,), clsAttributes)
group.AddAction(cls)
self.AddAction(self.MyCommand)
src/e/v/eventghost-HEAD/trunk/eg/Classes/ActionGroup.py eventghost(Download)
# $LastChangedBy: bitmonster $ import eg from types import ClassType from eg.Utils import SetDefault
if identifier is not None:
description = name if description is None else description
defaultText = ClassType(
identifier,
(),
{"name": name, "description": description}
)
translatedText = getattr(plugin.text, identifier, None)
if translatedText is None:
translatedText = ClassType(identifier, (), {})
raise Exception("Actions must be subclasses of eg.ActionBase")
if clsName is not None:
actionCls = ClassType(
clsName,
(actionCls, ),
dict(name=name, description=description, value=value),
)
text = self.Translate(plugin, actionCls, actionClsName)
actionCls = ClassType(
actionClsName,
(actionCls, ),
dict(
name=text.name,
def Translate(self, plugin, actionCls, actionClsName):
defaultText = actionCls.text
if defaultText is None:
defaultText = ClassType(actionClsName, (), {})
translatedText = getattr(plugin.text, actionClsName, None)
if translatedText is None:
translatedText = ClassType(actionClsName, (), {})
src/e/v/eventghost-HEAD/plugins/ZoomPlayer/__init__.py eventghost(Download)
import socket import asyncore import threading from types import ClassType class Text:
group = self.AddGroup('Navigational Commands')
for className, descr, scancode in NV_ACTIONS:
clsAttributes = dict(name=descr, value=scancode)
cls = ClassType(className, (NvAction,), clsAttributes)
group.AddAction(cls)
group = self.AddGroup('Regular Functions')
for className, descr in FN_ACTIONS:
clsAttributes = dict(
name=className[2:],
description=descr,
value=className
)
cls = ClassType(className, (FnAction,), clsAttributes)
description=descr,
value=className
)
cls = ClassType(className, (ExAction,), clsAttributes)
group.AddAction(cls)
self.AddAction(self.MyCommand)
src/e/v/eventghost-HEAD/eg/Classes/ActionGroup.py eventghost(Download)
# $LastChangedBy: bitmonster $ import eg from types import ClassType from eg.Utils import SetDefault
if identifier is not None:
description = name if description is None else description
defaultText = ClassType(
identifier,
(),
{"name": name, "description": description}
)
translatedText = getattr(plugin.text, identifier, None)
if translatedText is None:
translatedText = ClassType(identifier, (), {})
raise Exception("Actions must be subclasses of eg.ActionBase")
if clsName is not None:
actionCls = ClassType(
clsName,
(actionCls, ),
dict(name=name, description=description, value=value),
)
text = self.Translate(plugin, actionCls, actionClsName)
actionCls = ClassType(
actionClsName,
(actionCls, ),
dict(
name=text.name,
def Translate(self, plugin, actionCls, actionClsName):
defaultText = actionCls.text
if defaultText is None:
defaultText = ClassType(actionClsName, (), {})
translatedText = getattr(plugin.text, actionClsName, None)
if translatedText is None:
translatedText = ClassType(actionClsName, (), {})
src/l/o/Loopy-0.1.0-3/src/loopy/libevent/wrapper.py Loopy(Download)
from ctypes import * from ctypes.util import find_library from types import ClassType as classobj import socket from decimal import Decimal, getcontext
def tailq_entry(eltype, name): #{{{
anon = classobj(name, (Structure,), {})
anon._fields_ = [("tqe_next", POINTER(eltype)),
("tqe_prev", POINTER(POINTER(eltype)))]
return anon
# End def #}}}
def rb_entry(eltype, name): #{{{
anon = classobj(name, (Structure,), {})
src/r/p/rpyc-3.0.7/rpyc/core/vinegar.py RPyC(Download)
import sys import exceptions import traceback from types import InstanceType, ClassType from rpyc.core import brine from rpyc.core import consts
if fullname not in _generic_exceptions_cache:
fakemodule = {"__module__" : "%s.%s" % (__name__, modname)}
if isinstance(GenericException, ClassType):
_generic_exceptions_cache[fullname] = ClassType(fullname, (GenericException,), fakemodule)
else:
_generic_exceptions_cache[fullname] = type(fullname, (GenericException,), fakemodule)
cls = _generic_exceptions_cache[fullname]
src/e/v/eventghost-HEAD/trunk/eg/Classes/Document.py eventghost(Download)
import eg import wx from types import ClassType import os from xml.etree import cElementTree as ElementTree from tempfile import mkstemp
def MakeCls(name):
baseCls = getattr(eg, name)
cls = ClassType(name, (ItemMixin, baseCls), itemNamespace)
self.XMLTag2ClassDict[cls.xmlTag] = cls
return cls
self.TreeLink = eg.TreeLink
src/e/v/eventghost-HEAD/eg/Classes/Document.py eventghost(Download)
import eg import wx from types import ClassType import os from xml.etree import cElementTree as ElementTree from tempfile import mkstemp
def MakeCls(name):
baseCls = getattr(eg, name)
cls = ClassType(name, (ItemMixin, baseCls), itemNamespace)
self.XMLTag2ClassDict[cls.xmlTag] = cls
return cls
self.TreeLink = eg.TreeLink
src/z/o/zope.app.twisted-3.5.0/src/twisted/spread/jelly.py zope.app.twisted(Download)
from types import DictionaryType from types import InstanceType from types import NoneType from types import ClassType import copy import datetime
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Doc/docutils/nodes.py ironruby(Download)
import os
import re
import warnings
from types import IntType, SliceType, StringType, UnicodeType, \
TupleType, ListType, ClassType, TypeType
from UserString import UserString
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next