Skip to content

Commit

Permalink
Cleanup and almost ready to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
EphraimSiegfried committed Nov 20, 2022
1 parent 1c40561 commit 58ad5e3
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
*.json
.DS_Store
.idea/
__pycache__/
move_config.txt
__pycache__/
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Ephraim Siegfried

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# file-mover

A file manager that moves files based on file properties and specified criteria.

## Description

An in-depth paragraph about your project and overview of use.

## Getting Started

### Dependencies

* Describe any prerequisites, libraries, OS version, etc., needed before installing program.
* ex. Windows 10

### Installing

* How/where to download your program
* Any modifications needed to be made to files/folders

### Executing program

* How to run the program
* Step-by-step bullets
```
code blocks for commands
```

## Help

Any advise for common problems or issues.
```
command to run if program contains helper info
```

## Authors

Contributors names and contact info

ex. Dominique Pizzie
ex. [@DomPizzie](https://twitter.com/dompizzie)

## Version History

* 0.2
* Various bug fixes and optimizations
* See [commit change]() or See [release history]()
* 0.1
* Initial Release

## License

This project is licensed under the [NAME HERE] License - see the LICENSE.md file for details

## Acknowledgments

Inspiration, code snippets, etc.
* [awesome-readme](https://github.com/matiassingers/awesome-readme)
* [PurpleBooth](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2)
* [dbader](https://github.com/dbader/readme-template)
* [zenorocha](https://gist.github.com/zenorocha/4526327)
* [fvcproductions](https://gist.github.com/fvcproductions/1bfc2d4aecb01a834b46)
25 changes: 25 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from setuptools import setup, find_packages
import pathlib

here = pathlib.Path(__file__).parent.resolve()
long_description = (here, "README.md").read_text(encoding="utf-8")

setup(
name='file-mover',
version='0.0.1',
description='Move files based on file properties and given criteria',
long_description=long_description,
long_description_content_type="text/markdown",
author='Ephraim Siegfried',
author_email='[email protected]',
package_dir={'': 'src'},
python_requires=">=3.6.0",
packages=find_packages(exclude=["tests"]),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Topic :: Desktop Environment :: File Managers"
],
entrypoints={"console_scripts":["file-mover = src.__main__:main"]},
install_requires=["notifypy>=1.0.3.0", "osxmetadata>=1.2.2"]
)
File renamed without changes.
13 changes: 9 additions & 4 deletions file_mover/__main__.py → src/__main__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import file_mover.cli as cli
import file_mover.configs as configs
from file_mover.mover import Mover
import src.cli as cli
import src.configs as configs
from src.mover import Mover

if __name__ == '__main__':

def main():
args = cli.enable_argument_parser().parse_args()
if args.listConfigs:
configs.print_list_configurations()
Expand All @@ -24,3 +25,7 @@
elif args.moveAllFilesInFolder:
dir_path, config = tuple(args.moveAllFilesInFolder)
Mover(configs.get_config_path(config)).move_files_in_dir(dir_path, True)


if __name__ == '__main__':
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions file_mover/mover.py → src/mover.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import shutil
import os
from notifypy import Notify
from file_mover.config import MoveConfig
from file_mover.file_property import FileMetadata
from file_mover.interpreter import Interpreter
from src.config import MoveConfig
from src.file_property import FileMetadata
from src.interpreter import Interpreter


class Mover:
Expand Down
Empty file added tests/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions tests/interpreter_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
from file_mover import interpreter
from src import interpreter


class InterpreterTest(unittest.TestCase):
Expand All @@ -9,7 +9,7 @@ def setUp(self):
'NAME': {'China': 'Users/Peter'},
'FILE_EXTENSION': {'.zip': 'Users/Peter/Home'}}
file_props = {'WHERE_FROM': 'wikipedia', 'NAME': 'China', 'FILE_EXTENSION': '.html'}
self.interpreter = interpreter.Interpreter(file_props, move_config, {})
self.interpreter = interpreter.Interpreter(file_props, move_config, [])

def test_token_corresponds_with_WHERE_FROM_parameter_is_true_when_match(self):
self.assertTrue(self.interpreter.token_corresponds("WHERE_FROM(wikipedia)"))
Expand Down

0 comments on commit 58ad5e3

Please sign in to comment.