Esempio n. 1
0
 def name(self):
     """
     describes the wikified name of this namespace (e.g. "Contribution")
     @return: the name as a string
     @rtype: str
     """
     if not '_Namespace__name' in self.__dict__:
         self.__name = wikifyNamespace(self.identifier)
     return self.__name
Esempio n. 2
0
    def __init__(self, identifier, parent=None):
        """
        The Constructor for the Member class.
        @param identifier: the unique identifier for the member (e.g."contributions/antlrLexer")
        @type identifier str
        @param parent: optional parameter to set the parent of this member (leave out if you're instancing this class
        directly)
        @type parent Namespace
        @return: a instance of Member
        @rtype Member
        """
        Folder.__init__(self, identifier, member=self, parent=parent)
        parts = identifier.split('/')

        self.__namespace = wikifyNamespace(parts[0])

        if USE_EXPLORER_SERVICE:
            self.__virtual = None != self.github
        else:
            self.__virtual = not os.path.exists(self.path)
            if not self.name in json.load(open(os.path.join(const101.tRoot, parts[0], 'members.json'), 'r')):
                raise BadIdentifierException(identifier, '{} does not belong to a member')