Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a revert feature to return to last state. #24

Open
zeerorg opened this issue Oct 10, 2016 · 5 comments
Open

Creating a revert feature to return to last state. #24

zeerorg opened this issue Oct 10, 2016 · 5 comments

Comments

@zeerorg
Copy link

zeerorg commented Oct 10, 2016

Can we create a '.pysorter' file in the directory so that we store changes done. and later on maybe revert back to the previous directory state using a '--revert' flag?

This can also be done while logging to standard output.

@chriscz
Copy link
Owner

chriscz commented Oct 10, 2016

This is a great idea. The .pysorter file would work well.
I am not sure what the best format for it would be, maybe json is a good pick here.
Please look at the comments in PR #20, which will be merged soon. Another related feature which is almost done is #14.

Thanks for your support!

@zeerorg
Copy link
Author

zeerorg commented Oct 10, 2016

I was thinking we could have json with something like

{
    date:"current_date",
    time:"current_time",
    src:["path/to/file1", "path/to/dir"],
    dest:["newpath/to/file1", "newpath/to/dir"]
}

@chriscz
Copy link
Owner

chriscz commented Oct 10, 2016

That looks good for now.

@zeerorg
Copy link
Author

zeerorg commented Oct 11, 2016

sorry for a lame question but I wanted to ask how can I run pysorter after git cloning. I basically do

python __main__.py "path/to/directory"

and it gives me an error
File "__main__.py", line 3, in <module>
from .core import pysorter
SystemError: Parent module '' not loaded, cannot perform relative import

@chriscz
Copy link
Owner

chriscz commented Oct 11, 2016

python -m pysorter should do the trick. Here we run the pysorter package as if it was a program.

I'd recommend creating a virtualenv and installing all the requirements
in there.
Then you can install it in editable mode with pip install -e .
To quote the documentation:

-e, --editable <path/url>   Install a project in editable mode (i.e.
setuptools "develop mode") from a local project path or a VCS url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants