Commit c3e9f21a authored by Marc Betoule's avatar Marc Betoule
Browse files

Bug fix, in directive: processing only commented lines, and catch parsing errors

parent 98599360
...@@ -2,7 +2,10 @@ import shlex ...@@ -2,7 +2,10 @@ import shlex
class Directive: class Directive:
def parse(self, code): def parse(self, code):
l = shlex.split(code) try:
l = shlex.split(code)
except ValueError:
raise StopIteration()
it = iter(l) it = iter(l)
if it.next() != self._name: if it.next() != self._name:
raise StopIteration() raise StopIteration()
......
...@@ -67,7 +67,7 @@ class Repository: ...@@ -67,7 +67,7 @@ class Repository:
c = self.get_code_string(seg) c = self.get_code_string(seg)
d = Direct() d = Direct()
for l in c.splitlines(): for l in c.splitlines():
if c[0] = "#": if c[0] == "#":
continue continue
try: try:
d.parse(l) d.parse(l)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment