Skip to content

Commit

Permalink
2007-08-14 Michal Ludvig <michal@logix.cz>
Browse files Browse the repository at this point in the history
	* setup.py, S3/Utils.py: Try import xml.etree.ElementTree
	  or elementtree.ElementTree module.



git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@141 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information
mludvig committed Aug 14, 2007
1 parent 18c4a15 commit 7bae4e1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2007-08-14 Michal Ludvig <michal@logix.cz>

* setup.py, S3/Utils.py: Try import xml.etree.ElementTree
or elementtree.ElementTree module.

2007-08-14 Michal Ludvig <michal@logix.cz>

* s3cmd.1: Add info about --encrypt parameter.
Expand Down
5 changes: 5 additions & 0 deletions S3/Utils.py
Expand Up @@ -11,6 +11,11 @@
import random
import md5

try:
import xml.etree.ElementTree as ET
except ImportError:
import elementtree.ElementTree as ET

def parseNodes(nodes, xmlns = ""):
retval = []
for node in nodes:
Expand Down
16 changes: 11 additions & 5 deletions setup.py
Expand Up @@ -10,12 +10,18 @@
sys.exit(1)

try:
import elementtree.ElementTree as ET
import xml.etree.ElementTree as ET
print "Using xml.etree.ElementTree for XML processing"
except ImportError, e:
sys.stderr.write(e.message + "\n")
sys.stderr.write("Please upgrade to Python 2.5 or install ElementTree module\n")
sys.stderr.write("from http://effbot.org/zone/element-index.htm\n")
sys.exit(1)
sys.stderr.write(str(e) + "\n")
try:
import elementtree.ElementTree as ET
print "Using elementtree.ElementTree for XML processing"
except ImportError, e:
sys.stderr.write(str(e) + "\n")
sys.stderr.write("Please install ElementTree module from\n")
sys.stderr.write("http://effbot.org/zone/element-index.htm\n")
sys.exit(1)

try:
## Remove 'MANIFEST' file to force
Expand Down

0 comments on commit 7bae4e1

Please sign in to comment.