예제 #1
0
def _getUids(value):
    """ must be a string argument"""
    uids = []
    if value.startswith(json._filedata_marker):
        # do not check file data
        return []
    elif value.startswith(json._uid_marker):
        # converted uid
        uids.append(json.decodeUid(value))
    elif 'resolveuid/' in value:
        for match in resolveuid_re.findall(value):
            uids.append(match)
    return uids
예제 #2
0
def _getUids(value):
    """ must be a string argument"""
    uids = []
    if value.startswith(json._filedata_marker):
        # do not check file data
        return []
    elif value.startswith(json._uid_marker):
        # converted uid
        uids.append(json.decodeUid(value))
    elif 'resolveuid/' in value:
        for match in resolveuid_re.findall(value):
            uids.append(match)
    return uids
예제 #3
0
 def _fixUids(self, value):
     """ must be a string argument"""
     if value.startswith(json._filedata_marker):
         # do not check file data
         return value
     elif value.startswith(json._uid_marker):
         # converted uid
         # these may need to be touched
         uid, path = json.decodeUid(value)
         if uid not in self.convertedUids:
             _, realuid, _ = self.touchPath(path, uid)
         else:
             realuid = self.convertedUids[uid]
         return self.uid_cat(UID=realuid)[0].getObject()
     elif 'resolveuid/' in value:
         for uid in resolveuid_re.findall(value):
             if uid in self.convertedUids:
                 value = value.replace('resolveuid/%s' % uid,
                     'resolveuid/%s' % self.convertedUids[uid])
     return value
예제 #4
0
 def _fixUids(self, value):
     """ must be a string argument"""
     if value.startswith(json._filedata_marker):
         # do not check file data
         return value
     elif value.startswith(json._uid_marker):
         # converted uid
         # these may need to be touched
         uid, path = json.decodeUid(value)
         if uid not in self.convertedUids:
             _, realuid, _ = self.touchPath(path, uid)
         else:
             realuid = self.convertedUids[uid]
         return self.uid_cat(UID=realuid)[0].getObject()
     elif 'resolveuid/' in value:
         for uid in resolveuid_re.findall(value):
             if uid in self.convertedUids:
                 value = value.replace(
                     'resolveuid/%s' % uid,
                     'resolveuid/%s' % self.convertedUids[uid])
     return value