Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
akazukin5151 committed May 27, 2020
2 parents aff7cfe + 140e9e4 commit 4bf6b48
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 35 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ For more details refer to the [manual](#manual).
* For multi-image posts in image view, enter a number to jump to the post's page
* Image view should preview the next few images in multi-image posts (currently experimental feature for first image)

## Upcoming changelog (in dev branch)

For full changelogs please see [releases](https://github.com/twenty5151/koneko/releases)

### Version 0.7


# FAQ
* Pixiv keeps emailing me saying I've logged in, every time I use this app!
Expand All @@ -126,7 +132,7 @@ If only I can understand how to use asyncio. See [I don't understand Python's As

First, koneko is intended to work for full screen terminals, so don't tile it around unless your screen is big enough. Moving and resizing it abruptly will not be good for icat, which is really kitty's problem not mine.

You can also use versions less than v0.5.1, which retains legacy support for the original lsix shell script. Note that I've never really tested it, which is why I decided to be honest and depreciated legacy support from v0.6.1 onwards.
You can also use versions less than v0.5.1, which retains legacy support for the original lsix shell script. Note that I've never really tested it, which is why I decided to be honest and depreciated legacy support from v0.6.2 onwards.

# Contributing
* Fork it
Expand Down Expand Up @@ -204,7 +210,7 @@ Note: if you want to make some edits, you should install it in a conda environme
```sh
# Use the latest stable version (recommended for usage)
# Make sure the version number is the latest
git clone -b 'v0.6.1' --depth 1 https://github.com/twenty5151/koneko.git
git clone -b 'v0.6.2' --depth 1 https://github.com/twenty5151/koneko.git
# Use the master branch for upcoming features:
git clone -b master https://github.com/twenty5151/koneko.git
# Use the dev branch for latest features, fixes, and instability (recommended for contributers):
Expand Down Expand Up @@ -236,7 +242,7 @@ Run `pytest testing/ -vvvv -l -s --icat`. If icat fails, skip the three offendin
## Upload to PyPI
When test installing with pip, don't forget to use `pip install .` or `python setup.py install`, not `pip install koneko` (which will grab from latest stable version). (Yes, I made the same mistake again)

**Warning:** you *must* test installing with both `pip install .` and `python setup.py install`.
**Warning:** you *must* test installing with `pip install .`, `python setup.py install`, and `python setup.py develop`.

Bump version info in `__init__.py`, `setup.py`, and `README.md`

Expand Down
2 changes: 1 addition & 1 deletion koneko/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pathlib import Path

__version__ = '0.6.1'
__version__ = '0.6.2'
KONEKODIR = Path('~/.local/share/koneko/cache').expanduser()
2 changes: 1 addition & 1 deletion koneko/koneko/api.py → koneko/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import funcy
from pixivpy3 import PixivError, AppPixivAPI

from koneko.koneko import pure
from koneko import pure


class APIHandler:
Expand Down
2 changes: 1 addition & 1 deletion koneko/koneko/cli.py → koneko/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

from docopt import docopt

from koneko.koneko import pure
from koneko import pure


def process_cli_args():
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion koneko/koneko/data.py → koneko/data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Stores json data from the api. Acts as frontend to access data in a single line.
Functionally pure, no side effects (but stores state)
"""
from koneko.koneko import KONEKODIR, pure
from koneko import KONEKODIR, pure


class GalleryJson:
Expand Down
2 changes: 1 addition & 1 deletion koneko/koneko/download.py → koneko/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import cytoolz

from koneko.koneko import api, pure, utils
from koneko import api, pure, utils


@pure.spinner('')
Expand Down
4 changes: 0 additions & 4 deletions koneko/koneko/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions koneko/koneko/lscat.py → koneko/lscat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from pixcat import Image
from blessed import Terminal

from koneko.koneko.pure import cd
from koneko.koneko import utils
from koneko.pure import cd
from koneko import utils

TERM = Terminal()

Expand Down
2 changes: 1 addition & 1 deletion koneko/koneko/prompt.py → koneko/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from blessed import Terminal

from koneko.koneko import ui, pure, colors
from koneko import ui, pure, colors

TERM = Terminal()

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion koneko/koneko/ui.py → koneko/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from tqdm import tqdm

from koneko.koneko import (KONEKODIR, api, data, pure, lscat, utils, colors, prompt,
from koneko import (KONEKODIR, api, data, pure, lscat, utils, colors, prompt,
download)


Expand Down
2 changes: 1 addition & 1 deletion koneko/koneko/utils.py → koneko/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import pixcat

from koneko.koneko import KONEKODIR, ui, cli, pure, __version__
from koneko import KONEKODIR, ui, cli, pure, __version__


def verify_full_download(filepath):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name="koneko",
version="0.6.1",
version="0.6.2",
description="Browse pixiv in the terminal",
long_description=README,
long_description_content_type="text/markdown",
Expand Down
3 changes: 1 addition & 2 deletions testing/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import pytest

# Lmao python
sys.path.append('../koneko/koneko')
sys.path.append('testing')

from koneko.koneko import pure, lscat, utils, data, KONEKODIR
from koneko import pure, lscat, utils, data, KONEKODIR
from page_json import * # Imports the current_page (dict) stored in disk

page_illusts = page_json["illusts"]
Expand Down
5 changes: 2 additions & 3 deletions testing/test_lscat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import pytest

# Lmao python
sys.path.append('../koneko/koneko')
sys.path.append('testing')

from koneko.koneko import lscat
from koneko import lscat

def test_xcoords():
assert lscat.xcoords(100) == [2, 20, 38, 56, 74]
Expand All @@ -34,7 +33,7 @@ def __init__(self):
self.download_path = Path('testing/files/')

# This config has noprint = False
monkeypatch.setattr('koneko.koneko.utils.Path.expanduser',
monkeypatch.setattr('koneko.utils.Path.expanduser',
lambda x: Path('example_config.ini'))

fakedata = FakeData()
Expand Down
3 changes: 1 addition & 2 deletions testing/test_pure.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import pytest

# Lmao python
sys.path.append('../koneko/koneko')
sys.path.append('testing')

from koneko.koneko import pure, lscat, utils, data, KONEKODIR
from koneko import pure, lscat, utils, data, KONEKODIR
from page_json import * # Imports the current_page (dict) stored in disk

page_illusts = page_json["illusts"]
Expand Down
19 changes: 9 additions & 10 deletions testing/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
import pytest

# Lmao python
sys.path.append('../koneko/koneko')
sys.path.append('testing')

from koneko.koneko import utils
from koneko import utils

@pytest.fixture
def turn_off_print(monkeypatch):
Expand Down Expand Up @@ -58,15 +57,15 @@ def test_info_screen_loop(monkeypatch):
os.system("kitty +kitten icat --clear")

def test_check_noprint(monkeypatch):
monkeypatch.setattr("koneko.koneko.utils.get_settings", lambda x, y: "on")
monkeypatch.setattr("koneko.utils.get_settings", lambda x, y: "on")
assert utils.check_noprint() == True
monkeypatch.setattr("koneko.koneko.utils.get_settings", lambda x, y: "off")
monkeypatch.setattr("koneko.utils.get_settings", lambda x, y: "off")
assert utils.check_noprint() == False
monkeypatch.setattr("koneko.koneko.utils.get_settings", lambda x, y: "false")
monkeypatch.setattr("koneko.utils.get_settings", lambda x, y: "false")
assert utils.check_noprint() == False

# Test with an actual cfg
monkeypatch.setattr('koneko.koneko.utils.Path.expanduser',
monkeypatch.setattr('koneko.utils.Path.expanduser',
lambda x: Path('example_config.ini'))
assert utils.check_noprint() == False

Expand All @@ -77,7 +76,7 @@ def test_noprint(capsys):

def test_get_settings(monkeypatch):
# Redivert the config path
monkeypatch.setattr('koneko.koneko.utils.Path.expanduser',
monkeypatch.setattr('koneko.utils.Path.expanduser',
lambda x: Path('example_config.ini'))

assert utils.get_settings('Credentials', 'username') == 'koneko'
Expand All @@ -89,7 +88,7 @@ def test_get_settings(monkeypatch):
def test_config(monkeypatch):
# If config exists
example_path = Path('example_config.ini')
monkeypatch.setattr('koneko.koneko.utils.Path.expanduser', lambda x: example_path)
monkeypatch.setattr('koneko.utils.Path.expanduser', lambda x: example_path)

creds, your_id = utils.config()
assert your_id == '1234'
Expand All @@ -101,12 +100,12 @@ def test_config(monkeypatch):
if test_cfg_path.exists():
os.system(f'rm {test_cfg_path}')

monkeypatch.setattr('koneko.koneko.utils.Path.expanduser', lambda x: test_cfg_path)
monkeypatch.setattr('koneko.utils.Path.expanduser', lambda x: test_cfg_path)

# It asks for multiple inputs: username, whether to save user id, user id
responses = iter(['myusername', 'y', 'myid'])
monkeypatch.setattr('builtins.input', lambda x=None: next(responses))
monkeypatch.setattr('koneko.koneko.utils.getpass', lambda: 'mypassword')
monkeypatch.setattr('koneko.utils.getpass', lambda: 'mypassword')

creds, your_id = utils.config()
assert your_id == 'myid'
Expand Down

0 comments on commit 4bf6b48

Please sign in to comment.