From: <lu...@us...> - 2008-06-23 04:01:06
|
Revision: 197 http://s3tools.svn.sourceforge.net/s3tools/?rev=197&view=rev Author: ludvigm Date: 2008-06-22 21:01:04 -0700 (Sun, 22 Jun 2008) Log Message: ----------- * s3cmd: Don't require $HOME env variable to be set. Fixes #2000133 Modified Paths: -------------- s3cmd/trunk/ChangeLog s3cmd/trunk/s3cmd Modified: s3cmd/trunk/ChangeLog =================================================================== --- s3cmd/trunk/ChangeLog 2008-06-23 03:47:01 UTC (rev 196) +++ s3cmd/trunk/ChangeLog 2008-06-23 04:01:04 UTC (rev 197) @@ -1,5 +1,7 @@ 2008-06-23 Michal Ludvig <mi...@lo...> + * s3cmd: Don't require $HOME env variable to be set. + Fixes #2000133 * s3cmd: Wrapped all execution in a try/except block to catch all exceptions and ask for a report. Modified: s3cmd/trunk/s3cmd =================================================================== --- s3cmd/trunk/s3cmd 2008-06-23 03:47:01 UTC (rev 196) +++ s3cmd/trunk/s3cmd 2008-06-23 04:01:04 UTC (rev 197) @@ -862,7 +862,9 @@ optparser = OptionParser(option_class=OptionMimeType, formatter=MyHelpFormatter()) #optparser.disable_interspersed_args() - optparser.set_defaults(config=os.getenv("HOME")+"/.s3cfg") + if os.getenv("HOME"): + optparser.set_defaults(config=os.getenv("HOME")+"/.s3cfg") + optparser.set_defaults(verbosity = default_verbosity) optparser.add_option( "--configure", dest="run_configure", action="store_true", help="Invoke interactive (re)configuration tool.") @@ -916,6 +918,10 @@ sys.exit(0) ## Now finally parse the config file + if not options.config: + error("Can't find a config file. Please use --config option.") + sys.exit(1) + try: cfg = Config(options.config) except IOError, e: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |