Skip to content

Commit

Permalink
Style cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gtback committed Jun 18, 2015
1 parent f134069 commit 04aed75
Show file tree
Hide file tree
Showing 65 changed files with 134 additions and 142 deletions.
2 changes: 0 additions & 2 deletions cybox/objects/__init__.py
@@ -1,4 +1,2 @@
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.


7 changes: 1 addition & 6 deletions cybox/objects/archive_file_object.py
@@ -1,15 +1,10 @@
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.

import base64
import bz2
import zlib

from mixbox import fields

import cybox
import cybox.bindings.archive_file_object as archive_binding
from cybox.common import ObjectProperties, String, Integer
from cybox.common import Integer, String
from cybox.objects.file_object import File


Expand Down
6 changes: 4 additions & 2 deletions cybox/objects/arp_cache_object.py
Expand Up @@ -7,18 +7,20 @@
import cybox.bindings.arp_cache_object as arp_binding
from cybox.objects.address_object import Address
from cybox.objects.system_object import NetworkInterface
from cybox.common import ObjectProperties, String, HexBinary, StructuredText, PlatformSpecification
from cybox.common import ObjectProperties, String


class ARPCacheEntry(cybox.Entity):
_binding = arp_binding
_binding_class = arp_binding.ARPCacheEntryType
_namespace = "http://cybox.mitre.org/objects#ARPCacheObject-1"

ip_address = fields.TypedField("IP_Address", Address)
physical_address = fields.TypedField("Physical_Address", String)
type_ = fields.TypedField("Type", String)
network_interface = fields.TypedField("Network_Interface", NetworkInterface)


class ARPCache(ObjectProperties):
_binding = arp_binding
_binding_class = arp_binding.ARPCacheObjectType
Expand Down
1 change: 0 additions & 1 deletion cybox/objects/artifact_object.py
Expand Up @@ -6,7 +6,6 @@
import zlib

from mixbox import fields

from mixbox.vendor import six

import cybox
Expand Down
2 changes: 0 additions & 2 deletions cybox/objects/as_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields

import cybox
import cybox.bindings.as_object as as_binding
from cybox.common import NonNegativeInteger, ObjectProperties, String

Expand All @@ -22,4 +21,3 @@ class AutonomousSystem(ObjectProperties):

# Add alias for the "proper", but completely unhelpful name, "AS"
AS = AutonomousSystem

3 changes: 3 additions & 0 deletions cybox/objects/code_object.py
Expand Up @@ -9,20 +9,23 @@
MeasureSource, PlatformSpecification, ExtractedFeatures,\
DigitalSignatureList


class CodeSegmentXOR(String):
_binding = code_binding
_binding_class = code_binding.CodeSegmentXORType
_namespace = "http://cybox.mitre.org/objects#CodeObject-2"

xor_pattern = fields.TypedField('xor_pattern')


class TargetedPlatforms(cybox.EntityList):
_binding = code_binding
_binding_class = code_binding.TargetedPlatformsType
_binding_var = "Targeted_Platform"
_contained_type = PlatformSpecification
_namespace = "http://cybox.mitre.org/objects#CodeObject-2"


class Code(ObjectProperties):
_binding = code_binding
_binding_class = code_binding.CodeObjectType
Expand Down
4 changes: 2 additions & 2 deletions cybox/objects/custom_object.py
Expand Up @@ -3,9 +3,9 @@

from mixbox import fields

import cybox
import cybox.bindings.custom_object as custom_binding
from cybox.common import ObjectProperties, String, StructuredText
from cybox.common import ObjectProperties, StructuredText


class Custom(ObjectProperties):
_binding = custom_binding
Expand Down
1 change: 0 additions & 1 deletion cybox/objects/device_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields

import cybox
import cybox.bindings.device_object as device_binding
from cybox.common import ObjectProperties, String, StructuredText

Expand Down
3 changes: 2 additions & 1 deletion cybox/objects/disk_object.py
Expand Up @@ -8,13 +8,15 @@
from cybox.objects.disk_partition_object import DiskPartition
from cybox.common import ObjectProperties, String, UnsignedLong


class PartitionList(cybox.EntityList):
_binding = disk_binding
_binding_class = disk_binding.PartitionListType
_binding_var = "Partition"
_contained_type = DiskPartition
_namespace = "http://cybox.mitre.org/objects#DiskObject-2"


class Disk(ObjectProperties):
_binding = disk_binding
_binding_class = disk_binding.DiskObjectType
Expand All @@ -27,4 +29,3 @@ class Disk(ObjectProperties):
free_space = fields.TypedField('Free_Space', UnsignedLong)
partition_list = fields.TypedField('Partition_List', PartitionList)
type = fields.TypedField('Type', String)

