Trees | Indices | Help |
|
---|
|
1 #-*- coding: utf8 -* 2 # 3 # Max E. Kuznecov ~syhpoon <syhpoon@syhpoon.name> 2008 4 # 5 # This file is part of XYZCommander. 6 # XYZCommander is free software: you can redistribute it and/or modify 7 # it under the terms of the GNU Lesser Public License as published by 8 # the Free Software Foundation, either version 3 of the License, or 9 # (at your option) any later version. 10 # XYZCommander is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU Lesser Public License for more details. 14 # You should have received a copy of the GNU Lesser Public License 15 # along with XYZCommander. If not, see <http://www.gnu.org/licenses/>. 16 17 from libxyz.exceptions import XYZValueError 1820 """ 21 Plugin namespace abstraction 22 """ 23 24 # All wildcard 25 ALL = u"*" 269828 _path = path 29 30 if not path.startswith(u":"): 31 raise XYZValueError(_(u"Invalid plugin path: %s") % path) 32 else: 33 _path = path[1:] 34 35 _raw = _path.split(u":") 36 _len = len(_raw) 37 38 if _len < 2 or _len > 3: 39 raise XYZValueError(_(u"Invalid plugin path: %s") % path) 40 41 # Full namespace path 42 self.full = path 43 # Full plugin path without method name 44 self.pfull = ":".join(("", _raw[0], _raw[1])) 45 # Namespace part 46 self.ns = _raw[0] 47 # Plugin name 48 self.plugin = _raw[1] 49 # Method name 50 self.method = None 51 52 # Internal representation 53 self.internal = self._make_intern(self.full) 54 55 if _len == 3: 56 self.method = _raw[2]57 58 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5961 """ 62 Add method name to namespace 63 """ 64 65 self.method = method 66 self.full += u":%s" % method 67 self.internal = self._make_intern(self.full)68 69 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 73 74 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 78 79 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8082 return self.__str__()83 84 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8587 return self.__str__()88 89 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 90 93 94 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 95
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Sep 16 01:52:01 2010 | http://epydoc.sourceforge.net |