Skip to content

Commit

Permalink
Bump version: 0.3.10a → 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arzkar committed Jan 9, 2022
1 parent ba77360 commit fb2172b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.10a
current_version = 0.4.0
commit = True
tag = False
parse = ^
Expand Down
49 changes: 23 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To report issues for the CLI, open an issue at https://github.com/FicHub/fichub-
pip install -U fichub-cli
```

## From Source (Might have bugs, for development use)
## From Source (Might have bugs, for testing only)

```
pip install git+https://github.com/FicHub/fichub-cli@main
Expand All @@ -35,26 +35,31 @@ Usage: fichub_cli [OPTIONS]
https://github.com/FicHub/fichub-cli/issues
Options:
-u, --url TEXT The url of the fanfiction enclosed within quotes.
-i, --infile TEXT Give a filename to read URLs from.
-l, --list-url TEXT Enter a comma separated list of urls to download,
enclosed within quotes.
-u, --url TEXT The url of the fanfiction enclosed within quotes
-i, --infile TEXT Give a filename to read URLs from
-l, --list-url TEXT Enter a comma separated list of urls to download, enclosed within quotes
-v, --verbose Verbose progressbar
-o, --out-dir TEXT Absolute path to the Output directory for files
(default: Current Directory).
-f, --format TEXT Download Format: epub (default), mobi, pdf or html.
--force Force overwrite of an existing file.
--get-urls TEXT Get all story urls found from a page. Currently
supports archiveofourown.org only.
-s, --supported-sites List of supported sites.
-d, --debug Show the log in the console for debugging.
--meta-json TEXT Fetch only the metadata for the fanfiction in json
format.
--log Save the logfile for debugging.
--version Display version & quit.
--help Show this message and exit.
-o, --out-dir TEXT Absolute path to the Output directory for files (default: Current Directory)
-f, --format TEXT Download Format: epub (default), mobi, pdf or html
--force Force overwrite of an existing file
--get-urls TEXT Get all story urls found from a page.Currently supports archiveofourown.org only
-s, --supported-sites List of supported sites
-d, --debug Show the log in the console for debugging
--meta-json TEXT Fetch only the metadata for the fanfiction in json format
--log Save the logfile for debugging
--version Display version & quit
--help Show this message and exit
```

### Default Configuration

- The fanfiction will be downloaded in epub format. To change it, use `-f` followed by the format.
- The fanfiction will be downloaded in the current directory. To change it, use `-o` followed by the path to the directory.
- Failed downloads will be saved in the `err.log` file in the current directory.
- `--meta-json` takes either URL or a file containing a list of URLs.

Check `fichub_cli --help` for more info.

## Example

- To download using a URL
Expand Down Expand Up @@ -87,14 +92,6 @@ fichub_cli --get-urls https://archiveofourown.org/users/flamethrower/
fichub_cli --meta-json "https://www.fanfiction.net/s/12933896/1/Things-you-cannot-leave-behind"
```

### Default Configuration

- The fanfiction will be downloaded in epub format. To change it, use `-f` followed by the format.
- The fanfiction will be downloaded in the current directory. To change it, use `-o` followed by the path to the directory.
- Failed downloads will be saved in the `err.log` file in the current directory.

Check `fichub_cli --help` for more info.

# Links

- [Official Discord Server](https://discord.gg/sByBAhX)
28 changes: 14 additions & 14 deletions fichub_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@

# @logger.catch # for internal debugging
@click.command(no_args_is_help=True)
@click.option('-u', '--url', help='The url of the fanfiction enclosed within quotes.')
@click.option('-i', '--infile', help='Give a filename to read URLs from.')
@click.option('-l', '--list-url', 'list_url', help='Enter a comma separated list of urls to download, enclosed within quotes.')
@click.option('-u', '--url', help='The url of the fanfiction enclosed within quotes')
@click.option('-i', '--infile', help='Give a filename to read URLs from')
@click.option('-l', '--list-url', 'list_url', help='Enter a comma separated list of urls to download, enclosed within quotes')
@click.option('-v', '--verbose', default=False, help='Verbose progressbar', is_flag=True)
@click.option('-o', '--out-dir', 'out_dir', default="", help='Absolute path to the Output directory for files (default: Current Directory).')
@click.option('-f', '--format', '_format', default="epub", help='Download Format: epub (default), mobi, pdf or html.')
@click.option('--force', default=False, help=' Force overwrite of an existing file.', is_flag=True)
@click.option('--get-urls', 'get_urls', default=None, help='Get all story urls found from a page. Currently supports archiveofourown.org only.')
@click.option('-s', '--supported-sites', 'supported_sites', default=False, help='List of supported sites.', is_flag=True)
@click.option('-d', '--debug', default=False, help='Show the log in the console for debugging.', is_flag=True)
@click.option('--meta-json', 'meta_json', default=None, help='Fetch only the metadata for the fanfiction in json format.')
@click.option('--log', default=False, help='Save the logfile for debugging.', is_flag=True)
@click.option('-a', '--automated', default=False, help='For internal testing only.', is_flag=True, hidden=True)
@click.option('-o', '--out-dir', 'out_dir', default="", help='Absolute path to the Output directory for files (default: Current Directory)')
@click.option('-f', '--format', '_format', default="epub", help='Download Format: epub (default), mobi, pdf or html')
@click.option('--force', default=False, help=' Force overwrite of an existing file', is_flag=True)
@click.option('--get-urls', 'get_urls', default=None, help='Get all story urls found from a page. Currently supports archiveofourown.org only')
@click.option('-s', '--supported-sites', 'supported_sites', default=False, help='List of supported sites', is_flag=True)
@click.option('-d', '--debug', default=False, help='Show the log in the console for debugging', is_flag=True)
@click.option('--meta-json', 'meta_json', default=None, help='Fetch only the metadata for the fanfiction in json format')
@click.option('--log', default=False, help='Save the logfile for debugging', is_flag=True)
@click.option('-a', '--automated', default=False, help='For internal testing only', is_flag=True, hidden=True)
@click.option('--pytest', default=False, help='To run pytest on the CLI for internal testing', is_flag=True, hidden=True)
@click.option('--version', default=False, help='Display version & quit.', is_flag=True)
@click.option('--version', default=False, help='Display version & quit', is_flag=True)
def run_cli(infile: str, url: str, list_url: str, _format: str, get_urls: str,
out_dir: str, debug: bool, version: bool, log: bool,
supported_sites: bool, force: bool, automated: bool,
Expand Down Expand Up @@ -76,7 +76,7 @@ def run_cli(infile: str, url: str, list_url: str, _format: str, get_urls: str,
fic.get_metadata(meta_json)

if version:
click.echo("Version: 0.3.10a")
click.echo("Version: 0.4.0")

if supported_sites:
click.echo(Fore.GREEN + """
Expand Down
2 changes: 1 addition & 1 deletion fichub_cli/utils/fichub.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json

headers = {
'User-Agent': 'fichub_cli/0.3.10a',
'User-Agent': 'fichub_cli/0.4.0',
}


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
description="A CLI for the fichub.net API",
long_description=long_description,
long_description_content_type="text/markdown",
version='0.3.10a',
version='0.4.0',
license='MIT',
url="https://github.com/FicHub/fichub-cli",
packages=find_packages(include=['fichub_cli', 'fichub_cli.*']),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ def test_cli_version():

assert not result.exception
assert result.exit_code == 0
assert result.output.strip() == 'Version: 0.3.10a'
assert result.output.strip() == 'Version: 0.4.0'

0 comments on commit fb2172b

Please sign in to comment.