Exemplo n.º 1
0
    def testCore(self):
        o = TestObject()
        self.assertTrue(o)
        o.ValidateExports()
        o.AddExportObject('Counter')
        o.AddExportObject('Counter')
        o.AddExportObject('Counter')
        print o.ListExports(recursive=False)
        print o.ListExports(recursive=True)
        self.assertEqual(list(o.ListExports()),
                         ['Counter.', 'SubObj.', 'TestParam'])
        self.assertEqual(list(o.ListExports(recursive=True)), [
            'Counter.', 'Counter.0.', 'Counter.0.Count', 'Counter.1.',
            'Counter.1.Count', 'Counter.2.', 'Counter.2.Count', 'SubObj.',
            'SubObj.Count', 'TestParam'
        ])

        ds1 = core.DumpSchema(TestObject)
        ds2 = core.DumpSchema(o)
        self.assertEqual(ds1, ds2)

        o.DeleteExportObject('Counter', 1)
        self.assertEqual(list(o.ListExports(recursive=True)), [
            'Counter.', 'Counter.0.', 'Counter.0.Count', 'Counter.2.',
            'Counter.2.Count', 'SubObj.', 'SubObj.Count', 'TestParam'
        ])
        self.assertEqual([(idx, i.Count) for idx, i in o.CounterList.items()],
                         [(0, 2), (2, 4)])
        idx, eo = o.AddExportObject('Counter', 'fred')
        eo.Count = 99
        print o.ListExports(recursive=True)
        self.assertEqual([(idx, i.Count) for idx, i in o.CounterList.items()],
                         [(0, 2), (2, 4), ('fred', 99)])
        print core.Dump(o)
        o.ValidateExports()
Exemplo n.º 2
0
                class Description(core.Exporter):
                    """Represents VoiceService_v1_0.VoiceService.{i}.VoiceProfile.{i}.Tone.Description.{i}."""
                    def __init__(self, **defaults):
                        core.Exporter.__init__(self, defaults=defaults)
                        self.Export(params=[
                            'EntryID', 'ToneEnable', 'ToneFile', 'ToneName',
                            'TonePattern', 'ToneRepetitions', 'ToneText'
                        ])

                class Event(core.Exporter):
                    """Represents VoiceService_v1_0.VoiceService.{i}.VoiceProfile.{i}.Tone.Event.{i}."""
                    def __init__(self, **defaults):
                        core.Exporter.__init__(self, defaults=defaults)
                        self.Export(params=['Function', 'ToneID'])

                class Pattern(core.Exporter):
                    """Represents VoiceService_v1_0.VoiceService.{i}.VoiceProfile.{i}.Tone.Pattern.{i}."""
                    def __init__(self, **defaults):
                        core.Exporter.__init__(self, defaults=defaults)
                        self.Export(params=[
                            'Duration', 'EntryID', 'Frequency1', 'Frequency2',
                            'Frequency3', 'Frequency4', 'ModulationFrequency',
                            'ModulationPower', 'NextEntryID', 'Power1',
                            'Power2', 'Power3', 'Power4', 'ToneOn'
                        ])


if __name__ == '__main__':
    print core.DumpSchema(VoiceService_v1_0)
Exemplo n.º 3
0
            self.Export(params=['CertificateNumberOfEntries'],
                        lists=['Certificate'])

        class Certificate(core.Exporter):
            """Represents InternetGatewayDevice_v1_10.Security.Certificate.{i}."""
            def __init__(self, **defaults):
                core.Exporter.__init__(self, defaults=defaults)
                self.Export(params=[
                    'Enable', 'Issuer', 'LastModif', 'NotAfter', 'NotBefore',
                    'SerialNumber', 'SignatureAlgorithm', 'Subject',
                    'SubjectAlt'
                ])

    class SoftwareModules(InternetGatewayDevice_v1_9.SoftwareModules):
        """Represents InternetGatewayDevice_v1_10.SoftwareModules."""
        def __init__(self, **defaults):
            InternetGatewayDevice_v1_9.SoftwareModules.__init__(
                self, defaults=defaults)
            self.Export(lists=['ExecEnv'])

        class ExecEnv(InternetGatewayDevice_v1_9.SoftwareModules.ExecEnv):
            """Represents InternetGatewayDevice_v1_10.SoftwareModules.ExecEnv.{i}."""
            def __init__(self, **defaults):
                InternetGatewayDevice_v1_9.SoftwareModules.ExecEnv.__init__(
                    self, defaults=defaults)
                self.Export(params=['InitialExecutionUnitRunLevel'])


if __name__ == '__main__':
    print core.DumpSchema(InternetGatewayDevice_v1_10)
