Permalink
Browse files

Merge branch 'master' into no-gevent

  • Loading branch information...
2 parents a8a1cee + c816bd6 commit 189768face01af3b55ed2753165002dfbb7476ab Adam DePrince committed Mar 5, 2013
Showing with 10 additions and 2 deletions.
  1. +9 −1 autosync/daemon.py
  2. +1 −1 setup.py
View
@@ -36,7 +36,7 @@ def joinall(locks):
import autosync.actors.s3
from autosync.files import File
import os.path
-
+import re
import gflags
if use_gevent:
@@ -48,6 +48,8 @@ def joinall(locks):
gflags.DEFINE_string('target_prefix', '', 'The "directory" within the target to write files into')
+gflags.DEFINE_string('source_filter', '^.*$', 'Only accept files that match this regex')
+
gflags.DEFINE_string('source_prefix', None, 'The path to strip from the local file name\' absolute path. This works like s3cmd\'s -P flag or acts like the current directory would when rsyncing, scping or taring non-absolute paths')
gflags.DEFINE_string('actor', 's3', 'The full name of the module and class use to generate a connection to the target. So if you created a connection object called my.foobar.Connection yuo would type --actor=my.foobar.Connection. Moduled included with autosync (i.e. autosync.actors.*.Connection) can be abbreviated with the base module name (i.e. --actor=s3)')
@@ -141,7 +143,13 @@ def filename_to_File(self, path):
class SyncState(State):
+ RE = None
+ def acceptable(self, s):
+ if self.RE is None:
+ self.RE = re.compile(FLAGS.source_filter)
+ return bool(self.RE.match(s))
+
def add_path_to_que(self, path):
self.local_que.put(self.filename_to_File(path))
View
@@ -12,7 +12,7 @@
setup(
name='autosync',
- version='0.0.2',
+ version='0.0.3',
author='Adam DePrince',
author_email='adeprince@nypublicradio.org',
description='Efficent synchronization of the local file system to S3',

0 comments on commit 189768f

Please sign in to comment.