Esempio n. 1
0
    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]
Esempio n. 2
0
    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
Esempio n. 3
0
    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
Esempio n. 4
0
 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
Esempio n. 5
0
 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
Esempio n. 6
0
 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
Esempio n. 7
0
 def roundtrip_quote_plus(text, quoted):
     quote = pocommon.quote_plus(text)
     assert quote == quoted
     unquote = pocommon.unquote_plus(quoted)
     assert unquote == text
Esempio n. 8
0
 def roundtrip_quote_plus(text, quoted):
     quote = pocommon.quote_plus(text)
     assert quote == quoted
     unquote = pocommon.unquote_plus(quoted)
     assert unquote == text