How to use gds_format_integer method in autotest

Best Python code snippet using autotest_python

driverdatastructs.py

Source:driverdatastructs.py Github

copy

Full Screen

...104 def gds_format_base64(self, input_data, input_name=''):105 return base64.b64encode(input_data)106 def gds_validate_base64(self, input_data, node, input_name=''):107 return input_data108 def gds_format_integer(self, input_data, input_name=''):109 return '%d' % input_data110 def gds_validate_integer(self, input_data, node, input_name=''):111 return input_data112 def gds_format_integer_list(self, input_data, input_name=''):113 return '%s' % input_data114 def gds_validate_integer_list(self, input_data, node, input_name=''):115 values = input_data.split()116 for value in values:117 try:118 float(value)119 except (TypeError, ValueError):120 raise_parse_error(node, 'Requires sequence of integers')121 return input_data122 def gds_format_float(self, input_data, input_name=''):123 return ('%.15f' % input_data).rstrip('0')124 def gds_validate_float(self, input_data, node, input_name=''):125 return input_data126 def gds_format_float_list(self, input_data, input_name=''):127 return '%s' % input_data128 def gds_validate_float_list(self, input_data, node, input_name=''):129 values = input_data.split()130 for value in values:131 try:132 float(value)133 except (TypeError, ValueError):134 raise_parse_error(node, 'Requires sequence of floats')135 return input_data136 def gds_format_double(self, input_data, input_name=''):137 return '%e' % input_data138 def gds_validate_double(self, input_data, node, input_name=''):139 return input_data140 def gds_format_double_list(self, input_data, input_name=''):141 return '%s' % input_data142 def gds_validate_double_list(self, input_data, node, input_name=''):143 values = input_data.split()144 for value in values:145 try:146 float(value)147 except (TypeError, ValueError):148 raise_parse_error(node, 'Requires sequence of doubles')149 return input_data150 def gds_format_boolean(self, input_data, input_name=''):151 return ('%s' % input_data).lower()152 def gds_validate_boolean(self, input_data, node, input_name=''):153 return input_data154 def gds_format_boolean_list(self, input_data, input_name=''):155 return '%s' % input_data156 def gds_validate_boolean_list(self, input_data, node, input_name=''):157 values = input_data.split()158 for value in values:159 if value not in ('true', '1', 'false', '0', ):160 raise_parse_error(161 node,162 'Requires sequence of booleans '163 '("true", "1", "false", "0")')164 return input_data165 def gds_validate_datetime(self, input_data, node, input_name=''):166 return input_data167 def gds_format_datetime(self, input_data, input_name=''):168 if input_data.microsecond == 0:169 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (170 input_data.year,171 input_data.month,172 input_data.day,173 input_data.hour,174 input_data.minute,175 input_data.second,176 )177 else:178 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (179 input_data.year,180 input_data.month,181 input_data.day,182 input_data.hour,183 input_data.minute,184 input_data.second,185 ('%f' % (float(input_data.microsecond) / 1000000))[2:],186 )187 if input_data.tzinfo is not None:188 tzoff = input_data.tzinfo.utcoffset(input_data)189 if tzoff is not None:190 total_seconds = tzoff.seconds + (86400 * tzoff.days)191 if total_seconds == 0:192 _svalue += 'Z'193 else:194 if total_seconds < 0:195 _svalue += '-'196 total_seconds *= -1197 else:198 _svalue += '+'199 hours = total_seconds // 3600200 minutes = (total_seconds - (hours * 3600)) // 60201 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)202 return _svalue203 @classmethod204 def gds_parse_datetime(cls, input_data):205 tz = None206 if input_data[-1] == 'Z':207 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')208 input_data = input_data[:-1]209 else:210 results = GeneratedsSuper.tzoff_pattern.search(input_data)211 if results is not None:212 tzoff_parts = results.group(2).split(':')213 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])214 if results.group(1) == '-':215 tzoff *= -1216 tz = GeneratedsSuper._FixedOffsetTZ(217 tzoff, results.group(0))218 input_data = input_data[:-6]219 time_parts = input_data.split('.')220 if len(time_parts) > 1:221 micro_seconds = int(float('0.' + time_parts[1]) * 1000000)222 input_data = '%s.%s' % (time_parts[0], micro_seconds, )223 dt = datetime_.datetime.strptime(224 input_data, '%Y-%m-%dT%H:%M:%S.%f')225 else:226 dt = datetime_.datetime.strptime(227 input_data, '%Y-%m-%dT%H:%M:%S')228 dt = dt.replace(tzinfo=tz)229 return dt230 def gds_validate_date(self, input_data, node, input_name=''):231 return input_data232 def gds_format_date(self, input_data, input_name=''):233 _svalue = '%04d-%02d-%02d' % (234 input_data.year,235 input_data.month,236 input_data.day,237 )238 try:239 if input_data.tzinfo is not None:240 tzoff = input_data.tzinfo.utcoffset(input_data)241 if tzoff is not None:242 total_seconds = tzoff.seconds + (86400 * tzoff.days)243 if total_seconds == 0:244 _svalue += 'Z'245 else:246 if total_seconds < 0:247 _svalue += '-'248 total_seconds *= -1249 else:250 _svalue += '+'251 hours = total_seconds // 3600252 minutes = (total_seconds - (hours * 3600)) // 60253 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)254 except AttributeError:255 pass256 return _svalue257 @classmethod258 def gds_parse_date(cls, input_data):259 tz = None260 if input_data[-1] == 'Z':261 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')262 input_data = input_data[:-1]263 else:264 results = GeneratedsSuper.tzoff_pattern.search(input_data)265 if results is not None:266 tzoff_parts = results.group(2).split(':')267 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])268 if results.group(1) == '-':269 tzoff *= -1270 tz = GeneratedsSuper._FixedOffsetTZ(271 tzoff, results.group(0))272 input_data = input_data[:-6]273 dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')274 dt = dt.replace(tzinfo=tz)275 return dt.date()276 def gds_validate_time(self, input_data, node, input_name=''):277 return input_data278 def gds_format_time(self, input_data, input_name=''):279 if input_data.microsecond == 0:280 _svalue = '%02d:%02d:%02d' % (281 input_data.hour,282 input_data.minute,283 input_data.second,284 )285 else:286 _svalue = '%02d:%02d:%02d.%s' % (287 input_data.hour,288 input_data.minute,289 input_data.second,290 ('%f' % (float(input_data.microsecond) / 1000000))[2:],291 )292 if input_data.tzinfo is not None:293 tzoff = input_data.tzinfo.utcoffset(input_data)294 if tzoff is not None:295 total_seconds = tzoff.seconds + (86400 * tzoff.days)296 if total_seconds == 0:297 _svalue += 'Z'298 else:299 if total_seconds < 0:300 _svalue += '-'301 total_seconds *= -1302 else:303 _svalue += '+'304 hours = total_seconds // 3600305 minutes = (total_seconds - (hours * 3600)) // 60306 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)307 return _svalue308 @classmethod309 def gds_parse_time(cls, input_data):310 tz = None311 if input_data[-1] == 'Z':312 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')313 input_data = input_data[:-1]314 else:315 results = GeneratedsSuper.tzoff_pattern.search(input_data)316 if results is not None:317 tzoff_parts = results.group(2).split(':')318 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])319 if results.group(1) == '-':320 tzoff *= -1321 tz = GeneratedsSuper._FixedOffsetTZ(322 tzoff, results.group(0))323 input_data = input_data[:-6]324 if len(input_data.split('.')) > 1:325 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')326 else:327 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')328 dt = dt.replace(tzinfo=tz)329 return dt.time()330 def gds_str_lower(self, instring):331 return instring.lower()332 def get_path_(self, node):333 path_list = []334 self.get_path_list_(node, path_list)335 path_list.reverse()336 path = '/'.join(path_list)337 return path338 Tag_strip_pattern_ = re_.compile(r'\{.*\}')339 def get_path_list_(self, node, path_list):340 if node is None:341 return342 tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)343 if tag:344 path_list.append(tag)345 self.get_path_list_(node.getparent(), path_list)346 def get_class_obj_(self, node, default_class=None):347 class_obj1 = default_class348 if 'xsi' in node.nsmap:349 classname = node.get('{%s}type' % node.nsmap['xsi'])350 if classname is not None:351 names = classname.split(':')352 if len(names) == 2:353 classname = names[1]354 class_obj2 = globals().get(classname)355 if class_obj2 is not None:356 class_obj1 = class_obj2357 return class_obj1358 def gds_build_any(self, node, type_name=None):359 return None360 @classmethod361 def gds_reverse_node_mapping(cls, mapping):362 return dict(((v, k) for k, v in mapping.iteritems()))363#364# If you have installed IPython you can uncomment and use the following.365# IPython is available from http://ipython.scipy.org/.366#367## from IPython.Shell import IPShellEmbed368## args = ''369## ipshell = IPShellEmbed(args,370## banner = 'Dropping into IPython',371## exit_msg = 'Leaving Interpreter, back to program.')372# Then use the following line where and when you want to drop into the373# IPython shell:374# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')375#376# Globals377#378ExternalEncoding = 'utf-8'379Tag_pattern_ = re_.compile(r'({.*})?(.*)')380String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")381Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')382#383# Support/utility functions.384#385def showIndent(outfile, level, pretty_print=True):386 if pretty_print:387 for idx in range(level):388 outfile.write(' ')389def quote_xml(inStr):390 if not inStr:391 return ''392 s1 = (isinstance(inStr, basestring) and inStr or393 '%s' % inStr)394 s1 = s1.replace('&', '&amp;')395 s1 = s1.replace('<', '&lt;')396 s1 = s1.replace('>', '&gt;')397 return s1398def quote_attrib(inStr):399 s1 = (isinstance(inStr, basestring) and inStr or400 '%s' % inStr)401 s1 = s1.replace('&', '&amp;')402 s1 = s1.replace('<', '&lt;')403 s1 = s1.replace('>', '&gt;')404 if '"' in s1:405 if "'" in s1:406 s1 = '"%s"' % s1.replace('"', "&quot;")407 else:408 s1 = "'%s'" % s1409 else:410 s1 = '"%s"' % s1411 return s1412def quote_python(inStr):413 s1 = inStr414 if s1.find("'") == -1:415 if s1.find('\n') == -1:416 return "'%s'" % s1417 else:418 return "'''%s'''" % s1419 else:420 if s1.find('"') != -1:421 s1 = s1.replace('"', '\\"')422 if s1.find('\n') == -1:423 return '"%s"' % s1424 else:425 return '"""%s"""' % s1426def get_all_text_(node):427 if node.text is not None:428 text = node.text429 else:430 text = ''431 for child in node:432 if child.tail is not None:433 text += child.tail434 return text435def find_attr_value_(attr_name, node):436 attrs = node.attrib437 attr_parts = attr_name.split(':')438 value = None439 if len(attr_parts) == 1:440 value = attrs.get(attr_name)441 elif len(attr_parts) == 2:442 prefix, name = attr_parts443 namespace = node.nsmap.get(prefix)444 if namespace is not None:445 value = attrs.get('{%s}%s' % (namespace, name, ))446 return value447class GDSParseError(Exception):448 pass449def raise_parse_error(node, msg):450 if XMLParser_import_library == XMLParser_import_lxml:451 msg = '%s (element %s/line %d)' % (452 msg, node.tag, node.sourceline, )453 else:454 msg = '%s (element %s)' % (msg, node.tag, )455 raise GDSParseError(msg)456class MixedContainer:457 # Constants for category:458 CategoryNone = 0459 CategoryText = 1460 CategorySimple = 2461 CategoryComplex = 3462 # Constants for content_type:463 TypeNone = 0464 TypeText = 1465 TypeString = 2466 TypeInteger = 3467 TypeFloat = 4468 TypeDecimal = 5469 TypeDouble = 6470 TypeBoolean = 7471 TypeBase64 = 8472 def __init__(self, category, content_type, name, value):473 self.category = category474 self.content_type = content_type475 self.name = name476 self.value = value477 def getCategory(self):478 return self.category479 def getContenttype(self, content_type):480 return self.content_type481 def getValue(self):482 return self.value483 def getName(self):484 return self.name485 def export(self, outfile, level, name, namespace, pretty_print=True):486 if self.category == MixedContainer.CategoryText:487 # Prevent exporting empty content as empty lines.488 if self.value.strip():489 outfile.write(self.value)490 elif self.category == MixedContainer.CategorySimple:491 self.exportSimple(outfile, level, name)492 else: # category == MixedContainer.CategoryComplex493 self.value.export(outfile, level, namespace, name, pretty_print)494 def exportSimple(self, outfile, level, name):495 if self.content_type == MixedContainer.TypeString:496 outfile.write('<%s>%s</%s>' % (497 self.name, self.value, self.name))498 elif self.content_type == MixedContainer.TypeInteger or \499 self.content_type == MixedContainer.TypeBoolean:500 outfile.write('<%s>%d</%s>' % (501 self.name, self.value, self.name))502 elif self.content_type == MixedContainer.TypeFloat or \503 self.content_type == MixedContainer.TypeDecimal:504 outfile.write('<%s>%f</%s>' % (505 self.name, self.value, self.name))506 elif self.content_type == MixedContainer.TypeDouble:507 outfile.write('<%s>%g</%s>' % (508 self.name, self.value, self.name))509 elif self.content_type == MixedContainer.TypeBase64:510 outfile.write('<%s>%s</%s>' % (511 self.name, base64.b64encode(self.value), self.name))512 def to_etree(self, element):513 if self.category == MixedContainer.CategoryText:514 # Prevent exporting empty content as empty lines.515 if self.value.strip():516 if len(element) > 0:517 if element[-1].tail is None:518 element[-1].tail = self.value519 else:520 element[-1].tail += self.value521 else:522 if element.text is None:523 element.text = self.value524 else:525 element.text += self.value526 elif self.category == MixedContainer.CategorySimple:527 subelement = etree_.SubElement(element, '%s' % self.name)528 subelement.text = self.to_etree_simple()529 else: # category == MixedContainer.CategoryComplex530 self.value.to_etree(element)531 def to_etree_simple(self):532 if self.content_type == MixedContainer.TypeString:533 text = self.value534 elif (self.content_type == MixedContainer.TypeInteger or535 self.content_type == MixedContainer.TypeBoolean):536 text = '%d' % self.value537 elif (self.content_type == MixedContainer.TypeFloat or538 self.content_type == MixedContainer.TypeDecimal):539 text = '%f' % self.value540 elif self.content_type == MixedContainer.TypeDouble:541 text = '%g' % self.value542 elif self.content_type == MixedContainer.TypeBase64:543 text = '%s' % base64.b64encode(self.value)544 return text545 def exportLiteral(self, outfile, level, name):546 if self.category == MixedContainer.CategoryText:547 showIndent(outfile, level)548 outfile.write(549 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (550 self.category, self.content_type, self.name, self.value))551 elif self.category == MixedContainer.CategorySimple:552 showIndent(outfile, level)553 outfile.write(554 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (555 self.category, self.content_type, self.name, self.value))556 else: # category == MixedContainer.CategoryComplex557 showIndent(outfile, level)558 outfile.write(559 'model_.MixedContainer(%d, %d, "%s",\n' % (560 self.category, self.content_type, self.name,))561 self.value.exportLiteral(outfile, level + 1)562 showIndent(outfile, level)563 outfile.write(')\n')564class MemberSpec_(object):565 def __init__(self, name='', data_type='', container=0):566 self.name = name567 self.data_type = data_type568 self.container = container569 def set_name(self, name): self.name = name570 def get_name(self): return self.name571 def set_data_type(self, data_type): self.data_type = data_type572 def get_data_type_chain(self): return self.data_type573 def get_data_type(self):574 if isinstance(self.data_type, list):575 if len(self.data_type) > 0:576 return self.data_type[-1]577 else:578 return 'xs:string'579 else:580 return self.data_type581 def set_container(self, container): self.container = container582 def get_container(self): return self.container583def _cast(typ, value):584 if typ is None or value is None:585 return value586 return typ(value)587#588# Data representation classes.589#590class root(GeneratedsSuper):591 subclass = None592 superclass = None593 def __init__(self, Driver=None):594 self.original_tagname_ = None595 if Driver is None:596 self.Driver = []597 else:598 self.Driver = Driver599 def factory(*args_, **kwargs_):600 if root.subclass:601 return root.subclass(*args_, **kwargs_)602 else:603 return root(*args_, **kwargs_)604 factory = staticmethod(factory)605 def get_Driver(self): return self.Driver606 def set_Driver(self, Driver): self.Driver = Driver607 def add_Driver(self, value): self.Driver.append(value)608 def insert_Driver_at(self, index, value): self.Driver.insert(index, value)609 def replace_Driver_at(self, index, value): self.Driver[index] = value610 def hasContent_(self):611 if (612 self.Driver613 ):614 return True615 else:616 return False617 def export(self, outfile, level, namespace_='', name_='root', namespacedef_='', pretty_print=True):618 if pretty_print:619 eol_ = '\n'620 else:621 eol_ = ''622 if self.original_tagname_ is not None:623 name_ = self.original_tagname_624 showIndent(outfile, level, pretty_print)625 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))626 already_processed = set()627 self.exportAttributes(outfile, level, already_processed, namespace_, name_='root')628 if self.hasContent_():629 outfile.write('>%s' % (eol_, ))630 self.exportChildren(outfile, level + 1, namespace_='', name_='root', pretty_print=pretty_print)631 showIndent(outfile, level, pretty_print)632 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))633 else:634 outfile.write('/>%s' % (eol_, ))635 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='root'):636 pass637 def exportChildren(self, outfile, level, namespace_='', name_='root', fromsubclass_=False, pretty_print=True):638 if pretty_print:639 eol_ = '\n'640 else:641 eol_ = ''642 for Driver_ in self.Driver:643 Driver_.export(outfile, level, namespace_, name_='Driver', pretty_print=pretty_print)644 def exportLiteral(self, outfile, level, name_='root'):645 level += 1646 already_processed = set()647 self.exportLiteralAttributes(outfile, level, already_processed, name_)648 if self.hasContent_():649 self.exportLiteralChildren(outfile, level, name_)650 def exportLiteralAttributes(self, outfile, level, already_processed, name_):651 pass652 def exportLiteralChildren(self, outfile, level, name_):653 showIndent(outfile, level)654 outfile.write('Driver=[\n')655 level += 1656 for Driver_ in self.Driver:657 showIndent(outfile, level)658 outfile.write('model_.DriverType(\n')659 Driver_.exportLiteral(outfile, level, name_='DriverType')660 showIndent(outfile, level)661 outfile.write('),\n')662 level -= 1663 showIndent(outfile, level)664 outfile.write('],\n')665 def build(self, node):666 already_processed = set()667 self.buildAttributes(node, node.attrib, already_processed)668 for child in node:669 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]670 self.buildChildren(child, node, nodeName_)671 return self672 def buildAttributes(self, node, attrs, already_processed):673 pass674 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):675 if nodeName_ == 'Driver':676 obj_ = DriverType.factory()677 obj_.build(child_)678 self.Driver.append(obj_)679 obj_.original_tagname_ = 'Driver'680# end class root681class DriverType(GeneratedsSuper):682 subclass = None683 superclass = None684 def __init__(self, resultitemtype=None, ServiceKeyName=None, ImagePath=None, Type=None, DriverObj_Location=None, DeviceObj_Location=None, Driver_Init=None, Driver_StartIO=None, Driver_Unload=None, BaseAddress=None, StartTime=None, Dependencies=None, Size=None, Instances=None, Name=None, StartedAs=None, State=None, RealState=None, StartMode=None, RealStartMode=None, RealType=None, Path=None, plist=None, MD5=None, SHA1=None, FuzzySize=None, Fuzzy=None, Fuzzy2X=None, KFFStatus=None, processid=None, IRP_MJ_CREATE=None, IRP_MJ_CREATE_NAMED_PIPE=None, IRP_MJ_CLOSE=None, IRP_MJ_READ=None, IRP_MJ_WRITE=None, IRP_MJ_QUERY_INFORMATION=None, IRP_MJ_SET_INFORMATION=None, IRP_MJ_QUERY_EA=None, IRP_MJ_SET_EA=None, IRP_MJ_FLUSH_BUFFERS=None, IRP_MJ_QUERY_VOLUME_INFORMATION=None, IRP_MJ_SET_VOLUME_INFORMATION=None, IRP_MJ_DIRECTORY_CONTROL=None, IRP_MJ_FILE_SYSTEM_CONTROL=None, IRP_MJ_DEVICE_CONTROL=None, IRP_MJ_INTERNAL_DEVICE_CONTROL=None, IRP_MJ_SHUTDOWN=None, IRP_MJ_LOCK_CONTROL=None, IRP_MJ_CLEANUP=None, IRP_MJ_CREATE_MAILSLOT=None, IRP_MJ_QUERY_SECURITY=None, IRP_MJ_SET_SECURITY=None, IRP_MJ_POWER=None, IRP_MJ_SYSTEM_CONTROL=None, IRP_MJ_DEVICE_CHANGE=None, IRP_MJ_QUERY_QUOTA=None, IRP_MJ_SET_QUOTA=None, IRP_MJ_PNP=None, Driver_Device_List=None):685 self.original_tagname_ = None686 self.resultitemtype = _cast(int, resultitemtype)687 self.ServiceKeyName = ServiceKeyName688 self.ImagePath = ImagePath689 self.Type = Type690 self.DriverObj_Location = DriverObj_Location691 self.DeviceObj_Location = DeviceObj_Location692 self.Driver_Init = Driver_Init693 self.Driver_StartIO = Driver_StartIO694 self.Driver_Unload = Driver_Unload695 self.BaseAddress = BaseAddress696 self.StartTime = StartTime697 self.Dependencies = Dependencies698 self.Size = Size699 self.Instances = Instances700 self.Name = Name701 self.StartedAs = StartedAs702 self.State = State703 self.RealState = RealState704 self.StartMode = StartMode705 self.RealStartMode = RealStartMode706 self.RealType = RealType707 self.Path = Path708 self.plist = plist709 self.MD5 = MD5710 self.SHA1 = SHA1711 self.FuzzySize = FuzzySize712 self.Fuzzy = Fuzzy713 self.Fuzzy2X = Fuzzy2X714 self.KFFStatus = KFFStatus715 self.processid = processid716 self.IRP_MJ_CREATE = IRP_MJ_CREATE717 self.IRP_MJ_CREATE_NAMED_PIPE = IRP_MJ_CREATE_NAMED_PIPE718 self.IRP_MJ_CLOSE = IRP_MJ_CLOSE719 self.IRP_MJ_READ = IRP_MJ_READ720 self.IRP_MJ_WRITE = IRP_MJ_WRITE721 self.IRP_MJ_QUERY_INFORMATION = IRP_MJ_QUERY_INFORMATION722 self.IRP_MJ_SET_INFORMATION = IRP_MJ_SET_INFORMATION723 self.IRP_MJ_QUERY_EA = IRP_MJ_QUERY_EA724 self.IRP_MJ_SET_EA = IRP_MJ_SET_EA725 self.IRP_MJ_FLUSH_BUFFERS = IRP_MJ_FLUSH_BUFFERS726 self.IRP_MJ_QUERY_VOLUME_INFORMATION = IRP_MJ_QUERY_VOLUME_INFORMATION727 self.IRP_MJ_SET_VOLUME_INFORMATION = IRP_MJ_SET_VOLUME_INFORMATION728 self.IRP_MJ_DIRECTORY_CONTROL = IRP_MJ_DIRECTORY_CONTROL729 self.IRP_MJ_FILE_SYSTEM_CONTROL = IRP_MJ_FILE_SYSTEM_CONTROL730 self.IRP_MJ_DEVICE_CONTROL = IRP_MJ_DEVICE_CONTROL731 self.IRP_MJ_INTERNAL_DEVICE_CONTROL = IRP_MJ_INTERNAL_DEVICE_CONTROL732 self.IRP_MJ_SHUTDOWN = IRP_MJ_SHUTDOWN733 self.IRP_MJ_LOCK_CONTROL = IRP_MJ_LOCK_CONTROL734 self.IRP_MJ_CLEANUP = IRP_MJ_CLEANUP735 self.IRP_MJ_CREATE_MAILSLOT = IRP_MJ_CREATE_MAILSLOT736 self.IRP_MJ_QUERY_SECURITY = IRP_MJ_QUERY_SECURITY737 self.IRP_MJ_SET_SECURITY = IRP_MJ_SET_SECURITY738 self.IRP_MJ_POWER = IRP_MJ_POWER739 self.IRP_MJ_SYSTEM_CONTROL = IRP_MJ_SYSTEM_CONTROL740 self.IRP_MJ_DEVICE_CHANGE = IRP_MJ_DEVICE_CHANGE741 self.IRP_MJ_QUERY_QUOTA = IRP_MJ_QUERY_QUOTA742 self.IRP_MJ_SET_QUOTA = IRP_MJ_SET_QUOTA743 self.IRP_MJ_PNP = IRP_MJ_PNP744 self.Driver_Device_List = Driver_Device_List745 def factory(*args_, **kwargs_):746 if DriverType.subclass:747 return DriverType.subclass(*args_, **kwargs_)748 else:749 return DriverType(*args_, **kwargs_)750 factory = staticmethod(factory)751 def get_ServiceKeyName(self): return self.ServiceKeyName752 def set_ServiceKeyName(self, ServiceKeyName): self.ServiceKeyName = ServiceKeyName753 def get_ImagePath(self): return self.ImagePath754 def set_ImagePath(self, ImagePath): self.ImagePath = ImagePath755 def get_Type(self): return self.Type756 def set_Type(self, Type): self.Type = Type757 def get_DriverObj_Location(self): return self.DriverObj_Location758 def set_DriverObj_Location(self, DriverObj_Location): self.DriverObj_Location = DriverObj_Location759 def get_DeviceObj_Location(self): return self.DeviceObj_Location760 def set_DeviceObj_Location(self, DeviceObj_Location): self.DeviceObj_Location = DeviceObj_Location761 def get_Driver_Init(self): return self.Driver_Init762 def set_Driver_Init(self, Driver_Init): self.Driver_Init = Driver_Init763 def get_Driver_StartIO(self): return self.Driver_StartIO764 def set_Driver_StartIO(self, Driver_StartIO): self.Driver_StartIO = Driver_StartIO765 def get_Driver_Unload(self): return self.Driver_Unload766 def set_Driver_Unload(self, Driver_Unload): self.Driver_Unload = Driver_Unload767 def get_BaseAddress(self): return self.BaseAddress768 def set_BaseAddress(self, BaseAddress): self.BaseAddress = BaseAddress769 def get_StartTime(self): return self.StartTime770 def set_StartTime(self, StartTime): self.StartTime = StartTime771 def get_Dependencies(self): return self.Dependencies772 def set_Dependencies(self, Dependencies): self.Dependencies = Dependencies773 def get_Size(self): return self.Size774 def set_Size(self, Size): self.Size = Size775 def get_Instances(self): return self.Instances776 def set_Instances(self, Instances): self.Instances = Instances777 def get_Name(self): return self.Name778 def set_Name(self, Name): self.Name = Name779 def get_StartedAs(self): return self.StartedAs780 def set_StartedAs(self, StartedAs): self.StartedAs = StartedAs781 def get_State(self): return self.State782 def set_State(self, State): self.State = State783 def get_RealState(self): return self.RealState784 def set_RealState(self, RealState): self.RealState = RealState785 def get_StartMode(self): return self.StartMode786 def set_StartMode(self, StartMode): self.StartMode = StartMode787 def get_RealStartMode(self): return self.RealStartMode788 def set_RealStartMode(self, RealStartMode): self.RealStartMode = RealStartMode789 def get_RealType(self): return self.RealType790 def set_RealType(self, RealType): self.RealType = RealType791 def get_Path(self): return self.Path792 def set_Path(self, Path): self.Path = Path793 def get_plist(self): return self.plist794 def set_plist(self, plist): self.plist = plist795 def get_MD5(self): return self.MD5796 def set_MD5(self, MD5): self.MD5 = MD5797 def get_SHA1(self): return self.SHA1798 def set_SHA1(self, SHA1): self.SHA1 = SHA1799 def get_FuzzySize(self): return self.FuzzySize800 def set_FuzzySize(self, FuzzySize): self.FuzzySize = FuzzySize801 def get_Fuzzy(self): return self.Fuzzy802 def set_Fuzzy(self, Fuzzy): self.Fuzzy = Fuzzy803 def get_Fuzzy2X(self): return self.Fuzzy2X804 def set_Fuzzy2X(self, Fuzzy2X): self.Fuzzy2X = Fuzzy2X805 def get_KFFStatus(self): return self.KFFStatus806 def set_KFFStatus(self, KFFStatus): self.KFFStatus = KFFStatus807 def get_processid(self): return self.processid808 def set_processid(self, processid): self.processid = processid809 def get_IRP_MJ_CREATE(self): return self.IRP_MJ_CREATE810 def set_IRP_MJ_CREATE(self, IRP_MJ_CREATE): self.IRP_MJ_CREATE = IRP_MJ_CREATE811 def get_IRP_MJ_CREATE_NAMED_PIPE(self): return self.IRP_MJ_CREATE_NAMED_PIPE812 def set_IRP_MJ_CREATE_NAMED_PIPE(self, IRP_MJ_CREATE_NAMED_PIPE): self.IRP_MJ_CREATE_NAMED_PIPE = IRP_MJ_CREATE_NAMED_PIPE813 def get_IRP_MJ_CLOSE(self): return self.IRP_MJ_CLOSE814 def set_IRP_MJ_CLOSE(self, IRP_MJ_CLOSE): self.IRP_MJ_CLOSE = IRP_MJ_CLOSE815 def get_IRP_MJ_READ(self): return self.IRP_MJ_READ816 def set_IRP_MJ_READ(self, IRP_MJ_READ): self.IRP_MJ_READ = IRP_MJ_READ817 def get_IRP_MJ_WRITE(self): return self.IRP_MJ_WRITE818 def set_IRP_MJ_WRITE(self, IRP_MJ_WRITE): self.IRP_MJ_WRITE = IRP_MJ_WRITE819 def get_IRP_MJ_QUERY_INFORMATION(self): return self.IRP_MJ_QUERY_INFORMATION820 def set_IRP_MJ_QUERY_INFORMATION(self, IRP_MJ_QUERY_INFORMATION): self.IRP_MJ_QUERY_INFORMATION = IRP_MJ_QUERY_INFORMATION821 def get_IRP_MJ_SET_INFORMATION(self): return self.IRP_MJ_SET_INFORMATION822 def set_IRP_MJ_SET_INFORMATION(self, IRP_MJ_SET_INFORMATION): self.IRP_MJ_SET_INFORMATION = IRP_MJ_SET_INFORMATION823 def get_IRP_MJ_QUERY_EA(self): return self.IRP_MJ_QUERY_EA824 def set_IRP_MJ_QUERY_EA(self, IRP_MJ_QUERY_EA): self.IRP_MJ_QUERY_EA = IRP_MJ_QUERY_EA825 def get_IRP_MJ_SET_EA(self): return self.IRP_MJ_SET_EA826 def set_IRP_MJ_SET_EA(self, IRP_MJ_SET_EA): self.IRP_MJ_SET_EA = IRP_MJ_SET_EA827 def get_IRP_MJ_FLUSH_BUFFERS(self): return self.IRP_MJ_FLUSH_BUFFERS828 def set_IRP_MJ_FLUSH_BUFFERS(self, IRP_MJ_FLUSH_BUFFERS): self.IRP_MJ_FLUSH_BUFFERS = IRP_MJ_FLUSH_BUFFERS829 def get_IRP_MJ_QUERY_VOLUME_INFORMATION(self): return self.IRP_MJ_QUERY_VOLUME_INFORMATION830 def set_IRP_MJ_QUERY_VOLUME_INFORMATION(self, IRP_MJ_QUERY_VOLUME_INFORMATION): self.IRP_MJ_QUERY_VOLUME_INFORMATION = IRP_MJ_QUERY_VOLUME_INFORMATION831 def get_IRP_MJ_SET_VOLUME_INFORMATION(self): return self.IRP_MJ_SET_VOLUME_INFORMATION832 def set_IRP_MJ_SET_VOLUME_INFORMATION(self, IRP_MJ_SET_VOLUME_INFORMATION): self.IRP_MJ_SET_VOLUME_INFORMATION = IRP_MJ_SET_VOLUME_INFORMATION833 def get_IRP_MJ_DIRECTORY_CONTROL(self): return self.IRP_MJ_DIRECTORY_CONTROL834 def set_IRP_MJ_DIRECTORY_CONTROL(self, IRP_MJ_DIRECTORY_CONTROL): self.IRP_MJ_DIRECTORY_CONTROL = IRP_MJ_DIRECTORY_CONTROL835 def get_IRP_MJ_FILE_SYSTEM_CONTROL(self): return self.IRP_MJ_FILE_SYSTEM_CONTROL836 def set_IRP_MJ_FILE_SYSTEM_CONTROL(self, IRP_MJ_FILE_SYSTEM_CONTROL): self.IRP_MJ_FILE_SYSTEM_CONTROL = IRP_MJ_FILE_SYSTEM_CONTROL837 def get_IRP_MJ_DEVICE_CONTROL(self): return self.IRP_MJ_DEVICE_CONTROL838 def set_IRP_MJ_DEVICE_CONTROL(self, IRP_MJ_DEVICE_CONTROL): self.IRP_MJ_DEVICE_CONTROL = IRP_MJ_DEVICE_CONTROL839 def get_IRP_MJ_INTERNAL_DEVICE_CONTROL(self): return self.IRP_MJ_INTERNAL_DEVICE_CONTROL840 def set_IRP_MJ_INTERNAL_DEVICE_CONTROL(self, IRP_MJ_INTERNAL_DEVICE_CONTROL): self.IRP_MJ_INTERNAL_DEVICE_CONTROL = IRP_MJ_INTERNAL_DEVICE_CONTROL841 def get_IRP_MJ_SHUTDOWN(self): return self.IRP_MJ_SHUTDOWN842 def set_IRP_MJ_SHUTDOWN(self, IRP_MJ_SHUTDOWN): self.IRP_MJ_SHUTDOWN = IRP_MJ_SHUTDOWN843 def get_IRP_MJ_LOCK_CONTROL(self): return self.IRP_MJ_LOCK_CONTROL844 def set_IRP_MJ_LOCK_CONTROL(self, IRP_MJ_LOCK_CONTROL): self.IRP_MJ_LOCK_CONTROL = IRP_MJ_LOCK_CONTROL845 def get_IRP_MJ_CLEANUP(self): return self.IRP_MJ_CLEANUP846 def set_IRP_MJ_CLEANUP(self, IRP_MJ_CLEANUP): self.IRP_MJ_CLEANUP = IRP_MJ_CLEANUP847 def get_IRP_MJ_CREATE_MAILSLOT(self): return self.IRP_MJ_CREATE_MAILSLOT848 def set_IRP_MJ_CREATE_MAILSLOT(self, IRP_MJ_CREATE_MAILSLOT): self.IRP_MJ_CREATE_MAILSLOT = IRP_MJ_CREATE_MAILSLOT849 def get_IRP_MJ_QUERY_SECURITY(self): return self.IRP_MJ_QUERY_SECURITY850 def set_IRP_MJ_QUERY_SECURITY(self, IRP_MJ_QUERY_SECURITY): self.IRP_MJ_QUERY_SECURITY = IRP_MJ_QUERY_SECURITY851 def get_IRP_MJ_SET_SECURITY(self): return self.IRP_MJ_SET_SECURITY852 def set_IRP_MJ_SET_SECURITY(self, IRP_MJ_SET_SECURITY): self.IRP_MJ_SET_SECURITY = IRP_MJ_SET_SECURITY853 def get_IRP_MJ_POWER(self): return self.IRP_MJ_POWER854 def set_IRP_MJ_POWER(self, IRP_MJ_POWER): self.IRP_MJ_POWER = IRP_MJ_POWER855 def get_IRP_MJ_SYSTEM_CONTROL(self): return self.IRP_MJ_SYSTEM_CONTROL856 def set_IRP_MJ_SYSTEM_CONTROL(self, IRP_MJ_SYSTEM_CONTROL): self.IRP_MJ_SYSTEM_CONTROL = IRP_MJ_SYSTEM_CONTROL857 def get_IRP_MJ_DEVICE_CHANGE(self): return self.IRP_MJ_DEVICE_CHANGE858 def set_IRP_MJ_DEVICE_CHANGE(self, IRP_MJ_DEVICE_CHANGE): self.IRP_MJ_DEVICE_CHANGE = IRP_MJ_DEVICE_CHANGE859 def get_IRP_MJ_QUERY_QUOTA(self): return self.IRP_MJ_QUERY_QUOTA860 def set_IRP_MJ_QUERY_QUOTA(self, IRP_MJ_QUERY_QUOTA): self.IRP_MJ_QUERY_QUOTA = IRP_MJ_QUERY_QUOTA861 def get_IRP_MJ_SET_QUOTA(self): return self.IRP_MJ_SET_QUOTA862 def set_IRP_MJ_SET_QUOTA(self, IRP_MJ_SET_QUOTA): self.IRP_MJ_SET_QUOTA = IRP_MJ_SET_QUOTA863 def get_IRP_MJ_PNP(self): return self.IRP_MJ_PNP864 def set_IRP_MJ_PNP(self, IRP_MJ_PNP): self.IRP_MJ_PNP = IRP_MJ_PNP865 def get_Driver_Device_List(self): return self.Driver_Device_List866 def set_Driver_Device_List(self, Driver_Device_List): self.Driver_Device_List = Driver_Device_List867 def get_resultitemtype(self): return self.resultitemtype868 def set_resultitemtype(self, resultitemtype): self.resultitemtype = resultitemtype869 def hasContent_(self):870 if (871 self.ServiceKeyName is not None or872 self.ImagePath is not None or873 self.Type is not None or874 self.DriverObj_Location is not None or875 self.DeviceObj_Location is not None or876 self.Driver_Init is not None or877 self.Driver_StartIO is not None or878 self.Driver_Unload is not None or879 self.BaseAddress is not None or880 self.StartTime is not None or881 self.Dependencies is not None or882 self.Size is not None or883 self.Instances is not None or884 self.Name is not None or885 self.StartedAs is not None or886 self.State is not None or887 self.RealState is not None or888 self.StartMode is not None or889 self.RealStartMode is not None or890 self.RealType is not None or891 self.Path is not None or892 self.plist is not None or893 self.MD5 is not None or894 self.SHA1 is not None or895 self.FuzzySize is not None or896 self.Fuzzy is not None or897 self.Fuzzy2X is not None or898 self.KFFStatus is not None or899 self.processid is not None or900 self.IRP_MJ_CREATE is not None or901 self.IRP_MJ_CREATE_NAMED_PIPE is not None or902 self.IRP_MJ_CLOSE is not None or903 self.IRP_MJ_READ is not None or904 self.IRP_MJ_WRITE is not None or905 self.IRP_MJ_QUERY_INFORMATION is not None or906 self.IRP_MJ_SET_INFORMATION is not None or907 self.IRP_MJ_QUERY_EA is not None or908 self.IRP_MJ_SET_EA is not None or909 self.IRP_MJ_FLUSH_BUFFERS is not None or910 self.IRP_MJ_QUERY_VOLUME_INFORMATION is not None or911 self.IRP_MJ_SET_VOLUME_INFORMATION is not None or912 self.IRP_MJ_DIRECTORY_CONTROL is not None or913 self.IRP_MJ_FILE_SYSTEM_CONTROL is not None or914 self.IRP_MJ_DEVICE_CONTROL is not None or915 self.IRP_MJ_INTERNAL_DEVICE_CONTROL is not None or916 self.IRP_MJ_SHUTDOWN is not None or917 self.IRP_MJ_LOCK_CONTROL is not None or918 self.IRP_MJ_CLEANUP is not None or919 self.IRP_MJ_CREATE_MAILSLOT is not None or920 self.IRP_MJ_QUERY_SECURITY is not None or921 self.IRP_MJ_SET_SECURITY is not None or922 self.IRP_MJ_POWER is not None or923 self.IRP_MJ_SYSTEM_CONTROL is not None or924 self.IRP_MJ_DEVICE_CHANGE is not None or925 self.IRP_MJ_QUERY_QUOTA is not None or926 self.IRP_MJ_SET_QUOTA is not None or927 self.IRP_MJ_PNP is not None or928 self.Driver_Device_List is not None929 ):930 return True931 else:932 return False933 def export(self, outfile, level, namespace_='', name_='DriverType', namespacedef_='', pretty_print=True):934 if pretty_print:935 eol_ = '\n'936 else:937 eol_ = ''938 if self.original_tagname_ is not None:939 name_ = self.original_tagname_940 showIndent(outfile, level, pretty_print)941 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))942 already_processed = set()943 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DriverType')944 if self.hasContent_():945 outfile.write('>%s' % (eol_, ))946 self.exportChildren(outfile, level + 1, namespace_='', name_='DriverType', pretty_print=pretty_print)947 showIndent(outfile, level, pretty_print)948 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))949 else:950 outfile.write('/>%s' % (eol_, ))951 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DriverType'):952 if self.resultitemtype is not None and 'resultitemtype' not in already_processed:953 already_processed.add('resultitemtype')954 outfile.write(' resultitemtype="%s"' % self.gds_format_integer(self.resultitemtype, input_name='resultitemtype'))955 def exportChildren(self, outfile, level, namespace_='', name_='DriverType', fromsubclass_=False, pretty_print=True):956 if pretty_print:957 eol_ = '\n'958 else:959 eol_ = ''960 if self.ServiceKeyName is not None:961 showIndent(outfile, level, pretty_print)962 outfile.write('<%sServiceKeyName>%s</%sServiceKeyName>%s' % (namespace_, self.gds_format_string(quote_xml(self.ServiceKeyName).encode(ExternalEncoding), input_name='ServiceKeyName'), namespace_, eol_))963 if self.ImagePath is not None:964 showIndent(outfile, level, pretty_print)965 outfile.write('<%sImagePath>%s</%sImagePath>%s' % (namespace_, self.gds_format_string(quote_xml(self.ImagePath).encode(ExternalEncoding), input_name='ImagePath'), namespace_, eol_))966 if self.Type is not None:967 showIndent(outfile, level, pretty_print)968 outfile.write('<%sType>%s</%sType>%s' % (namespace_, self.gds_format_integer(self.Type, input_name='Type'), namespace_, eol_))969 if self.DriverObj_Location is not None:970 showIndent(outfile, level, pretty_print)971 outfile.write('<%sDriverObj_Location>%s</%sDriverObj_Location>%s' % (namespace_, self.gds_format_integer(self.DriverObj_Location, input_name='DriverObj_Location'), namespace_, eol_))972 if self.DeviceObj_Location is not None:973 showIndent(outfile, level, pretty_print)974 outfile.write('<%sDeviceObj_Location>%s</%sDeviceObj_Location>%s' % (namespace_, self.gds_format_integer(self.DeviceObj_Location, input_name='DeviceObj_Location'), namespace_, eol_))975 if self.Driver_Init is not None:976 showIndent(outfile, level, pretty_print)977 outfile.write('<%sDriver_Init>%s</%sDriver_Init>%s' % (namespace_, self.gds_format_integer(self.Driver_Init, input_name='Driver_Init'), namespace_, eol_))978 if self.Driver_StartIO is not None:979 showIndent(outfile, level, pretty_print)980 outfile.write('<%sDriver_StartIO>%s</%sDriver_StartIO>%s' % (namespace_, self.gds_format_integer(self.Driver_StartIO, input_name='Driver_StartIO'), namespace_, eol_))981 if self.Driver_Unload is not None:982 showIndent(outfile, level, pretty_print)983 outfile.write('<%sDriver_Unload>%s</%sDriver_Unload>%s' % (namespace_, self.gds_format_integer(self.Driver_Unload, input_name='Driver_Unload'), namespace_, eol_))984 if self.BaseAddress is not None:985 showIndent(outfile, level, pretty_print)986 outfile.write('<%sBaseAddress>%s</%sBaseAddress>%s' % (namespace_, self.gds_format_integer(self.BaseAddress, input_name='BaseAddress'), namespace_, eol_))987 if self.StartTime is not None:988 showIndent(outfile, level, pretty_print)989 outfile.write('<%sStartTime>%s</%sStartTime>%s' % (namespace_, self.gds_format_string(quote_xml(self.StartTime).encode(ExternalEncoding), input_name='StartTime'), namespace_, eol_))990 if self.Dependencies is not None:991 showIndent(outfile, level, pretty_print)992 outfile.write('<%sDependencies>%s</%sDependencies>%s' % (namespace_, self.gds_format_string(quote_xml(self.Dependencies).encode(ExternalEncoding), input_name='Dependencies'), namespace_, eol_))993 if self.Size is not None:994 showIndent(outfile, level, pretty_print)995 outfile.write('<%sSize>%s</%sSize>%s' % (namespace_, self.gds_format_integer(self.Size, input_name='Size'), namespace_, eol_))996 if self.Instances is not None:997 showIndent(outfile, level, pretty_print)998 outfile.write('<%sInstances>%s</%sInstances>%s' % (namespace_, self.gds_format_integer(self.Instances, input_name='Instances'), namespace_, eol_))999 if self.Name is not None:1000 showIndent(outfile, level, pretty_print)1001 outfile.write('<%sName>%s</%sName>%s' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_, eol_))1002 if self.StartedAs is not None:1003 showIndent(outfile, level, pretty_print)1004 outfile.write('<%sStartedAs>%s</%sStartedAs>%s' % (namespace_, self.gds_format_string(quote_xml(self.StartedAs).encode(ExternalEncoding), input_name='StartedAs'), namespace_, eol_))1005 if self.State is not None:1006 showIndent(outfile, level, pretty_print)1007 outfile.write('<%sState>%s</%sState>%s' % (namespace_, self.gds_format_integer(self.State, input_name='State'), namespace_, eol_))1008 if self.RealState is not None:1009 showIndent(outfile, level, pretty_print)1010 outfile.write('<%sRealState>%s</%sRealState>%s' % (namespace_, self.gds_format_integer(self.RealState, input_name='RealState'), namespace_, eol_))1011 if self.StartMode is not None:1012 showIndent(outfile, level, pretty_print)1013 outfile.write('<%sStartMode>%s</%sStartMode>%s' % (namespace_, self.gds_format_integer(self.StartMode, input_name='StartMode'), namespace_, eol_))1014 if self.RealStartMode is not None:1015 showIndent(outfile, level, pretty_print)1016 outfile.write('<%sRealStartMode>%s</%sRealStartMode>%s' % (namespace_, self.gds_format_integer(self.RealStartMode, input_name='RealStartMode'), namespace_, eol_))1017 if self.RealType is not None:1018 showIndent(outfile, level, pretty_print)1019 outfile.write('<%sRealType>%s</%sRealType>%s' % (namespace_, self.gds_format_integer(self.RealType, input_name='RealType'), namespace_, eol_))1020 if self.Path is not None:1021 showIndent(outfile, level, pretty_print)1022 outfile.write('<%sPath>%s</%sPath>%s' % (namespace_, self.gds_format_string(quote_xml(self.Path).encode(ExternalEncoding), input_name='Path'), namespace_, eol_))1023 if self.plist is not None:1024 showIndent(outfile, level, pretty_print)1025 outfile.write('<%splist>%s</%splist>%s' % (namespace_, self.gds_format_string(quote_xml(self.plist).encode(ExternalEncoding), input_name='plist'), namespace_, eol_))1026 if self.MD5 is not None:1027 showIndent(outfile, level, pretty_print)1028 outfile.write('<%sMD5>%s</%sMD5>%s' % (namespace_, self.gds_format_string(quote_xml(self.MD5).encode(ExternalEncoding), input_name='MD5'), namespace_, eol_))1029 if self.SHA1 is not None:1030 showIndent(outfile, level, pretty_print)1031 outfile.write('<%sSHA1>%s</%sSHA1>%s' % (namespace_, self.gds_format_string(quote_xml(self.SHA1).encode(ExternalEncoding), input_name='SHA1'), namespace_, eol_))1032 if self.FuzzySize is not None:1033 showIndent(outfile, level, pretty_print)1034 outfile.write('<%sFuzzySize>%s</%sFuzzySize>%s' % (namespace_, self.gds_format_integer(self.FuzzySize, input_name='FuzzySize'), namespace_, eol_))1035 if self.Fuzzy is not None:1036 showIndent(outfile, level, pretty_print)1037 outfile.write('<%sFuzzy>%s</%sFuzzy>%s' % (namespace_, self.gds_format_string(quote_xml(self.Fuzzy).encode(ExternalEncoding), input_name='Fuzzy'), namespace_, eol_))1038 if self.Fuzzy2X is not None:1039 showIndent(outfile, level, pretty_print)1040 outfile.write('<%sFuzzy2X>%s</%sFuzzy2X>%s' % (namespace_, self.gds_format_string(quote_xml(self.Fuzzy2X).encode(ExternalEncoding), input_name='Fuzzy2X'), namespace_, eol_))1041 if self.KFFStatus is not None:1042 showIndent(outfile, level, pretty_print)1043 outfile.write('<%sKFFStatus>%s</%sKFFStatus>%s' % (namespace_, self.gds_format_integer(self.KFFStatus, input_name='KFFStatus'), namespace_, eol_))1044 if self.processid is not None:1045 showIndent(outfile, level, pretty_print)1046 outfile.write('<%sprocessid>%s</%sprocessid>%s' % (namespace_, self.gds_format_integer(self.processid, input_name='processid'), namespace_, eol_))1047 if self.IRP_MJ_CREATE is not None:1048 showIndent(outfile, level, pretty_print)1049 outfile.write('<%sIRP_MJ_CREATE>%s</%sIRP_MJ_CREATE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CREATE, input_name='IRP_MJ_CREATE'), namespace_, eol_))1050 if self.IRP_MJ_CREATE_NAMED_PIPE is not None:1051 showIndent(outfile, level, pretty_print)1052 outfile.write('<%sIRP_MJ_CREATE_NAMED_PIPE>%s</%sIRP_MJ_CREATE_NAMED_PIPE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CREATE_NAMED_PIPE, input_name='IRP_MJ_CREATE_NAMED_PIPE'), namespace_, eol_))1053 if self.IRP_MJ_CLOSE is not None:1054 showIndent(outfile, level, pretty_print)1055 outfile.write('<%sIRP_MJ_CLOSE>%s</%sIRP_MJ_CLOSE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CLOSE, input_name='IRP_MJ_CLOSE'), namespace_, eol_))1056 if self.IRP_MJ_READ is not None:1057 showIndent(outfile, level, pretty_print)1058 outfile.write('<%sIRP_MJ_READ>%s</%sIRP_MJ_READ>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_READ, input_name='IRP_MJ_READ'), namespace_, eol_))1059 if self.IRP_MJ_WRITE is not None:1060 showIndent(outfile, level, pretty_print)1061 outfile.write('<%sIRP_MJ_WRITE>%s</%sIRP_MJ_WRITE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_WRITE, input_name='IRP_MJ_WRITE'), namespace_, eol_))1062 if self.IRP_MJ_QUERY_INFORMATION is not None:1063 showIndent(outfile, level, pretty_print)1064 outfile.write('<%sIRP_MJ_QUERY_INFORMATION>%s</%sIRP_MJ_QUERY_INFORMATION>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_INFORMATION, input_name='IRP_MJ_QUERY_INFORMATION'), namespace_, eol_))1065 if self.IRP_MJ_SET_INFORMATION is not None:1066 showIndent(outfile, level, pretty_print)1067 outfile.write('<%sIRP_MJ_SET_INFORMATION>%s</%sIRP_MJ_SET_INFORMATION>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_INFORMATION, input_name='IRP_MJ_SET_INFORMATION'), namespace_, eol_))1068 if self.IRP_MJ_QUERY_EA is not None:1069 showIndent(outfile, level, pretty_print)1070 outfile.write('<%sIRP_MJ_QUERY_EA>%s</%sIRP_MJ_QUERY_EA>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_EA, input_name='IRP_MJ_QUERY_EA'), namespace_, eol_))1071 if self.IRP_MJ_SET_EA is not None:1072 showIndent(outfile, level, pretty_print)1073 outfile.write('<%sIRP_MJ_SET_EA>%s</%sIRP_MJ_SET_EA>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_EA, input_name='IRP_MJ_SET_EA'), namespace_, eol_))1074 if self.IRP_MJ_FLUSH_BUFFERS is not None:1075 showIndent(outfile, level, pretty_print)1076 outfile.write('<%sIRP_MJ_FLUSH_BUFFERS>%s</%sIRP_MJ_FLUSH_BUFFERS>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_FLUSH_BUFFERS, input_name='IRP_MJ_FLUSH_BUFFERS'), namespace_, eol_))1077 if self.IRP_MJ_QUERY_VOLUME_INFORMATION is not None:1078 showIndent(outfile, level, pretty_print)1079 outfile.write('<%sIRP_MJ_QUERY_VOLUME_INFORMATION>%s</%sIRP_MJ_QUERY_VOLUME_INFORMATION>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_VOLUME_INFORMATION, input_name='IRP_MJ_QUERY_VOLUME_INFORMATION'), namespace_, eol_))1080 if self.IRP_MJ_SET_VOLUME_INFORMATION is not None:1081 showIndent(outfile, level, pretty_print)1082 outfile.write('<%sIRP_MJ_SET_VOLUME_INFORMATION>%s</%sIRP_MJ_SET_VOLUME_INFORMATION>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_VOLUME_INFORMATION, input_name='IRP_MJ_SET_VOLUME_INFORMATION'), namespace_, eol_))1083 if self.IRP_MJ_DIRECTORY_CONTROL is not None:1084 showIndent(outfile, level, pretty_print)1085 outfile.write('<%sIRP_MJ_DIRECTORY_CONTROL>%s</%sIRP_MJ_DIRECTORY_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_DIRECTORY_CONTROL, input_name='IRP_MJ_DIRECTORY_CONTROL'), namespace_, eol_))1086 if self.IRP_MJ_FILE_SYSTEM_CONTROL is not None:1087 showIndent(outfile, level, pretty_print)1088 outfile.write('<%sIRP_MJ_FILE_SYSTEM_CONTROL>%s</%sIRP_MJ_FILE_SYSTEM_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_FILE_SYSTEM_CONTROL, input_name='IRP_MJ_FILE_SYSTEM_CONTROL'), namespace_, eol_))1089 if self.IRP_MJ_DEVICE_CONTROL is not None:1090 showIndent(outfile, level, pretty_print)1091 outfile.write('<%sIRP_MJ_DEVICE_CONTROL>%s</%sIRP_MJ_DEVICE_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_DEVICE_CONTROL, input_name='IRP_MJ_DEVICE_CONTROL'), namespace_, eol_))1092 if self.IRP_MJ_INTERNAL_DEVICE_CONTROL is not None:1093 showIndent(outfile, level, pretty_print)1094 outfile.write('<%sIRP_MJ_INTERNAL_DEVICE_CONTROL>%s</%sIRP_MJ_INTERNAL_DEVICE_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_INTERNAL_DEVICE_CONTROL, input_name='IRP_MJ_INTERNAL_DEVICE_CONTROL'), namespace_, eol_))1095 if self.IRP_MJ_SHUTDOWN is not None:1096 showIndent(outfile, level, pretty_print)1097 outfile.write('<%sIRP_MJ_SHUTDOWN>%s</%sIRP_MJ_SHUTDOWN>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SHUTDOWN, input_name='IRP_MJ_SHUTDOWN'), namespace_, eol_))1098 if self.IRP_MJ_LOCK_CONTROL is not None:1099 showIndent(outfile, level, pretty_print)1100 outfile.write('<%sIRP_MJ_LOCK_CONTROL>%s</%sIRP_MJ_LOCK_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_LOCK_CONTROL, input_name='IRP_MJ_LOCK_CONTROL'), namespace_, eol_))1101 if self.IRP_MJ_CLEANUP is not None:1102 showIndent(outfile, level, pretty_print)1103 outfile.write('<%sIRP_MJ_CLEANUP>%s</%sIRP_MJ_CLEANUP>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CLEANUP, input_name='IRP_MJ_CLEANUP'), namespace_, eol_))1104 if self.IRP_MJ_CREATE_MAILSLOT is not None:1105 showIndent(outfile, level, pretty_print)1106 outfile.write('<%sIRP_MJ_CREATE_MAILSLOT>%s</%sIRP_MJ_CREATE_MAILSLOT>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CREATE_MAILSLOT, input_name='IRP_MJ_CREATE_MAILSLOT'), namespace_, eol_))1107 if self.IRP_MJ_QUERY_SECURITY is not None:1108 showIndent(outfile, level, pretty_print)1109 outfile.write('<%sIRP_MJ_QUERY_SECURITY>%s</%sIRP_MJ_QUERY_SECURITY>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_SECURITY, input_name='IRP_MJ_QUERY_SECURITY'), namespace_, eol_))1110 if self.IRP_MJ_SET_SECURITY is not None:1111 showIndent(outfile, level, pretty_print)1112 outfile.write('<%sIRP_MJ_SET_SECURITY>%s</%sIRP_MJ_SET_SECURITY>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_SECURITY, input_name='IRP_MJ_SET_SECURITY'), namespace_, eol_))1113 if self.IRP_MJ_POWER is not None:1114 showIndent(outfile, level, pretty_print)1115 outfile.write('<%sIRP_MJ_POWER>%s</%sIRP_MJ_POWER>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_POWER, input_name='IRP_MJ_POWER'), namespace_, eol_))1116 if self.IRP_MJ_SYSTEM_CONTROL is not None:1117 showIndent(outfile, level, pretty_print)1118 outfile.write('<%sIRP_MJ_SYSTEM_CONTROL>%s</%sIRP_MJ_SYSTEM_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SYSTEM_CONTROL, input_name='IRP_MJ_SYSTEM_CONTROL'), namespace_, eol_))1119 if self.IRP_MJ_DEVICE_CHANGE is not None:1120 showIndent(outfile, level, pretty_print)1121 outfile.write('<%sIRP_MJ_DEVICE_CHANGE>%s</%sIRP_MJ_DEVICE_CHANGE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_DEVICE_CHANGE, input_name='IRP_MJ_DEVICE_CHANGE'), namespace_, eol_))1122 if self.IRP_MJ_QUERY_QUOTA is not None:1123 showIndent(outfile, level, pretty_print)1124 outfile.write('<%sIRP_MJ_QUERY_QUOTA>%s</%sIRP_MJ_QUERY_QUOTA>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_QUOTA, input_name='IRP_MJ_QUERY_QUOTA'), namespace_, eol_))1125 if self.IRP_MJ_SET_QUOTA is not None:1126 showIndent(outfile, level, pretty_print)1127 outfile.write('<%sIRP_MJ_SET_QUOTA>%s</%sIRP_MJ_SET_QUOTA>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_QUOTA, input_name='IRP_MJ_SET_QUOTA'), namespace_, eol_))1128 if self.IRP_MJ_PNP is not None:1129 showIndent(outfile, level, pretty_print)1130 outfile.write('<%sIRP_MJ_PNP>%s</%sIRP_MJ_PNP>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_PNP, input_name='IRP_MJ_PNP'), namespace_, eol_))1131 if self.Driver_Device_List is not None:1132 self.Driver_Device_List.export(outfile, level, namespace_, name_='Driver_Device_List', pretty_print=pretty_print)1133 def exportLiteral(self, outfile, level, name_='DriverType'):1134 level += 11135 already_processed = set()1136 self.exportLiteralAttributes(outfile, level, already_processed, name_)1137 if self.hasContent_():1138 self.exportLiteralChildren(outfile, level, name_)1139 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1140 if self.resultitemtype is not None and 'resultitemtype' not in already_processed:1141 already_processed.add('resultitemtype')1142 showIndent(outfile, level)1143 outfile.write('resultitemtype=%d,\n' % (self.resultitemtype,))1144 def exportLiteralChildren(self, outfile, level, name_):1145 if self.ServiceKeyName is not None:1146 showIndent(outfile, level)1147 outfile.write('ServiceKeyName=%s,\n' % quote_python(self.ServiceKeyName).encode(ExternalEncoding))1148 if self.ImagePath is not None:1149 showIndent(outfile, level)1150 outfile.write('ImagePath=%s,\n' % quote_python(self.ImagePath).encode(ExternalEncoding))1151 if self.Type is not None:1152 showIndent(outfile, level)1153 outfile.write('Type=%d,\n' % self.Type)1154 if self.DriverObj_Location is not None:1155 showIndent(outfile, level)1156 outfile.write('DriverObj_Location=%d,\n' % self.DriverObj_Location)1157 if self.DeviceObj_Location is not None:1158 showIndent(outfile, level)1159 outfile.write('DeviceObj_Location=%d,\n' % self.DeviceObj_Location)1160 if self.Driver_Init is not None:1161 showIndent(outfile, level)1162 outfile.write('Driver_Init=%d,\n' % self.Driver_Init)1163 if self.Driver_StartIO is not None:1164 showIndent(outfile, level)1165 outfile.write('Driver_StartIO=%d,\n' % self.Driver_StartIO)1166 if self.Driver_Unload is not None:1167 showIndent(outfile, level)1168 outfile.write('Driver_Unload=%d,\n' % self.Driver_Unload)1169 if self.BaseAddress is not None:1170 showIndent(outfile, level)1171 outfile.write('BaseAddress=%d,\n' % self.BaseAddress)1172 if self.StartTime is not None:1173 showIndent(outfile, level)1174 outfile.write('StartTime=%s,\n' % quote_python(self.StartTime).encode(ExternalEncoding))1175 if self.Dependencies is not None:1176 showIndent(outfile, level)1177 outfile.write('Dependencies=%s,\n' % quote_python(self.Dependencies).encode(ExternalEncoding))1178 if self.Size is not None:1179 showIndent(outfile, level)1180 outfile.write('Size=%d,\n' % self.Size)1181 if self.Instances is not None:1182 showIndent(outfile, level)1183 outfile.write('Instances=%d,\n' % self.Instances)1184 if self.Name is not None:1185 showIndent(outfile, level)1186 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding))1187 if self.StartedAs is not None:1188 showIndent(outfile, level)1189 outfile.write('StartedAs=%s,\n' % quote_python(self.StartedAs).encode(ExternalEncoding))1190 if self.State is not None:1191 showIndent(outfile, level)1192 outfile.write('State=%d,\n' % self.State)1193 if self.RealState is not None:1194 showIndent(outfile, level)1195 outfile.write('RealState=%d,\n' % self.RealState)1196 if self.StartMode is not None:1197 showIndent(outfile, level)1198 outfile.write('StartMode=%d,\n' % self.StartMode)1199 if self.RealStartMode is not None:1200 showIndent(outfile, level)1201 outfile.write('RealStartMode=%d,\n' % self.RealStartMode)1202 if self.RealType is not None:1203 showIndent(outfile, level)1204 outfile.write('RealType=%d,\n' % self.RealType)1205 if self.Path is not None:1206 showIndent(outfile, level)1207 outfile.write('Path=%s,\n' % quote_python(self.Path).encode(ExternalEncoding))1208 if self.plist is not None:1209 showIndent(outfile, level)1210 outfile.write('plist=%s,\n' % quote_python(self.plist).encode(ExternalEncoding))1211 if self.MD5 is not None:1212 showIndent(outfile, level)1213 outfile.write('MD5=%d,\n' % self.MD5)1214 if self.SHA1 is not None:1215 showIndent(outfile, level)1216 outfile.write('SHA1=%d,\n' % self.SHA1)1217 if self.FuzzySize is not None:1218 showIndent(outfile, level)1219 outfile.write('FuzzySize=%d,\n' % self.FuzzySize)1220 if self.Fuzzy is not None:1221 showIndent(outfile, level)1222 outfile.write('Fuzzy=%s,\n' % quote_python(self.Fuzzy).encode(ExternalEncoding))1223 if self.Fuzzy2X is not None:1224 showIndent(outfile, level)1225 outfile.write('Fuzzy2X=%s,\n' % quote_python(self.Fuzzy2X).encode(ExternalEncoding))1226 if self.KFFStatus is not None:1227 showIndent(outfile, level)1228 outfile.write('KFFStatus=%d,\n' % self.KFFStatus)1229 if self.processid is not None:1230 showIndent(outfile, level)1231 outfile.write('processid=%d,\n' % self.processid)1232 if self.IRP_MJ_CREATE is not None:1233 showIndent(outfile, level)1234 outfile.write('IRP_MJ_CREATE=%d,\n' % self.IRP_MJ_CREATE)1235 if self.IRP_MJ_CREATE_NAMED_PIPE is not None:1236 showIndent(outfile, level)1237 outfile.write('IRP_MJ_CREATE_NAMED_PIPE=%d,\n' % self.IRP_MJ_CREATE_NAMED_PIPE)1238 if self.IRP_MJ_CLOSE is not None:1239 showIndent(outfile, level)1240 outfile.write('IRP_MJ_CLOSE=%d,\n' % self.IRP_MJ_CLOSE)1241 if self.IRP_MJ_READ is not None:1242 showIndent(outfile, level)1243 outfile.write('IRP_MJ_READ=%d,\n' % self.IRP_MJ_READ)1244 if self.IRP_MJ_WRITE is not None:1245 showIndent(outfile, level)1246 outfile.write('IRP_MJ_WRITE=%d,\n' % self.IRP_MJ_WRITE)1247 if self.IRP_MJ_QUERY_INFORMATION is not None:1248 showIndent(outfile, level)1249 outfile.write('IRP_MJ_QUERY_INFORMATION=%d,\n' % self.IRP_MJ_QUERY_INFORMATION)1250 if self.IRP_MJ_SET_INFORMATION is not None:1251 showIndent(outfile, level)1252 outfile.write('IRP_MJ_SET_INFORMATION=%d,\n' % self.IRP_MJ_SET_INFORMATION)1253 if self.IRP_MJ_QUERY_EA is not None:1254 showIndent(outfile, level)1255 outfile.write('IRP_MJ_QUERY_EA=%d,\n' % self.IRP_MJ_QUERY_EA)1256 if self.IRP_MJ_SET_EA is not None:1257 showIndent(outfile, level)1258 outfile.write('IRP_MJ_SET_EA=%d,\n' % self.IRP_MJ_SET_EA)1259 if self.IRP_MJ_FLUSH_BUFFERS is not None:1260 showIndent(outfile, level)1261 outfile.write('IRP_MJ_FLUSH_BUFFERS=%d,\n' % self.IRP_MJ_FLUSH_BUFFERS)1262 if self.IRP_MJ_QUERY_VOLUME_INFORMATION is not None:1263 showIndent(outfile, level)1264 outfile.write('IRP_MJ_QUERY_VOLUME_INFORMATION=%d,\n' % self.IRP_MJ_QUERY_VOLUME_INFORMATION)1265 if self.IRP_MJ_SET_VOLUME_INFORMATION is not None:1266 showIndent(outfile, level)1267 outfile.write('IRP_MJ_SET_VOLUME_INFORMATION=%d,\n' % self.IRP_MJ_SET_VOLUME_INFORMATION)1268 if self.IRP_MJ_DIRECTORY_CONTROL is not None:1269 showIndent(outfile, level)1270 outfile.write('IRP_MJ_DIRECTORY_CONTROL=%d,\n' % self.IRP_MJ_DIRECTORY_CONTROL)1271 if self.IRP_MJ_FILE_SYSTEM_CONTROL is not None:1272 showIndent(outfile, level)1273 outfile.write('IRP_MJ_FILE_SYSTEM_CONTROL=%d,\n' % self.IRP_MJ_FILE_SYSTEM_CONTROL)1274 if self.IRP_MJ_DEVICE_CONTROL is not None:1275 showIndent(outfile, level)1276 outfile.write('IRP_MJ_DEVICE_CONTROL=%d,\n' % self.IRP_MJ_DEVICE_CONTROL)1277 if self.IRP_MJ_INTERNAL_DEVICE_CONTROL is not None:1278 showIndent(outfile, level)1279 outfile.write('IRP_MJ_INTERNAL_DEVICE_CONTROL=%d,\n' % self.IRP_MJ_INTERNAL_DEVICE_CONTROL)1280 if self.IRP_MJ_SHUTDOWN is not None:1281 showIndent(outfile, level)1282 outfile.write('IRP_MJ_SHUTDOWN=%d,\n' % self.IRP_MJ_SHUTDOWN)1283 if self.IRP_MJ_LOCK_CONTROL is not None:1284 showIndent(outfile, level)1285 outfile.write('IRP_MJ_LOCK_CONTROL=%d,\n' % self.IRP_MJ_LOCK_CONTROL)1286 if self.IRP_MJ_CLEANUP is not None:1287 showIndent(outfile, level)1288 outfile.write('IRP_MJ_CLEANUP=%d,\n' % self.IRP_MJ_CLEANUP)1289 if self.IRP_MJ_CREATE_MAILSLOT is not None:1290 showIndent(outfile, level)1291 outfile.write('IRP_MJ_CREATE_MAILSLOT=%d,\n' % self.IRP_MJ_CREATE_MAILSLOT)1292 if self.IRP_MJ_QUERY_SECURITY is not None:1293 showIndent(outfile, level)1294 outfile.write('IRP_MJ_QUERY_SECURITY=%d,\n' % self.IRP_MJ_QUERY_SECURITY)1295 if self.IRP_MJ_SET_SECURITY is not None:1296 showIndent(outfile, level)1297 outfile.write('IRP_MJ_SET_SECURITY=%d,\n' % self.IRP_MJ_SET_SECURITY)1298 if self.IRP_MJ_POWER is not None:1299 showIndent(outfile, level)1300 outfile.write('IRP_MJ_POWER=%d,\n' % self.IRP_MJ_POWER)1301 if self.IRP_MJ_SYSTEM_CONTROL is not None:1302 showIndent(outfile, level)1303 outfile.write('IRP_MJ_SYSTEM_CONTROL=%d,\n' % self.IRP_MJ_SYSTEM_CONTROL)1304 if self.IRP_MJ_DEVICE_CHANGE is not None:1305 showIndent(outfile, level)1306 outfile.write('IRP_MJ_DEVICE_CHANGE=%d,\n' % self.IRP_MJ_DEVICE_CHANGE)1307 if self.IRP_MJ_QUERY_QUOTA is not None:1308 showIndent(outfile, level)1309 outfile.write('IRP_MJ_QUERY_QUOTA=%d,\n' % self.IRP_MJ_QUERY_QUOTA)1310 if self.IRP_MJ_SET_QUOTA is not None:1311 showIndent(outfile, level)1312 outfile.write('IRP_MJ_SET_QUOTA=%d,\n' % self.IRP_MJ_SET_QUOTA)1313 if self.IRP_MJ_PNP is not None:1314 showIndent(outfile, level)1315 outfile.write('IRP_MJ_PNP=%d,\n' % self.IRP_MJ_PNP)1316 if self.Driver_Device_List is not None:1317 showIndent(outfile, level)1318 outfile.write('Driver_Device_List=model_.Driver_Device_ListType(\n')1319 self.Driver_Device_List.exportLiteral(outfile, level, name_='Driver_Device_List')1320 showIndent(outfile, level)1321 outfile.write('),\n')1322 def build(self, node):1323 already_processed = set()1324 self.buildAttributes(node, node.attrib, already_processed)1325 for child in node:1326 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1327 self.buildChildren(child, node, nodeName_)1328 return self1329 def buildAttributes(self, node, attrs, already_processed):1330 value = find_attr_value_('resultitemtype', node)1331 if value is not None and 'resultitemtype' not in already_processed:1332 already_processed.add('resultitemtype')1333 try:1334 self.resultitemtype = int(value)1335 except ValueError, exp:1336 raise_parse_error(node, 'Bad integer attribute: %s' % exp)1337 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1338 if nodeName_ == 'ServiceKeyName':1339 ServiceKeyName_ = child_.text1340 ServiceKeyName_ = self.gds_validate_string(ServiceKeyName_, node, 'ServiceKeyName')1341 self.ServiceKeyName = ServiceKeyName_1342 elif nodeName_ == 'ImagePath':1343 ImagePath_ = child_.text1344 ImagePath_ = self.gds_validate_string(ImagePath_, node, 'ImagePath')1345 self.ImagePath = ImagePath_1346 elif nodeName_ == 'Type':1347 sval_ = child_.text1348 try:1349 ival_ = int(sval_)1350 except (TypeError, ValueError), exp:1351 raise_parse_error(child_, 'requires integer: %s' % exp)1352 ival_ = self.gds_validate_integer(ival_, node, 'Type')1353 self.Type = ival_1354 elif nodeName_ == 'DriverObj_Location':1355 sval_ = child_.text1356 try:1357 ival_ = int(sval_)1358 except (TypeError, ValueError), exp:1359 raise_parse_error(child_, 'requires integer: %s' % exp)1360 ival_ = self.gds_validate_integer(ival_, node, 'DriverObj_Location')1361 self.DriverObj_Location = ival_1362 elif nodeName_ == 'DeviceObj_Location':1363 sval_ = child_.text1364 try:1365 ival_ = int(sval_)1366 except (TypeError, ValueError), exp:1367 raise_parse_error(child_, 'requires integer: %s' % exp)1368 ival_ = self.gds_validate_integer(ival_, node, 'DeviceObj_Location')1369 self.DeviceObj_Location = ival_1370 elif nodeName_ == 'Driver_Init':1371 sval_ = child_.text1372 try:1373 ival_ = int(sval_)1374 except (TypeError, ValueError), exp:1375 raise_parse_error(child_, 'requires integer: %s' % exp)1376 ival_ = self.gds_validate_integer(ival_, node, 'Driver_Init')1377 self.Driver_Init = ival_1378 elif nodeName_ == 'Driver_StartIO':1379 sval_ = child_.text1380 try:1381 ival_ = int(sval_)1382 except (TypeError, ValueError), exp:1383 raise_parse_error(child_, 'requires integer: %s' % exp)1384 ival_ = self.gds_validate_integer(ival_, node, 'Driver_StartIO')1385 self.Driver_StartIO = ival_1386 elif nodeName_ == 'Driver_Unload':1387 sval_ = child_.text1388 try:1389 ival_ = int(sval_)1390 except (TypeError, ValueError), exp:1391 raise_parse_error(child_, 'requires integer: %s' % exp)1392 ival_ = self.gds_validate_integer(ival_, node, 'Driver_Unload')1393 self.Driver_Unload = ival_1394 elif nodeName_ == 'BaseAddress':1395 sval_ = child_.text1396 try:1397 ival_ = int(sval_)1398 except (TypeError, ValueError), exp:1399 raise_parse_error(child_, 'requires integer: %s' % exp)1400 ival_ = self.gds_validate_integer(ival_, node, 'BaseAddress')1401 self.BaseAddress = ival_1402 elif nodeName_ == 'StartTime':1403 StartTime_ = child_.text1404 StartTime_ = self.gds_validate_string(StartTime_, node, 'StartTime')1405 self.StartTime = StartTime_1406 elif nodeName_ == 'Dependencies':1407 Dependencies_ = child_.text1408 Dependencies_ = self.gds_validate_string(Dependencies_, node, 'Dependencies')1409 self.Dependencies = Dependencies_1410 elif nodeName_ == 'Size':1411 sval_ = child_.text1412 try:1413 ival_ = int(sval_)1414 except (TypeError, ValueError), exp:1415 raise_parse_error(child_, 'requires integer: %s' % exp)1416 ival_ = self.gds_validate_integer(ival_, node, 'Size')1417 self.Size = ival_1418 elif nodeName_ == 'Instances':1419 sval_ = child_.text1420 try:1421 ival_ = int(sval_)1422 except (TypeError, ValueError), exp:1423 raise_parse_error(child_, 'requires integer: %s' % exp)1424 ival_ = self.gds_validate_integer(ival_, node, 'Instances')1425 self.Instances = ival_1426 elif nodeName_ == 'Name':1427 Name_ = child_.text1428 Name_ = self.gds_validate_string(Name_, node, 'Name')1429 self.Name = Name_1430 elif nodeName_ == 'StartedAs':1431 StartedAs_ = child_.text1432 StartedAs_ = self.gds_validate_string(StartedAs_, node, 'StartedAs')1433 self.StartedAs = StartedAs_1434 elif nodeName_ == 'State':1435 sval_ = child_.text1436 try:1437 ival_ = int(sval_)1438 except (TypeError, ValueError), exp:1439 raise_parse_error(child_, 'requires integer: %s' % exp)1440 ival_ = self.gds_validate_integer(ival_, node, 'State')1441 self.State = ival_1442 elif nodeName_ == 'RealState':1443 sval_ = child_.text1444 try:1445 ival_ = int(sval_)1446 except (TypeError, ValueError), exp:1447 raise_parse_error(child_, 'requires integer: %s' % exp)1448 ival_ = self.gds_validate_integer(ival_, node, 'RealState')1449 self.RealState = ival_1450 elif nodeName_ == 'StartMode':1451 sval_ = child_.text1452 try:1453 ival_ = int(sval_)1454 except (TypeError, ValueError), exp:1455 raise_parse_error(child_, 'requires integer: %s' % exp)1456 ival_ = self.gds_validate_integer(ival_, node, 'StartMode')1457 self.StartMode = ival_1458 elif nodeName_ == 'RealStartMode':1459 sval_ = child_.text1460 try:1461 ival_ = int(sval_)1462 except (TypeError, ValueError), exp:1463 raise_parse_error(child_, 'requires integer: %s' % exp)1464 ival_ = self.gds_validate_integer(ival_, node, 'RealStartMode')1465 self.RealStartMode = ival_1466 elif nodeName_ == 'RealType':1467 sval_ = child_.text1468 try:1469 ival_ = int(sval_)1470 except (TypeError, ValueError), exp:1471 raise_parse_error(child_, 'requires integer: %s' % exp)1472 ival_ = self.gds_validate_integer(ival_, node, 'RealType')1473 self.RealType = ival_1474 elif nodeName_ == 'Path':1475 Path_ = child_.text1476 Path_ = self.gds_validate_string(Path_, node, 'Path')1477 self.Path = Path_1478 elif nodeName_ == 'plist':1479 plist_ = child_.text1480 plist_ = self.gds_validate_string(plist_, node, 'plist')1481 self.plist = plist_1482 elif nodeName_ == 'MD5':1483 sval_ = child_.text1484 try:1485 ival_ = int(sval_)1486 except (TypeError, ValueError), exp:1487 raise_parse_error(child_, 'requires integer: %s' % exp)1488 ival_ = self.gds_validate_integer(ival_, node, 'MD5')1489 self.MD5 = ival_1490 elif nodeName_ == 'SHA1':1491 sval_ = child_.text1492 try:1493 ival_ = int(sval_)1494 except (TypeError, ValueError), exp:1495 raise_parse_error(child_, 'requires integer: %s' % exp)1496 ival_ = self.gds_validate_integer(ival_, node, 'SHA1')1497 self.SHA1 = ival_1498 elif nodeName_ == 'FuzzySize':1499 sval_ = child_.text1500 try:1501 ival_ = int(sval_)1502 except (TypeError, ValueError), exp:1503 raise_parse_error(child_, 'requires integer: %s' % exp)1504 ival_ = self.gds_validate_integer(ival_, node, 'FuzzySize')1505 self.FuzzySize = ival_1506 elif nodeName_ == 'Fuzzy':1507 Fuzzy_ = child_.text1508 Fuzzy_ = self.gds_validate_string(Fuzzy_, node, 'Fuzzy')1509 self.Fuzzy = Fuzzy_1510 elif nodeName_ == 'Fuzzy2X':1511 Fuzzy2X_ = child_.text1512 Fuzzy2X_ = self.gds_validate_string(Fuzzy2X_, node, 'Fuzzy2X')1513 self.Fuzzy2X = Fuzzy2X_1514 elif nodeName_ == 'KFFStatus':1515 sval_ = child_.text1516 try:1517 ival_ = int(sval_)1518 except (TypeError, ValueError), exp:1519 raise_parse_error(child_, 'requires integer: %s' % exp)1520 ival_ = self.gds_validate_integer(ival_, node, 'KFFStatus')1521 self.KFFStatus = ival_1522 elif nodeName_ == 'processid':1523 sval_ = child_.text1524 try:1525 ival_ = int(sval_)1526 except (TypeError, ValueError), exp:1527 raise_parse_error(child_, 'requires integer: %s' % exp)1528 ival_ = self.gds_validate_integer(ival_, node, 'processid')1529 self.processid = ival_1530 elif nodeName_ == 'IRP_MJ_CREATE':1531 sval_ = child_.text1532 try:1533 ival_ = int(sval_)1534 except (TypeError, ValueError), exp:1535 raise_parse_error(child_, 'requires integer: %s' % exp)1536 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CREATE')1537 self.IRP_MJ_CREATE = ival_1538 elif nodeName_ == 'IRP_MJ_CREATE_NAMED_PIPE':1539 sval_ = child_.text1540 try:1541 ival_ = int(sval_)1542 except (TypeError, ValueError), exp:1543 raise_parse_error(child_, 'requires integer: %s' % exp)1544 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CREATE_NAMED_PIPE')1545 self.IRP_MJ_CREATE_NAMED_PIPE = ival_1546 elif nodeName_ == 'IRP_MJ_CLOSE':1547 sval_ = child_.text1548 try:1549 ival_ = int(sval_)1550 except (TypeError, ValueError), exp:1551 raise_parse_error(child_, 'requires integer: %s' % exp)1552 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CLOSE')1553 self.IRP_MJ_CLOSE = ival_1554 elif nodeName_ == 'IRP_MJ_READ':1555 sval_ = child_.text1556 try:1557 ival_ = int(sval_)1558 except (TypeError, ValueError), exp:1559 raise_parse_error(child_, 'requires integer: %s' % exp)1560 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_READ')1561 self.IRP_MJ_READ = ival_1562 elif nodeName_ == 'IRP_MJ_WRITE':1563 sval_ = child_.text1564 try:1565 ival_ = int(sval_)1566 except (TypeError, ValueError), exp:1567 raise_parse_error(child_, 'requires integer: %s' % exp)1568 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_WRITE')1569 self.IRP_MJ_WRITE = ival_1570 elif nodeName_ == 'IRP_MJ_QUERY_INFORMATION':1571 sval_ = child_.text1572 try:1573 ival_ = int(sval_)1574 except (TypeError, ValueError), exp:1575 raise_parse_error(child_, 'requires integer: %s' % exp)1576 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_INFORMATION')1577 self.IRP_MJ_QUERY_INFORMATION = ival_1578 elif nodeName_ == 'IRP_MJ_SET_INFORMATION':1579 sval_ = child_.text1580 try:1581 ival_ = int(sval_)1582 except (TypeError, ValueError), exp:1583 raise_parse_error(child_, 'requires integer: %s' % exp)1584 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_INFORMATION')1585 self.IRP_MJ_SET_INFORMATION = ival_1586 elif nodeName_ == 'IRP_MJ_QUERY_EA':1587 sval_ = child_.text1588 try:1589 ival_ = int(sval_)1590 except (TypeError, ValueError), exp:1591 raise_parse_error(child_, 'requires integer: %s' % exp)1592 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_EA')1593 self.IRP_MJ_QUERY_EA = ival_1594 elif nodeName_ == 'IRP_MJ_SET_EA':1595 sval_ = child_.text1596 try:1597 ival_ = int(sval_)1598 except (TypeError, ValueError), exp:1599 raise_parse_error(child_, 'requires integer: %s' % exp)1600 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_EA')1601 self.IRP_MJ_SET_EA = ival_1602 elif nodeName_ == 'IRP_MJ_FLUSH_BUFFERS':1603 sval_ = child_.text1604 try:1605 ival_ = int(sval_)1606 except (TypeError, ValueError), exp:1607 raise_parse_error(child_, 'requires integer: %s' % exp)1608 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_FLUSH_BUFFERS')1609 self.IRP_MJ_FLUSH_BUFFERS = ival_1610 elif nodeName_ == 'IRP_MJ_QUERY_VOLUME_INFORMATION':1611 sval_ = child_.text1612 try:1613 ival_ = int(sval_)1614 except (TypeError, ValueError), exp:1615 raise_parse_error(child_, 'requires integer: %s' % exp)1616 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_VOLUME_INFORMATION')1617 self.IRP_MJ_QUERY_VOLUME_INFORMATION = ival_1618 elif nodeName_ == 'IRP_MJ_SET_VOLUME_INFORMATION':1619 sval_ = child_.text1620 try:1621 ival_ = int(sval_)1622 except (TypeError, ValueError), exp:1623 raise_parse_error(child_, 'requires integer: %s' % exp)1624 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_VOLUME_INFORMATION')1625 self.IRP_MJ_SET_VOLUME_INFORMATION = ival_1626 elif nodeName_ == 'IRP_MJ_DIRECTORY_CONTROL':1627 sval_ = child_.text1628 try:1629 ival_ = int(sval_)1630 except (TypeError, ValueError), exp:1631 raise_parse_error(child_, 'requires integer: %s' % exp)1632 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_DIRECTORY_CONTROL')1633 self.IRP_MJ_DIRECTORY_CONTROL = ival_1634 elif nodeName_ == 'IRP_MJ_FILE_SYSTEM_CONTROL':1635 sval_ = child_.text1636 try:1637 ival_ = int(sval_)1638 except (TypeError, ValueError), exp:1639 raise_parse_error(child_, 'requires integer: %s' % exp)1640 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_FILE_SYSTEM_CONTROL')1641 self.IRP_MJ_FILE_SYSTEM_CONTROL = ival_1642 elif nodeName_ == 'IRP_MJ_DEVICE_CONTROL':1643 sval_ = child_.text1644 try:1645 ival_ = int(sval_)1646 except (TypeError, ValueError), exp:1647 raise_parse_error(child_, 'requires integer: %s' % exp)1648 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_DEVICE_CONTROL')1649 self.IRP_MJ_DEVICE_CONTROL = ival_1650 elif nodeName_ == 'IRP_MJ_INTERNAL_DEVICE_CONTROL':1651 sval_ = child_.text1652 try:1653 ival_ = int(sval_)1654 except (TypeError, ValueError), exp:1655 raise_parse_error(child_, 'requires integer: %s' % exp)1656 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_INTERNAL_DEVICE_CONTROL')1657 self.IRP_MJ_INTERNAL_DEVICE_CONTROL = ival_1658 elif nodeName_ == 'IRP_MJ_SHUTDOWN':1659 sval_ = child_.text1660 try:1661 ival_ = int(sval_)1662 except (TypeError, ValueError), exp:1663 raise_parse_error(child_, 'requires integer: %s' % exp)1664 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SHUTDOWN')1665 self.IRP_MJ_SHUTDOWN = ival_1666 elif nodeName_ == 'IRP_MJ_LOCK_CONTROL':1667 sval_ = child_.text1668 try:1669 ival_ = int(sval_)1670 except (TypeError, ValueError), exp:1671 raise_parse_error(child_, 'requires integer: %s' % exp)1672 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_LOCK_CONTROL')1673 self.IRP_MJ_LOCK_CONTROL = ival_1674 elif nodeName_ == 'IRP_MJ_CLEANUP':1675 sval_ = child_.text1676 try:1677 ival_ = int(sval_)1678 except (TypeError, ValueError), exp:1679 raise_parse_error(child_, 'requires integer: %s' % exp)1680 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CLEANUP')1681 self.IRP_MJ_CLEANUP = ival_1682 elif nodeName_ == 'IRP_MJ_CREATE_MAILSLOT':1683 sval_ = child_.text1684 try:1685 ival_ = int(sval_)1686 except (TypeError, ValueError), exp:1687 raise_parse_error(child_, 'requires integer: %s' % exp)1688 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CREATE_MAILSLOT')1689 self.IRP_MJ_CREATE_MAILSLOT = ival_1690 elif nodeName_ == 'IRP_MJ_QUERY_SECURITY':1691 sval_ = child_.text1692 try:1693 ival_ = int(sval_)1694 except (TypeError, ValueError), exp:1695 raise_parse_error(child_, 'requires integer: %s' % exp)1696 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_SECURITY')1697 self.IRP_MJ_QUERY_SECURITY = ival_1698 elif nodeName_ == 'IRP_MJ_SET_SECURITY':1699 sval_ = child_.text1700 try:1701 ival_ = int(sval_)1702 except (TypeError, ValueError), exp:1703 raise_parse_error(child_, 'requires integer: %s' % exp)1704 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_SECURITY')1705 self.IRP_MJ_SET_SECURITY = ival_1706 elif nodeName_ == 'IRP_MJ_POWER':1707 sval_ = child_.text1708 try:1709 ival_ = int(sval_)1710 except (TypeError, ValueError), exp:1711 raise_parse_error(child_, 'requires integer: %s' % exp)1712 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_POWER')1713 self.IRP_MJ_POWER = ival_1714 elif nodeName_ == 'IRP_MJ_SYSTEM_CONTROL':1715 sval_ = child_.text1716 try:1717 ival_ = int(sval_)1718 except (TypeError, ValueError), exp:1719 raise_parse_error(child_, 'requires integer: %s' % exp)1720 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SYSTEM_CONTROL')1721 self.IRP_MJ_SYSTEM_CONTROL = ival_1722 elif nodeName_ == 'IRP_MJ_DEVICE_CHANGE':1723 sval_ = child_.text1724 try:1725 ival_ = int(sval_)1726 except (TypeError, ValueError), exp:1727 raise_parse_error(child_, 'requires integer: %s' % exp)1728 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_DEVICE_CHANGE')1729 self.IRP_MJ_DEVICE_CHANGE = ival_1730 elif nodeName_ == 'IRP_MJ_QUERY_QUOTA':1731 sval_ = child_.text1732 try:1733 ival_ = int(sval_)1734 except (TypeError, ValueError), exp:1735 raise_parse_error(child_, 'requires integer: %s' % exp)1736 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_QUOTA')1737 self.IRP_MJ_QUERY_QUOTA = ival_1738 elif nodeName_ == 'IRP_MJ_SET_QUOTA':1739 sval_ = child_.text1740 try:1741 ival_ = int(sval_)1742 except (TypeError, ValueError), exp:1743 raise_parse_error(child_, 'requires integer: %s' % exp)1744 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_QUOTA')1745 self.IRP_MJ_SET_QUOTA = ival_1746 elif nodeName_ == 'IRP_MJ_PNP':1747 sval_ = child_.text1748 try:1749 ival_ = int(sval_)1750 except (TypeError, ValueError), exp:1751 raise_parse_error(child_, 'requires integer: %s' % exp)1752 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_PNP')1753 self.IRP_MJ_PNP = ival_1754 elif nodeName_ == 'Driver_Device_List':1755 obj_ = Driver_Device_ListType.factory()1756 obj_.build(child_)1757 self.Driver_Device_List = obj_1758 obj_.original_tagname_ = 'Driver_Device_List'1759# end class DriverType1760class Driver_Device_ListType(GeneratedsSuper):1761 subclass = None1762 superclass = None1763 def __init__(self, Device=None):1764 self.original_tagname_ = None1765 if Device is None:1766 self.Device = []1767 else:1768 self.Device = Device1769 def factory(*args_, **kwargs_):1770 if Driver_Device_ListType.subclass:1771 return Driver_Device_ListType.subclass(*args_, **kwargs_)1772 else:1773 return Driver_Device_ListType(*args_, **kwargs_)1774 factory = staticmethod(factory)1775 def get_Device(self): return self.Device1776 def set_Device(self, Device): self.Device = Device1777 def add_Device(self, value): self.Device.append(value)1778 def insert_Device_at(self, index, value): self.Device.insert(index, value)1779 def replace_Device_at(self, index, value): self.Device[index] = value1780 def hasContent_(self):1781 if (1782 self.Device1783 ):1784 return True1785 else:1786 return False1787 def export(self, outfile, level, namespace_='', name_='Driver_Device_ListType', namespacedef_='', pretty_print=True):1788 if pretty_print:1789 eol_ = '\n'1790 else:1791 eol_ = ''1792 if self.original_tagname_ is not None:1793 name_ = self.original_tagname_1794 showIndent(outfile, level, pretty_print)1795 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1796 already_processed = set()1797 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Driver_Device_ListType')1798 if self.hasContent_():1799 outfile.write('>%s' % (eol_, ))1800 self.exportChildren(outfile, level + 1, namespace_='', name_='Driver_Device_ListType', pretty_print=pretty_print)1801 showIndent(outfile, level, pretty_print)1802 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1803 else:1804 outfile.write('/>%s' % (eol_, ))1805 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Driver_Device_ListType'):1806 pass1807 def exportChildren(self, outfile, level, namespace_='', name_='Driver_Device_ListType', fromsubclass_=False, pretty_print=True):1808 if pretty_print:1809 eol_ = '\n'1810 else:1811 eol_ = ''1812 for Device_ in self.Device:1813 Device_.export(outfile, level, namespace_, name_='Device', pretty_print=pretty_print)1814 def exportLiteral(self, outfile, level, name_='Driver_Device_ListType'):1815 level += 11816 already_processed = set()1817 self.exportLiteralAttributes(outfile, level, already_processed, name_)1818 if self.hasContent_():1819 self.exportLiteralChildren(outfile, level, name_)1820 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1821 pass1822 def exportLiteralChildren(self, outfile, level, name_):1823 showIndent(outfile, level)1824 outfile.write('Device=[\n')1825 level += 11826 for Device_ in self.Device:1827 showIndent(outfile, level)1828 outfile.write('model_.DeviceType(\n')1829 Device_.exportLiteral(outfile, level, name_='DeviceType')1830 showIndent(outfile, level)1831 outfile.write('),\n')1832 level -= 11833 showIndent(outfile, level)1834 outfile.write('],\n')1835 def build(self, node):1836 already_processed = set()1837 self.buildAttributes(node, node.attrib, already_processed)1838 for child in node:1839 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1840 self.buildChildren(child, node, nodeName_)1841 return self1842 def buildAttributes(self, node, attrs, already_processed):1843 pass1844 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1845 if nodeName_ == 'Device':1846 obj_ = DeviceType.factory()1847 obj_.build(child_)1848 self.Device.append(obj_)1849 obj_.original_tagname_ = 'Device'1850# end class Driver_Device_ListType1851class DeviceType(GeneratedsSuper):1852 subclass = None1853 superclass = None1854 def __init__(self, Name=None, DeviceObj_Location=None, DriverObj_Location=None, NextDeviceObj_Location=None, AttachedDeviceObj_Location=None):1855 self.original_tagname_ = None1856 self.Name = Name1857 self.DeviceObj_Location = DeviceObj_Location1858 self.DriverObj_Location = DriverObj_Location1859 self.NextDeviceObj_Location = NextDeviceObj_Location1860 self.AttachedDeviceObj_Location = AttachedDeviceObj_Location1861 def factory(*args_, **kwargs_):1862 if DeviceType.subclass:1863 return DeviceType.subclass(*args_, **kwargs_)1864 else:1865 return DeviceType(*args_, **kwargs_)1866 factory = staticmethod(factory)1867 def get_Name(self): return self.Name1868 def set_Name(self, Name): self.Name = Name1869 def get_DeviceObj_Location(self): return self.DeviceObj_Location1870 def set_DeviceObj_Location(self, DeviceObj_Location): self.DeviceObj_Location = DeviceObj_Location1871 def get_DriverObj_Location(self): return self.DriverObj_Location1872 def set_DriverObj_Location(self, DriverObj_Location): self.DriverObj_Location = DriverObj_Location1873 def get_NextDeviceObj_Location(self): return self.NextDeviceObj_Location1874 def set_NextDeviceObj_Location(self, NextDeviceObj_Location): self.NextDeviceObj_Location = NextDeviceObj_Location1875 def get_AttachedDeviceObj_Location(self): return self.AttachedDeviceObj_Location1876 def set_AttachedDeviceObj_Location(self, AttachedDeviceObj_Location): self.AttachedDeviceObj_Location = AttachedDeviceObj_Location1877 def hasContent_(self):1878 if (1879 self.Name is not None or1880 self.DeviceObj_Location is not None or1881 self.DriverObj_Location is not None or1882 self.NextDeviceObj_Location is not None or1883 self.AttachedDeviceObj_Location is not None1884 ):1885 return True1886 else:1887 return False1888 def export(self, outfile, level, namespace_='', name_='DeviceType', namespacedef_='', pretty_print=True):1889 if pretty_print:1890 eol_ = '\n'1891 else:1892 eol_ = ''1893 if self.original_tagname_ is not None:1894 name_ = self.original_tagname_1895 showIndent(outfile, level, pretty_print)1896 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1897 already_processed = set()1898 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DeviceType')1899 if self.hasContent_():1900 outfile.write('>%s' % (eol_, ))1901 self.exportChildren(outfile, level + 1, namespace_='', name_='DeviceType', pretty_print=pretty_print)1902 showIndent(outfile, level, pretty_print)1903 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1904 else:1905 outfile.write('/>%s' % (eol_, ))1906 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DeviceType'):1907 pass1908 def exportChildren(self, outfile, level, namespace_='', name_='DeviceType', fromsubclass_=False, pretty_print=True):1909 if pretty_print:1910 eol_ = '\n'1911 else:1912 eol_ = ''1913 if self.Name is not None:1914 showIndent(outfile, level, pretty_print)1915 outfile.write('<%sName>%s</%sName>%s' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_, eol_))1916 if self.DeviceObj_Location is not None:1917 showIndent(outfile, level, pretty_print)1918 outfile.write('<%sDeviceObj_Location>%s</%sDeviceObj_Location>%s' % (namespace_, self.gds_format_integer(self.DeviceObj_Location, input_name='DeviceObj_Location'), namespace_, eol_))1919 if self.DriverObj_Location is not None:1920 showIndent(outfile, level, pretty_print)1921 outfile.write('<%sDriverObj_Location>%s</%sDriverObj_Location>%s' % (namespace_, self.gds_format_integer(self.DriverObj_Location, input_name='DriverObj_Location'), namespace_, eol_))1922 if self.NextDeviceObj_Location is not None:1923 showIndent(outfile, level, pretty_print)1924 outfile.write('<%sNextDeviceObj_Location>%s</%sNextDeviceObj_Location>%s' % (namespace_, self.gds_format_integer(self.NextDeviceObj_Location, input_name='NextDeviceObj_Location'), namespace_, eol_))1925 if self.AttachedDeviceObj_Location is not None:1926 showIndent(outfile, level, pretty_print)1927 outfile.write('<%sAttachedDeviceObj_Location>%s</%sAttachedDeviceObj_Location>%s' % (namespace_, self.gds_format_integer(self.AttachedDeviceObj_Location, input_name='AttachedDeviceObj_Location'), namespace_, eol_))1928 def exportLiteral(self, outfile, level, name_='DeviceType'):1929 level += 11930 already_processed = set()1931 self.exportLiteralAttributes(outfile, level, already_processed, name_)1932 if self.hasContent_():1933 self.exportLiteralChildren(outfile, level, name_)1934 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1935 pass1936 def exportLiteralChildren(self, outfile, level, name_):1937 if self.Name is not None:1938 showIndent(outfile, level)1939 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding))1940 if self.DeviceObj_Location is not None:1941 showIndent(outfile, level)...

