mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-28 22:33:59 -06:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ad563ad93 | ||
|
|
29207c1d4c | ||
|
|
67c3888f82 | ||
|
|
d4675c747a | ||
|
|
c5f0c60ec8 | ||
|
|
fc4dcff9e3 |
@@ -41,3 +41,14 @@ $ git clone https://github.com/rr-/pq-cli.git
|
||||
$ cd pq-cli
|
||||
$ pip install --user .
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### `_curses.error: init_pair() returned ERR`
|
||||
|
||||
If running on Linux and you get the error `_curses.error: init_pair() returned ERR`,
|
||||
try making sure that your `$TERM` variable is set to a value which supports
|
||||
256 colors, such as via the following:
|
||||
|
||||
TERM=xterm-256color pqcli
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ class Roster:
|
||||
tmp_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
tmp_path.write_bytes(pickle.dumps(self.players))
|
||||
if self.path.exists():
|
||||
if old_path.exists():
|
||||
old_path.unlink()
|
||||
self.path.rename(old_path)
|
||||
tmp_path.rename(self.path)
|
||||
|
||||
|
||||
@@ -3,10 +3,8 @@ import typing as T
|
||||
|
||||
from pqcli.lingo import act_name, to_roman
|
||||
from pqcli.roster import Roster
|
||||
from pqcli.ui.curses.event_handler import EventHandler
|
||||
from pqcli.ui.curses.util import KEYS_CANCEL, Choice
|
||||
from pqcli.ui.curses.views.menu_view import MenuView
|
||||
from pqcli.ui.curses.widgets import Menu
|
||||
|
||||
|
||||
class ChooseCharacterView(MenuView):
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
import curses
|
||||
import typing as T
|
||||
|
||||
from pqcli.lingo import to_roman
|
||||
from pqcli.mechanic import InventoryItem, Player
|
||||
from pqcli.ui.curses.widgets import (
|
||||
DataTable,
|
||||
Focusable,
|
||||
ProgressBar,
|
||||
WindowWrapper,
|
||||
)
|
||||
from pqcli.ui.curses.widgets import Focusable
|
||||
|
||||
from .progress_bar_window import DataTableProgressBarWindow
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import typing as T
|
||||
|
||||
from pqcli.lingo import act_name
|
||||
from pqcli.mechanic import Player
|
||||
from pqcli.ui.curses.widgets import Focusable, ListBox, WindowWrapper
|
||||
from pqcli.ui.curses.widgets import Focusable
|
||||
|
||||
from .progress_bar_window import ListBoxProgressBarWindow
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import typing as T
|
||||
|
||||
from pqcli.mechanic import Player
|
||||
from pqcli.ui.curses.widgets import Focusable, ListBox, WindowWrapper
|
||||
from pqcli.ui.curses.widgets import Focusable
|
||||
|
||||
from .progress_bar_window import ListBoxProgressBarWindow
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import functools
|
||||
import typing as T
|
||||
|
||||
from pqcli.ui.curses.event_handler import EventHandler
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import curses
|
||||
import enum
|
||||
import typing as T
|
||||
|
||||
from pqcli.ui.curses.colors import COLOR_HIGHLIGHT, has_colors
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import curses
|
||||
import enum
|
||||
import typing as T
|
||||
|
||||
from pqcli.ui.curses.colors import COLOR_HIGHLIGHT, has_colors
|
||||
|
||||
@@ -25,7 +25,10 @@ class ProgressBar(WindowWrapper):
|
||||
return None
|
||||
time_then, pos_then = self._last_tick
|
||||
time_now, pos_now = datetime.datetime.now(), self._cur_pos
|
||||
speed = (pos_now - pos_then) / (time_now - time_then).total_seconds()
|
||||
div = (time_now - time_then).total_seconds()
|
||||
if div == 0:
|
||||
return None
|
||||
speed = (pos_now - pos_then) / div
|
||||
if not speed:
|
||||
return None
|
||||
return datetime.timedelta(seconds=(self._max_pos - pos_now) / speed)
|
||||
|
||||
@@ -5,12 +5,17 @@ setup(
|
||||
author_email="rr-@sakuya.pl",
|
||||
name="pqcli",
|
||||
long_description="Progress Quest: the CLI edition",
|
||||
version="1.0.1",
|
||||
version="1.0.2",
|
||||
url="https://github.com/rr-/pq-cli.git",
|
||||
packages=find_packages(),
|
||||
entry_points={"console_scripts": ["pqcli = pqcli.__main__:main"]},
|
||||
package_dir={"pqcli": "pqcli"},
|
||||
install_requires=["xdg", "urwid", "urwid_readline"],
|
||||
install_requires=[
|
||||
"xdg",
|
||||
"urwid",
|
||||
"urwid_readline",
|
||||
'windows-curses;platform_system=="Windows"',
|
||||
],
|
||||
classifiers=[
|
||||
"Environment :: Console",
|
||||
"Development Status :: 4 - Beta",
|
||||
|
||||
Reference in New Issue
Block a user