4 changes: 2 additions & 2 deletions cybox/objects/disk_partition_object.py
Expand Up @@ -3,9 +3,9 @@

from mixbox import fields

import cybox
import cybox.bindings.disk_partition_object as disk_partition_binding
from cybox.common import ObjectProperties, String, Integer, Name, UnsignedLong, DateTime
from cybox.common import ObjectProperties, String, Integer, Name, UnsignedLong


class DiskPartition(ObjectProperties):
_binding = disk_partition_binding
Expand Down
2 changes: 1 addition & 1 deletion cybox/objects/dns_cache_object.py
Expand Up @@ -5,7 +5,7 @@

import cybox
import cybox.bindings.dns_cache_object as dns_cache_binding
from cybox.common import DateTime, ObjectProperties, PositiveInteger
from cybox.common import ObjectProperties, PositiveInteger
from cybox.objects.dns_record_object import DNSRecord


Expand Down
1 change: 0 additions & 1 deletion cybox/objects/dns_record_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields

import cybox
import cybox.bindings.dns_record_object as dns_record_binding
from cybox.common import (Integer, HexBinary, ObjectProperties, String,
StructuredText, DateTime)
Expand Down
2 changes: 0 additions & 2 deletions cybox/objects/domain_name_object.py
Expand Up @@ -3,8 +3,6 @@

from mixbox import fields


import cybox
import cybox.bindings.domain_name_object as domainname_binding
from cybox.common import ObjectProperties, String

Expand Down
12 changes: 7 additions & 5 deletions cybox/objects/file_object.py
Expand Up @@ -56,29 +56,33 @@ def from_dict(filepath_dict):
filepath.fully_qualified = filepath_dict.get('fully_qualified')
return filepath


class EPJumpCode(cybox.Entity):
_binding = file_binding
_binding_class = file_binding.EPJumpCodeType
_namespace = 'http://cybox.mitre.org/objects#FileObject-2'

depth = fields.TypedField("Depth", Integer)
opcodes = fields.TypedField("Opcodes", String)



class EntryPointSignature(cybox.Entity):
_binding = file_binding
_binding_class = file_binding.EntryPointSignatureType
_namespace = 'http://cybox.mitre.org/objects#FileObject-2'

name = fields.TypedField("Name", String)
type_ = fields.TypedField("Type", String)



class EntryPointSignatureList(cybox.EntityList):
_binding = file_binding
_binding_class = file_binding.EntryPointSignatureListType
_binding_var = "Entry_Point_Signature"
_contained_type = EntryPointSignature
_namespace = 'http://cybox.mitre.org/objects#FileObject-2'


class Packer(cybox.Entity):
_binding = file_binding
_binding_class = file_binding.PackerType
Expand Down Expand Up @@ -249,5 +253,3 @@ def add_hash(self, hash_):
if self.hashes is None:
self.hashes = HashList()
self.hashes.append(hash_)


3 changes: 1 addition & 2 deletions cybox/objects/gui_dialogbox_object.py
Expand Up @@ -3,10 +3,9 @@

from mixbox import fields

import cybox
import cybox.bindings.gui_dialogbox_object as gui_dialogbox_binding
from cybox.objects.gui_object import GUI
from cybox.common import String
from cybox.objects.gui_object import GUI


class GUIDialogbox(GUI):
Expand Down
1 change: 0 additions & 1 deletion cybox/objects/gui_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields

import cybox
import cybox.bindings.gui_object as gui_binding
from cybox.common import ObjectProperties, Integer

Expand Down
1 change: 0 additions & 1 deletion cybox/objects/gui_window_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields

import cybox
import cybox.bindings.gui_window_object as gui_window_binding
from cybox.objects.gui_object import GUI
from cybox.common import String
Expand Down
3 changes: 1 addition & 2 deletions cybox/objects/hostname_object.py
Expand Up @@ -3,11 +3,10 @@

from mixbox import fields


import cybox
import cybox.bindings.hostname_object as hostname_binding
from cybox.common import ObjectProperties, String


class Hostname(ObjectProperties):
_binding = hostname_binding
_binding_class = hostname_binding.HostnameObjectType
Expand Down
7 changes: 1 addition & 6 deletions cybox/objects/image_file_object.py
@@ -1,15 +1,10 @@
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.

import base64
import bz2
import zlib

from mixbox import fields

import cybox
import cybox.bindings.image_file_object as image_binding
from cybox.common import ObjectProperties, String, Integer, PositiveInteger
from cybox.common import String, Integer, PositiveInteger
from cybox.objects.file_object import File


Expand Down
4 changes: 2 additions & 2 deletions cybox/objects/library_object.py
Expand Up @@ -3,10 +3,10 @@

from mixbox import fields

