summaryrefslogtreecommitdiff
path: root/scripts/db_access/client_side_db.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2014-06-05 13:08:59 -0300
committerdrebs <drebs@leap.se>2014-06-05 13:09:39 -0300
commit9a4fd9e1e7580f4f31acbaea7d3315302c01e42e (patch)
treeaf4b4f8c2d24ea13f2f292bc5fa59a65e20535a7 /scripts/db_access/client_side_db.py
parent08a2f350690b3a66212f3d4f63b24b20f682f88e (diff)
Reorganize profiling scripts.
Diffstat (limited to 'scripts/db_access/client_side_db.py')
-rw-r--r--scripts/db_access/client_side_db.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/scripts/db_access/client_side_db.py b/scripts/db_access/client_side_db.py
index 9aadd5fe..6c456c41 100644
--- a/scripts/db_access/client_side_db.py
+++ b/scripts/db_access/client_side_db.py
@@ -15,10 +15,14 @@ import srp._pysrp as srp
import binascii
import logging
+
from leap.common.config import get_path_prefix
from leap.soledad.client import Soledad
+from util import ValidateUserHandle
+
+
# create a logger
logger = logging.getLogger(__name__)
LOG_FORMAT = '%(asctime)s %(message)s'
@@ -118,16 +122,6 @@ def get_soledad_instance(username, provider, passphrase, basedir):
auth_token=token)
-class ValidateUserHandle(argparse.Action):
- def __call__(self, parser, namespace, values, option_string=None):
- m = re.compile('^([^@]+)@([^@]+\.[^@]+)$')
- res = m.match(values)
- if res == None:
- parser.error('User handle should have the form user@provider.')
- setattr(namespace, 'username', res.groups()[0])
- setattr(namespace, 'provider', res.groups()[1])
-
-
# main program
if __name__ == '__main__':