[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pywikipediabot-users
Subject:    Re: [Pywikipedia-l] Display of help
From:       Bináris <wikiposta () gmail ! com>
Date:       2012-01-29 20:56:46
Message-ID: CAD0L+c9aDfX52cBjR5M=hO0P=CxfFUUD1OhNCwBuoNQAvC+aGA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


2012/1/29 Merlijn van Deen <valhallasw@arctus.nl>

>
> Which is incredibly weird, considering the try-except block is inside
> showHelp, which is a line *above* the sys.exit().
>
I realized that myself after sending mail. :-)

>
> Possibly the problem is caused by a double import
>
Exactly that's what happened!


> The solution would then be to make sure pywikibot.handleArgs() is only
> called when the script runs from the command like (i.e. use a
> __name__=="__main__" block).
>
Thank you, this solved the problem finally! I had this block but I didn't
know that handleArgs  had to be there. Now I understand.

-- 
Bináris

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">2012/1/29 Merlijn van Deen <span dir="ltr">&lt;<a \
href="mailto:valhallasw@arctus.nl">valhallasw@arctus.nl</a>&gt;</span><br><blockquote \
class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <div class="gmail_quote"><br><div>Which is \
incredibly weird, considering the try-except block is inside showHelp, which is a \
line <i>above</i> the sys.exit(). </div></div></blockquote><div>I realized that \
myself after sending mail. :-) <br> </div><blockquote class="gmail_quote" \
style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div class="gmail_quote">

<div><br></div><div>Possibly the problem is caused by a double import \
</div></div></blockquote><div>Exactly that&#39;s what happened!<br> </div><blockquote \
class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <div class="gmail_quote">The solution would then \
be to make sure pywikibot.handleArgs() is only called when the script runs from the \
command like (i.e. use a __name__==&quot;__main__&quot; block).

</div></blockquote><div>Thank you, this solved the problem finally! I had this block \
but I didn&#39;t know that handleArgs  had to be there. Now I \
understand.<br></div></div><br>-- <br>Bináris<br>



_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic