diff options
author | Auke Booij (tulcod) <auke@tulcod.com> | 2010-06-26 00:38:21 +0200 |
---|---|---|
committer | Auke Booij (tulcod) <auke@tulcod.com> | 2010-06-26 00:38:21 +0200 |
commit | c8d93826d032d7e55d10e4b82d5a2b8bba211320 (patch) | |
tree | 5f459e5bf26e1acad406d410211a8ccb536fafd3 /g_cran/filetricks.py | |
parent | What a shameful commit, putting my home directory out there just like that. (diff) | |
download | g-cran-c8d93826d032d7e55d10e4b82d5a2b8bba211320.tar.gz g-cran-c8d93826d032d7e55d10e4b82d5a2b8bba211320.tar.bz2 g-cran-c8d93826d032d7e55d10e4b82d5a2b8bba211320.zip |
Prepare for packaging with distutils
Diffstat (limited to 'g_cran/filetricks.py')
-rw-r--r-- | g_cran/filetricks.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/g_cran/filetricks.py b/g_cran/filetricks.py new file mode 100644 index 0000000..e42e059 --- /dev/null +++ b/g_cran/filetricks.py @@ -0,0 +1,15 @@ +#!/usr/bin/python +class EmptyLinesFile: + def __init__(self,myfile): + self.file=myfile + self.eof=False + self.lines=self.generate_lines() + def generate_lines(self,size=-1): + for line in self.file: + yield line + self.eof=True + def readline(self): + try: + return self.lines.next() + except StopIteration: + return '' |