Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a method for line by line asset parsing

  • Loading branch information...
commit 2e9472e4989985ebdb770c193856a02616a3d8e4 1 parent ab2a15e
@hellais hellais authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 plugoo/assets.py
View
11 plugoo/assets.py
@@ -26,6 +26,13 @@ def len(self):
self.fh.seek(0)
return i + 1
+ def parse_line(self, line):
+ """
+ Override this method if you need line
+ by line parsing of an Asset.
+ """
+ return line.replace('\n','')
+
def next_asset(self):
"""
Return the next asset.
@@ -34,7 +41,9 @@ def next_asset(self):
# clean me up please...
line = self.fh.readline()
if line:
- return line.replace('\n','')
+ parsed_line = self.parse_line(line)
+ if parsed_line:
+ return parsed_line
else:
self.fh.seek(0)
raise StopIteration
Please sign in to comment.
Something went wrong with that request. Please try again.