Permalink
Browse files

Fixes #8

  • Loading branch information...
1 parent 98c25b8 commit 3f95a6847a21fa0198e7f9b5e1cd57dced76b7b8 Adam DePrince committed Mar 13, 2013
Showing with 8 additions and 0 deletions.
  1. +5 −0 autosync/actors/s3.py
  2. +3 −0 autosync/daemon.py
@@ -19,6 +19,11 @@ def __init__(self, connection, container_name, prefix):
return
except S3ResponseError:
self.container = self.connection.create_bucket(container_name)
+
+ @staticmethod
+ def validate_flags():
+ """Return a string error message if there is a problem with a flag"""
+ return None
def list(self):
return (RemoteFile(obj.key, obj.size, obj.etag.replace('"', '')) for obj in self.container.list(prefix=self.prefix))
View
@@ -276,6 +276,9 @@ def main(argv = None, stdin = None, stdout=None, stderr=None, actor=None):
return 1
def actor_factory(actor=actor):
+ error = actor.validate_flags()
+ if error:
+ print >>stderr, "%s\nUsage: %s ARGS\\n%s" % (error, sys.argv[0], FLAGS)
if not actor:
if FLAGS.actor in ACTOR_CONNECTION_FACTORIES:
actor = ACTOR_CONNECTION_FACTORIES[FLAGS.actor]

0 comments on commit 3f95a68

Please sign in to comment.