Exemplo n.º 4
0
        def __init__(self, **defaults):
            Device_v2_4.DeviceInfo.__init__(self, defaults=defaults)
            self.Export(params=['X_CATAWAMPUS-ORG_LedStatusNumberOfEntries'],
                        objects=['TemperatureStatus'],
                        lists=['X_CATAWAMPUS-ORG_LedStatus'])

        class TemperatureStatus(Device_v2_4.DeviceInfo.TemperatureStatus):
            """Represents X_CATAWAMPUS_ORG_Device_v2_0.DeviceInfo.TemperatureStatus."""
            def __init__(self, **defaults):
                Device_v2_4.DeviceInfo.TemperatureStatus.__init__(
                    self, defaults=defaults)
                self.Export(lists=['X_CATAWAMPUS-ORG_Fan'])

            class X_CATAWAMPUS_ORG_Fan(core.Exporter):
                """Represents X_CATAWAMPUS_ORG_Device_v2_0.DeviceInfo.TemperatureStatus.X_CATAWAMPUS-ORG_Fan.{i}."""
                def __init__(self, **defaults):
                    core.Exporter.__init__(self, defaults=defaults)
                    self.Export(params=[
                        'DesiredPercentage', 'DesiredRPM', 'Name', 'RPM'
                    ])

        class X_CATAWAMPUS_ORG_LedStatus(core.Exporter):
            """Represents X_CATAWAMPUS_ORG_Device_v2_0.DeviceInfo.X_CATAWAMPUS-ORG_LedStatus.{i}."""
            def __init__(self, **defaults):
                core.Exporter.__init__(self, defaults=defaults)
                self.Export(params=['Name', 'Status'])


if __name__ == '__main__':
    print core.DumpSchema(X_CATAWAMPUS_ORG_Device_v2_0)
Exemplo n.º 5
0
                self.Export(params=[
                    'ActiveExecutionUnits', 'Alias', 'AllocatedDiskSpace',
                    'AllocatedMemory', 'AvailableDiskSpace', 'AvailableMemory',
                    'CurrentRunLevel', 'Enable', 'InitialRunLevel', 'Name',
                    'ParentExecEnv', 'ProcessorRefList', 'RequestedRunLevel',
                    'Reset', 'Status', 'Type', 'Vendor', 'Version'
                ])

        class ExecutionUnit(core.Exporter):
            """Represents Device_v2_1.SoftwareModules.ExecutionUnit.{i}."""
            def __init__(self, **defaults):
                core.Exporter.__init__(self, defaults=defaults)
                self.Export(params=[
                    'Alias', 'AssociatedProcessList', 'AutoStart',
                    'Description', 'DiskSpaceInUse', 'EUID', 'ExecEnvLabel',
                    'ExecutionEnvRef', 'ExecutionFaultCode',
                    'ExecutionFaultMessage', 'MemoryInUse', 'Name',
                    'References', 'RequestedState', 'RunLevel', 'Status',
                    'SupportedDataModelList', 'Vendor', 'VendorConfigList',
                    'VendorLogList', 'Version'
                ],
                            objects=['Extensions'])

            class Extensions(core.Exporter):
                """Represents Device_v2_1.SoftwareModules.ExecutionUnit.{i}.Extensions."""
                pass


if __name__ == '__main__':
    print core.DumpSchema(Device_v2_1)
Exemplo n.º 6
0
            core.Exporter.__init__(self, defaults=defaults)
            self.Export(params=['CertificateNumberOfEntries'],
                        lists=['Certificate'])

        class Certificate(core.Exporter):
            """Represents Device_v1_9.Security.Certificate.{i}."""
            def __init__(self, **defaults):
                core.Exporter.__init__(self, defaults=defaults)
                self.Export(params=[
                    'Enable', 'Issuer', 'LastModif', 'NotAfter', 'NotBefore',
                    'SerialNumber', 'SignatureAlgorithm', 'Subject',
                    'SubjectAlt'
                ])

    class SoftwareModules(Device_v1_8.SoftwareModules):
        """Represents Device_v1_9.SoftwareModules."""
        def __init__(self, **defaults):
            Device_v1_8.SoftwareModules.__init__(self, defaults=defaults)
            self.Export(lists=['ExecEnv'])

        class ExecEnv(Device_v1_8.SoftwareModules.ExecEnv):
            """Represents Device_v1_9.SoftwareModules.ExecEnv.{i}."""
            def __init__(self, **defaults):
                Device_v1_8.SoftwareModules.ExecEnv.__init__(self,
                                                             defaults=defaults)
                self.Export(params=['InitialExecutionUnitRunLevel'])


if __name__ == '__main__':
    print core.DumpSchema(Device_v1_9)
