summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* new function combox.file.rm_dirSiddharth Ravikumar2015-03-042-0/+18
| | | | | | | also wrote test for it. modified: combox/file.py modified: tests/file_test.py
* updated TODO.orgSiddharth Ravikumar2015-03-041-2/+4
|
* combox/events.py: fixed the silo bug.Siddharth Ravikumar2015-03-041-3/+16
| | | | | | | | In both the ComboxDirMonitor and the NodeDirMonitor all the methods -- housekeep, on_created, on_moved, on_deleted, on_modified -- called the silo_update method before doing anything. The silo_update() method re-reads the silo from disk.
* updated TODO.orgSiddharth Ravikumar2015-02-261-0/+6
|
* added TODO.org - moved combox TODO here.Siddharth Ravikumar2015-02-261-0/+39
|
* fleshed out the NodeDirMonitor's on_modified method + wrote tests for it.Siddharth Ravikumar2015-02-262-2/+64
| | | | | modified: combox/events.py modified: tests/events_test.py
* updated tests.utils.shardedp - nows additionally checks if shard exists.Siddharth Ravikumar2015-02-261-1/+1
|
* modded combox.file.hash_file function -- added new arg `file_content'Siddharth Ravikumar2015-02-262-4/+9
| | | | | | | | | | - `file_content' is set to None by default - If `file_content' is not None, hash of this is returned. Updated the test for hash_file function. modified: combox/file.py modified: tests/file_test.py
* updated combox.silo.ComboxSilo.stale method - added new arg fhashSiddharth Ravikumar2015-02-262-4/+7
| | | | | | | | - the arg `fhash' is set to None by default. - if `fhash' is not None, it is considered as file's current hash. modified: combox/silo.py modified: tests/silo_test.py
* updated tests.crypto_test.TestCrypto.test_convenience_cryptoSiddharth Ravikumar2015-02-261-1/+5
| | | | | Added code to test the new arg `write' in the decrypt_and_glue function.
* modded combox.crypto.decrypt_and_glue - added new arg called `write'Siddharth Ravikumar2015-02-261-4/+7
| | | | | - 'write' is set to True by set default. - If `write' is set, then the reconstructed file content is written to disk.
* updated combox.events.ComboxDirMonitor.on_create methodSiddharth Ravikumar2015-02-251-3/+6
| | | | | | | | Now the file shards or directory is created in the node directories only if they don't already exist; if they exist that means this file was created from another computer (also running combox). modified: combox/events.py
* tests/file_test.py: corrected typo in the docstring of test_cbpath method.Siddharth Ravikumar2015-02-251-1/+1
|
* new function combox.file.node_path.Siddharth Ravikumar2015-02-252-0/+41
| | | | | | | | | | | | | This function takes the path to the file in the combox and returns the path of its first shard in the node directory. If the the given argument is a directory (inside the combox directory), the function returns the corresponding path of the directory under the first node directory. Test for the function was also written. modified: combox/file.py modified: tests/file_test.py
* New combox.events.NodeDirMonitor class defined.Siddharth Ravikumar2015-02-202-8/+134
| | | | | | | | | | At the moment only the on_created method of this class is kinda fleshed out. The tests for this class is at tests.events_test.TestEvents.test_NDM modified: combox/events.py modified: tests/events_test.py
* modded tests/events_test.TestEvents.teardown methodSiddharth Ravikumar2015-02-201-1/+3
| | | | This method now checks if the `silo.db' exists before deleting it.
* Refactored combox.crypto.split_and_encrypt function.Siddharth Ravikumar2015-02-201-5/+12
| | | | Now it accepts an optional third argument `fcontent' (defaults to None) which contains the contents of the file `fpath'.
* Refactored combox.file.cb_path to accept a file or a directory under a node ↵Siddharth Ravikumar2015-02-202-6/+23
| | | | | | | | | | | directory. It returns the path of the respective file or directory in the combox directory. Also updated the test for this function at tests.file_test.TestFile.test_cbpath modified: combox/file.py modified: tests/file_test.py
* combox/events.py: now the silo.db is purged after every test method in ↵Siddharth Ravikumar2015-02-191-7/+2
| | | | EventsTest class.
* tests/events_test.py: defined teardown method in TestEvents class.Siddharth Ravikumar2015-02-191-1/+7
| | | | | - The teardown method is invoked after the end of each test in the TestEvents class. - At the moment the teardown method just purges the node directories.
* tests/utils.py: modded `rm_nodedirs' and defined new function 'purge_nodedirs'Siddharth Ravikumar2015-02-191-2/+10
| | | | | - rm_nodedirs now calls purge_nodedirs and then deletes the node directories. - purge_nodedirs function just purges the contents of the node directories.
* combox/crypto.py: corrected typo in docstring of decrypt_and_glue function.Siddharth Ravikumar2015-02-191-1/+1
|
* Defined new function in combox.file.cb_pathSiddharth Ravikumar2015-02-192-0/+20
| | | | | | | | | | This function, given the path of a file shard, returns the corresponding path of the file in the combox directory. The test for this function is at tests.file_test.TestFile.test_cbpath modified: combox/file.py modified: tests/file_test.py
* tests/file_test.py: in test_relativepath method path.join is used to ↵Siddharth Ravikumar2015-02-191-3/+2
| | | | construct pathnames.
* modded combox.file.relative_path function.Siddharth Ravikumar2015-02-192-7/+34
| | | | | | | | | | Now the function is rigged up to return path relative to both combox directory and node directory. Corresponding test for this function is at tests.file_test module. modified: combox/file.py modified: tests/file_test.py
* updated .gitignoreSiddharth Ravikumar2015-02-181-5/+1
|
* All the test classes now call rm_configdir() in their teardown method.Siddharth Ravikumar2015-02-185-5/+11
| | | | | | | | modified: tests/config_test.py modified: tests/crypto_test.py modified: tests/events_test.py modified: tests/file_test.py modified: tests/silo_test.py
* tests/utils.py: added rm_configdir functionSiddharth Ravikumar2015-02-181-0/+10
| | | | | rm_configdir() will be used to remove the test-config/ directory and will be called in all teardown methods of Test classes.
* All the tests now remove the node directories (tests/shard-dir-0 & ↵Siddharth Ravikumar2015-02-137-5/+12
| | | | | | | | | | | | | tests/shard-dir-1) in the teardown method. modified: tests/config_test.py modified: tests/crypto_test.py modified: tests/events_test.py modified: tests/file_test.py modified: tests/silo_test.py deleted: tests/shard-dir-0/.foo deleted: tests/shard-dir-1/.foo
* tests/utils.py: added new function rm_nodedirs.Siddharth Ravikumar2015-02-131-1/+12
| | | | | rm_nodedirs purges the node directories. This function will be used later to remove the test node directories.
* tests/crypto_test.py & tests/file_test.py - corrected typos in doctstrings.Siddharth Ravikumar2015-02-132-2/+2
|
* tests/config_test.py: config.yaml file is purged after all the tests.Siddharth Ravikumar2015-02-131-5/+3
|
* removed tests/test-config/config.yaml - no longer needed.Siddharth Ravikumar2015-02-131-13/+0
|
* tests/silo_test.py: re-wrote it.Siddharth Ravikumar2015-02-131-45/+58
| | | | Now the test is in a Test class with proper setup and teardown methods.
* tests/events_test.py: now teardown purges the shards of TEST_FILESiddharth Ravikumar2015-02-131-0/+2
|
* tests/events_test.py: corrected typo in docstring.Siddharth Ravikumar2015-02-131-1/+1
|
* tests/events_test.py: re-wrote itSiddharth Ravikumar2015-02-121-237/+187
| | | | | | | - Now the test is in a Test class with proper setup and teardown methods. - Utility functions were removed; these utility function were added to tests/utils.py module (see previous commit).
* tests/utils.py: copied the utility functions in tests/events_test.py to this ↵Siddharth Ravikumar2015-02-121-2/+81
| | | | | | module. These utility functions will be deleted from tests/events_test.py
* tests/crypto_test.py: re-wrote it.Siddharth Ravikumar2015-02-121-56/+68
| | | | Now the test is in a Test class with proper setup and teardown methods.
* tests/file_test.py: re-wrote it.Siddharth Ravikumar2015-02-111-48/+54
| | | | Now the test is in a Test class with proper setup and teardown methods.
* tests/utils.py: removed extraneous import thingies.Siddharth Ravikumar2015-02-091-1/+1
|
* tests/config_test.py: re-wrote it.Siddharth Ravikumar2015-02-091-24/+27
| | | | | | | Now the test is in a Test class with proper setup and teardown methods. The teardown method has been purposely not fleshed out. It will be fleshed out after all the test modules have been re-written.
* tests/utils.py: contains utility functions, etc that will be used in test ↵Siddharth Ravikumar2015-02-091-0/+57
| | | | modules.
* combox/config.py: added a new arg `write' (boolean) to cb_config function.Siddharth Ravikumar2015-02-091-5/+8
| | | | | | `write' is set to 'True' by default. If `write' is 'True' the generated config is written to the disk; otherwise it is returned.
* [bugfix]: combox/config.py - when empty string is given for 'silo_dir'; it ↵Siddharth Ravikumar2015-02-081-2/+4
| | | | | | | | | | | | | | | | sets the dir to PWD, this was not intended. This was fixed. When empty string is given for 'silo_dir', the intended default directory was the combox's config directory. The input to 'silo_dir' was directly given to path.abspath() The path.abspath() function, when an empty string is given returns the PWD. That's where the bug was! So, now the 'silo_dir' input is read to a local variable `silo_dir'. If the local variable `silo_dir' is empty, the combox config directory is assigned; else, the given directory is assigned.
* setup.py: added 'console_scripts' under 'entry_points'Siddharth Ravikumar2015-02-051-0/+3
| | | | | | | | | | | Now, whenever combox is installed using 'python setup.py install' command, the setup script automatically puts an executed script in the respective bin/ directory in Unix like operating systems. According to the setuptools documentation[1], on Windows, it should create a respective .exe file. This is yet to be tested. [1]: https://pythonhosted.org/setuptools/setuptools.html#automatic-script-creation
* combox/events.py: Under ComboxDIrMonitor, set logging's level to INFO.Siddharth Ravikumar2015-02-051-0/+4
| | | | | | Reason why this was done: Every time a file is renamed/deleted/modified/created in the combox directory, a message about this is puked out to stdout.
* combox/cbox.py: put the code under __main__ into a new function called 'main()'Siddharth Ravikumar2015-02-051-2/+8
| | | | main() is called from __main__ now.
* [bugfix] combox/cbox.py: Forgot to rename ComboxEventHandler -> ↵Siddharth Ravikumar2015-02-051-2/+2
| | | | ComboxDirMonitor. Fixed it now.
* combox/events.py: In ComboxDirMonitor class, housekeep() is called from the ↵Siddharth Ravikumar2015-01-281-0/+2
| | | | __init__ method.