Browse Source

0.3.8

write_txt added
pysitemap-python-2.7
Kamo Petrosyan 9 years ago
parent
commit
e484c6d05a
2 changed files with 11 additions and 1 deletions
  1. +10
    -0
      pysitemap/crawler.py
  2. +1
    -1
      setup.py

+ 10
- 0
pysitemap/crawler.py View File

@ -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('</urlset>')
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()

+ 1
- 1
setup.py View File

@ -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,


Loading…
Cancel
Save