diff --git a/pysitemap/crawler.py b/pysitemap/crawler.py index 09e5dcf..6608dfa 100644 --- a/pysitemap/crawler.py +++ b/pysitemap/crawler.py @@ -56,6 +56,8 @@ class Crawler: self.parse() if self.oformat == 'xml': self.write_xml() + elif self.oformat == 'txt': + self.write_txt() def parse_gevent(self): self.parse() @@ -120,4 +122,12 @@ class Crawler: of.write(url_str.format(self.visited.pop())) of.write('') + of.close() + + def write_txt(self): + of = open(self.outputfile, 'w') + url_str = '{}\n' + while self.visited: + of.write(url_str.format(self.visited.pop())) + of.close() \ No newline at end of file diff --git a/setup.py b/setup.py index c94073b..b4c0397 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( version=get_version( major=0, minor=3, - build=7, + build=8, ), packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES), include_package_data=True,