| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
instead of using `path.isfile' to check if the path is a shard file or
not, it is checked if the path endswidth 'shard.N' where `N' is a
number.
|
|
|
|
|
|
|
|
| |
rm_path deletes a file or an empty directory.
updated the test for it too.
modified: tests/file_test.py
|
| |
|
| |
|
|
|
|
|
|
|
| |
wrote test for it too.
modified: combox/file.py
modified: tests/file_test.py
|
|
|
|
|
|
|
| |
also wrote test for it.
modified: combox/file.py
modified: tests/file_test.py
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
modified: combox/events.py
modified: tests/events_test.py
|
|
|
|
|
|
|
|
|
|
| |
- `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
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
| |
- 'write' is set to True by set default.
- If `write' is set, then the reconstructed file content is written to disk.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Now it accepts an optional third argument `fcontent' (defaults to None) which contains the contents of the file `fpath'.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
`write' is set to 'True' by default.
If `write' is 'True' the generated config is written to the disk; otherwise it is returned.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
main() is called from __main__ now.
|
|
|
|
| |
ComboxDirMonitor. Fixed it now.
|
|
|
|
| |
__init__ method.
|
|
|
|
| |
of FileSystemEventHandler.
|
|
|
|
|
|
|
| |
ComboxDirMonitor class.
The test for this method at tests/events_test.py only tests a part of
it.
|
|
|
|
| |
os.remove()ing it.
|
| |
|
|
|
|
|
|
|
| |
their info is kept track in simple db file (using PickleDB).
also updated tests/events_test.py to test if the newly added code to
that updates the db works properly.
|
|
|
|
|
|
|
| |
- Contains the ComboxSilo class which provides an interface to access
the db that stores information about files in the combox directory.
Tests for this module is at tests/silo_test.py
|
|
|
|
|
|
| |
hash_file function returns the SHA512 hash of the file's content.
The test for the hash_file function is at tests/file_test.py
|
|
|
|
|
| |
modified: combox/events.py
modified: tests/events_test.py
|
|
|
|
|
|
|
|
| |
the combox.
modified: combox/config.py
modified: tests/config_test.py
modified: tests/test-config/config.yaml
|
|
|
|
|
|
|
|
|
| |
silo directory is the location where the silo (silo.db) containing
information about files in the combox directory is stored.
modified: combox/config.py
modified: tests/config_test.py
modified: tests/test-config/config.yaml
|
|
|
|
|
|
|
|
|
| |
tests for it.
modified: combox/events.py
modified: tests/events_test.py
new file: tests/files/ipsum.txt
new file: tests/files/lorem.txt
|
|
|
|
|
|
|
|
|
|
|
|
| |
modified: combox/cbox.py
modified: combox/config.py
modified: combox/crypto.py
modified: combox/events.py
modified: combox/file.py
modified: tests/config_test.py
modified: tests/crypto_test.py
modified: tests/events_test.py
modified: tests/file_test.py
|
|
|
|
| |
contains function that runs combox.
|
|
|
|
|
| |
the fix: the shards don't have to be renamed when the directory under
which they're located is renamed/moved.
|
|
|
|
| |
The functions are not yet fully complete (See TODO in each function).
|
|
|
|
|
|
|
| |
- rm_nodedir
- move_nodedir
- rm_shards
- move_shards
|
| |
|
|
|
|
| |
the combox thing.
|
|
|
|
| |
basename.
|
|
|
|
|
|
| |
relative_path: returns relative path of directory or file w. r. t combox directory.
mk_nodedir: creates a directory inside all node directories
purge_dir: (1) purges a file or (2) purges everything inside a directory (except itself).
|
|
|
|
| |
path.
|
|
|
|
| |
bottom :<
|
| |
|
| |
|
| |
|