Permalink
Browse files

* S3/Utils.py, S3/S3Uri.py: Fixed names after moving

	  functions between modules.



git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@419 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information...
1 parent 121face commit 618918cee0f4056df92062a47e19bbdaa6a327d8 ludvigm committed Jul 7, 2010
Showing with 17 additions and 12 deletions.
  1. +5 −0 ChangeLog
  2. +2 −2 S3/S3Uri.py
  3. +10 −10 S3/Utils.py
View
5 ChangeLog
@@ -1,3 +1,8 @@
+2010-07-08 Michal Ludvig <mludvig@logix.net.nz>
+
+ * S3/Utils.py, S3/S3Uri.py: Fixed names after moving
+ functions between modules.
+
2010-06-29 Timothee Groleau <kde@timotheegroleau.com>
* S3/ACL.py: Fix isAnonRead method on Grantees
View
4 S3/S3Uri.py
@@ -9,7 +9,7 @@
from BidirMap import BidirMap
from logging import debug
import S3
-from Utils import unicodise
+from Utils import unicodise, check_bucket_name_dns_conformity
class S3Uri(object):
type = None
@@ -73,7 +73,7 @@ def uri(self):
return "/".join(["s3:/", self._bucket, self._object])
def is_dns_compatible(self):
- return S3.S3.check_bucket_name_dns_conformity(self._bucket)
+ return check_bucket_name_dns_conformity(self._bucket)
def public_url(self):
if self.is_dns_compatible():
View
20 S3/Utils.py
@@ -324,34 +324,34 @@ def check_bucket_name(bucket, dns_strict = True):
if dns_strict:
invalid = re.search("([^a-z0-9\.-])", bucket)
if invalid:
- raise ParameterError("Bucket name '%s' contains disallowed character '%s'. The only supported ones are: lowercase us-ascii letters (a-z), digits (0-9), dot (.) and hyphen (-)." % (bucket, invalid.groups()[0]))
+ raise Exceptions.ParameterError("Bucket name '%s' contains disallowed character '%s'. The only supported ones are: lowercase us-ascii letters (a-z), digits (0-9), dot (.) and hyphen (-)." % (bucket, invalid.groups()[0]))
else:
invalid = re.search("([^A-Za-z0-9\._-])", bucket)
if invalid:
- raise ParameterError("Bucket name '%s' contains disallowed character '%s'. The only supported ones are: us-ascii letters (a-z, A-Z), digits (0-9), dot (.), hyphen (-) and underscore (_)." % (bucket, invalid.groups()[0]))
+ raise Exceptions.ParameterError("Bucket name '%s' contains disallowed character '%s'. The only supported ones are: us-ascii letters (a-z, A-Z), digits (0-9), dot (.), hyphen (-) and underscore (_)." % (bucket, invalid.groups()[0]))
if len(bucket) < 3:
- raise ParameterError("Bucket name '%s' is too short (min 3 characters)" % bucket)
+ raise Exceptions.ParameterError("Bucket name '%s' is too short (min 3 characters)" % bucket)
if len(bucket) > 255:
- raise ParameterError("Bucket name '%s' is too long (max 255 characters)" % bucket)
+ raise Exceptions.ParameterError("Bucket name '%s' is too long (max 255 characters)" % bucket)
if dns_strict:
if len(bucket) > 63:
- raise ParameterError("Bucket name '%s' is too long (max 63 characters)" % bucket)
+ raise Exceptions.ParameterError("Bucket name '%s' is too long (max 63 characters)" % bucket)
if re.search("-\.", bucket):
- raise ParameterError("Bucket name '%s' must not contain sequence '-.' for DNS compatibility" % bucket)
+ raise Exceptions.ParameterError("Bucket name '%s' must not contain sequence '-.' for DNS compatibility" % bucket)
if re.search("\.\.", bucket):
- raise ParameterError("Bucket name '%s' must not contain sequence '..' for DNS compatibility" % bucket)
+ raise Exceptions.ParameterError("Bucket name '%s' must not contain sequence '..' for DNS compatibility" % bucket)
if not re.search("^[0-9a-z]", bucket):
- raise ParameterError("Bucket name '%s' must start with a letter or a digit" % bucket)
+ raise Exceptions.ParameterError("Bucket name '%s' must start with a letter or a digit" % bucket)
if not re.search("[0-9a-z]$", bucket):
- raise ParameterError("Bucket name '%s' must end with a letter or a digit" % bucket)
+ raise Exceptions.ParameterError("Bucket name '%s' must end with a letter or a digit" % bucket)
return True
__all__.append("check_bucket_name")
def check_bucket_name_dns_conformity(bucket):
try:
return check_bucket_name(bucket, dns_strict = True)
- except ParameterError:
+ except Exceptions.ParameterError:
return False
__all__.append("check_bucket_name_dns_conformity")

0 comments on commit 618918c

Please sign in to comment.