only call main() when __name__ == "__main__"

This commit is contained in:
Alex Schroeder
2006-02-26 02:00:32 +00:00
parent e9ae052dad
commit f74cfbe3e3
3 changed files with 7 additions and 4 deletions

View File

@@ -91,4 +91,5 @@ def parse_wiki_location(where):
(scheme, host, path, params, query, fragment) = urlparse.urlparse(where)
return (host, path+params, query)
main()
if __name__ == "__main__":
main()

View File

@@ -105,4 +105,5 @@ def parse_wiki_location(where):
path = "/".join(list)
return (host, path+params, query)
main()
if __name__ == "__main__":
main()

View File

@@ -19,7 +19,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# $Id: wikiupload,v 1.4 2005/07/25 12:33:03 as Exp $
# $Id: wikiupload,v 1.5 2006/02/26 02:00:54 as Exp $
import mimetypes, httplib, urllib, re, urlparse, sys, getopt
from time import time
@@ -141,4 +141,5 @@ def parse_wiki_location(where):
path = "/".join(list)
return (host, path+params, query)
main()
if __name__ == "__main__":
main()