-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved #3
- Loading branch information
Showing
12 changed files
with
71 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,44 @@ | ||
from unittest import TestCase | ||
|
||
from check import * | ||
from hb_organiser.check import * | ||
|
||
|
||
class HBOrganiserTestCase(TestCase): | ||
# === [ check_source_exists ] === # | ||
def test_check_source_exists_returns_false_on_empty_path(self): | ||
# === [ source_exists ] === # | ||
def test_source_exists_returns_false_on_empty_path(self): | ||
self.assertFalse(source_exists('')) | ||
|
||
def test_check_source_exists_returns_false_on_relative_bad_path(self): | ||
def test_source_exists_returns_false_on_relative_bad_path(self): | ||
self.assertFalse(source_exists('~/fake_dir/')) | ||
|
||
def test_check_source_exists_returns_false_on_absolute_bad_path(self): | ||
def test_source_exists_returns_false_on_absolute_bad_path(self): | ||
self.assertFalse(source_exists('/home/fake_user/fake_dir/')) | ||
|
||
def test_check_source_exists_returns_true_on_relative_good_path(self): | ||
self.assertTrue(source_exists('library/')) | ||
def test_source_exists_returns_true_on_relative_good_path(self): | ||
self.assertTrue(source_exists('tests/test_libraries/library/')) | ||
|
||
def test_check_source_exists_returns_true_on_absolute_good_path(self): | ||
def test_source_exists_returns_true_on_absolute_good_path(self): | ||
self.assertTrue(source_exists('/')) | ||
|
||
# === [ check_source_levels ] === # | ||
def test_check_source_levels_returns_false_on_no_platform(self): | ||
self.assertFalse(source_levels('library/bundle/')) | ||
# === [ source_levels ] === # | ||
def test_source_levels_returns_false_on_no_platform(self): | ||
self.assertFalse(source_levels('tests/test_libraries/library/bundle/')) | ||
|
||
def test_check_source_levels_returns_false_on_no_item(self): | ||
self.assertFalse(source_levels('library/bundle/item/')) | ||
def test_source_levels_returns_false_on_no_item(self): | ||
self.assertFalse(source_levels('tests/test_libraries/library/bundle/item/')) | ||
|
||
def test_check_source_levels_returns_false_on_no_bundle(self): | ||
self.assertFalse(source_levels('library/bundle/item/platform/')) | ||
def test_source_levels_returns_false_on_no_bundle(self): | ||
self.assertFalse(source_levels('tests/test_libraries/library/bundle/item/platform/')) | ||
|
||
def test_check_source_levels_return_true_on_good_path(self): | ||
self.assertTrue('library/') | ||
def test_source_levels_return_true_on_good_path(self): | ||
self.assertTrue(source_levels('tests/test_libraries/library/')) | ||
|
||
def test_source_levels_return_true_when_target_set(self): | ||
self.assertTrue(source_levels('tests/test_libraries/library/', 'bundle')) | ||
|
||
# === [ number_of_items ] === # | ||
def test_number_of_items_returns_zero_ignoring_directories(self): | ||
self.assertEqual(number_of_items('tests/test_libraries/library/', ['all']), 1) | ||
|
||
def test_number_of_items_returns_one_ignoring_md5_and_directories(self): | ||
self.assertEqual(number_of_items('tests/test_libraries/other_library/', ['all']), 1) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
Metadata-Version: 2.1 | ||
Name: hb-organiser | ||
Version: 0.0.5 | ||
Version: 0.0.6 | ||
Summary: Organises Humble Bundle bundles based on their platform. | ||
Home-page: https://github.com/WhaleJ84/hb_organiser | ||
Author: James Whale | ||
Author-email: [email protected] | ||
License: UNKNOWN | ||
Description: # hb_organiser | ||
Description: # hb\_organiser | ||
|
||
[![PyPI](https://img.shields.io/pypi/v/hb-organiser.svg)](https://pypi.python.org/pypi/hb-organiser) | ||
![Unittests](https://github.com/WhaleJ84/hb_organiser/workflows/Unittests/badge.svg) | ||
[![codecov](https://codecov.io/gh/WhaleJ84/hb_organiser/branch/main/graph/badge.svg?token=IJSKBUAP81)](https://codecov.io/gh/WhaleJ84/hb_organiser) | ||
![Pylint](https://github.com/WhaleJ84/hb_organiser/workflows/Pylint/badge.svg) | ||
|
||
Organises Humble Bundle bundles based on their platform. | ||
Designed to work around the structure created via Talonius' [hb-downloader](https://github.com/talonius/hb-downloader). | ||
Other automated HB downloaders may not work with this out of the box. | ||
|
||
![Copying files](media/hb_organiser_demo.png) | ||
|
||
## Install | ||
|
||
As it's packaged as a Pip module, `python3-pip` is required. Run `pip install --user hb-organiser` to install only for your user and omit `--user` to install for all. See `hb_organiser -h` for help. | ||
|
||
## Why is this needed? | ||
|
||
I mainly use Humble Bundle to purchase book bundles (that I'll totally read at some point, I swear!) and have accumulated thousands of books over the years. | ||
|
@@ -20,14 +31,19 @@ Description: # hb_organiser | |
To alleviate this issue, I'm making this script that will organise my libraries with a click of a key. | ||
Duplicate items across different bundles will be ignored, all the books will be easily discovered via Calibre, and my sanity will be saved. | ||
|
||
## Features | ||
|
||
- Calculates number of tasks so that you're not left in the dark and can tell the progress. | ||
|
||
- A crude way of tracking files being corrupted via a cancelled transfer by logging what is being operated upon and clearing it once complete. If it doesn't get cleared, chances are it was corrupted. | ||
|
||
- Skips copying of duplicate files by checking for its existence first (although there is a chance it may skip newer files such as updated editions of books (see [issue 6](https://github.com/WhaleJ84/hb_organiser/issues/6))). | ||
|
||
## Immediate roadmap | ||
|
||
The immediate goal is to put out something working. | ||
To keep development more direct I'll outline pressing matters below: | ||
|
||
- Publish Pip module | ||
- At the moment it currently runs as a series of scripts. | ||
This needs to change ASAP. | ||
- Cut down on operation times | ||
- Organising thousands of files in one go is very time-consuming - especially when working with game bundles. | ||
Speeding this up will save millions of hours of collective time over the years via optimisation. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setuptools.setup( | ||
name="hb_organiser", | ||
version="0.0.5", | ||
version="0.0.6", | ||
author="James Whale", | ||
author_email="[email protected]", | ||
description="Organises Humble Bundle bundles based on their platform.", | ||
|