Trees | Indices | Help |
---|
|
1 # -*- Mode: Python; test-case-name: flumotion.test.test_config -*- 2 # vi:si:et:sw=4:sts=4:ts=4 3 4 # Flumotion - a streaming media server 5 # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. 6 # Copyright (C) 2010,2011 Flumotion Services, S.A. 7 # All rights reserved. 8 # 9 # This file may be distributed and/or modified under the terms of 10 # the GNU Lesser General Public License version 2.1 as published by 11 # the Free Software Foundation. 12 # This file is distributed without any warranty; without even the implied 13 # warranty of merchantability or fitness for a particular purpose. 14 # See "LICENSE.LGPL" in the source distribution for more information. 15 # 16 # Headers in this file shall remain intact. 17 18 """ 19 parsing of admin configuration files 20 """ 21 22 from flumotion.common import errors 23 from flumotion.common import config as fluconfig 24 25 __version__ = "$Rev$" 26 2729 """ 30 Admin configuration file parser. 31 """ 32 logCategory = 'config' 3362 parsers = {'plugs': (parseplugs, addplugs)} 63 64 self.parseFromTable(root, parsers) 65 self.doc.unlink() 66 self.doc = None 6735 """ 36 @param file: The file to parse, either as an open file object, 37 or as the name of a file to open. 38 @type file: str or file. 39 """ 40 self.plugs = {} 41 for socket in sockets: 42 self.plugs[socket] = [] 43 44 # will start the parse via self.add() 45 fluconfig.BaseConfigParser.__init__(self, file)4648 # <admin> 49 # <plugs> 50 root = self.doc.documentElement 51 if not root.nodeName == 'admin': 52 raise errors.ConfigError("unexpected root node': %s" % 53 (root.nodeName, )) 54 55 def parseplugs(node): 56 return fluconfig.buildPlugsSet(self.parsePlugs(node), 57 self.plugs.keys())58 59 def addplugs(plugs): 60 for socket in plugs: 61 self.plugs[socket].extend(plugs[socket])69 """ 70 @param file: The file to parse, either as an open file object, 71 or as the name of a file to open. 72 @type file: str or file. 73 """ 74 fluconfig.BaseConfigParser.add(self, file) 75 self._parse()76
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Aug 13 06:17:34 2013 | http://epydoc.sourceforge.net |