Example #1
0
    def _set_num_copies(self):
        from repository.models import git_annex_where_is

        data = git_annex_where_is(self)
        try:
            whereis = json.loads(data)
            self.num_copies = len(whereis[u'whereis'])
        except ValueError:
            self.num_copies = 1
Example #2
0
 def _set_num_copies(self):
     from repository.models import git_annex_where_is
     
     data = git_annex_where_is(self)
     try:
         whereis = json.loads(data)
         self.num_copies = len(whereis[u'whereis'])
     except ValueError:
         self.num_copies = 1
Example #3
0
    def where_is(self):
        from repository.models import git_annex_where_is

        data = git_annex_where_is(self)
        whereis = json.loads(data)

        index = 0
        for item in whereis["whereis"]:
            # strip [ or ]  (prevent errors of getting mucuas address like [dpadua])
            mucua_name = re.sub("[\[\]]", "", item["description"]).split(" ")[0]
            whereis["whereis"][index]["description"] = mucua_name
            index += 1

        return whereis
Example #4
0
    def where_is(self):
        from repository.models import git_annex_where_is

        data = git_annex_where_is(self)
        whereis = json.loads(data)

        index = 0
        for item in whereis['whereis']:
            # strip [ or ]  (prevent errors of getting mucuas address like [dpadua])
            mucua_name = re.sub("[\[\]]", "",
                                item['description']).split(' ')[0]
            whereis['whereis'][index]['description'] = mucua_name
            index += 1

        return whereis
Example #5
0
 def where_is(self):
     from repository.models import git_annex_where_is
     
     data = git_annex_where_is(self)
     try:
         whereis = json.loads(data)
     except ValueError:
         logger.debug("Data error " + data)
         whereis = { 'whereis': [] }
     
     index = 0
     for item in whereis['whereis']:
         # strip [ or ]  (prevent errors of getting mucuas address like [dpadua])
         mucua_name = re.sub("[\[\]]", "", item['description']).split(' ')[0]
         whereis['whereis'][index]['description'] = mucua_name
         index += 1
     
     return whereis
Example #6
0
 def where_is(self):
     from repository.models import git_annex_where_is
     return git_annex_where_is(self)
Example #7
0
 def _set_num_copies(self):
     from repository.models import git_annex_where_is
     import json
     data = git_annex_where_is(self)
     whereis = json.loads(data)
     self.num_copies = len(whereis[u'whereis'])
Example #8
0
 def where_is(self):
     from repository.models import git_annex_where_is
     return git_annex_where_is(self)
Example #9
0
 def _set_num_copies(self):        
     from repository.models import git_annex_where_is
     import json
     data = git_annex_where_is(self)
     whereis = json.loads(data)
     self.num_copies = len(whereis[u'whereis'])