Exemplo n.º 1
0
 def __loadFromWeb(self):
     try:
         self.__raw_data = helpers.loadJSONFromUrl(self.path)
         for p in self.__otherPaths:
             self.__raw_data += helpers.loadJSONFromUrl(os.path.join(const101.url101data, 'resources', p))
         self.__exists = True
     except:
         self.__exists = False
Exemplo n.º 2
0
 def endpointData(self):
     """
     Queries the endpoint for the actual wiki triples that exist for this member.
     @return: a list of string triples [ [s1, p1, o1], ... ]
     @rtype list
     """
     if not '_Member__endpointData' in self.__dict__:
         self.__endpointData = helpers.loadJSONFromUrl(self.endpointLink)
     return self.__endpointData
Exemplo n.º 3
0
    def __loadFromWeb(self):
        data = helpers.loadJSONFromUrl(os.path.join(const101.url101explorer, self.identifier))

        self.__github = data['github']
        self.__geshi = data['geshi']
        if 'content' in data:
            self.__content = data['content']

        self.__fragmentIds = []
        for fragment in data['fragments']:
            self.__fragmentIds.append(fragment['resource'].replace(const101.url101explorer, ''))
Exemplo n.º 4
0
    def __loadFromWeb(self):
        data = helpers.loadJSONFromUrl(self.path)

        self.__wiki = data['wiki']
        self.__github = data['github']
        self.__headline = data['headline']
        self.__endpoint = data['endpoint']

        self.__memberIds = []
        for id in data['members']:
            if self.identifier == 'namespaces':
                self.__memberIds.append(id['resource'].replace(const101.url101explorer, ''))
            else:
                self.__memberIds.append(id['resource'].replace(const101.url101explorer, ''))
Exemplo n.º 5
0
    def __loadFromWeb(self):
        data = helpers.loadJSONFromUrl(self.__sPath)

        self.__github = data.get('github', None)
        self.__folderIds = []
        for folderId in data.get('folders', []):
            self.__folderIds.append(folderId['resource'].replace(const101.url101explorer, ''))
        self.__fileIds = []
        for fileId in data.get('files', []):
            self.__fileIds.append(fileId['resource'].replace(const101.url101explorer, ''))

        if isinstance(self, Member):
            self.__dict__['_Member__endpoint'] = data['endpoint']
            self.__dict__['_Member__wiki'] = data['wiki']
            self.__dict__['_Member__headline'] = data['headline']
Exemplo n.º 6
0
 def __loadFromWeb(self):
     self.__raw_data = helpers.loadJSONFromUrl(self.path)
Exemplo n.º 7
0
 def __loadFromWeb(self):
     self.__raw_data = helpers.loadJSONFromUrl(self.path)