diff options
author | Florent Pigout <florent.pigout@gmail.com> | 2011-12-17 13:44:14 (GMT) |
---|---|---|
committer | Florent Pigout <florent.pigout@gmail.com> | 2011-12-17 13:44:14 (GMT) |
commit | b60ebb27b6cac928dc08fa31fbda806cf2621b10 (patch) | |
tree | c1b3aaf6235283d2720b161d716b58555f4d5cb2 |
initial commit with dummy test and modular method way purpose
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | datastore_reader/datastore_reader.py | 31 | ||||
-rw-r--r-- | setup.py | 20 |
3 files changed, 56 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee93d73 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +syntax: glob +*.pyc +*.swp +*.py~ +data/ diff --git a/datastore_reader/datastore_reader.py b/datastore_reader/datastore_reader.py new file mode 100644 index 0000000..55d6d49 --- /dev/null +++ b/datastore_reader/datastore_reader.py @@ -0,0 +1,31 @@ +import os + + +def extract(file_path): + os.chdir(config.input_path) + # unzip + f = tarfile.open(file_path) + # get input file name + _in_file_name = f.getnames()[0] + f.extractall() + f.close() + + +def list_datastores(working_dir=None): + """Returns a dict of datastores from the working dir, + ex.: {'kevin': '/somewhere/here'} + + Returns None if no working dir. + + :param working_dir: for testing issue otherwise use the value from + the config file. + + >>> list_datastores() + + """ + return None + + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..1e048ef --- /dev/null +++ b/setup.py @@ -0,0 +1,20 @@ +# setuptools import +from setuptools import setup, find_packages + +setup(name="datastore-reader", + version="0.1", + description="Sugar DS reader for backup analysis", + long_description=""" + """, + author="Florent Pigout", + author_email="florent@toopy.org", + url="", + license='MIT', + install_requires = [ + ], + packages = find_packages(), + include_package_data=True, + zip_safe=False, + classifiers = [ + ], + ) |