Python script prob - Google Sitemap Generator
Posted by: mahalie
Posted on: 2005-06-03 18:20:00
I'm trying to setup and use Google's new sitemap generator. (It was just released yesterday - here's the 'help' page: https://www.google.com/webmasters/sitemaps/docs/en/sitemap-generator.html).
It is just a python script and that calls a config file. I don't seem to be getting the script to recognize the config file. The instructions from google are to enter this line (while I'm SSH'ed in):
$ python sitemap_gen.py --config=/path/config.xml
I have the .py file and the .xml file in my general directory, that is... home/username/ and I have entered both
$ python sitemap_gen.py --config=/home/username/config.xml
and
$ python sitemap_gen.py --config=config.xml
since both files are in the same directory, and the one I'm running the script from.
I'm a total n00b at running scripts and unix commands in general. Through a little trial and error though, it would seem the script is excecuting as other things I've tried don't return anything. Here's what I'm getting:
mahalie@narcissus:~$ python sitemap_gen.py --config=config.xml
sitemap_gen.py:543: SyntaxWarning: local name 'consumer' in 'ProduceURLs' shadows use of 'consumer' as global in nested scope 'PerFile'
def ProduceURLs(self, consumer):
sitemap_gen.py:543: SyntaxWarning: local name 'root_path' in 'ProduceURLs' shadows use of 'root_path' as global in nested scope 'PerFile'
def ProduceURLs(self, consumer):
sitemap_gen.py:543: SyntaxWarning: local name 'root_URL' in 'ProduceURLs' shadows use of 'root_URL' as global in nested scope 'PerFile'
def ProduceURLs(self, consumer):
Traceback (most recent call last):
File "sitemap_gen.py", line 203, in ?
class URL(object):
NameError: name 'object' is not defined
Just to offer up thorough info - I searched the Knowledge base and did CHMOD 755 the .py file, and the .xml file just for kicks. Since I've tried running the command without the --config parameter and recieved the same error, it doesn't seem to be a problem with the paramaters set forth in the config.xml file either.
Any help would be MOST appreciated. I'm trying to write a step-by-step tutorial for using the Google Sitemap Generator (obviously not because I'm qualified to) because I think a lot of people will want to use it. Thank You!
mail[at]mahalie[dot]com