Exemplo n.º 7
0
                    'Enable', 'IdleTime', 'MaxNumUsers', 'PortNumber', 'Status'
                ])

        class StorageArray(core.Exporter):
            """Represents StorageService_v1_0.StorageService.{i}.StorageArray.{i}."""
            def __init__(self, **defaults):
                core.Exporter.__init__(self, defaults=defaults)
                self.Export(params=[
                    'Enable', 'Name', 'PhysicalMediumReference', 'RaidType',
                    'Status', 'UsableCapacity'
                ])

        class UserAccount(core.Exporter):
            """Represents StorageService_v1_0.StorageService.{i}.UserAccount.{i}."""
            def __init__(self, **defaults):
                core.Exporter.__init__(self, defaults=defaults)
                self.Export(params=[
                    'AllowFTPAccess', 'AllowHTTPAccess', 'Enable', 'Password',
                    'UserGroupParticipation', 'Username'
                ])

        class UserGroup(core.Exporter):
            """Represents StorageService_v1_0.StorageService.{i}.UserGroup.{i}."""
            def __init__(self, **defaults):
                core.Exporter.__init__(self, defaults=defaults)
                self.Export(params=['Enable', 'GroupName'])


if __name__ == '__main__':
    print core.DumpSchema(StorageService_v1_0)
Exemplo n.º 8
0
# AUTO-GENERATED BY parse-schema.py
#
# DO NOT EDIT!!
#
#pylint: disable-msg=C6202
#pylint: disable-msg=C6409
#pylint: disable-msg=C6310
# These should not actually be necessary (bugs in gpylint?):
#pylint: disable-msg=E1101
#pylint: disable-msg=W0231
#
"""Auto-generated from spec: urn:google-com:x-gvsb-1-0."""

import core


class X_GOOGLE_COM_GVSB_v1_1(core.Exporter):
  """Represents X_GOOGLE_COM_GVSB_v1_1."""

  def __init__(self, **defaults):
    core.Exporter.__init__(self, defaults=defaults)
    self.Export(params=['EpgPrimary',
                        'EpgSecondary',
                        'GvsbChannelLineup',
                        'GvsbKick',
                        'GvsbServer'])


if __name__ == '__main__':
  print core.DumpSchema(X_GOOGLE_COM_GVSB_v1_1)
Exemplo n.º 9
0
                                'SevereLossLengthCount',
                                'SevereLossLengthCountBeforeEC'
                            ])

                    class VideoDecoderStats(core.Exporter):
                        """Represents STBService_v1_0.STBService.{i}.ServiceMonitoring.MainStream.{i}.Total.VideoDecoderStats."""
                        def __init__(self, **defaults):
                            core.Exporter.__init__(self, defaults=defaults)
                            self.Export(params=[
                                'AVResynchCounter', 'BConcealedFrames',
                                'BDecodedFrames', 'BLostFrames',
                                'ConcealedFrames', 'DecodedFrames',
                                'FrameRate', 'IConcealedFrames',
                                'IDecodedFrames', 'ILostFrames', 'LostFrames',
                                'PConcealedFrames', 'PDecodedFrames',
                                'PLostFrames'
                            ])

                    class VideoResponseStats(core.Exporter):
                        """Represents STBService_v1_0.STBService.{i}.ServiceMonitoring.MainStream.{i}.Total.VideoResponseStats."""
                        def __init__(self, **defaults):
                            core.Exporter.__init__(self, defaults=defaults)
                            self.Export(params=[
                                'MaximumVideoSystemResponse',
                                'MinimumVideoSystemResponse'
                            ])


if __name__ == '__main__':
    print core.DumpSchema(STBService_v1_0)
Exemplo n.º 10
0
#!/usr/bin/python
# Copyright 2011 Google Inc. All Rights Reserved.
#
# AUTO-GENERATED BY parse-schema.py
#
# DO NOT EDIT!!
#
#pylint: disable-msg=C6202
#pylint: disable-msg=C6409
#pylint: disable-msg=C6310
# These should not actually be necessary (bugs in gpylint?):
#pylint: disable-msg=E1101
#pylint: disable-msg=W0231
#
"""Auto-generated from spec: urn:catawampus-org:x-catawampus-1-0."""

import core


class X_CATAWAMPUS_ORG_CATAWAMPUS_v1_0(core.Exporter):
    """Represents X_CATAWAMPUS_ORG_CATAWAMPUS_v1_0."""
    def __init__(self, **defaults):
        core.Exporter.__init__(self, defaults=defaults)
        self.Export(params=['RuntimeEnvInfo'])


if __name__ == '__main__':
    print core.DumpSchema(X_CATAWAMPUS_ORG_CATAWAMPUS_v1_0)
