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)
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())
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)
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)
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)
def roundtrip_quote_plus(text, quoted): quote = pocommon.quote_plus(text) assert quote == quoted unquote = pocommon.unquote_plus(quoted) assert unquote == text