本文整理汇总了Python中entry.Entry.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.__init__方法的具体用法?Python Entry.__init__怎么用?Python Entry.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entry.Entry
的用法示例。
在下文中一共展示了Entry.__init__方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, section, etype, node):
Entry.__init__(self, section, etype, node)
self.return_invalid_entry = fdt_util.GetBool(self._node,
'return-invalid-entry')
self.return_unknown_contents = fdt_util.GetBool(self._node,
'return-unknown-contents')
self.bad_update_contents = fdt_util.GetBool(self._node,
'bad-update-contents')
self.return_contents_once = fdt_util.GetBool(self._node,
'return-contents-once')
# Set to True when the entry is ready to process the FDT.
self.process_fdt_ready = False
self.never_complete_process_fdt = fdt_util.GetBool(self._node,
'never-complete-process-fdt')
self.require_args = fdt_util.GetBool(self._node, 'require-args')
# This should be picked up by GetEntryArgsOrProps()
self.test_existing_prop = 'existing'
self.force_bad_datatype = fdt_util.GetBool(self._node,
'force-bad-datatype')
(self.test_str_fdt, self.test_str_arg, self.test_int_fdt,
self.test_int_arg, existing) = self.GetEntryArgsOrProps([
EntryArg('test-str-fdt', str),
EntryArg('test-str-arg', str),
EntryArg('test-int-fdt', int),
EntryArg('test-int-arg', int),
EntryArg('test-existing-prop', str)], self.require_args)
if self.force_bad_datatype:
self.GetEntryArgsOrProps([EntryArg('test-bad-datatype-arg', bool)])
self.return_contents = True
示例2: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, section, etype, node):
Entry.__init__(self, section, etype, node)
self.text_label, = self.GetEntryArgsOrProps(
[EntryArg('text-label', str)])
self.value, = self.GetEntryArgsOrProps([EntryArg(self.text_label, str)])
if not self.value:
self.Raise("No value provided for text label '%s'" %
self.text_label)
示例3: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, section, etype, node):
Entry.__init__(self, section, etype, node)
self.content = fdt_util.GetPhandleList(self._node, 'content')
if not self.content:
self.Raise("Vblock must have a 'content' property")
(self.keydir, self.keyblock, self.signprivate, self.version,
self.kernelkey, self.preamble_flags) = self.GetEntryArgsOrProps([
EntryArg('keydir', str),
EntryArg('keyblock', str),
EntryArg('signprivate', str),
EntryArg('version', int),
EntryArg('kernelkey', str),
EntryArg('preamble-flags', int)])
示例4: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, section, etype, node):
Entry.__init__(self, section, etype, node)
self.hardware_id, self.keydir, self.bmpblk = self.GetEntryArgsOrProps(
[EntryArg('hardware-id', str),
EntryArg('keydir', str),
EntryArg('bmpblk', str)])
# Read in the GBB flags from the config
self.gbb_flags = 0
flags_node = node.FindNode('flags')
if flags_node:
for flag, value in gbb_flag_properties.iteritems():
if fdt_util.GetBool(flags_node, flag):
self.gbb_flags |= value
示例5: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, index, parent, initials=None, name=None,
index_as=None, sort_as=None, meta=None, alias=None,
**rest):
for attribute in self._generated_fields:
setattr(self, attribute, dict.fromkeys([Entry.INFLECTION_NONE,]))
Entry.__init__(self, index, parent, meta)
# If this entry is an alias for another entry, indicate that
# here.
self.alias = alias
names = escape_aware_split(name, ',')
if len(names) > 1:
last_name, first_name = names
else:
last_name, first_name = names[0], ''
# Remove any preceding commas (',') and surrounding
# whitespace.
first_name = first_name.lstrip(',').strip()
field_variable_map = [
('reference', 'reference'),
('typeset_in_text_first', 'first_name'),
('typeset_in_text_last', 'last_name'),
('typeset_in_index', 'typeset_formal'),]
# Prepare the different local variables.
reference = initials
if first_name:
typeset_formal = '%s, %s' % (last_name, first_name)
else:
typeset_formal = last_name
for particle in ['the', 'von', 'van', 'van der']:
if first_name.endswith(particle):
last_name = ' '.join([first_name[-len(particle):], last_name])
first_name = first_name[:-len(particle)]
break # Will avoid the following else-clause.
variables = locals()
for field, variable in field_variable_map:
getattr(self, field)[Entry.INFLECTION_NONE] = variables[variable]
self.index_inflection = Entry.INFLECTION_NONE
示例6: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, index, parent, acronym=None, indent_level=None,
full_form=None, meta=None, alias=None, **rest):
# Set a couple of defining attributes before calling our base
# constructor.
for attribute in self._generated_fields:
setattr(self, attribute, dict.fromkeys([Entry.INFLECTION_SINGULAR,
Entry.INFLECTION_PLURAL]))
# Register this entry in the INDEX, set our PARENT and if we
# do have a parent, add ourselves to that PARENT's set of
# children.
Entry.__init__(self, index, parent, meta)
# If this entry is an alias for another entry, indicate that
# here.
self.alias = alias
self._setup(acronym, full_form, self._meta, indent_level)
# To enable a ConceptEntry to refer to an AcronymEntry:
self.typeset_in_index = self.typeset_in_index_long
示例7: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, text='text', getter=None, setter=None, on_change=None):
''' Create a text entry.
:Parameters:
`text` : str
Initial text
`getter` : function()
Function to be used to get actual value
`setter` : function(value)
Function to be used to set actual value
`on_change` : function(entry)
Function to be called when entry has changed
'''
self._text = text
self._setter = setter
self._getter = getter
self._on_change = on_change
Entry.__init__(self, text=text, on_change=self._on_commit)
self._expand[0] = True
if self._getter:
pyglet.clock.schedule_interval(self._update_text, 0.1)
self.text = text
示例8: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, index, parent, concept=None, indent_level=None,
plural=None, index_as=None, sort_as=None, meta=None,
alias=None, **rest):
# Set a couple of defining attributes before calling our base
# constructor.
for attribute in self._generated_fields:
setattr(self, attribute,
dict.fromkeys([Entry.INFLECTION_SINGULAR,
Entry.INFLECTION_PLURAL,
]))
# Call the base constructor.
Entry.__init__(self, index, parent, meta)
# If this entry is an alias for another entry, indicate that
# here.
self.alias = alias
if concept:
concept = self.unescape(concept.strip())
else:
concept = ''
self._setup(concept, self._meta, indent_level)
示例9: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, router=None, core=None, rdonly=True):
Entry.__init__(self, router, core)
self._temp = Temp(self, rdonly)
示例10: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, section, etype, node):
Entry.__init__(self, section, etype, node)
self.text_label, = self.GetEntryArgsOrProps(
[EntryArg('text-label', str)])
self.value, = self.GetEntryArgsOrProps([EntryArg(self.text_label, str)])
示例11: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, image, etype, node):
Entry.__init__(self, image, etype, node)
示例12: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, vrtx, edge, attr, router=None, core=None, rdonly=True):
Entry.__init__(self, router, core)
self._temp = Temp(self, rdonly)
self._vrtx = vrtx
self._edge = edge
self._attr = attr
示例13: __init__
# 需要导入模块: from entry import Entry [as 别名]
# 或者: from entry.Entry import __init__ [as 别名]
def __init__(self, section, etype, node):
Entry.__init__(self, section, etype, node)
if self.size is None:
self.Raise("'fill' entry must have a size property")
self.fill_value = fdt_util.GetByte(self._node, 'fill-byte', 0)