Exemplo n.º 11
0
      core.Exporter.__init__(self, defaults=defaults)
      self.Export(params=['BtConfig',
                          'BtDevices',
                          'BtHHDevices',
                          'BtNoPairing',
                          'DevicePropertiesNumberOfEntries'],
                  objects=['Mailbox'],
                  lists=['DeviceProperties'])

    class DeviceProperties(core.Exporter):
      """Represents X_GOOGLE_COM_GFIBERTV_v1_0.X_GOOGLE_COM_GFIBERTV.DeviceProperties.{i}."""

      def __init__(self, **defaults):
        core.Exporter.__init__(self, defaults=defaults)
        self.Export(params=['NickName',
                            'SerialNumber'])

    class Mailbox(core.Exporter):
      """Represents X_GOOGLE_COM_GFIBERTV_v1_0.X_GOOGLE_COM_GFIBERTV.Mailbox."""

      def __init__(self, **defaults):
        core.Exporter.__init__(self, defaults=defaults)
        self.Export(params=['Name',
                            'Node',
                            'NodeList',
                            'Value'])


if __name__ == '__main__':
  print core.DumpSchema(X_GOOGLE_COM_GFIBERTV_v1_0)
Exemplo n.º 12
0
    class X_CATAWAMPUS_ORG_FlashMedia(core.Exporter):
      """Represents X_CATAWAMPUS_ORG_Storage_v1_0.StorageService.{i}.X_CATAWAMPUS-ORG_FlashMedia.{i}."""

      def __init__(self, **defaults):
        core.Exporter.__init__(self, defaults=defaults)
        self.Export(params=['BadEraseBlocks',
                            'CorrectedErrors',
                            'EraseBlockSize',
                            'IOSize',
                            'MaxEraseCount',
                            'Name',
                            'ReservedEraseBlocks',
                            'SubVolumeNumberOfEntries',
                            'TotalEraseBlocks',
                            'UncorrectedErrors'],
                    lists=['SubVolume'])

      class SubVolume(core.Exporter):
        """Represents X_CATAWAMPUS_ORG_Storage_v1_0.StorageService.{i}.X_CATAWAMPUS-ORG_FlashMedia.{i}.SubVolume.{i}."""

        def __init__(self, **defaults):
          core.Exporter.__init__(self, defaults=defaults)
          self.Export(params=['DataMBytes',
                              'Name',
                              'Status'])


if __name__ == '__main__':
  print core.DumpSchema(X_CATAWAMPUS_ORG_Storage_v1_0)
Exemplo n.º 13
0
#!/usr/bin/python
# Copyright 2011 Google Inc. All Rights Reserved.
#
# AUTO-GENERATED BY parse-schema.py
#
# DO NOT EDIT!!
#
#pylint: disable-msg=C6202
#pylint: disable-msg=C6409
#pylint: disable-msg=C6310
# These should not actually be necessary (bugs in gpylint?):
#pylint: disable-msg=E1101
#pylint: disable-msg=W0231
#
"""Auto-generated from spec: urn:google-com:x-gmoca-1-0."""

import core


class X_GOOGLE_COM_GMOCA_v1_0(core.Exporter):
  """Represents X_GOOGLE_COM_GMOCA_v1_0."""

  def __init__(self, **defaults):
    core.Exporter.__init__(self, defaults=defaults)
    self.Export(params=['DebugOutput'])


if __name__ == '__main__':
  print core.DumpSchema(X_GOOGLE_COM_GMOCA_v1_0)
Exemplo n.º 14
0
class X_CATAWAMPUS_ORG_STBVideoMonitoring_v1_0(STBService_v1_2):
    """Represents X_CATAWAMPUS_ORG_STBVideoMonitoring_v1_0."""
    def __init__(self, **defaults):
        STBService_v1_2.__init__(self, defaults=defaults)
        self.Export(lists=['STBService'])

    class STBService(STBService_v1_2.STBService):
        """Represents X_CATAWAMPUS_ORG_STBVideoMonitoring_v1_0.STBService.{i}."""
        def __init__(self, **defaults):
            STBService_v1_2.STBService.__init__(self, defaults=defaults)
            self.Export(objects=['X_CATAWAMPUS-ORG_ProgramMetadata'])

        class X_CATAWAMPUS_ORG_ProgramMetadata(core.Exporter):
            """Represents X_CATAWAMPUS_ORG_STBVideoMonitoring_v1_0.STBService.{i}.X_CATAWAMPUS-ORG_ProgramMetadata."""
            def __init__(self, **defaults):
                core.Exporter.__init__(self, defaults=defaults)
                self.Export(objects=['EPG'])

            class EPG(core.Exporter):
                """Represents X_CATAWAMPUS_ORG_STBVideoMonitoring_v1_0.STBService.{i}.X_CATAWAMPUS-ORG_ProgramMetadata.EPG."""
                def __init__(self, **defaults):
                    core.Exporter.__init__(self, defaults=defaults)
                    self.Export(params=[
                        'EPGErrors', 'EPGExpireTime', 'LastReceivedTime',
                        'MulticastPackets'
                    ])


if __name__ == '__main__':
    print core.DumpSchema(X_CATAWAMPUS_ORG_STBVideoMonitoring_v1_0)