Example #1
0
    def addlocation(self, location):
        """Add a location to sourcecomments in the PO unit

        :param location: Text location e.g. 'file.c:23' does not include #:
        :type location: String

        """
        location = pocommon.quote_plus(location)
        self.sourcecomments.append("#: %s\n" % location)
Example #2
0
    def addlocation(self, location):
        """Add a location to sourcecomments in the PO unit

        @param location: Text location e.g. 'file.c:23' does not include #:
        @type location: String
        """
        if location.find(" ") != -1:
            location = pocommon.quote_plus(location)
        self.sourcecomments.extend(location.split())
Example #3
0
 def addlocation(self, location):
     if location.find(" ") != -1:
         location = pocommon.quote_plus(location)
     parts = location.split(":")
     file = parts[0]
     if len(parts) == 2:
         line = int(parts[1] or "0")
     else:
         line = -1
     gpo.po_message_add_filepos(self._gpo_message, file, line)
Example #4
0
    def addlocation(self, location):
        """Add a location to sourcecomments in the PO unit

        :param location: Text location e.g. 'file.c:23' does not include #:
        :type location: String

        """
        location = data.forceunicode(location)
        location = pocommon.quote_plus(location)
        self.sourcecomments.append("#: %s\n" % location)
Example #5
0
 def addlocation(self, location):
     if location.find(" ") != -1:
         location = pocommon.quote_plus(location)
     parts = location.split(":")
     file = parts[0]
     if len(parts) == 2:
         line = int(parts[1] or "0")
     else:
         line = -1
     gpo.po_message_add_filepos(self._gpo_message, file, line)
Example #6
0
 def addlocation(self, location):
     if location.find(" ") != -1:
         location = pocommon.quote_plus(location)
     parts = location.split(":")
     if len(parts) == 2 and parts[1].isdigit():
         file = parts[0]
         line = int(parts[1] or "0")
     else:
         file = location
         line = -1
     gpo.po_message_add_filepos(self._gpo_message, gpo_encode(file), line)
Example #7
0
 def addlocation(self, location):
     if location.find(" ") != -1:
         location = pocommon.quote_plus(location)
     parts = location.split(":")
     if len(parts) == 2 and parts[1].isdigit():
         file = parts[0]
         line = int(parts[1] or "0")
     else:
         file = location
         line = -1
     gpo.po_message_add_filepos(self._gpo_message, gpo_encode(file), line)
Example #8
0
 def roundtrip_quote_plus(text, quoted):
     quote = pocommon.quote_plus(text)
     assert quote == quoted
     unquote = pocommon.unquote_plus(quoted)
     assert unquote == text
Example #9
0
 def roundtrip_quote_plus(text, quoted):
     quote = pocommon.quote_plus(text)
     assert quote == quoted
     unquote = pocommon.unquote_plus(quoted)
     assert unquote == text