1
# -*- coding: utf-8 -*-
3
# Copyright (c) 2006 - 2007 Detlev Offenbach <detlev@die-offenbachs.de>
7
Module implementing the handler class for reading an XML user project properties file.
12
from Config import userProjectFileFormatVersion
13
from XMLHandlerBase import XMLHandlerBase
17
class UserProjectHandler(XMLHandlerBase):
19
Class implementing a sax handler to read an XML user project properties file.
21
def __init__(self, project):
25
@param project Reference to the project object to store the
28
XMLHandlerBase.__init__(self)
30
self.startDocumentSpecific = self.startDocumentProject
32
self.elements.update({
33
'UserProject' : (self.startUserProject, self.defaultEndElement),
34
'VcsType' : (self.defaultStartElement, self.endVcsType),
35
'VcsStatusMonitorInterval' : (self.startVcsStatusMonitorInterval,
36
self.defaultEndElement),
39
self.project = project
41
def startDocumentProject(self):
43
Handler called, when the document parsing is started.
47
###################################################
48
## below follow the individual handler functions
49
###################################################
53
Handler method for the "VcsType" end tag.
55
self.buffer = self.utf8_to_code(self.buffer)
56
self.project.pudata["VCSOVERRIDE"] = [self.buffer]
58
def startVcsStatusMonitorInterval(self, attrs):
60
Handler method for the "VcsStatusMonitorInterval" start tag.
62
@param attrs list of tag attributes
64
interval = int(attrs.get("value", Preferences.getVCS("StatusMonitorInterval")))
65
self.project.pudata["VCSSTATUSMONITORINTERVAL"] = [interval]
67
def startUserProject(self, attrs):
69
Handler method for the "UserProject" start tag.
71
@param attrs list of tag attributes
73
self.version = attrs.get('version', userProjectFileFormatVersion)
77
Public method to retrieve the version of the user project file.
79
@return String containing the version number.