import cybox
import cybox.bindings.library_object as library_binding
from cybox.common.extracted_features import ExtractedFeatures
from cybox.common import ObjectProperties, HashList, String, UnsignedLong, HexBinary
from cybox.common import ObjectProperties, String, UnsignedLong, HexBinary


class Library(ObjectProperties):
_binding = library_binding
Expand Down
5 changes: 2 additions & 3 deletions cybox/objects/link_object.py
Expand Up @@ -3,11 +3,10 @@

from mixbox import fields


import cybox
import cybox.bindings.link_object as link_binding
from cybox.objects.uri_object import URI
from cybox.common import ObjectProperties, String
from cybox.common import String


class Link(URI):
_binding = link_binding
Expand Down
1 change: 0 additions & 1 deletion cybox/objects/linux_package_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields

import cybox
import cybox.bindings.linux_package_object as linux_package_binding
from cybox.common import ObjectProperties, String, VocabString, vocabs

Expand Down
2 changes: 0 additions & 2 deletions cybox/objects/memory_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields

import cybox
import cybox.bindings.memory_object as memory_binding
from cybox.common import (ExtractedFeatures, HashList, HexBinary,
ObjectProperties, String, UnsignedLong)
Expand All @@ -29,4 +28,3 @@ class Memory(ObjectProperties):
region_end_address = fields.TypedField("Region_End_Address", HexBinary)
extracted_features = fields.TypedField("Extracted_Features",
ExtractedFeatures)

1 change: 0 additions & 1 deletion cybox/objects/mutex_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields

import cybox
import cybox.bindings.mutex_object as mutex_binding
from cybox.common import ObjectProperties, String

Expand Down
1 change: 0 additions & 1 deletion cybox/objects/network_packet_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields


import cybox
import cybox.bindings.network_packet_object as network_packet_binding
from cybox.common import (DataSegment, HexBinary, Integer, ObjectProperties,
Expand Down
6 changes: 2 additions & 4 deletions cybox/objects/network_route_entry_object.py
Expand Up @@ -3,7 +3,6 @@

from mixbox import fields

import cybox
import cybox.bindings.network_route_entry_object as network_route_entry_binding
from cybox.common import ObjectProperties, String, UnsignedLong, Duration
from cybox.objects.address_object import Address
Expand All @@ -21,17 +20,16 @@ class NetworkRouteEntry(ObjectProperties):
is_immortal = fields.TypedField("is_immortal")
is_loopback = fields.TypedField("is_loopback")
is_publish = fields.TypedField("is_publish")

destination_address = fields.TypedField("Destination_Address", Address)
origin = fields.TypedField("Origin", Address)
netmask = fields.TypedField("Netmask", Address)
gateway_address = fields.TypedField("Gateway_Address", Address)
metric = fields.TypedField("Metric", UnsignedLong)

type_ = fields.TypedField("Type", String)
protocol = fields.TypedField("Protocol", String)
interface = fields.TypedField("Interface", String)
preferred_lifetime = fields.TypedField("Preferred_Lifetime", Duration)
valid_lifetime = fields.TypedField("Valid_Lifetime", Duration)
route_age = fields.TypedField("Route_Age", Duration)

9 changes: 5 additions & 4 deletions cybox/objects/network_route_object.py
Expand Up @@ -5,16 +5,18 @@

import cybox
import cybox.bindings.network_route_object as network_route_binding
from cybox.common import ObjectProperties, String, UnsignedLong, StructuredText, Duration
from cybox.common import Duration, ObjectProperties, StructuredText
from cybox.objects.network_route_entry_object import NetworkRouteEntry


class NetworkRouteEntries(cybox.EntityList):
_binding = network_route_binding
_binding_class = network_route_binding.NetworkRouteEntriesType
_binding_var = "Network_Route_Entry"
_contained_type = NetworkRouteEntry
_namespace = "http://cybox.mitre.org/objects#NetworkRouteObject-2"



class NetRoute(ObjectProperties):
_binding = network_route_binding
_binding_class = network_route_binding.NetRouteObjectType
Expand All @@ -27,11 +29,10 @@ class NetRoute(ObjectProperties):
is_immortal = fields.TypedField("is_immortal")
is_loopback = fields.TypedField("is_loopback")
is_publish = fields.TypedField("is_publish")

description = fields.TypedField("Description", StructuredText)
preferred_lifetime = fields.TypedField("Preferred_Lifetime", Duration)
valid_lifetime = fields.TypedField("Valid_Lifetime", Duration)
route_age = fields.TypedField("Route_Age", Duration)

network_route_entries = fields.TypedField("Network_Route_Entries", NetworkRouteEntries)

0 comments on commit 04aed75

Please sign in to comment.