Full Screen

Full Screen

e549fde04458da16ae5679a1a2ff75f5f647987b.svn-base

Source:e549fde04458da16ae5679a1a2ff75f5f647987b.svn-base Github

copy

Full Screen

...104 def gds_format_base64(self, input_data, input_name=''):105 return base64.b64encode(input_data)106 def gds_validate_base64(self, input_data, node, input_name=''):107 return input_data108 def gds_format_integer(self, input_data, input_name=''):109 return '%d' % input_data110 def gds_validate_integer(self, input_data, node, input_name=''):111 return input_data112 def gds_format_integer_list(self, input_data, input_name=''):113 return '%s' % input_data114 def gds_validate_integer_list(self, input_data, node, input_name=''):115 values = input_data.split()116 for value in values:117 try:118 float(value)119 except (TypeError, ValueError):120 raise_parse_error(node, 'Requires sequence of integers')121 return input_data122 def gds_format_float(self, input_data, input_name=''):123 return ('%.15f' % input_data).rstrip('0')124 def gds_validate_float(self, input_data, node, input_name=''):125 return input_data126 def gds_format_float_list(self, input_data, input_name=''):127 return '%s' % input_data128 def gds_validate_float_list(self, input_data, node, input_name=''):129 values = input_data.split()130 for value in values:131 try:132 float(value)133 except (TypeError, ValueError):134 raise_parse_error(node, 'Requires sequence of floats')135 return input_data136 def gds_format_double(self, input_data, input_name=''):137 return '%e' % input_data138 def gds_validate_double(self, input_data, node, input_name=''):139 return input_data140 def gds_format_double_list(self, input_data, input_name=''):141 return '%s' % input_data142 def gds_validate_double_list(self, input_data, node, input_name=''):143 values = input_data.split()144 for value in values:145 try:146 float(value)147 except (TypeError, ValueError):148 raise_parse_error(node, 'Requires sequence of doubles')149 return input_data150 def gds_format_boolean(self, input_data, input_name=''):151 return ('%s' % input_data).lower()152 def gds_validate_boolean(self, input_data, node, input_name=''):153 return input_data154 def gds_format_boolean_list(self, input_data, input_name=''):155 return '%s' % input_data156 def gds_validate_boolean_list(self, input_data, node, input_name=''):157 values = input_data.split()158 for value in values:159 if value not in ('true', '1', 'false', '0', ):160 raise_parse_error(161 node,162 'Requires sequence of booleans '163 '("true", "1", "false", "0")')164 return input_data165 def gds_validate_datetime(self, input_data, node, input_name=''):166 return input_data167 def gds_format_datetime(self, input_data, input_name=''):168 if input_data.microsecond == 0:169 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (170 input_data.year,171 input_data.month,172 input_data.day,173 input_data.hour,174 input_data.minute,175 input_data.second,176 )177 else:178 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (179 input_data.year,180 input_data.month,181 input_data.day,182 input_data.hour,183 input_data.minute,184 input_data.second,185 ('%f' % (float(input_data.microsecond) / 1000000))[2:],186 )187 if input_data.tzinfo is not None:188 tzoff = input_data.tzinfo.utcoffset(input_data)189 if tzoff is not None:190 total_seconds = tzoff.seconds + (86400 * tzoff.days)191 if total_seconds == 0:192 _svalue += 'Z'193 else:194 if total_seconds < 0:195 _svalue += '-'196 total_seconds *= -1197 else:198 _svalue += '+'199 hours = total_seconds // 3600200 minutes = (total_seconds - (hours * 3600)) // 60201 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)202 return _svalue203 @classmethod204 def gds_parse_datetime(cls, input_data):205 tz = None206 if input_data[-1] == 'Z':207 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')208 input_data = input_data[:-1]209 else:210 results = GeneratedsSuper.tzoff_pattern.search(input_data)211 if results is not None:212 tzoff_parts = results.group(2).split(':')213 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])214 if results.group(1) == '-':215 tzoff *= -1216 tz = GeneratedsSuper._FixedOffsetTZ(217 tzoff, results.group(0))218 input_data = input_data[:-6]219 time_parts = input_data.split('.')220 if len(time_parts) > 1:221 micro_seconds = int(float('0.' + time_parts[1]) * 1000000)222 input_data = '%s.%s' % (time_parts[0], micro_seconds, )223 dt = datetime_.datetime.strptime(224 input_data, '%Y-%m-%dT%H:%M:%S.%f')225 else:226 dt = datetime_.datetime.strptime(227 input_data, '%Y-%m-%dT%H:%M:%S')228 dt = dt.replace(tzinfo=tz)229 return dt230 def gds_validate_date(self, input_data, node, input_name=''):231 return input_data232 def gds_format_date(self, input_data, input_name=''):233 _svalue = '%04d-%02d-%02d' % (234 input_data.year,235 input_data.month,236 input_data.day,237 )238 try:239 if input_data.tzinfo is not None:240 tzoff = input_data.tzinfo.utcoffset(input_data)241 if tzoff is not None:242 total_seconds = tzoff.seconds + (86400 * tzoff.days)243 if total_seconds == 0:244 _svalue += 'Z'245 else:246 if total_seconds < 0:247 _svalue += '-'248 total_seconds *= -1249 else:250 _svalue += '+'251 hours = total_seconds // 3600252 minutes = (total_seconds - (hours * 3600)) // 60253 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)254 except AttributeError:255 pass256 return _svalue257 @classmethod258 def gds_parse_date(cls, input_data):259 tz = None260 if input_data[-1] == 'Z':261 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')262 input_data = input_data[:-1]263 else:264 results = GeneratedsSuper.tzoff_pattern.search(input_data)265 if results is not None:266 tzoff_parts = results.group(2).split(':')267 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])268 if results.group(1) == '-':269 tzoff *= -1270 tz = GeneratedsSuper._FixedOffsetTZ(271 tzoff, results.group(0))272 input_data = input_data[:-6]273 dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')274 dt = dt.replace(tzinfo=tz)275 return dt.date()276 def gds_validate_time(self, input_data, node, input_name=''):277 return input_data278 def gds_format_time(self, input_data, input_name=''):279 if input_data.microsecond == 0:280 _svalue = '%02d:%02d:%02d' % (281 input_data.hour,282 input_data.minute,283 input_data.second,284 )285 else:286 _svalue = '%02d:%02d:%02d.%s' % (287 input_data.hour,288 input_data.minute,289 input_data.second,290 ('%f' % (float(input_data.microsecond) / 1000000))[2:],291 )292 if input_data.tzinfo is not None:293 tzoff = input_data.tzinfo.utcoffset(input_data)294 if tzoff is not None:295 total_seconds = tzoff.seconds + (86400 * tzoff.days)296 if total_seconds == 0:297 _svalue += 'Z'298 else:299 if total_seconds < 0:300 _svalue += '-'301 total_seconds *= -1302 else:303 _svalue += '+'304 hours = total_seconds // 3600305 minutes = (total_seconds - (hours * 3600)) // 60306 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)307 return _svalue308 @classmethod309 def gds_parse_time(cls, input_data):310 tz = None311 if input_data[-1] == 'Z':312 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')313 input_data = input_data[:-1]314 else:315 results = GeneratedsSuper.tzoff_pattern.search(input_data)316 if results is not None:317 tzoff_parts = results.group(2).split(':')318 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])319 if results.group(1) == '-':320 tzoff *= -1321 tz = GeneratedsSuper._FixedOffsetTZ(322 tzoff, results.group(0))323 input_data = input_data[:-6]324 if len(input_data.split('.')) > 1:325 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')326 else:327 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')328 dt = dt.replace(tzinfo=tz)329 return dt.time()330 def gds_str_lower(self, instring):331 return instring.lower()332 def get_path_(self, node):333 path_list = []334 self.get_path_list_(node, path_list)335 path_list.reverse()336 path = '/'.join(path_list)337 return path338 Tag_strip_pattern_ = re_.compile(r'\{.*\}')339 def get_path_list_(self, node, path_list):340 if node is None:341 return342 tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)343 if tag:344 path_list.append(tag)345 self.get_path_list_(node.getparent(), path_list)346 def get_class_obj_(self, node, default_class=None):347 class_obj1 = default_class348 if 'xsi' in node.nsmap:349 classname = node.get('{%s}type' % node.nsmap['xsi'])350 if classname is not None:351 names = classname.split(':')352 if len(names) == 2:353 classname = names[1]354 class_obj2 = globals().get(classname)355 if class_obj2 is not None:356 class_obj1 = class_obj2357 return class_obj1358 def gds_build_any(self, node, type_name=None):359 return None360 @classmethod361 def gds_reverse_node_mapping(cls, mapping):362 return dict(((v, k) for k, v in mapping.iteritems()))363#364# If you have installed IPython you can uncomment and use the following.365# IPython is available from http://ipython.scipy.org/.366#367## from IPython.Shell import IPShellEmbed368## args = ''369## ipshell = IPShellEmbed(args,370## banner = 'Dropping into IPython',371## exit_msg = 'Leaving Interpreter, back to program.')372# Then use the following line where and when you want to drop into the373# IPython shell:374# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')375#376# Globals377#378ExternalEncoding = 'utf-8'379Tag_pattern_ = re_.compile(r'({.*})?(.*)')380String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")381Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')382#383# Support/utility functions.384#385def showIndent(outfile, level, pretty_print=True):386 if pretty_print:387 for idx in range(level):388 outfile.write(' ')389def quote_xml(inStr):390 if not inStr:391 return ''392 s1 = (isinstance(inStr, basestring) and inStr or393 '%s' % inStr)394 s1 = s1.replace('&', '&amp;')395 s1 = s1.replace('<', '&lt;')396 s1 = s1.replace('>', '&gt;')397 return s1398def quote_attrib(inStr):399 s1 = (isinstance(inStr, basestring) and inStr or400 '%s' % inStr)401 s1 = s1.replace('&', '&amp;')402 s1 = s1.replace('<', '&lt;')403 s1 = s1.replace('>', '&gt;')404 if '"' in s1:405 if "'" in s1:406 s1 = '"%s"' % s1.replace('"', "&quot;")407 else:408 s1 = "'%s'" % s1409 else:410 s1 = '"%s"' % s1411 return s1412def quote_python(inStr):413 s1 = inStr414 if s1.find("'") == -1:415 if s1.find('\n') == -1:416 return "'%s'" % s1417 else:418 return "'''%s'''" % s1419 else:420 if s1.find('"') != -1:421 s1 = s1.replace('"', '\\"')422 if s1.find('\n') == -1:423 return '"%s"' % s1424 else:425 return '"""%s"""' % s1426def get_all_text_(node):427 if node.text is not None:428 text = node.text429 else:430 text = ''431 for child in node:432 if child.tail is not None:433 text += child.tail434 return text435def find_attr_value_(attr_name, node):436 attrs = node.attrib437 attr_parts = attr_name.split(':')438 value = None439 if len(attr_parts) == 1:440 value = attrs.get(attr_name)441 elif len(attr_parts) == 2:442 prefix, name = attr_parts443 namespace = node.nsmap.get(prefix)444 if namespace is not None:445 value = attrs.get('{%s}%s' % (namespace, name, ))446 return value447class GDSParseError(Exception):448 pass449def raise_parse_error(node, msg):450 if XMLParser_import_library == XMLParser_import_lxml:451 msg = '%s (element %s/line %d)' % (452 msg, node.tag, node.sourceline, )453 else:454 msg = '%s (element %s)' % (msg, node.tag, )455 raise GDSParseError(msg)456class MixedContainer:457 # Constants for category:458 CategoryNone = 0459 CategoryText = 1460 CategorySimple = 2461 CategoryComplex = 3462 # Constants for content_type:463 TypeNone = 0464 TypeText = 1465 TypeString = 2466 TypeInteger = 3467 TypeFloat = 4468 TypeDecimal = 5469 TypeDouble = 6470 TypeBoolean = 7471 TypeBase64 = 8472 def __init__(self, category, content_type, name, value):473 self.category = category474 self.content_type = content_type475 self.name = name476 self.value = value477 def getCategory(self):478 return self.category479 def getContenttype(self, content_type):480 return self.content_type481 def getValue(self):482 return self.value483 def getName(self):484 return self.name485 def export(self, outfile, level, name, namespace, pretty_print=True):486 if self.category == MixedContainer.CategoryText:487 # Prevent exporting empty content as empty lines.488 if self.value.strip():489 outfile.write(self.value)490 elif self.category == MixedContainer.CategorySimple:491 self.exportSimple(outfile, level, name)492 else: # category == MixedContainer.CategoryComplex493 self.value.export(outfile, level, namespace, name, pretty_print)494 def exportSimple(self, outfile, level, name):495 if self.content_type == MixedContainer.TypeString:496 outfile.write('<%s>%s</%s>' % (497 self.name, self.value, self.name))498 elif self.content_type == MixedContainer.TypeInteger or \499 self.content_type == MixedContainer.TypeBoolean:500 outfile.write('<%s>%d</%s>' % (501 self.name, self.value, self.name))502 elif self.content_type == MixedContainer.TypeFloat or \503 self.content_type == MixedContainer.TypeDecimal:504 outfile.write('<%s>%f</%s>' % (505 self.name, self.value, self.name))506 elif self.content_type == MixedContainer.TypeDouble:507 outfile.write('<%s>%g</%s>' % (508 self.name, self.value, self.name))509 elif self.content_type == MixedContainer.TypeBase64:510 outfile.write('<%s>%s</%s>' % (511 self.name, base64.b64encode(self.value), self.name))512 def to_etree(self, element):513 if self.category == MixedContainer.CategoryText:514 # Prevent exporting empty content as empty lines.515 if self.value.strip():516 if len(element) > 0:517 if element[-1].tail is None:518 element[-1].tail = self.value519 else:520 element[-1].tail += self.value521 else:522 if element.text is None:523 element.text = self.value524 else:525 element.text += self.value526 elif self.category == MixedContainer.CategorySimple:527 subelement = etree_.SubElement(element, '%s' % self.name)528 subelement.text = self.to_etree_simple()529 else: # category == MixedContainer.CategoryComplex530 self.value.to_etree(element)531 def to_etree_simple(self):532 if self.content_type == MixedContainer.TypeString:533 text = self.value534 elif (self.content_type == MixedContainer.TypeInteger or535 self.content_type == MixedContainer.TypeBoolean):536 text = '%d' % self.value537 elif (self.content_type == MixedContainer.TypeFloat or538 self.content_type == MixedContainer.TypeDecimal):539 text = '%f' % self.value540 elif self.content_type == MixedContainer.TypeDouble:541 text = '%g' % self.value542 elif self.content_type == MixedContainer.TypeBase64:543 text = '%s' % base64.b64encode(self.value)544 return text545 def exportLiteral(self, outfile, level, name):546 if self.category == MixedContainer.CategoryText:547 showIndent(outfile, level)548 outfile.write(549 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (550 self.category, self.content_type, self.name, self.value))551 elif self.category == MixedContainer.CategorySimple:552 showIndent(outfile, level)553 outfile.write(554 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (555 self.category, self.content_type, self.name, self.value))556 else: # category == MixedContainer.CategoryComplex557 showIndent(outfile, level)558 outfile.write(559 'model_.MixedContainer(%d, %d, "%s",\n' % (560 self.category, self.content_type, self.name,))561 self.value.exportLiteral(outfile, level + 1)562 showIndent(outfile, level)563 outfile.write(')\n')564class MemberSpec_(object):565 def __init__(self, name='', data_type='', container=0):566 self.name = name567 self.data_type = data_type568 self.container = container569 def set_name(self, name): self.name = name570 def get_name(self): return self.name571 def set_data_type(self, data_type): self.data_type = data_type572 def get_data_type_chain(self): return self.data_type573 def get_data_type(self):574 if isinstance(self.data_type, list):575 if len(self.data_type) > 0:576 return self.data_type[-1]577 else:578 return 'xs:string'579 else:580 return self.data_type581 def set_container(self, container): self.container = container582 def get_container(self): return self.container583def _cast(typ, value):584 if typ is None or value is None:585 return value586 return typ(value)587#588# Data representation classes.589#590class root(GeneratedsSuper):591 subclass = None592 superclass = None593 def __init__(self, Driver=None):594 self.original_tagname_ = None595 if Driver is None:596 self.Driver = []597 else:598 self.Driver = Driver599 def factory(*args_, **kwargs_):600 if root.subclass:601 return root.subclass(*args_, **kwargs_)602 else:603 return root(*args_, **kwargs_)604 factory = staticmethod(factory)605 def get_Driver(self): return self.Driver606 def set_Driver(self, Driver): self.Driver = Driver607 def add_Driver(self, value): self.Driver.append(value)608 def insert_Driver_at(self, index, value): self.Driver.insert(index, value)609 def replace_Driver_at(self, index, value): self.Driver[index] = value610 def hasContent_(self):611 if (612 self.Driver613 ):614 return True615 else:616 return False617 def export(self, outfile, level, namespace_='', name_='root', namespacedef_='', pretty_print=True):618 if pretty_print:619 eol_ = '\n'620 else:621 eol_ = ''622 if self.original_tagname_ is not None:623 name_ = self.original_tagname_624 showIndent(outfile, level, pretty_print)625 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))626 already_processed = set()627 self.exportAttributes(outfile, level, already_processed, namespace_, name_='root')628 if self.hasContent_():629 outfile.write('>%s' % (eol_, ))630 self.exportChildren(outfile, level + 1, namespace_='', name_='root', pretty_print=pretty_print)631 showIndent(outfile, level, pretty_print)632 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))633 else:634 outfile.write('/>%s' % (eol_, ))635 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='root'):636 pass637 def exportChildren(self, outfile, level, namespace_='', name_='root', fromsubclass_=False, pretty_print=True):638 if pretty_print:639 eol_ = '\n'640 else:641 eol_ = ''642 for Driver_ in self.Driver:643 Driver_.export(outfile, level, namespace_, name_='Driver', pretty_print=pretty_print)644 def exportLiteral(self, outfile, level, name_='root'):645 level += 1646 already_processed = set()647 self.exportLiteralAttributes(outfile, level, already_processed, name_)648 if self.hasContent_():649 self.exportLiteralChildren(outfile, level, name_)650 def exportLiteralAttributes(self, outfile, level, already_processed, name_):651 pass652 def exportLiteralChildren(self, outfile, level, name_):653 showIndent(outfile, level)654 outfile.write('Driver=[\n')655 level += 1656 for Driver_ in self.Driver:657 showIndent(outfile, level)658 outfile.write('model_.DriverType(\n')659 Driver_.exportLiteral(outfile, level, name_='DriverType')660 showIndent(outfile, level)661 outfile.write('),\n')662 level -= 1663 showIndent(outfile, level)664 outfile.write('],\n')665 def build(self, node):666 already_processed = set()667 self.buildAttributes(node, node.attrib, already_processed)668 for child in node:669 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]670 self.buildChildren(child, node, nodeName_)671 return self672 def buildAttributes(self, node, attrs, already_processed):673 pass674 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):675 if nodeName_ == 'Driver':676 obj_ = DriverType.factory()677 obj_.build(child_)678 self.Driver.append(obj_)679 obj_.original_tagname_ = 'Driver'680# end class root681class DriverType(GeneratedsSuper):682 subclass = None683 superclass = None684 def __init__(self, resultitemtype=None, ServiceKeyName=None, ImagePath=None, Type=None, DriverObj_Location=None, DeviceObj_Location=None, Driver_Init=None, Driver_StartIO=None, Driver_Unload=None, BaseAddress=None, StartTime=None, Dependencies=None, Size=None, Instances=None, Name=None, StartedAs=None, State=None, RealState=None, StartMode=None, RealStartMode=None, RealType=None, Path=None, plist=None, MD5=None, SHA1=None, FuzzySize=None, Fuzzy=None, Fuzzy2X=None, KFFStatus=None, processid=None, IRP_MJ_CREATE=None, IRP_MJ_CREATE_NAMED_PIPE=None, IRP_MJ_CLOSE=None, IRP_MJ_READ=None, IRP_MJ_WRITE=None, IRP_MJ_QUERY_INFORMATION=None, IRP_MJ_SET_INFORMATION=None, IRP_MJ_QUERY_EA=None, IRP_MJ_SET_EA=None, IRP_MJ_FLUSH_BUFFERS=None, IRP_MJ_QUERY_VOLUME_INFORMATION=None, IRP_MJ_SET_VOLUME_INFORMATION=None, IRP_MJ_DIRECTORY_CONTROL=None, IRP_MJ_FILE_SYSTEM_CONTROL=None, IRP_MJ_DEVICE_CONTROL=None, IRP_MJ_INTERNAL_DEVICE_CONTROL=None, IRP_MJ_SHUTDOWN=None, IRP_MJ_LOCK_CONTROL=None, IRP_MJ_CLEANUP=None, IRP_MJ_CREATE_MAILSLOT=None, IRP_MJ_QUERY_SECURITY=None, IRP_MJ_SET_SECURITY=None, IRP_MJ_POWER=None, IRP_MJ_SYSTEM_CONTROL=None, IRP_MJ_DEVICE_CHANGE=None, IRP_MJ_QUERY_QUOTA=None, IRP_MJ_SET_QUOTA=None, IRP_MJ_PNP=None, Driver_Device_List=None):685 self.original_tagname_ = None686 self.resultitemtype = _cast(int, resultitemtype)687 self.ServiceKeyName = ServiceKeyName688 self.ImagePath = ImagePath689 self.Type = Type690 self.DriverObj_Location = DriverObj_Location691 self.DeviceObj_Location = DeviceObj_Location692 self.Driver_Init = Driver_Init693 self.Driver_StartIO = Driver_StartIO694 self.Driver_Unload = Driver_Unload695 self.BaseAddress = BaseAddress696 self.StartTime = StartTime697 self.Dependencies = Dependencies698 self.Size = Size699 self.Instances = Instances700 self.Name = Name701 self.StartedAs = StartedAs702 self.State = State703 self.RealState = RealState704 self.StartMode = StartMode705 self.RealStartMode = RealStartMode706 self.RealType = RealType707 self.Path = Path708 self.plist = plist709 self.MD5 = MD5710 self.SHA1 = SHA1711 self.FuzzySize = FuzzySize712 self.Fuzzy = Fuzzy713 self.Fuzzy2X = Fuzzy2X714 self.KFFStatus = KFFStatus715 self.processid = processid716 self.IRP_MJ_CREATE = IRP_MJ_CREATE717 self.IRP_MJ_CREATE_NAMED_PIPE = IRP_MJ_CREATE_NAMED_PIPE718 self.IRP_MJ_CLOSE = IRP_MJ_CLOSE719 self.IRP_MJ_READ = IRP_MJ_READ720 self.IRP_MJ_WRITE = IRP_MJ_WRITE721 self.IRP_MJ_QUERY_INFORMATION = IRP_MJ_QUERY_INFORMATION722 self.IRP_MJ_SET_INFORMATION = IRP_MJ_SET_INFORMATION723 self.IRP_MJ_QUERY_EA = IRP_MJ_QUERY_EA724 self.IRP_MJ_SET_EA = IRP_MJ_SET_EA725 self.IRP_MJ_FLUSH_BUFFERS = IRP_MJ_FLUSH_BUFFERS726 self.IRP_MJ_QUERY_VOLUME_INFORMATION = IRP_MJ_QUERY_VOLUME_INFORMATION727 self.IRP_MJ_SET_VOLUME_INFORMATION = IRP_MJ_SET_VOLUME_INFORMATION728 self.IRP_MJ_DIRECTORY_CONTROL = IRP_MJ_DIRECTORY_CONTROL729 self.IRP_MJ_FILE_SYSTEM_CONTROL = IRP_MJ_FILE_SYSTEM_CONTROL730 self.IRP_MJ_DEVICE_CONTROL = IRP_MJ_DEVICE_CONTROL731 self.IRP_MJ_INTERNAL_DEVICE_CONTROL = IRP_MJ_INTERNAL_DEVICE_CONTROL732 self.IRP_MJ_SHUTDOWN = IRP_MJ_SHUTDOWN733 self.IRP_MJ_LOCK_CONTROL = IRP_MJ_LOCK_CONTROL734 self.IRP_MJ_CLEANUP = IRP_MJ_CLEANUP735 self.IRP_MJ_CREATE_MAILSLOT = IRP_MJ_CREATE_MAILSLOT736 self.IRP_MJ_QUERY_SECURITY = IRP_MJ_QUERY_SECURITY737 self.IRP_MJ_SET_SECURITY = IRP_MJ_SET_SECURITY738 self.IRP_MJ_POWER = IRP_MJ_POWER739 self.IRP_MJ_SYSTEM_CONTROL = IRP_MJ_SYSTEM_CONTROL740 self.IRP_MJ_DEVICE_CHANGE = IRP_MJ_DEVICE_CHANGE741 self.IRP_MJ_QUERY_QUOTA = IRP_MJ_QUERY_QUOTA742 self.IRP_MJ_SET_QUOTA = IRP_MJ_SET_QUOTA743 self.IRP_MJ_PNP = IRP_MJ_PNP744 self.Driver_Device_List = Driver_Device_List745 def factory(*args_, **kwargs_):746 if DriverType.subclass:747 return DriverType.subclass(*args_, **kwargs_)748 else:749 return DriverType(*args_, **kwargs_)750 factory = staticmethod(factory)751 def get_ServiceKeyName(self): return self.ServiceKeyName752 def set_ServiceKeyName(self, ServiceKeyName): self.ServiceKeyName = ServiceKeyName753 def get_ImagePath(self): return self.ImagePath754 def set_ImagePath(self, ImagePath): self.ImagePath = ImagePath755 def get_Type(self): return self.Type756 def set_Type(self, Type): self.Type = Type757 def get_DriverObj_Location(self): return self.DriverObj_Location758 def set_DriverObj_Location(self, DriverObj_Location): self.DriverObj_Location = DriverObj_Location759 def get_DeviceObj_Location(self): return self.DeviceObj_Location760 def set_DeviceObj_Location(self, DeviceObj_Location): self.DeviceObj_Location = DeviceObj_Location761 def get_Driver_Init(self): return self.Driver_Init762 def set_Driver_Init(self, Driver_Init): self.Driver_Init = Driver_Init763 def get_Driver_StartIO(self): return self.Driver_StartIO764 def set_Driver_StartIO(self, Driver_StartIO): self.Driver_StartIO = Driver_StartIO765 def get_Driver_Unload(self): return self.Driver_Unload766 def set_Driver_Unload(self, Driver_Unload): self.Driver_Unload = Driver_Unload767 def get_BaseAddress(self): return self.BaseAddress768 def set_BaseAddress(self, BaseAddress): self.BaseAddress = BaseAddress769 def get_StartTime(self): return self.StartTime770 def set_StartTime(self, StartTime): self.StartTime = StartTime771 def get_Dependencies(self): return self.Dependencies772 def set_Dependencies(self, Dependencies): self.Dependencies = Dependencies773 def get_Size(self): return self.Size774 def set_Size(self, Size): self.Size = Size775 def get_Instances(self): return self.Instances776 def set_Instances(self, Instances): self.Instances = Instances777 def get_Name(self): return self.Name778 def set_Name(self, Name): self.Name = Name779 def get_StartedAs(self): return self.StartedAs780 def set_StartedAs(self, StartedAs): self.StartedAs = StartedAs781 def get_State(self): return self.State782 def set_State(self, State): self.State = State783 def get_RealState(self): return self.RealState784 def set_RealState(self, RealState): self.RealState = RealState785 def get_StartMode(self): return self.StartMode786 def set_StartMode(self, StartMode): self.StartMode = StartMode787 def get_RealStartMode(self): return self.RealStartMode788 def set_RealStartMode(self, RealStartMode): self.RealStartMode = RealStartMode789 def get_RealType(self): return self.RealType790 def set_RealType(self, RealType): self.RealType = RealType791 def get_Path(self): return self.Path792 def set_Path(self, Path): self.Path = Path793 def get_plist(self): return self.plist794 def set_plist(self, plist): self.plist = plist795 def get_MD5(self): return self.MD5796 def set_MD5(self, MD5): self.MD5 = MD5797 def get_SHA1(self): return self.SHA1798 def set_SHA1(self, SHA1): self.SHA1 = SHA1799 def get_FuzzySize(self): return self.FuzzySize800 def set_FuzzySize(self, FuzzySize): self.FuzzySize = FuzzySize801 def get_Fuzzy(self): return self.Fuzzy802 def set_Fuzzy(self, Fuzzy): self.Fuzzy = Fuzzy803 def get_Fuzzy2X(self): return self.Fuzzy2X804 def set_Fuzzy2X(self, Fuzzy2X): self.Fuzzy2X = Fuzzy2X805 def get_KFFStatus(self): return self.KFFStatus806 def set_KFFStatus(self, KFFStatus): self.KFFStatus = KFFStatus807 def get_processid(self): return self.processid808 def set_processid(self, processid): self.processid = processid809 def get_IRP_MJ_CREATE(self): return self.IRP_MJ_CREATE810 def set_IRP_MJ_CREATE(self, IRP_MJ_CREATE): self.IRP_MJ_CREATE = IRP_MJ_CREATE811 def get_IRP_MJ_CREATE_NAMED_PIPE(self): return self.IRP_MJ_CREATE_NAMED_PIPE812 def set_IRP_MJ_CREATE_NAMED_PIPE(self, IRP_MJ_CREATE_NAMED_PIPE): self.IRP_MJ_CREATE_NAMED_PIPE = IRP_MJ_CREATE_NAMED_PIPE813 def get_IRP_MJ_CLOSE(self): return self.IRP_MJ_CLOSE814 def set_IRP_MJ_CLOSE(self, IRP_MJ_CLOSE): self.IRP_MJ_CLOSE = IRP_MJ_CLOSE815 def get_IRP_MJ_READ(self): return self.IRP_MJ_READ816 def set_IRP_MJ_READ(self, IRP_MJ_READ): self.IRP_MJ_READ = IRP_MJ_READ817 def get_IRP_MJ_WRITE(self): return self.IRP_MJ_WRITE818 def set_IRP_MJ_WRITE(self, IRP_MJ_WRITE): self.IRP_MJ_WRITE = IRP_MJ_WRITE819 def get_IRP_MJ_QUERY_INFORMATION(self): return self.IRP_MJ_QUERY_INFORMATION820 def set_IRP_MJ_QUERY_INFORMATION(self, IRP_MJ_QUERY_INFORMATION): self.IRP_MJ_QUERY_INFORMATION = IRP_MJ_QUERY_INFORMATION821 def get_IRP_MJ_SET_INFORMATION(self): return self.IRP_MJ_SET_INFORMATION822 def set_IRP_MJ_SET_INFORMATION(self, IRP_MJ_SET_INFORMATION): self.IRP_MJ_SET_INFORMATION = IRP_MJ_SET_INFORMATION823 def get_IRP_MJ_QUERY_EA(self): return self.IRP_MJ_QUERY_EA824 def set_IRP_MJ_QUERY_EA(self, IRP_MJ_QUERY_EA): self.IRP_MJ_QUERY_EA = IRP_MJ_QUERY_EA825 def get_IRP_MJ_SET_EA(self): return self.IRP_MJ_SET_EA826 def set_IRP_MJ_SET_EA(self, IRP_MJ_SET_EA): self.IRP_MJ_SET_EA = IRP_MJ_SET_EA827 def get_IRP_MJ_FLUSH_BUFFERS(self): return self.IRP_MJ_FLUSH_BUFFERS828 def set_IRP_MJ_FLUSH_BUFFERS(self, IRP_MJ_FLUSH_BUFFERS): self.IRP_MJ_FLUSH_BUFFERS = IRP_MJ_FLUSH_BUFFERS829 def get_IRP_MJ_QUERY_VOLUME_INFORMATION(self): return self.IRP_MJ_QUERY_VOLUME_INFORMATION830 def set_IRP_MJ_QUERY_VOLUME_INFORMATION(self, IRP_MJ_QUERY_VOLUME_INFORMATION): self.IRP_MJ_QUERY_VOLUME_INFORMATION = IRP_MJ_QUERY_VOLUME_INFORMATION831 def get_IRP_MJ_SET_VOLUME_INFORMATION(self): return self.IRP_MJ_SET_VOLUME_INFORMATION832 def set_IRP_MJ_SET_VOLUME_INFORMATION(self, IRP_MJ_SET_VOLUME_INFORMATION): self.IRP_MJ_SET_VOLUME_INFORMATION = IRP_MJ_SET_VOLUME_INFORMATION833 def get_IRP_MJ_DIRECTORY_CONTROL(self): return self.IRP_MJ_DIRECTORY_CONTROL834 def set_IRP_MJ_DIRECTORY_CONTROL(self, IRP_MJ_DIRECTORY_CONTROL): self.IRP_MJ_DIRECTORY_CONTROL = IRP_MJ_DIRECTORY_CONTROL835 def get_IRP_MJ_FILE_SYSTEM_CONTROL(self): return self.IRP_MJ_FILE_SYSTEM_CONTROL836 def set_IRP_MJ_FILE_SYSTEM_CONTROL(self, IRP_MJ_FILE_SYSTEM_CONTROL): self.IRP_MJ_FILE_SYSTEM_CONTROL = IRP_MJ_FILE_SYSTEM_CONTROL837 def get_IRP_MJ_DEVICE_CONTROL(self): return self.IRP_MJ_DEVICE_CONTROL838 def set_IRP_MJ_DEVICE_CONTROL(self, IRP_MJ_DEVICE_CONTROL): self.IRP_MJ_DEVICE_CONTROL = IRP_MJ_DEVICE_CONTROL839 def get_IRP_MJ_INTERNAL_DEVICE_CONTROL(self): return self.IRP_MJ_INTERNAL_DEVICE_CONTROL840 def set_IRP_MJ_INTERNAL_DEVICE_CONTROL(self, IRP_MJ_INTERNAL_DEVICE_CONTROL): self.IRP_MJ_INTERNAL_DEVICE_CONTROL = IRP_MJ_INTERNAL_DEVICE_CONTROL841 def get_IRP_MJ_SHUTDOWN(self): return self.IRP_MJ_SHUTDOWN842 def set_IRP_MJ_SHUTDOWN(self, IRP_MJ_SHUTDOWN): self.IRP_MJ_SHUTDOWN = IRP_MJ_SHUTDOWN843 def get_IRP_MJ_LOCK_CONTROL(self): return self.IRP_MJ_LOCK_CONTROL844 def set_IRP_MJ_LOCK_CONTROL(self, IRP_MJ_LOCK_CONTROL): self.IRP_MJ_LOCK_CONTROL = IRP_MJ_LOCK_CONTROL845 def get_IRP_MJ_CLEANUP(self): return self.IRP_MJ_CLEANUP846 def set_IRP_MJ_CLEANUP(self, IRP_MJ_CLEANUP): self.IRP_MJ_CLEANUP = IRP_MJ_CLEANUP847 def get_IRP_MJ_CREATE_MAILSLOT(self): return self.IRP_MJ_CREATE_MAILSLOT848 def set_IRP_MJ_CREATE_MAILSLOT(self, IRP_MJ_CREATE_MAILSLOT): self.IRP_MJ_CREATE_MAILSLOT = IRP_MJ_CREATE_MAILSLOT849 def get_IRP_MJ_QUERY_SECURITY(self): return self.IRP_MJ_QUERY_SECURITY850 def set_IRP_MJ_QUERY_SECURITY(self, IRP_MJ_QUERY_SECURITY): self.IRP_MJ_QUERY_SECURITY = IRP_MJ_QUERY_SECURITY851 def get_IRP_MJ_SET_SECURITY(self): return self.IRP_MJ_SET_SECURITY852 def set_IRP_MJ_SET_SECURITY(self, IRP_MJ_SET_SECURITY): self.IRP_MJ_SET_SECURITY = IRP_MJ_SET_SECURITY853 def get_IRP_MJ_POWER(self): return self.IRP_MJ_POWER854 def set_IRP_MJ_POWER(self, IRP_MJ_POWER): self.IRP_MJ_POWER = IRP_MJ_POWER855 def get_IRP_MJ_SYSTEM_CONTROL(self): return self.IRP_MJ_SYSTEM_CONTROL856 def set_IRP_MJ_SYSTEM_CONTROL(self, IRP_MJ_SYSTEM_CONTROL): self.IRP_MJ_SYSTEM_CONTROL = IRP_MJ_SYSTEM_CONTROL857 def get_IRP_MJ_DEVICE_CHANGE(self): return self.IRP_MJ_DEVICE_CHANGE858 def set_IRP_MJ_DEVICE_CHANGE(self, IRP_MJ_DEVICE_CHANGE): self.IRP_MJ_DEVICE_CHANGE = IRP_MJ_DEVICE_CHANGE859 def get_IRP_MJ_QUERY_QUOTA(self): return self.IRP_MJ_QUERY_QUOTA860 def set_IRP_MJ_QUERY_QUOTA(self, IRP_MJ_QUERY_QUOTA): self.IRP_MJ_QUERY_QUOTA = IRP_MJ_QUERY_QUOTA861 def get_IRP_MJ_SET_QUOTA(self): return self.IRP_MJ_SET_QUOTA862 def set_IRP_MJ_SET_QUOTA(self, IRP_MJ_SET_QUOTA): self.IRP_MJ_SET_QUOTA = IRP_MJ_SET_QUOTA863 def get_IRP_MJ_PNP(self): return self.IRP_MJ_PNP864 def set_IRP_MJ_PNP(self, IRP_MJ_PNP): self.IRP_MJ_PNP = IRP_MJ_PNP865 def get_Driver_Device_List(self): return self.Driver_Device_List866 def set_Driver_Device_List(self, Driver_Device_List): self.Driver_Device_List = Driver_Device_List867 def get_resultitemtype(self): return self.resultitemtype868 def set_resultitemtype(self, resultitemtype): self.resultitemtype = resultitemtype869 def hasContent_(self):870 if (871 self.ServiceKeyName is not None or872 self.ImagePath is not None or873 self.Type is not None or874 self.DriverObj_Location is not None or875 self.DeviceObj_Location is not None or876 self.Driver_Init is not None or877 self.Driver_StartIO is not None or878 self.Driver_Unload is not None or879 self.BaseAddress is not None or880 self.StartTime is not None or881 self.Dependencies is not None or882 self.Size is not None or883 self.Instances is not None or884 self.Name is not None or885 self.StartedAs is not None or886 self.State is not None or887 self.RealState is not None or888 self.StartMode is not None or889 self.RealStartMode is not None or890 self.RealType is not None or891 self.Path is not None or892 self.plist is not None or893 self.MD5 is not None or894 self.SHA1 is not None or895 self.FuzzySize is not None or896 self.Fuzzy is not None or897 self.Fuzzy2X is not None or898 self.KFFStatus is not None or899 self.processid is not None or900 self.IRP_MJ_CREATE is not None or901 self.IRP_MJ_CREATE_NAMED_PIPE is not None or902 self.IRP_MJ_CLOSE is not None or903 self.IRP_MJ_READ is not None or904 self.IRP_MJ_WRITE is not None or905 self.IRP_MJ_QUERY_INFORMATION is not None or906 self.IRP_MJ_SET_INFORMATION is not None or907 self.IRP_MJ_QUERY_EA is not None or908 self.IRP_MJ_SET_EA is not None or909 self.IRP_MJ_FLUSH_BUFFERS is not None or910 self.IRP_MJ_QUERY_VOLUME_INFORMATION is not None or911 self.IRP_MJ_SET_VOLUME_INFORMATION is not None or912 self.IRP_MJ_DIRECTORY_CONTROL is not None or913 self.IRP_MJ_FILE_SYSTEM_CONTROL is not None or914 self.IRP_MJ_DEVICE_CONTROL is not None or915 self.IRP_MJ_INTERNAL_DEVICE_CONTROL is not None or916 self.IRP_MJ_SHUTDOWN is not None or917 self.IRP_MJ_LOCK_CONTROL is not None or918 self.IRP_MJ_CLEANUP is not None or919 self.IRP_MJ_CREATE_MAILSLOT is not None or920 self.IRP_MJ_QUERY_SECURITY is not None or921 self.IRP_MJ_SET_SECURITY is not None or922 self.IRP_MJ_POWER is not None or923 self.IRP_MJ_SYSTEM_CONTROL is not None or924 self.IRP_MJ_DEVICE_CHANGE is not None or925 self.IRP_MJ_QUERY_QUOTA is not None or926 self.IRP_MJ_SET_QUOTA is not None or927 self.IRP_MJ_PNP is not None or928 self.Driver_Device_List is not None929 ):930 return True931 else:932 return False933 def export(self, outfile, level, namespace_='', name_='DriverType', namespacedef_='', pretty_print=True):934 if pretty_print:935 eol_ = '\n'936 else:937 eol_ = ''938 if self.original_tagname_ is not None:939 name_ = self.original_tagname_940 showIndent(outfile, level, pretty_print)941 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))942 already_processed = set()943 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DriverType')944 if self.hasContent_():945 outfile.write('>%s' % (eol_, ))946 self.exportChildren(outfile, level + 1, namespace_='', name_='DriverType', pretty_print=pretty_print)947 showIndent(outfile, level, pretty_print)948 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))949 else:950 outfile.write('/>%s' % (eol_, ))951 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DriverType'):952 if self.resultitemtype is not None and 'resultitemtype' not in already_processed:953 already_processed.add('resultitemtype')954 outfile.write(' resultitemtype="%s"' % self.gds_format_integer(self.resultitemtype, input_name='resultitemtype'))955 def exportChildren(self, outfile, level, namespace_='', name_='DriverType', fromsubclass_=False, pretty_print=True):956 if pretty_print:957 eol_ = '\n'958 else:959 eol_ = ''960 if self.ServiceKeyName is not None:961 showIndent(outfile, level, pretty_print)962 outfile.write('<%sServiceKeyName>%s</%sServiceKeyName>%s' % (namespace_, self.gds_format_string(quote_xml(self.ServiceKeyName).encode(ExternalEncoding), input_name='ServiceKeyName'), namespace_, eol_))963 if self.ImagePath is not None:964 showIndent(outfile, level, pretty_print)965 outfile.write('<%sImagePath>%s</%sImagePath>%s' % (namespace_, self.gds_format_string(quote_xml(self.ImagePath).encode(ExternalEncoding), input_name='ImagePath'), namespace_, eol_))966 if self.Type is not None:967 showIndent(outfile, level, pretty_print)968 outfile.write('<%sType>%s</%sType>%s' % (namespace_, self.gds_format_integer(self.Type, input_name='Type'), namespace_, eol_))969 if self.DriverObj_Location is not None:970 showIndent(outfile, level, pretty_print)971 outfile.write('<%sDriverObj_Location>%s</%sDriverObj_Location>%s' % (namespace_, self.gds_format_integer(self.DriverObj_Location, input_name='DriverObj_Location'), namespace_, eol_))972 if self.DeviceObj_Location is not None:973 showIndent(outfile, level, pretty_print)974 outfile.write('<%sDeviceObj_Location>%s</%sDeviceObj_Location>%s' % (namespace_, self.gds_format_integer(self.DeviceObj_Location, input_name='DeviceObj_Location'), namespace_, eol_))975 if self.Driver_Init is not None:976 showIndent(outfile, level, pretty_print)977 outfile.write('<%sDriver_Init>%s</%sDriver_Init>%s' % (namespace_, self.gds_format_integer(self.Driver_Init, input_name='Driver_Init'), namespace_, eol_))978 if self.Driver_StartIO is not None:979 showIndent(outfile, level, pretty_print)980 outfile.write('<%sDriver_StartIO>%s</%sDriver_StartIO>%s' % (namespace_, self.gds_format_integer(self.Driver_StartIO, input_name='Driver_StartIO'), namespace_, eol_))981 if self.Driver_Unload is not None:982 showIndent(outfile, level, pretty_print)983 outfile.write('<%sDriver_Unload>%s</%sDriver_Unload>%s' % (namespace_, self.gds_format_integer(self.Driver_Unload, input_name='Driver_Unload'), namespace_, eol_))984 if self.BaseAddress is not None:985 showIndent(outfile, level, pretty_print)986 outfile.write('<%sBaseAddress>%s</%sBaseAddress>%s' % (namespace_, self.gds_format_integer(self.BaseAddress, input_name='BaseAddress'), namespace_, eol_))987 if self.StartTime is not None:988 showIndent(outfile, level, pretty_print)989 outfile.write('<%sStartTime>%s</%sStartTime>%s' % (namespace_, self.gds_format_string(quote_xml(self.StartTime).encode(ExternalEncoding), input_name='StartTime'), namespace_, eol_))990 if self.Dependencies is not None:991 showIndent(outfile, level, pretty_print)992 outfile.write('<%sDependencies>%s</%sDependencies>%s' % (namespace_, self.gds_format_string(quote_xml(self.Dependencies).encode(ExternalEncoding), input_name='Dependencies'), namespace_, eol_))993 if self.Size is not None:994 showIndent(outfile, level, pretty_print)995 outfile.write('<%sSize>%s</%sSize>%s' % (namespace_, self.gds_format_integer(self.Size, input_name='Size'), namespace_, eol_))996 if self.Instances is not None:997 showIndent(outfile, level, pretty_print)998 outfile.write('<%sInstances>%s</%sInstances>%s' % (namespace_, self.gds_format_integer(self.Instances, input_name='Instances'), namespace_, eol_))999 if self.Name is not None:1000 showIndent(outfile, level, pretty_print)1001 outfile.write('<%sName>%s</%sName>%s' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_, eol_))1002 if self.StartedAs is not None:1003 showIndent(outfile, level, pretty_print)1004 outfile.write('<%sStartedAs>%s</%sStartedAs>%s' % (namespace_, self.gds_format_string(quote_xml(self.StartedAs).encode(ExternalEncoding), input_name='StartedAs'), namespace_, eol_))1005 if self.State is not None:1006 showIndent(outfile, level, pretty_print)1007 outfile.write('<%sState>%s</%sState>%s' % (namespace_, self.gds_format_integer(self.State, input_name='State'), namespace_, eol_))1008 if self.RealState is not None:1009 showIndent(outfile, level, pretty_print)1010 outfile.write('<%sRealState>%s</%sRealState>%s' % (namespace_, self.gds_format_integer(self.RealState, input_name='RealState'), namespace_, eol_))1011 if self.StartMode is not None:1012 showIndent(outfile, level, pretty_print)1013 outfile.write('<%sStartMode>%s</%sStartMode>%s' % (namespace_, self.gds_format_integer(self.StartMode, input_name='StartMode'), namespace_, eol_))1014 if self.RealStartMode is not None:1015 showIndent(outfile, level, pretty_print)1016 outfile.write('<%sRealStartMode>%s</%sRealStartMode>%s' % (namespace_, self.gds_format_integer(self.RealStartMode, input_name='RealStartMode'), namespace_, eol_))1017 if self.RealType is not None:1018 showIndent(outfile, level, pretty_print)1019 outfile.write('<%sRealType>%s</%sRealType>%s' % (namespace_, self.gds_format_integer(self.RealType, input_name='RealType'), namespace_, eol_))1020 if self.Path is not None:1021 showIndent(outfile, level, pretty_print)1022 outfile.write('<%sPath>%s</%sPath>%s' % (namespace_, self.gds_format_string(quote_xml(self.Path).encode(ExternalEncoding), input_name='Path'), namespace_, eol_))1023 if self.plist is not None:1024 showIndent(outfile, level, pretty_print)1025 outfile.write('<%splist>%s</%splist>%s' % (namespace_, self.gds_format_string(quote_xml(self.plist).encode(ExternalEncoding), input_name='plist'), namespace_, eol_))1026 if self.MD5 is not None:1027 showIndent(outfile, level, pretty_print)1028 outfile.write('<%sMD5>%s</%sMD5>%s' % (namespace_, self.gds_format_string(quote_xml(self.MD5).encode(ExternalEncoding), input_name='MD5'), namespace_, eol_))1029 if self.SHA1 is not None:1030 showIndent(outfile, level, pretty_print)1031 outfile.write('<%sSHA1>%s</%sSHA1>%s' % (namespace_, self.gds_format_string(quote_xml(self.SHA1).encode(ExternalEncoding), input_name='SHA1'), namespace_, eol_))1032 if self.FuzzySize is not None:1033 showIndent(outfile, level, pretty_print)1034 outfile.write('<%sFuzzySize>%s</%sFuzzySize>%s' % (namespace_, self.gds_format_integer(self.FuzzySize, input_name='FuzzySize'), namespace_, eol_))1035 if self.Fuzzy is not None:1036 showIndent(outfile, level, pretty_print)1037 outfile.write('<%sFuzzy>%s</%sFuzzy>%s' % (namespace_, self.gds_format_string(quote_xml(self.Fuzzy).encode(ExternalEncoding), input_name='Fuzzy'), namespace_, eol_))1038 if self.Fuzzy2X is not None:1039 showIndent(outfile, level, pretty_print)1040 outfile.write('<%sFuzzy2X>%s</%sFuzzy2X>%s' % (namespace_, self.gds_format_string(quote_xml(self.Fuzzy2X).encode(ExternalEncoding), input_name='Fuzzy2X'), namespace_, eol_))1041 if self.KFFStatus is not None:1042 showIndent(outfile, level, pretty_print)1043 outfile.write('<%sKFFStatus>%s</%sKFFStatus>%s' % (namespace_, self.gds_format_integer(self.KFFStatus, input_name='KFFStatus'), namespace_, eol_))1044 if self.processid is not None:1045 showIndent(outfile, level, pretty_print)1046 outfile.write('<%sprocessid>%s</%sprocessid>%s' % (namespace_, self.gds_format_integer(self.processid, input_name='processid'), namespace_, eol_))1047 if self.IRP_MJ_CREATE is not None:1048 showIndent(outfile, level, pretty_print)1049 outfile.write('<%sIRP_MJ_CREATE>%s</%sIRP_MJ_CREATE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CREATE, input_name='IRP_MJ_CREATE'), namespace_, eol_))1050 if self.IRP_MJ_CREATE_NAMED_PIPE is not None:1051 showIndent(outfile, level, pretty_print)1052 outfile.write('<%sIRP_MJ_CREATE_NAMED_PIPE>%s</%sIRP_MJ_CREATE_NAMED_PIPE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CREATE_NAMED_PIPE, input_name='IRP_MJ_CREATE_NAMED_PIPE'), namespace_, eol_))1053 if self.IRP_MJ_CLOSE is not None:1054 showIndent(outfile, level, pretty_print)1055 outfile.write('<%sIRP_MJ_CLOSE>%s</%sIRP_MJ_CLOSE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CLOSE, input_name='IRP_MJ_CLOSE'), namespace_, eol_))1056 if self.IRP_MJ_READ is not None:1057 showIndent(outfile, level, pretty_print)1058 outfile.write('<%sIRP_MJ_READ>%s</%sIRP_MJ_READ>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_READ, input_name='IRP_MJ_READ'), namespace_, eol_))1059 if self.IRP_MJ_WRITE is not None:1060 showIndent(outfile, level, pretty_print)1061 outfile.write('<%sIRP_MJ_WRITE>%s</%sIRP_MJ_WRITE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_WRITE, input_name='IRP_MJ_WRITE'), namespace_, eol_))1062 if self.IRP_MJ_QUERY_INFORMATION is not None:1063 showIndent(outfile, level, pretty_print)1064 outfile.write('<%sIRP_MJ_QUERY_INFORMATION>%s</%sIRP_MJ_QUERY_INFORMATION>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_INFORMATION, input_name='IRP_MJ_QUERY_INFORMATION'), namespace_, eol_))1065 if self.IRP_MJ_SET_INFORMATION is not None:1066 showIndent(outfile, level, pretty_print)1067 outfile.write('<%sIRP_MJ_SET_INFORMATION>%s</%sIRP_MJ_SET_INFORMATION>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_INFORMATION, input_name='IRP_MJ_SET_INFORMATION'), namespace_, eol_))1068 if self.IRP_MJ_QUERY_EA is not None:1069 showIndent(outfile, level, pretty_print)1070 outfile.write('<%sIRP_MJ_QUERY_EA>%s</%sIRP_MJ_QUERY_EA>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_EA, input_name='IRP_MJ_QUERY_EA'), namespace_, eol_))1071 if self.IRP_MJ_SET_EA is not None:1072 showIndent(outfile, level, pretty_print)1073 outfile.write('<%sIRP_MJ_SET_EA>%s</%sIRP_MJ_SET_EA>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_EA, input_name='IRP_MJ_SET_EA'), namespace_, eol_))1074 if self.IRP_MJ_FLUSH_BUFFERS is not None:1075 showIndent(outfile, level, pretty_print)1076 outfile.write('<%sIRP_MJ_FLUSH_BUFFERS>%s</%sIRP_MJ_FLUSH_BUFFERS>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_FLUSH_BUFFERS, input_name='IRP_MJ_FLUSH_BUFFERS'), namespace_, eol_))1077 if self.IRP_MJ_QUERY_VOLUME_INFORMATION is not None:1078 showIndent(outfile, level, pretty_print)1079 outfile.write('<%sIRP_MJ_QUERY_VOLUME_INFORMATION>%s</%sIRP_MJ_QUERY_VOLUME_INFORMATION>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_VOLUME_INFORMATION, input_name='IRP_MJ_QUERY_VOLUME_INFORMATION'), namespace_, eol_))1080 if self.IRP_MJ_SET_VOLUME_INFORMATION is not None:1081 showIndent(outfile, level, pretty_print)1082 outfile.write('<%sIRP_MJ_SET_VOLUME_INFORMATION>%s</%sIRP_MJ_SET_VOLUME_INFORMATION>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_VOLUME_INFORMATION, input_name='IRP_MJ_SET_VOLUME_INFORMATION'), namespace_, eol_))1083 if self.IRP_MJ_DIRECTORY_CONTROL is not None:1084 showIndent(outfile, level, pretty_print)1085 outfile.write('<%sIRP_MJ_DIRECTORY_CONTROL>%s</%sIRP_MJ_DIRECTORY_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_DIRECTORY_CONTROL, input_name='IRP_MJ_DIRECTORY_CONTROL'), namespace_, eol_))1086 if self.IRP_MJ_FILE_SYSTEM_CONTROL is not None:1087 showIndent(outfile, level, pretty_print)1088 outfile.write('<%sIRP_MJ_FILE_SYSTEM_CONTROL>%s</%sIRP_MJ_FILE_SYSTEM_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_FILE_SYSTEM_CONTROL, input_name='IRP_MJ_FILE_SYSTEM_CONTROL'), namespace_, eol_))1089 if self.IRP_MJ_DEVICE_CONTROL is not None:1090 showIndent(outfile, level, pretty_print)1091 outfile.write('<%sIRP_MJ_DEVICE_CONTROL>%s</%sIRP_MJ_DEVICE_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_DEVICE_CONTROL, input_name='IRP_MJ_DEVICE_CONTROL'), namespace_, eol_))1092 if self.IRP_MJ_INTERNAL_DEVICE_CONTROL is not None:1093 showIndent(outfile, level, pretty_print)1094 outfile.write('<%sIRP_MJ_INTERNAL_DEVICE_CONTROL>%s</%sIRP_MJ_INTERNAL_DEVICE_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_INTERNAL_DEVICE_CONTROL, input_name='IRP_MJ_INTERNAL_DEVICE_CONTROL'), namespace_, eol_))1095 if self.IRP_MJ_SHUTDOWN is not None:1096 showIndent(outfile, level, pretty_print)1097 outfile.write('<%sIRP_MJ_SHUTDOWN>%s</%sIRP_MJ_SHUTDOWN>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SHUTDOWN, input_name='IRP_MJ_SHUTDOWN'), namespace_, eol_))1098 if self.IRP_MJ_LOCK_CONTROL is not None:1099 showIndent(outfile, level, pretty_print)1100 outfile.write('<%sIRP_MJ_LOCK_CONTROL>%s</%sIRP_MJ_LOCK_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_LOCK_CONTROL, input_name='IRP_MJ_LOCK_CONTROL'), namespace_, eol_))1101 if self.IRP_MJ_CLEANUP is not None:1102 showIndent(outfile, level, pretty_print)1103 outfile.write('<%sIRP_MJ_CLEANUP>%s</%sIRP_MJ_CLEANUP>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CLEANUP, input_name='IRP_MJ_CLEANUP'), namespace_, eol_))1104 if self.IRP_MJ_CREATE_MAILSLOT is not None:1105 showIndent(outfile, level, pretty_print)1106 outfile.write('<%sIRP_MJ_CREATE_MAILSLOT>%s</%sIRP_MJ_CREATE_MAILSLOT>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_CREATE_MAILSLOT, input_name='IRP_MJ_CREATE_MAILSLOT'), namespace_, eol_))1107 if self.IRP_MJ_QUERY_SECURITY is not None:1108 showIndent(outfile, level, pretty_print)1109 outfile.write('<%sIRP_MJ_QUERY_SECURITY>%s</%sIRP_MJ_QUERY_SECURITY>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_SECURITY, input_name='IRP_MJ_QUERY_SECURITY'), namespace_, eol_))1110 if self.IRP_MJ_SET_SECURITY is not None:1111 showIndent(outfile, level, pretty_print)1112 outfile.write('<%sIRP_MJ_SET_SECURITY>%s</%sIRP_MJ_SET_SECURITY>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_SECURITY, input_name='IRP_MJ_SET_SECURITY'), namespace_, eol_))1113 if self.IRP_MJ_POWER is not None:1114 showIndent(outfile, level, pretty_print)1115 outfile.write('<%sIRP_MJ_POWER>%s</%sIRP_MJ_POWER>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_POWER, input_name='IRP_MJ_POWER'), namespace_, eol_))1116 if self.IRP_MJ_SYSTEM_CONTROL is not None:1117 showIndent(outfile, level, pretty_print)1118 outfile.write('<%sIRP_MJ_SYSTEM_CONTROL>%s</%sIRP_MJ_SYSTEM_CONTROL>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SYSTEM_CONTROL, input_name='IRP_MJ_SYSTEM_CONTROL'), namespace_, eol_))1119 if self.IRP_MJ_DEVICE_CHANGE is not None:1120 showIndent(outfile, level, pretty_print)1121 outfile.write('<%sIRP_MJ_DEVICE_CHANGE>%s</%sIRP_MJ_DEVICE_CHANGE>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_DEVICE_CHANGE, input_name='IRP_MJ_DEVICE_CHANGE'), namespace_, eol_))1122 if self.IRP_MJ_QUERY_QUOTA is not None:1123 showIndent(outfile, level, pretty_print)1124 outfile.write('<%sIRP_MJ_QUERY_QUOTA>%s</%sIRP_MJ_QUERY_QUOTA>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_QUERY_QUOTA, input_name='IRP_MJ_QUERY_QUOTA'), namespace_, eol_))1125 if self.IRP_MJ_SET_QUOTA is not None:1126 showIndent(outfile, level, pretty_print)1127 outfile.write('<%sIRP_MJ_SET_QUOTA>%s</%sIRP_MJ_SET_QUOTA>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_SET_QUOTA, input_name='IRP_MJ_SET_QUOTA'), namespace_, eol_))1128 if self.IRP_MJ_PNP is not None:1129 showIndent(outfile, level, pretty_print)1130 outfile.write('<%sIRP_MJ_PNP>%s</%sIRP_MJ_PNP>%s' % (namespace_, self.gds_format_integer(self.IRP_MJ_PNP, input_name='IRP_MJ_PNP'), namespace_, eol_))1131 if self.Driver_Device_List is not None:1132 self.Driver_Device_List.export(outfile, level, namespace_, name_='Driver_Device_List', pretty_print=pretty_print)1133 def exportLiteral(self, outfile, level, name_='DriverType'):1134 level += 11135 already_processed = set()1136 self.exportLiteralAttributes(outfile, level, already_processed, name_)1137 if self.hasContent_():1138 self.exportLiteralChildren(outfile, level, name_)1139 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1140 if self.resultitemtype is not None and 'resultitemtype' not in already_processed:1141 already_processed.add('resultitemtype')1142 showIndent(outfile, level)1143 outfile.write('resultitemtype=%d,\n' % (self.resultitemtype,))1144 def exportLiteralChildren(self, outfile, level, name_):1145 if self.ServiceKeyName is not None:1146 showIndent(outfile, level)1147 outfile.write('ServiceKeyName=%s,\n' % quote_python(self.ServiceKeyName).encode(ExternalEncoding))1148 if self.ImagePath is not None:1149 showIndent(outfile, level)1150 outfile.write('ImagePath=%s,\n' % quote_python(self.ImagePath).encode(ExternalEncoding))1151 if self.Type is not None:1152 showIndent(outfile, level)1153 outfile.write('Type=%d,\n' % self.Type)1154 if self.DriverObj_Location is not None:1155 showIndent(outfile, level)1156 outfile.write('DriverObj_Location=%d,\n' % self.DriverObj_Location)1157 if self.DeviceObj_Location is not None:1158 showIndent(outfile, level)1159 outfile.write('DeviceObj_Location=%d,\n' % self.DeviceObj_Location)1160 if self.Driver_Init is not None:1161 showIndent(outfile, level)1162 outfile.write('Driver_Init=%d,\n' % self.Driver_Init)1163 if self.Driver_StartIO is not None:1164 showIndent(outfile, level)1165 outfile.write('Driver_StartIO=%d,\n' % self.Driver_StartIO)1166 if self.Driver_Unload is not None:1167 showIndent(outfile, level)1168 outfile.write('Driver_Unload=%d,\n' % self.Driver_Unload)1169 if self.BaseAddress is not None:1170 showIndent(outfile, level)1171 outfile.write('BaseAddress=%d,\n' % self.BaseAddress)1172 if self.StartTime is not None:1173 showIndent(outfile, level)1174 outfile.write('StartTime=%s,\n' % quote_python(self.StartTime).encode(ExternalEncoding))1175 if self.Dependencies is not None:1176 showIndent(outfile, level)1177 outfile.write('Dependencies=%s,\n' % quote_python(self.Dependencies).encode(ExternalEncoding))1178 if self.Size is not None:1179 showIndent(outfile, level)1180 outfile.write('Size=%d,\n' % self.Size)1181 if self.Instances is not None:1182 showIndent(outfile, level)1183 outfile.write('Instances=%d,\n' % self.Instances)1184 if self.Name is not None:1185 showIndent(outfile, level)1186 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding))1187 if self.StartedAs is not None:1188 showIndent(outfile, level)1189 outfile.write('StartedAs=%s,\n' % quote_python(self.StartedAs).encode(ExternalEncoding))1190 if self.State is not None:1191 showIndent(outfile, level)1192 outfile.write('State=%d,\n' % self.State)1193 if self.RealState is not None:1194 showIndent(outfile, level)1195 outfile.write('RealState=%d,\n' % self.RealState)1196 if self.StartMode is not None:1197 showIndent(outfile, level)1198 outfile.write('StartMode=%d,\n' % self.StartMode)1199 if self.RealStartMode is not None:1200 showIndent(outfile, level)1201 outfile.write('RealStartMode=%d,\n' % self.RealStartMode)1202 if self.RealType is not None:1203 showIndent(outfile, level)1204 outfile.write('RealType=%d,\n' % self.RealType)1205 if self.Path is not None:1206 showIndent(outfile, level)1207 outfile.write('Path=%s,\n' % quote_python(self.Path).encode(ExternalEncoding))1208 if self.plist is not None:1209 showIndent(outfile, level)1210 outfile.write('plist=%s,\n' % quote_python(self.plist).encode(ExternalEncoding))1211 if self.MD5 is not None:1212 showIndent(outfile, level)1213 outfile.write('MD5=%d,\n' % self.MD5)1214 if self.SHA1 is not None:1215 showIndent(outfile, level)1216 outfile.write('SHA1=%d,\n' % self.SHA1)1217 if self.FuzzySize is not None:1218 showIndent(outfile, level)1219 outfile.write('FuzzySize=%d,\n' % self.FuzzySize)1220 if self.Fuzzy is not None:1221 showIndent(outfile, level)1222 outfile.write('Fuzzy=%s,\n' % quote_python(self.Fuzzy).encode(ExternalEncoding))1223 if self.Fuzzy2X is not None:1224 showIndent(outfile, level)1225 outfile.write('Fuzzy2X=%s,\n' % quote_python(self.Fuzzy2X).encode(ExternalEncoding))1226 if self.KFFStatus is not None:1227 showIndent(outfile, level)1228 outfile.write('KFFStatus=%d,\n' % self.KFFStatus)1229 if self.processid is not None:1230 showIndent(outfile, level)1231 outfile.write('processid=%d,\n' % self.processid)1232 if self.IRP_MJ_CREATE is not None:1233 showIndent(outfile, level)1234 outfile.write('IRP_MJ_CREATE=%d,\n' % self.IRP_MJ_CREATE)1235 if self.IRP_MJ_CREATE_NAMED_PIPE is not None:1236 showIndent(outfile, level)1237 outfile.write('IRP_MJ_CREATE_NAMED_PIPE=%d,\n' % self.IRP_MJ_CREATE_NAMED_PIPE)1238 if self.IRP_MJ_CLOSE is not None:1239 showIndent(outfile, level)1240 outfile.write('IRP_MJ_CLOSE=%d,\n' % self.IRP_MJ_CLOSE)1241 if self.IRP_MJ_READ is not None:1242 showIndent(outfile, level)1243 outfile.write('IRP_MJ_READ=%d,\n' % self.IRP_MJ_READ)1244 if self.IRP_MJ_WRITE is not None:1245 showIndent(outfile, level)1246 outfile.write('IRP_MJ_WRITE=%d,\n' % self.IRP_MJ_WRITE)1247 if self.IRP_MJ_QUERY_INFORMATION is not None:1248 showIndent(outfile, level)1249 outfile.write('IRP_MJ_QUERY_INFORMATION=%d,\n' % self.IRP_MJ_QUERY_INFORMATION)1250 if self.IRP_MJ_SET_INFORMATION is not None:1251 showIndent(outfile, level)1252 outfile.write('IRP_MJ_SET_INFORMATION=%d,\n' % self.IRP_MJ_SET_INFORMATION)1253 if self.IRP_MJ_QUERY_EA is not None:1254 showIndent(outfile, level)1255 outfile.write('IRP_MJ_QUERY_EA=%d,\n' % self.IRP_MJ_QUERY_EA)1256 if self.IRP_MJ_SET_EA is not None:1257 showIndent(outfile, level)1258 outfile.write('IRP_MJ_SET_EA=%d,\n' % self.IRP_MJ_SET_EA)1259 if self.IRP_MJ_FLUSH_BUFFERS is not None:1260 showIndent(outfile, level)1261 outfile.write('IRP_MJ_FLUSH_BUFFERS=%d,\n' % self.IRP_MJ_FLUSH_BUFFERS)1262 if self.IRP_MJ_QUERY_VOLUME_INFORMATION is not None:1263 showIndent(outfile, level)1264 outfile.write('IRP_MJ_QUERY_VOLUME_INFORMATION=%d,\n' % self.IRP_MJ_QUERY_VOLUME_INFORMATION)1265 if self.IRP_MJ_SET_VOLUME_INFORMATION is not None:1266 showIndent(outfile, level)1267 outfile.write('IRP_MJ_SET_VOLUME_INFORMATION=%d,\n' % self.IRP_MJ_SET_VOLUME_INFORMATION)1268 if self.IRP_MJ_DIRECTORY_CONTROL is not None:1269 showIndent(outfile, level)1270 outfile.write('IRP_MJ_DIRECTORY_CONTROL=%d,\n' % self.IRP_MJ_DIRECTORY_CONTROL)1271 if self.IRP_MJ_FILE_SYSTEM_CONTROL is not None:1272 showIndent(outfile, level)1273 outfile.write('IRP_MJ_FILE_SYSTEM_CONTROL=%d,\n' % self.IRP_MJ_FILE_SYSTEM_CONTROL)1274 if self.IRP_MJ_DEVICE_CONTROL is not None:1275 showIndent(outfile, level)1276 outfile.write('IRP_MJ_DEVICE_CONTROL=%d,\n' % self.IRP_MJ_DEVICE_CONTROL)1277 if self.IRP_MJ_INTERNAL_DEVICE_CONTROL is not None:1278 showIndent(outfile, level)1279 outfile.write('IRP_MJ_INTERNAL_DEVICE_CONTROL=%d,\n' % self.IRP_MJ_INTERNAL_DEVICE_CONTROL)1280 if self.IRP_MJ_SHUTDOWN is not None:1281 showIndent(outfile, level)1282 outfile.write('IRP_MJ_SHUTDOWN=%d,\n' % self.IRP_MJ_SHUTDOWN)1283 if self.IRP_MJ_LOCK_CONTROL is not None:1284 showIndent(outfile, level)1285 outfile.write('IRP_MJ_LOCK_CONTROL=%d,\n' % self.IRP_MJ_LOCK_CONTROL)1286 if self.IRP_MJ_CLEANUP is not None:1287 showIndent(outfile, level)1288 outfile.write('IRP_MJ_CLEANUP=%d,\n' % self.IRP_MJ_CLEANUP)1289 if self.IRP_MJ_CREATE_MAILSLOT is not None:1290 showIndent(outfile, level)1291 outfile.write('IRP_MJ_CREATE_MAILSLOT=%d,\n' % self.IRP_MJ_CREATE_MAILSLOT)1292 if self.IRP_MJ_QUERY_SECURITY is not None:1293 showIndent(outfile, level)1294 outfile.write('IRP_MJ_QUERY_SECURITY=%d,\n' % self.IRP_MJ_QUERY_SECURITY)1295 if self.IRP_MJ_SET_SECURITY is not None:1296 showIndent(outfile, level)1297 outfile.write('IRP_MJ_SET_SECURITY=%d,\n' % self.IRP_MJ_SET_SECURITY)1298 if self.IRP_MJ_POWER is not None:1299 showIndent(outfile, level)1300 outfile.write('IRP_MJ_POWER=%d,\n' % self.IRP_MJ_POWER)1301 if self.IRP_MJ_SYSTEM_CONTROL is not None:1302 showIndent(outfile, level)1303 outfile.write('IRP_MJ_SYSTEM_CONTROL=%d,\n' % self.IRP_MJ_SYSTEM_CONTROL)1304 if self.IRP_MJ_DEVICE_CHANGE is not None:1305 showIndent(outfile, level)1306 outfile.write('IRP_MJ_DEVICE_CHANGE=%d,\n' % self.IRP_MJ_DEVICE_CHANGE)1307 if self.IRP_MJ_QUERY_QUOTA is not None:1308 showIndent(outfile, level)1309 outfile.write('IRP_MJ_QUERY_QUOTA=%d,\n' % self.IRP_MJ_QUERY_QUOTA)1310 if self.IRP_MJ_SET_QUOTA is not None:1311 showIndent(outfile, level)1312 outfile.write('IRP_MJ_SET_QUOTA=%d,\n' % self.IRP_MJ_SET_QUOTA)1313 if self.IRP_MJ_PNP is not None:1314 showIndent(outfile, level)1315 outfile.write('IRP_MJ_PNP=%d,\n' % self.IRP_MJ_PNP)1316 if self.Driver_Device_List is not None:1317 showIndent(outfile, level)1318 outfile.write('Driver_Device_List=model_.Driver_Device_ListType(\n')1319 self.Driver_Device_List.exportLiteral(outfile, level, name_='Driver_Device_List')1320 showIndent(outfile, level)1321 outfile.write('),\n')1322 def build(self, node):1323 already_processed = set()1324 self.buildAttributes(node, node.attrib, already_processed)1325 for child in node:1326 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1327 self.buildChildren(child, node, nodeName_)1328 return self1329 def buildAttributes(self, node, attrs, already_processed):1330 value = find_attr_value_('resultitemtype', node)1331 if value is not None and 'resultitemtype' not in already_processed:1332 already_processed.add('resultitemtype')1333 try:1334 self.resultitemtype = int(value)1335 except ValueError, exp:1336 raise_parse_error(node, 'Bad integer attribute: %s' % exp)1337 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1338 if nodeName_ == 'ServiceKeyName':1339 ServiceKeyName_ = child_.text1340 ServiceKeyName_ = self.gds_validate_string(ServiceKeyName_, node, 'ServiceKeyName')1341 self.ServiceKeyName = ServiceKeyName_1342 elif nodeName_ == 'ImagePath':1343 ImagePath_ = child_.text1344 ImagePath_ = self.gds_validate_string(ImagePath_, node, 'ImagePath')1345 self.ImagePath = ImagePath_1346 elif nodeName_ == 'Type':1347 sval_ = child_.text1348 try:1349 ival_ = int(sval_)1350 except (TypeError, ValueError), exp:1351 raise_parse_error(child_, 'requires integer: %s' % exp)1352 ival_ = self.gds_validate_integer(ival_, node, 'Type')1353 self.Type = ival_1354 elif nodeName_ == 'DriverObj_Location':1355 sval_ = child_.text1356 try:1357 ival_ = int(sval_)1358 except (TypeError, ValueError), exp:1359 raise_parse_error(child_, 'requires integer: %s' % exp)1360 ival_ = self.gds_validate_integer(ival_, node, 'DriverObj_Location')1361 self.DriverObj_Location = ival_1362 elif nodeName_ == 'DeviceObj_Location':1363 sval_ = child_.text1364 try:1365 ival_ = int(sval_)1366 except (TypeError, ValueError), exp:1367 raise_parse_error(child_, 'requires integer: %s' % exp)1368 ival_ = self.gds_validate_integer(ival_, node, 'DeviceObj_Location')1369 self.DeviceObj_Location = ival_1370 elif nodeName_ == 'Driver_Init':1371 sval_ = child_.text1372 try:1373 ival_ = int(sval_)1374 except (TypeError, ValueError), exp:1375 raise_parse_error(child_, 'requires integer: %s' % exp)1376 ival_ = self.gds_validate_integer(ival_, node, 'Driver_Init')1377 self.Driver_Init = ival_1378 elif nodeName_ == 'Driver_StartIO':1379 sval_ = child_.text1380 try:1381 ival_ = int(sval_)1382 except (TypeError, ValueError), exp:1383 raise_parse_error(child_, 'requires integer: %s' % exp)1384 ival_ = self.gds_validate_integer(ival_, node, 'Driver_StartIO')1385 self.Driver_StartIO = ival_1386 elif nodeName_ == 'Driver_Unload':1387 sval_ = child_.text1388 try:1389 ival_ = int(sval_)1390 except (TypeError, ValueError), exp:1391 raise_parse_error(child_, 'requires integer: %s' % exp)1392 ival_ = self.gds_validate_integer(ival_, node, 'Driver_Unload')1393 self.Driver_Unload = ival_1394 elif nodeName_ == 'BaseAddress':1395 sval_ = child_.text1396 try:1397 ival_ = int(sval_)1398 except (TypeError, ValueError), exp:1399 raise_parse_error(child_, 'requires integer: %s' % exp)1400 ival_ = self.gds_validate_integer(ival_, node, 'BaseAddress')1401 self.BaseAddress = ival_1402 elif nodeName_ == 'StartTime':1403 StartTime_ = child_.text1404 StartTime_ = self.gds_validate_string(StartTime_, node, 'StartTime')1405 self.StartTime = StartTime_1406 elif nodeName_ == 'Dependencies':1407 Dependencies_ = child_.text1408 Dependencies_ = self.gds_validate_string(Dependencies_, node, 'Dependencies')1409 self.Dependencies = Dependencies_1410 elif nodeName_ == 'Size':1411 sval_ = child_.text1412 try:1413 ival_ = int(sval_)1414 except (TypeError, ValueError), exp:1415 raise_parse_error(child_, 'requires integer: %s' % exp)1416 ival_ = self.gds_validate_integer(ival_, node, 'Size')1417 self.Size = ival_1418 elif nodeName_ == 'Instances':1419 sval_ = child_.text1420 try:1421 ival_ = int(sval_)1422 except (TypeError, ValueError), exp:1423 raise_parse_error(child_, 'requires integer: %s' % exp)1424 ival_ = self.gds_validate_integer(ival_, node, 'Instances')1425 self.Instances = ival_1426 elif nodeName_ == 'Name':1427 Name_ = child_.text1428 Name_ = self.gds_validate_string(Name_, node, 'Name')1429 self.Name = Name_1430 elif nodeName_ == 'StartedAs':1431 StartedAs_ = child_.text1432 StartedAs_ = self.gds_validate_string(StartedAs_, node, 'StartedAs')1433 self.StartedAs = StartedAs_1434 elif nodeName_ == 'State':1435 sval_ = child_.text1436 try:1437 ival_ = int(sval_)1438 except (TypeError, ValueError), exp:1439 raise_parse_error(child_, 'requires integer: %s' % exp)1440 ival_ = self.gds_validate_integer(ival_, node, 'State')1441 self.State = ival_1442 elif nodeName_ == 'RealState':1443 sval_ = child_.text1444 try:1445 ival_ = int(sval_)1446 except (TypeError, ValueError), exp:1447 raise_parse_error(child_, 'requires integer: %s' % exp)1448 ival_ = self.gds_validate_integer(ival_, node, 'RealState')1449 self.RealState = ival_1450 elif nodeName_ == 'StartMode':1451 sval_ = child_.text1452 try:1453 ival_ = int(sval_)1454 except (TypeError, ValueError), exp:1455 raise_parse_error(child_, 'requires integer: %s' % exp)1456 ival_ = self.gds_validate_integer(ival_, node, 'StartMode')1457 self.StartMode = ival_1458 elif nodeName_ == 'RealStartMode':1459 sval_ = child_.text1460 try:1461 ival_ = int(sval_)1462 except (TypeError, ValueError), exp:1463 raise_parse_error(child_, 'requires integer: %s' % exp)1464 ival_ = self.gds_validate_integer(ival_, node, 'RealStartMode')1465 self.RealStartMode = ival_1466 elif nodeName_ == 'RealType':1467 sval_ = child_.text1468 try:1469 ival_ = int(sval_)1470 except (TypeError, ValueError), exp:1471 raise_parse_error(child_, 'requires integer: %s' % exp)1472 ival_ = self.gds_validate_integer(ival_, node, 'RealType')1473 self.RealType = ival_1474 elif nodeName_ == 'Path':1475 Path_ = child_.text1476 Path_ = self.gds_validate_string(Path_, node, 'Path')1477 self.Path = Path_1478 elif nodeName_ == 'plist':1479 plist_ = child_.text1480 plist_ = self.gds_validate_string(plist_, node, 'plist')1481 self.plist = plist_1482 elif nodeName_ == 'MD5':1483 sval_ = child_.text1484 try:1485 ival_ = int(sval_)1486 except (TypeError, ValueError), exp:1487 raise_parse_error(child_, 'requires integer: %s' % exp)1488 ival_ = self.gds_validate_integer(ival_, node, 'MD5')1489 self.MD5 = ival_1490 elif nodeName_ == 'SHA1':1491 sval_ = child_.text1492 try:1493 ival_ = int(sval_)1494 except (TypeError, ValueError), exp:1495 raise_parse_error(child_, 'requires integer: %s' % exp)1496 ival_ = self.gds_validate_integer(ival_, node, 'SHA1')1497 self.SHA1 = ival_1498 elif nodeName_ == 'FuzzySize':1499 sval_ = child_.text1500 try:1501 ival_ = int(sval_)1502 except (TypeError, ValueError), exp:1503 raise_parse_error(child_, 'requires integer: %s' % exp)1504 ival_ = self.gds_validate_integer(ival_, node, 'FuzzySize')1505 self.FuzzySize = ival_1506 elif nodeName_ == 'Fuzzy':1507 Fuzzy_ = child_.text1508 Fuzzy_ = self.gds_validate_string(Fuzzy_, node, 'Fuzzy')1509 self.Fuzzy = Fuzzy_1510 elif nodeName_ == 'Fuzzy2X':1511 Fuzzy2X_ = child_.text1512 Fuzzy2X_ = self.gds_validate_string(Fuzzy2X_, node, 'Fuzzy2X')1513 self.Fuzzy2X = Fuzzy2X_1514 elif nodeName_ == 'KFFStatus':1515 sval_ = child_.text1516 try:1517 ival_ = int(sval_)1518 except (TypeError, ValueError), exp:1519 raise_parse_error(child_, 'requires integer: %s' % exp)1520 ival_ = self.gds_validate_integer(ival_, node, 'KFFStatus')1521 self.KFFStatus = ival_1522 elif nodeName_ == 'processid':1523 sval_ = child_.text1524 try:1525 ival_ = int(sval_)1526 except (TypeError, ValueError), exp:1527 raise_parse_error(child_, 'requires integer: %s' % exp)1528 ival_ = self.gds_validate_integer(ival_, node, 'processid')1529 self.processid = ival_1530 elif nodeName_ == 'IRP_MJ_CREATE':1531 sval_ = child_.text1532 try:1533 ival_ = int(sval_)1534 except (TypeError, ValueError), exp:1535 raise_parse_error(child_, 'requires integer: %s' % exp)1536 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CREATE')1537 self.IRP_MJ_CREATE = ival_1538 elif nodeName_ == 'IRP_MJ_CREATE_NAMED_PIPE':1539 sval_ = child_.text1540 try:1541 ival_ = int(sval_)1542 except (TypeError, ValueError), exp:1543 raise_parse_error(child_, 'requires integer: %s' % exp)1544 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CREATE_NAMED_PIPE')1545 self.IRP_MJ_CREATE_NAMED_PIPE = ival_1546 elif nodeName_ == 'IRP_MJ_CLOSE':1547 sval_ = child_.text1548 try:1549 ival_ = int(sval_)1550 except (TypeError, ValueError), exp:1551 raise_parse_error(child_, 'requires integer: %s' % exp)1552 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CLOSE')1553 self.IRP_MJ_CLOSE = ival_1554 elif nodeName_ == 'IRP_MJ_READ':1555 sval_ = child_.text1556 try:1557 ival_ = int(sval_)1558 except (TypeError, ValueError), exp:1559 raise_parse_error(child_, 'requires integer: %s' % exp)1560 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_READ')1561 self.IRP_MJ_READ = ival_1562 elif nodeName_ == 'IRP_MJ_WRITE':1563 sval_ = child_.text1564 try:1565 ival_ = int(sval_)1566 except (TypeError, ValueError), exp:1567 raise_parse_error(child_, 'requires integer: %s' % exp)1568 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_WRITE')1569 self.IRP_MJ_WRITE = ival_1570 elif nodeName_ == 'IRP_MJ_QUERY_INFORMATION':1571 sval_ = child_.text1572 try:1573 ival_ = int(sval_)1574 except (TypeError, ValueError), exp:1575 raise_parse_error(child_, 'requires integer: %s' % exp)1576 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_INFORMATION')1577 self.IRP_MJ_QUERY_INFORMATION = ival_1578 elif nodeName_ == 'IRP_MJ_SET_INFORMATION':1579 sval_ = child_.text1580 try:1581 ival_ = int(sval_)1582 except (TypeError, ValueError), exp:1583 raise_parse_error(child_, 'requires integer: %s' % exp)1584 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_INFORMATION')1585 self.IRP_MJ_SET_INFORMATION = ival_1586 elif nodeName_ == 'IRP_MJ_QUERY_EA':1587 sval_ = child_.text1588 try:1589 ival_ = int(sval_)1590 except (TypeError, ValueError), exp:1591 raise_parse_error(child_, 'requires integer: %s' % exp)1592 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_EA')1593 self.IRP_MJ_QUERY_EA = ival_1594 elif nodeName_ == 'IRP_MJ_SET_EA':1595 sval_ = child_.text1596 try:1597 ival_ = int(sval_)1598 except (TypeError, ValueError), exp:1599 raise_parse_error(child_, 'requires integer: %s' % exp)1600 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_EA')1601 self.IRP_MJ_SET_EA = ival_1602 elif nodeName_ == 'IRP_MJ_FLUSH_BUFFERS':1603 sval_ = child_.text1604 try:1605 ival_ = int(sval_)1606 except (TypeError, ValueError), exp:1607 raise_parse_error(child_, 'requires integer: %s' % exp)1608 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_FLUSH_BUFFERS')1609 self.IRP_MJ_FLUSH_BUFFERS = ival_1610 elif nodeName_ == 'IRP_MJ_QUERY_VOLUME_INFORMATION':1611 sval_ = child_.text1612 try:1613 ival_ = int(sval_)1614 except (TypeError, ValueError), exp:1615 raise_parse_error(child_, 'requires integer: %s' % exp)1616 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_VOLUME_INFORMATION')1617 self.IRP_MJ_QUERY_VOLUME_INFORMATION = ival_1618 elif nodeName_ == 'IRP_MJ_SET_VOLUME_INFORMATION':1619 sval_ = child_.text1620 try:1621 ival_ = int(sval_)1622 except (TypeError, ValueError), exp:1623 raise_parse_error(child_, 'requires integer: %s' % exp)1624 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_VOLUME_INFORMATION')1625 self.IRP_MJ_SET_VOLUME_INFORMATION = ival_1626 elif nodeName_ == 'IRP_MJ_DIRECTORY_CONTROL':1627 sval_ = child_.text1628 try:1629 ival_ = int(sval_)1630 except (TypeError, ValueError), exp:1631 raise_parse_error(child_, 'requires integer: %s' % exp)1632 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_DIRECTORY_CONTROL')1633 self.IRP_MJ_DIRECTORY_CONTROL = ival_1634 elif nodeName_ == 'IRP_MJ_FILE_SYSTEM_CONTROL':1635 sval_ = child_.text1636 try:1637 ival_ = int(sval_)1638 except (TypeError, ValueError), exp:1639 raise_parse_error(child_, 'requires integer: %s' % exp)1640 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_FILE_SYSTEM_CONTROL')1641 self.IRP_MJ_FILE_SYSTEM_CONTROL = ival_1642 elif nodeName_ == 'IRP_MJ_DEVICE_CONTROL':1643 sval_ = child_.text1644 try:1645 ival_ = int(sval_)1646 except (TypeError, ValueError), exp:1647 raise_parse_error(child_, 'requires integer: %s' % exp)1648 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_DEVICE_CONTROL')1649 self.IRP_MJ_DEVICE_CONTROL = ival_1650 elif nodeName_ == 'IRP_MJ_INTERNAL_DEVICE_CONTROL':1651 sval_ = child_.text1652 try:1653 ival_ = int(sval_)1654 except (TypeError, ValueError), exp:1655 raise_parse_error(child_, 'requires integer: %s' % exp)1656 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_INTERNAL_DEVICE_CONTROL')1657 self.IRP_MJ_INTERNAL_DEVICE_CONTROL = ival_1658 elif nodeName_ == 'IRP_MJ_SHUTDOWN':1659 sval_ = child_.text1660 try:1661 ival_ = int(sval_)1662 except (TypeError, ValueError), exp:1663 raise_parse_error(child_, 'requires integer: %s' % exp)1664 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SHUTDOWN')1665 self.IRP_MJ_SHUTDOWN = ival_1666 elif nodeName_ == 'IRP_MJ_LOCK_CONTROL':1667 sval_ = child_.text1668 try:1669 ival_ = int(sval_)1670 except (TypeError, ValueError), exp:1671 raise_parse_error(child_, 'requires integer: %s' % exp)1672 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_LOCK_CONTROL')1673 self.IRP_MJ_LOCK_CONTROL = ival_1674 elif nodeName_ == 'IRP_MJ_CLEANUP':1675 sval_ = child_.text1676 try:1677 ival_ = int(sval_)1678 except (TypeError, ValueError), exp:1679 raise_parse_error(child_, 'requires integer: %s' % exp)1680 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CLEANUP')1681 self.IRP_MJ_CLEANUP = ival_1682 elif nodeName_ == 'IRP_MJ_CREATE_MAILSLOT':1683 sval_ = child_.text1684 try:1685 ival_ = int(sval_)1686 except (TypeError, ValueError), exp:1687 raise_parse_error(child_, 'requires integer: %s' % exp)1688 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_CREATE_MAILSLOT')1689 self.IRP_MJ_CREATE_MAILSLOT = ival_1690 elif nodeName_ == 'IRP_MJ_QUERY_SECURITY':1691 sval_ = child_.text1692 try:1693 ival_ = int(sval_)1694 except (TypeError, ValueError), exp:1695 raise_parse_error(child_, 'requires integer: %s' % exp)1696 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_SECURITY')1697 self.IRP_MJ_QUERY_SECURITY = ival_1698 elif nodeName_ == 'IRP_MJ_SET_SECURITY':1699 sval_ = child_.text1700 try:1701 ival_ = int(sval_)1702 except (TypeError, ValueError), exp:1703 raise_parse_error(child_, 'requires integer: %s' % exp)1704 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_SECURITY')1705 self.IRP_MJ_SET_SECURITY = ival_1706 elif nodeName_ == 'IRP_MJ_POWER':1707 sval_ = child_.text1708 try:1709 ival_ = int(sval_)1710 except (TypeError, ValueError), exp:1711 raise_parse_error(child_, 'requires integer: %s' % exp)1712 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_POWER')1713 self.IRP_MJ_POWER = ival_1714 elif nodeName_ == 'IRP_MJ_SYSTEM_CONTROL':1715 sval_ = child_.text1716 try:1717 ival_ = int(sval_)1718 except (TypeError, ValueError), exp:1719 raise_parse_error(child_, 'requires integer: %s' % exp)1720 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SYSTEM_CONTROL')1721 self.IRP_MJ_SYSTEM_CONTROL = ival_1722 elif nodeName_ == 'IRP_MJ_DEVICE_CHANGE':1723 sval_ = child_.text1724 try:1725 ival_ = int(sval_)1726 except (TypeError, ValueError), exp:1727 raise_parse_error(child_, 'requires integer: %s' % exp)1728 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_DEVICE_CHANGE')1729 self.IRP_MJ_DEVICE_CHANGE = ival_1730 elif nodeName_ == 'IRP_MJ_QUERY_QUOTA':1731 sval_ = child_.text1732 try:1733 ival_ = int(sval_)1734 except (TypeError, ValueError), exp:1735 raise_parse_error(child_, 'requires integer: %s' % exp)1736 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_QUERY_QUOTA')1737 self.IRP_MJ_QUERY_QUOTA = ival_1738 elif nodeName_ == 'IRP_MJ_SET_QUOTA':1739 sval_ = child_.text1740 try:1741 ival_ = int(sval_)1742 except (TypeError, ValueError), exp:1743 raise_parse_error(child_, 'requires integer: %s' % exp)1744 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_SET_QUOTA')1745 self.IRP_MJ_SET_QUOTA = ival_1746 elif nodeName_ == 'IRP_MJ_PNP':1747 sval_ = child_.text1748 try:1749 ival_ = int(sval_)1750 except (TypeError, ValueError), exp:1751 raise_parse_error(child_, 'requires integer: %s' % exp)1752 ival_ = self.gds_validate_integer(ival_, node, 'IRP_MJ_PNP')1753 self.IRP_MJ_PNP = ival_1754 elif nodeName_ == 'Driver_Device_List':1755 obj_ = Driver_Device_ListType.factory()1756 obj_.build(child_)1757 self.Driver_Device_List = obj_1758 obj_.original_tagname_ = 'Driver_Device_List'1759# end class DriverType1760class Driver_Device_ListType(GeneratedsSuper):1761 subclass = None1762 superclass = None1763 def __init__(self, Device=None):1764 self.original_tagname_ = None1765 if Device is None:1766 self.Device = []1767 else:1768 self.Device = Device1769 def factory(*args_, **kwargs_):1770 if Driver_Device_ListType.subclass:1771 return Driver_Device_ListType.subclass(*args_, **kwargs_)1772 else:1773 return Driver_Device_ListType(*args_, **kwargs_)1774 factory = staticmethod(factory)1775 def get_Device(self): return self.Device1776 def set_Device(self, Device): self.Device = Device1777 def add_Device(self, value): self.Device.append(value)1778 def insert_Device_at(self, index, value): self.Device.insert(index, value)1779 def replace_Device_at(self, index, value): self.Device[index] = value1780 def hasContent_(self):1781 if (1782 self.Device1783 ):1784 return True1785 else:1786 return False1787 def export(self, outfile, level, namespace_='', name_='Driver_Device_ListType', namespacedef_='', pretty_print=True):1788 if pretty_print:1789 eol_ = '\n'1790 else:1791 eol_ = ''1792 if self.original_tagname_ is not None:1793 name_ = self.original_tagname_1794 showIndent(outfile, level, pretty_print)1795 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1796 already_processed = set()1797 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Driver_Device_ListType')1798 if self.hasContent_():1799 outfile.write('>%s' % (eol_, ))1800 self.exportChildren(outfile, level + 1, namespace_='', name_='Driver_Device_ListType', pretty_print=pretty_print)1801 showIndent(outfile, level, pretty_print)1802 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1803 else:1804 outfile.write('/>%s' % (eol_, ))1805 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Driver_Device_ListType'):1806 pass1807 def exportChildren(self, outfile, level, namespace_='', name_='Driver_Device_ListType', fromsubclass_=False, pretty_print=True):1808 if pretty_print:1809 eol_ = '\n'1810 else:1811 eol_ = ''1812 for Device_ in self.Device:1813 Device_.export(outfile, level, namespace_, name_='Device', pretty_print=pretty_print)1814 def exportLiteral(self, outfile, level, name_='Driver_Device_ListType'):1815 level += 11816 already_processed = set()1817 self.exportLiteralAttributes(outfile, level, already_processed, name_)1818 if self.hasContent_():1819 self.exportLiteralChildren(outfile, level, name_)1820 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1821 pass1822 def exportLiteralChildren(self, outfile, level, name_):1823 showIndent(outfile, level)1824 outfile.write('Device=[\n')1825 level += 11826 for Device_ in self.Device:1827 showIndent(outfile, level)1828 outfile.write('model_.DeviceType(\n')1829 Device_.exportLiteral(outfile, level, name_='DeviceType')1830 showIndent(outfile, level)1831 outfile.write('),\n')1832 level -= 11833 showIndent(outfile, level)1834 outfile.write('],\n')1835 def build(self, node):1836 already_processed = set()1837 self.buildAttributes(node, node.attrib, already_processed)1838 for child in node:1839 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1840 self.buildChildren(child, node, nodeName_)1841 return self1842 def buildAttributes(self, node, attrs, already_processed):1843 pass1844 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1845 if nodeName_ == 'Device':1846 obj_ = DeviceType.factory()1847 obj_.build(child_)1848 self.Device.append(obj_)1849 obj_.original_tagname_ = 'Device'1850# end class Driver_Device_ListType1851class DeviceType(GeneratedsSuper):1852 subclass = None1853 superclass = None1854 def __init__(self, Name=None, DeviceObj_Location=None, DriverObj_Location=None, NextDeviceObj_Location=None, AttachedDeviceObj_Location=None):1855 self.original_tagname_ = None1856 self.Name = Name1857 self.DeviceObj_Location = DeviceObj_Location1858 self.DriverObj_Location = DriverObj_Location1859 self.NextDeviceObj_Location = NextDeviceObj_Location1860 self.AttachedDeviceObj_Location = AttachedDeviceObj_Location1861 def factory(*args_, **kwargs_):1862 if DeviceType.subclass:1863 return DeviceType.subclass(*args_, **kwargs_)1864 else:1865 return DeviceType(*args_, **kwargs_)1866 factory = staticmethod(factory)1867 def get_Name(self): return self.Name1868 def set_Name(self, Name): self.Name = Name1869 def get_DeviceObj_Location(self): return self.DeviceObj_Location1870 def set_DeviceObj_Location(self, DeviceObj_Location): self.DeviceObj_Location = DeviceObj_Location1871 def get_DriverObj_Location(self): return self.DriverObj_Location1872 def set_DriverObj_Location(self, DriverObj_Location): self.DriverObj_Location = DriverObj_Location1873 def get_NextDeviceObj_Location(self): return self.NextDeviceObj_Location1874 def set_NextDeviceObj_Location(self, NextDeviceObj_Location): self.NextDeviceObj_Location = NextDeviceObj_Location1875 def get_AttachedDeviceObj_Location(self): return self.AttachedDeviceObj_Location1876 def set_AttachedDeviceObj_Location(self, AttachedDeviceObj_Location): self.AttachedDeviceObj_Location = AttachedDeviceObj_Location1877 def hasContent_(self):1878 if (1879 self.Name is not None or1880 self.DeviceObj_Location is not None or1881 self.DriverObj_Location is not None or1882 self.NextDeviceObj_Location is not None or1883 self.AttachedDeviceObj_Location is not None1884 ):1885 return True1886 else:1887 return False1888 def export(self, outfile, level, namespace_='', name_='DeviceType', namespacedef_='', pretty_print=True):1889 if pretty_print:1890 eol_ = '\n'1891 else:1892 eol_ = ''1893 if self.original_tagname_ is not None:1894 name_ = self.original_tagname_1895 showIndent(outfile, level, pretty_print)1896 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1897 already_processed = set()1898 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DeviceType')1899 if self.hasContent_():1900 outfile.write('>%s' % (eol_, ))1901 self.exportChildren(outfile, level + 1, namespace_='', name_='DeviceType', pretty_print=pretty_print)1902 showIndent(outfile, level, pretty_print)1903 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1904 else:1905 outfile.write('/>%s' % (eol_, ))1906 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DeviceType'):1907 pass1908 def exportChildren(self, outfile, level, namespace_='', name_='DeviceType', fromsubclass_=False, pretty_print=True):1909 if pretty_print:1910 eol_ = '\n'1911 else:1912 eol_ = ''1913 if self.Name is not None:1914 showIndent(outfile, level, pretty_print)1915 outfile.write('<%sName>%s</%sName>%s' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_, eol_))1916 if self.DeviceObj_Location is not None:1917 showIndent(outfile, level, pretty_print)1918 outfile.write('<%sDeviceObj_Location>%s</%sDeviceObj_Location>%s' % (namespace_, self.gds_format_integer(self.DeviceObj_Location, input_name='DeviceObj_Location'), namespace_, eol_))1919 if self.DriverObj_Location is not None:1920 showIndent(outfile, level, pretty_print)1921 outfile.write('<%sDriverObj_Location>%s</%sDriverObj_Location>%s' % (namespace_, self.gds_format_integer(self.DriverObj_Location, input_name='DriverObj_Location'), namespace_, eol_))1922 if self.NextDeviceObj_Location is not None:1923 showIndent(outfile, level, pretty_print)1924 outfile.write('<%sNextDeviceObj_Location>%s</%sNextDeviceObj_Location>%s' % (namespace_, self.gds_format_integer(self.NextDeviceObj_Location, input_name='NextDeviceObj_Location'), namespace_, eol_))1925 if self.AttachedDeviceObj_Location is not None:1926 showIndent(outfile, level, pretty_print)1927 outfile.write('<%sAttachedDeviceObj_Location>%s</%sAttachedDeviceObj_Location>%s' % (namespace_, self.gds_format_integer(self.AttachedDeviceObj_Location, input_name='AttachedDeviceObj_Location'), namespace_, eol_))1928 def exportLiteral(self, outfile, level, name_='DeviceType'):1929 level += 11930 already_processed = set()1931 self.exportLiteralAttributes(outfile, level, already_processed, name_)1932 if self.hasContent_():1933 self.exportLiteralChildren(outfile, level, name_)1934 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1935 pass1936 def exportLiteralChildren(self, outfile, level, name_):1937 if self.Name is not None:1938 showIndent(outfile, level)1939 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding))1940 if self.DeviceObj_Location is not None:1941 showIndent(outfile, level)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful