コード例 #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]
コード例 #2
0
ファイル: pypo.py プロジェクト: cc-archive/pootle
    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
コード例 #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
コード例 #4
0
ファイル: cpo.py プロジェクト: flyeven/translate
 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
コード例 #5
0
ファイル: cpo.py プロジェクト: cuonganh/translate
 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
コード例 #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
コード例 #7
0
 def roundtrip_quote_plus(text, quoted):
     quote = pocommon.quote_plus(text)
     assert quote == quoted
     unquote = pocommon.unquote_plus(quoted)
     assert unquote == text
コード例 #8
0
ファイル: test_pocommon.py プロジェクト: onia/translate
 def roundtrip_quote_plus(text, quoted):
     quote = pocommon.quote_plus(text)
     assert quote == quoted
     unquote = pocommon.unquote_plus(quoted)
     assert unquote == text