Fixing bugs

This commit is contained in:
freemansw1 2016-04-17 18:22:20 -06:00
parent 6a2db72ffd
commit 718d242ffe
12 changed files with 16 additions and 17 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
.ipynb_checkpoints
docs/build/
*.pyc

View file

@ -44,12 +44,11 @@ from thrift.Thrift import TType
import inspect, sys, types
import dynamicserialize
from dynamicserialize import dstypes, adapters
from . import SelfDescribingBinaryProtocol
from dynamicserialize import SelfDescribingBinaryProtocol
import numpy
import collections
dsObjTypes = {}
def buildObjMap(module):
if '__all__' in module.__dict__:
for i in module.__all__:
@ -75,7 +74,7 @@ pythonToThriftMap = {
float: SelfDescribingBinaryProtocol.FLOAT,
#types.FloatType: TType.DOUBLE,
bool: TType.BOOL,
types.InstanceType: TType.STRUCT,
object: TType.STRUCT,
type(None): TType.VOID,
numpy.float32: SelfDescribingBinaryProtocol.FLOAT,
numpy.int32: TType.I32,
@ -180,7 +179,7 @@ class ThriftSerializationContext(object):
if b in self.typeDeserializationMethod:
return self.typeDeserializationMethod[b]()
else:
raise dynamicserialize.SerializationException("Unsupported type value " + str(b))
raise SerializationException("Unsupported type value " + str(b))
def _deserializeField(self, structname, obj):
@ -200,9 +199,9 @@ class ThriftSerializationContext(object):
if isinstance(setMethod, collections.Callable):
setMethod(result)
else:
raise dynamicserialize.SerializationException("Couldn't find setter method " + lookingFor)
raise SerializationException("Couldn't find setter method " + lookingFor)
except:
raise dynamicserialize.SerializationException("Couldn't find setter method " + lookingFor)
raise SerializationException("Couldn't find setter method " + lookingFor)
self.protocol.readFieldEnd()
return True

View file

@ -66,7 +66,7 @@ classAdapterRegistry = {}
def getAdapterRegistry():
import sys
for x in __all__:
exec('import ' + x)
exec('import dynamicserialize.adapters.' + x )
m = sys.modules['dynamicserialize.adapters.' + x]
d = m.__dict__
if 'ClassAdapter' in d:

View file

@ -26,4 +26,3 @@ __all__ = [
'java'
]

View file

@ -28,7 +28,7 @@
from . import ActiveTableRecord
class OperationalActiveTableRecord(ActiveTableRecord.ActiveTableRecord):
class OperationalActiveTableRecord(ActiveTableRecord):
def __init__(self):
super(OperationalActiveTableRecord, self).__init__()

View file

@ -28,7 +28,7 @@
from . import ActiveTableRecord
class PracticeActiveTableRecord(ActiveTableRecord.ActiveTableRecord):
class PracticeActiveTableRecord(ActiveTableRecord):
def __init__(self):
super(PracticeActiveTableRecord, self).__init__()

View file

@ -28,7 +28,7 @@
from . import GfeNotification
class GridHistoryUpdateNotification(GfeNotification.GfeNotification):
class GridHistoryUpdateNotification(GfeNotification):
def __init__(self):
super(GridHistoryUpdateNotification, self).__init__()

View file

@ -29,7 +29,7 @@
from . import GfeNotification
class GridUpdateNotification(GfeNotification.GfeNotification):
class GridUpdateNotification(GfeNotification):
def __init__(self):
super(GridUpdateNotification, self).__init__()

View file

@ -29,7 +29,7 @@
from . import GfeNotification
class LockNotification(GfeNotification.GfeNotification):
class LockNotification(GfeNotification):
def __init__(self):
super(LockNotification, self).__init__()

View file

@ -28,7 +28,7 @@
from . import GfeNotification
class ServiceBackupJobStatusNotification(GfeNotification.GfeNotification):
class ServiceBackupJobStatusNotification(GfeNotification):
def __init__(self):
super(ServiceBackupJobStatusNotification, self).__init__()

View file

@ -27,8 +27,7 @@
##
from . import GfeNotification
class UserMessageNotification(GfeNotification.GfeNotification):
class UserMessageNotification(GfeNotification):
def __init__(self):
super(UserMessageNotification, self).__init__()

View file

@ -36,7 +36,7 @@
import numpy
import re
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.level import MasterLevel
from .MasterLevel import MasterLevel
LEVEL_NAMING_REGEX = re.compile("^(\d*(?:\.\d*)?)(?:_(\d*(?:\.\d*)?))?([a-zA-Z]+)$")