Permalink
Browse files

2007-03-26 Michal Ludvig <michal@logix.cz>

	* setup.py, S3/PkgInfo.py: Move package info out of setup.py
	* s3cmd: new parameter --version



git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@106 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information...
1 parent 72d9ddf commit 747ddb2a031e760673f02d189a9c1d72702f68bd @mludvig mludvig committed Mar 26, 2007
Showing with 37 additions and 15 deletions.
  1. +2 −0 ChangeLog
  2. +11 −0 S3/PkgInfo.py
  3. +13 −5 s3cmd
  4. +11 −10 setup.py
View
@@ -1,5 +1,7 @@
2007-03-26 Michal Ludvig <michal@logix.cz>
+ * setup.py, S3/PkgInfo.py: Move package info out of setup.py
+ * s3cmd: new parameter --version
* s3cmd, S3/S3Uri.py: Output public HTTP URL for objects
stored with Public ACL.
View
@@ -0,0 +1,11 @@
+package = "s3cmd"
+version = "0.9.1"
+url = "http://s3tools.logix.cz"
+license = "GPL version 2"
+short_description = "S3cmd is a tool for managing Amazon S3 storage space."
+long_description = """
+S3cmd lets you copy files from/to Amazon S3
+(Simple Storage Service) using a simple to use
+command line client.
+"""
+
View
18 s3cmd
@@ -18,6 +18,7 @@ import elementtree.ElementTree as ET
from S3.S3 import *
from S3.Config import Config
from S3.S3Uri import *
+import S3.PkgInfo
def output(message):
print message
@@ -120,7 +121,7 @@ def cmd_object_put(args):
error("Alternatively use --force argument and the specified")
error("object name will be prefixed to all stored filenames.")
sys.exit(1)
-
+
for file in files:
uri_arg_final = str(uri)
if len(files) > 1 or uri.object() == "":
@@ -269,11 +270,11 @@ if __name__ == '__main__':
default_verbosity = Config().verbosity
optparser = OptionParser(option_class=OptionMimeType, formatter=MyHelpFormatter())
#optparser.disable_interspersed_args()
+
optparser.set_defaults(config=os.getenv("HOME")+"/.s3cfg")
- optparser.add_option("-c", "--config", dest="config", metavar="FILE", help="Config file name. Defaults to %default")
optparser.set_defaults(verbosity = default_verbosity)
- optparser.add_option("-d", "--debug", dest="verbosity", action="store_const", const=logging.DEBUG, help="Enable debug output.")
- optparser.add_option("-v", "--verbose", dest="verbosity", action="store_const", const=logging.INFO, help="Enable verbose output.")
+
+ optparser.add_option("-c", "--config", dest="config", metavar="FILE", help="Config file name. Defaults to %default")
optparser.add_option("-H", "--human-readable-sizes", dest="human_readable_sizes", action="store_true", help="Print sizes in human readable form.")
optparser.add_option("-f", "--force", dest="force", action="store_true", help="Force overwrite and other dangerous operations.")
optparser.add_option("-u", "--show-uri", dest="show_uri", action="store_true", help="Show complete S3 URI in listings.")
@@ -282,21 +283,28 @@ if __name__ == '__main__':
optparser.add_option("-M", "--guess-mime-type", dest="guess_mime_type", action="store_true", help="Guess MIME-type of files by their extension. Falls back to default MIME-Type as specified by --mime-type option")
optparser.add_option( "--dump-config", dest="dump_config", action="store_true", help="Dump current configuration after parsin config files and command line options and exit.")
optparser.add_option( "--configure", dest="run_configure", action="store_true", help="Invoke interactive (re)configuration tool.")
+ optparser.add_option("-d", "--debug", dest="verbosity", action="store_const", const=logging.DEBUG, help="Enable debug output.")
+ optparser.add_option("-v", "--verbose", dest="verbosity", action="store_const", const=logging.INFO, help="Enable verbose output.")
+ optparser.add_option( "--version", dest="show_version", action="store_true", help="Show s3cmd version (%s) and exit." % (S3.PkgInfo.version))
optparser.set_usage(optparser.usage + " COMMAND [parameters]")
optparser.set_description('S3cmd is a tool to manage objects in '+
'Amazon S3 storage. It allows for making and removing '+
'"buckets" and uploading, downloading and removing '+
'"objects" from these buckets.')
optparser.epilog = format_commands(optparser.get_prog_name())
- optparser.epilog += '\nSee program homepage for more information at\nhttp://www.logix.cz/michal/devel/s3tools\n'
+ optparser.epilog += ("\nSee program homepage for more information at\n%s\n" % S3.PkgInfo.url)
(options, args) = optparser.parse_args()
## Some mucking with logging levels to enable
## debugging/verbose output for config file parser on request
logging.basicConfig(level=options.verbosity, format='%(levelname)s: %(message)s')
+ if options.show_version:
+ output("s3cmd version %s" % S3.PkgInfo.version)
+ sys.exit(0)
+
## Now finally parse the config file
try:
cfg = Config(options.config)
View
@@ -1,31 +1,32 @@
from distutils.core import setup
import os
+import S3.PkgInfo
+
try:
os.unlink("MANIFEST")
except:
pass
-setup(name = "s3cmd",
+setup(
## Content description
- version = "0.9.1",
+ name = S3.PkgInfo.package,
+ version = S3.PkgInfo.version,
packages = [ 'S3' ],
scripts = ['s3cmd'],
data_files = [ ("share/s3cmd", [ "README", "INSTALL", "NEWS" ]), ],
## Packaging details
author = "Michal Ludvig",
author_email = "michal@logix.cz",
- url = 'http://s3tools.sourceforge.net',
- license = 'GPL version 2',
- description = 'S3cmd is a tool for managing your Amazon S3 storage.',
+ url = S3.PkgInfo.url,
+ license = S3.PkgInfo.license,
+ description = S3.PkgInfo.short_description,
long_description = """
-S3cmd lets you copy files from/to Amazon S3
-(Simple Storage Service) using a simple to use
-command line client.
+%s
Authors:
--------
- Michal Ludvig <michal@logix.cz>
-""",
+ Michal Ludvig <michal@logix.cz>
+""" % (S3.PkgInfo.long_description)
)

0 comments on commit 747ddb2

Please sign in to comment.