~janusz-martyniak/mcdb/mice.cdb.client.api-python

« back to all changes in this revision

Viewing changes to src/cdb/_base.py

  • Committer: Antony Wilson
  • Date: 2011-09-01 08:10:55 UTC
  • Revision ID: antony.wilson@stfc.ac.uk-20110901081055-5hcu1wbeh9f75sdd
add calibration, fixes to cabling, pylint stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        """ Get the message extracted from the xml. """
77
77
        return self.message
78
78
 
79
 
    def startElement(self, name, attrs):
 
79
    def startElement(self, name, attrs): #pylint: disable-msg=C0103
80
80
        """ Method required for ContentHandler. """
81
81
        if name == 'error':
82
82
            self.message = ""
90
90
        """ Method required for ContentHandler. """
91
91
        self.message = self.message + message
92
92
 
93
 
    def endElement(self, name):
 
93
    def endElement(self, name): #pylint: disable-msg=C0103
94
94
        """ Method required for ContentHandler. """
95
95
        if name == 'error':
96
96
            raise CdbPermanentError(self.message)
121
121
 
122
122
def _get_cdb_server_name():
123
123
    """ Get the address of the CDB server. """
124
 
    _default_cdb_server = "http://micewww.pp.rl.ac.uk:4443"
 
124
    _default_cdb_server = "http://cdb.pp.rl.ac.uk"
125
125
    _cdb_server = None
126
126
 
127
127
    try:
148
148
            _dt = datetime.strptime(timestamp, "%Y-%m-%d %H:%M:%S")
149
149
        except ValueError, exception:
150
150
            raise CdbPermanentError(
151
 
                "ERROR - timestamp should be in the format yy-mm-dd hh:mm:ss[.fffffffff]",
152
 
                exception)
 
151
                "ERROR - timestamp should be in the format \
 
152
                yy-mm-dd hh:mm:ss[.fffffffff]", exception)
153
153
    return _dt
154
154
 
155
155
def _get_string_from_date(timestamp):