#2062: Screen.add_line.get_line_chunks() discards everything before first colour
string.
---------------------+------------------------------------------------------
Reporter: eirikba | Owner:
Type: patch | Status: new
Priority: minor | Milestone: Future
Component: other | Version: git 1.3-stable
Keywords: |
---------------------+------------------------------------------------------
Comment(by Cas):
Does it need such drastic code change, this would be simpler and i think
should work just as well.
{{{
@@ -172,6 +174,9 @@ def get_line_chunks(line):
end = line.find("!}") + 2
color = line[beg:end]
+ if not line.startswith("{!"):
+ # Found text with no color tag
+ chunks.append(('', line[:line.find("{!")]))
line = line[end:]
}}}
> Patch attached that fixes this issue, but also changes the chunking of
'{!1!}1{!2'. The old version would return [('{!1!}', '1'), ('{', '!2')].
The new version returns [('{!1!}', '1'), ('{!2', )].
If both opening and closing braces are not supplied then it is not valid
and I do not think it should be parsed and instead should return an
error/exception.
> On the other hand, both the new and the old chunks '{!a!}a{!}other' to
[('{!a!}', 'a'), ('{!}', 'other')]. I don't know if that's correct either.
This would be valid because '{!}' will match both '{!' and '!}' when
parsing.
--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2062#comment:1>
Deluge <http://deluge-torrent.org/>
Deluge project
--
You received this message because you are subscribed to the Google Groups
"Deluge Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/deluge-dev?hl=en.