def getlocations(self): """Get a list of locations from sourcecomments in the PO unit rtype: List return: A list of the locations with '#: ' stripped """ #TODO: rename to .locations return [pocommon.unquote_plus(loc) for loc in self.sourcecomments]
def getlocations(self): """Get a list of locations from sourcecomments in the PO unit rtype: List return: A list of the locations with '#: ' stripped """ locations = [] for sourcecomment in self.sourcecomments: locations += quote.rstripeol(sourcecomment)[3:].split() for i, loc in enumerate(locations): locations[i] = pocommon.unquote_plus(loc) return locations
def getlocations(self): """Get a list of locations from sourcecomments in the PO unit rtype: List return: A list of the locations with '#: ' stripped """ locations = [] for sourcecomment in self.sourcecomments: locations += quote.rstripeol(sourcecomment)[3:].split() for i, loc in enumerate(locations): locations[i] = pocommon.unquote_plus(loc) return locations
def getlocations(self): locations = [] i = 0 location = gpo.po_message_filepos(self._gpo_message, i) while location: locname = gpo.po_filepos_file(location).decode(self.CPO_ENC) locline = gpo.po_filepos_start_line(location) if locline == -1: locstring = locname else: locstring = locname + u":" + unicode(locline) locations.append(pocommon.unquote_plus(locstring)) i += 1 location = gpo.po_message_filepos(self._gpo_message, i) return locations
def getlocations(self): locations = [] i = 0 location = gpo.po_message_filepos(self._gpo_message, i) while location: locname = gpo_decode(gpo.po_filepos_file(location)) locline = gpo.po_filepos_start_line(location) if locline == -1: locstring = locname else: locstring = ":".join([locname, str(locline)]) locations.append(pocommon.unquote_plus(locstring)) i += 1 location = gpo.po_message_filepos(self._gpo_message, i) return locations
def getlocations(self): locations = [] i = 0 location = gpo.po_message_filepos(self._gpo_message, i) while location: locname = gpo_decode(gpo.po_filepos_file(location)) locline = gpo.po_filepos_start_line(location) if locline == -1: locstring = locname else: locstring = u":".join([locname, six.text_type(locline)]) locations.append(pocommon.unquote_plus(locstring)) i += 1 location = gpo.po_message_filepos(self._gpo_message, i) return locations
def roundtrip_quote_plus(text, quoted): quote = pocommon.quote_plus(text) assert quote == quoted unquote = pocommon.unquote_plus(quoted) assert unquote == text
def roundtrip_quote_plus(text, quoted): quote = pocommon.quote_plus(text) assert quote == quoted unquote = pocommon.unquote_plus(quoted) assert unquote == text