clox 0.1__py3-none-any.whl → 0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of clox might be problematic. Click here for more details.
- clox/functions.py +15 -3
- clox/params.py +3 -1
- {clox-0.1.dist-info → clox-0.2.dist-info}/METADATA +20 -5
- clox-0.2.dist-info/RECORD +11 -0
- clox-0.1.dist-info/RECORD +0 -11
- {clox-0.1.dist-info → clox-0.2.dist-info}/AUTHORS.md +0 -0
- {clox-0.1.dist-info → clox-0.2.dist-info}/LICENSE +0 -0
- {clox-0.1.dist-info → clox-0.2.dist-info}/WHEEL +0 -0
- {clox-0.1.dist-info → clox-0.2.dist-info}/entry_points.txt +0 -0
- {clox-0.1.dist-info → clox-0.2.dist-info}/top_level.txt +0 -0
clox/functions.py
CHANGED
|
@@ -8,6 +8,7 @@ import datetime
|
|
|
8
8
|
import argparse
|
|
9
9
|
import pytz
|
|
10
10
|
from art import tprint
|
|
11
|
+
from .params import TIME_FORMATS
|
|
11
12
|
from .params import TIMEZONES_LIST, CLOX_VERSION
|
|
12
13
|
from .params import ADDITIONAL_INFO, EXIT_MESSAGE
|
|
13
14
|
from .params import FACES_MAP, FACES_LIST, FACES_LIST_EXAMPLE_MESSAGE
|
|
@@ -62,7 +63,7 @@ def show_timezones_list():
|
|
|
62
63
|
print("{0}. {1}".format(index, timezone))
|
|
63
64
|
|
|
64
65
|
|
|
65
|
-
def run_clock(timezone=None, v_shift=0, h_shift=0, face=1):
|
|
66
|
+
def run_clock(timezone=None, v_shift=0, h_shift=0, face=1, no_blink=False):
|
|
66
67
|
"""
|
|
67
68
|
Run clock.
|
|
68
69
|
|
|
@@ -74,8 +75,11 @@ def run_clock(timezone=None, v_shift=0, h_shift=0, face=1):
|
|
|
74
75
|
:type h_shift: int
|
|
75
76
|
:param face: face index
|
|
76
77
|
:type face: int
|
|
78
|
+
:param no_blink: no-blink flag
|
|
79
|
+
:type no_blink: bool
|
|
77
80
|
:return: None
|
|
78
81
|
"""
|
|
82
|
+
format_index = 0
|
|
79
83
|
timezone_str = timezone
|
|
80
84
|
if timezone is None:
|
|
81
85
|
tz = None
|
|
@@ -89,11 +93,13 @@ def run_clock(timezone=None, v_shift=0, h_shift=0, face=1):
|
|
|
89
93
|
clear_screen()
|
|
90
94
|
print('\n' * v_shift, end='')
|
|
91
95
|
print(" " * h_shift, end='')
|
|
92
|
-
current_time = datetime.datetime.now(tz=tz).strftime(
|
|
96
|
+
current_time = datetime.datetime.now(tz=tz).strftime(TIME_FORMATS[format_index])
|
|
93
97
|
tprint(current_time, font=face, sep="\n" + " " * h_shift)
|
|
94
98
|
print(" " * h_shift, end='')
|
|
95
99
|
print("Timezone: {0}".format(timezone_str))
|
|
96
100
|
time.sleep(1)
|
|
101
|
+
if not no_blink:
|
|
102
|
+
format_index = int(not format_index)
|
|
97
103
|
|
|
98
104
|
|
|
99
105
|
def main():
|
|
@@ -111,6 +117,7 @@ def main():
|
|
|
111
117
|
parser.add_argument('--face', help='face', type=int, choices=FACES_LIST, default=1)
|
|
112
118
|
parser.add_argument('--faces-list', help='faces list', nargs="?", const=1)
|
|
113
119
|
parser.add_argument('--timezones-list', help='timezones list', nargs="?", const=1)
|
|
120
|
+
parser.add_argument('--no-blink', help='disable blinking mode', nargs="?", const=1)
|
|
114
121
|
args = parser.parse_args()
|
|
115
122
|
if args.version:
|
|
116
123
|
print(CLOX_VERSION)
|
|
@@ -120,6 +127,11 @@ def main():
|
|
|
120
127
|
show_timezones_list()
|
|
121
128
|
else:
|
|
122
129
|
try:
|
|
123
|
-
run_clock(
|
|
130
|
+
run_clock(
|
|
131
|
+
timezone=args.timezone,
|
|
132
|
+
h_shift=args.h_shift,
|
|
133
|
+
v_shift=args.v_shift,
|
|
134
|
+
face=args.face,
|
|
135
|
+
no_blink=args.no_blink)
|
|
124
136
|
except (KeyboardInterrupt, EOFError):
|
|
125
137
|
print(EXIT_MESSAGE)
|
clox/params.py
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
"""clox params."""
|
|
3
3
|
import pytz
|
|
4
4
|
|
|
5
|
-
CLOX_VERSION = "0.
|
|
5
|
+
CLOX_VERSION = "0.2"
|
|
6
6
|
|
|
7
7
|
ADDITIONAL_INFO = "Additional information: Press `Ctrl+C` to exit."
|
|
8
8
|
EXIT_MESSAGE = "See you. Bye!"
|
|
9
9
|
|
|
10
10
|
FACES_LIST_EXAMPLE_MESSAGE = "12 : 34"
|
|
11
11
|
|
|
12
|
+
TIME_FORMATS = ['%H:%M', '%H:%M.']
|
|
13
|
+
|
|
12
14
|
TIMEZONES_LIST = pytz.all_timezones
|
|
13
15
|
|
|
14
16
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: clox
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2
|
|
4
4
|
Summary: A Geeky Clock for Terminal Enthusiasts
|
|
5
5
|
Home-page: https://github.com/sepandhaghighi/clox
|
|
6
|
-
Download-URL: https://github.com/sepandhaghighi/clox/tarball/v0.
|
|
6
|
+
Download-URL: https://github.com/sepandhaghighi/clox/tarball/v0.2
|
|
7
7
|
Author: Sepand Haghighi
|
|
8
8
|
Author-email: me@sepand.tech
|
|
9
9
|
License: MIT
|
|
@@ -89,13 +89,13 @@ Clox is a terminal-based clock application designed for terminal enthusiasts who
|
|
|
89
89
|
## Installation
|
|
90
90
|
|
|
91
91
|
### Source Code
|
|
92
|
-
- Download [Version 0.
|
|
92
|
+
- Download [Version 0.2](https://github.com/sepandhaghighi/clox/archive/v0.2.zip) or [Latest Source](https://github.com/sepandhaghighi/clox/archive/dev.zip)
|
|
93
93
|
- `pip install .`
|
|
94
94
|
|
|
95
95
|
### PyPI
|
|
96
96
|
|
|
97
97
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
98
|
-
- `pip install clox==0.
|
|
98
|
+
- `pip install clox==0.2`
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
## Usage
|
|
@@ -141,6 +141,14 @@ clox --timezone="Etc/GMT+7"
|
|
|
141
141
|
clox --v-shift=20 --h-shift=30
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
### No Blink
|
|
145
|
+
|
|
146
|
+
Disable blinking mode
|
|
147
|
+
|
|
148
|
+
```console
|
|
149
|
+
clox --no-blink
|
|
150
|
+
```
|
|
151
|
+
|
|
144
152
|
## Issues & Bug Reports
|
|
145
153
|
|
|
146
154
|
Just fill an issue and describe it. We'll check it ASAP!
|
|
@@ -191,6 +199,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
191
199
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
192
200
|
|
|
193
201
|
## [Unreleased]
|
|
202
|
+
## [0.2] - 2025-01-01
|
|
203
|
+
### Added
|
|
204
|
+
- Blink mode
|
|
205
|
+
- `--no-blink` argument
|
|
206
|
+
### Changed
|
|
207
|
+
- `README.md` updated
|
|
194
208
|
## [0.1] - 2024-12-24
|
|
195
209
|
### Added
|
|
196
210
|
- `--v-shift` and `--h-shift` arguments
|
|
@@ -200,7 +214,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
200
214
|
- `TIMEZONES.md`
|
|
201
215
|
- `FACES.md`
|
|
202
216
|
|
|
203
|
-
[Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.
|
|
217
|
+
[Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.2...dev
|
|
218
|
+
[0.2]: https://github.com/sepandhaghighi/clox/compare/v0.1...v0.2
|
|
204
219
|
[0.1]: https://github.com/sepandhaghighi/clox/compare/e9b49e2...v0.1
|
|
205
220
|
|
|
206
221
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
clox/__init__.py,sha256=gErclFSjUDschQpngWqOBGkBKt1jwd-Ww8B9iJmlU5s,108
|
|
2
|
+
clox/__main__.py,sha256=9oJYc1WXu4ZMrjKny_2-4Cgu46-VWHuE9xOqD1iJY0E,109
|
|
3
|
+
clox/functions.py,sha256=ixKa3BHMzwWdnn8SWZAuk4f3-Kpqs0irHeEcP0n9_k0,3705
|
|
4
|
+
clox/params.py,sha256=7jFzOBH41Yfcmk-eUv1tBnOJfiBV0EV4kFJApPq66wE,802
|
|
5
|
+
clox-0.2.dist-info/AUTHORS.md,sha256=1T_gvCIPkHMdGX9e6dg9eich7OiqlYkE6hSk8tieihQ,116
|
|
6
|
+
clox-0.2.dist-info/LICENSE,sha256=WoAsqqZ_lNVBGdyxjwh7YnVNXKfOB-qYVrRhrn-e-_4,1072
|
|
7
|
+
clox-0.2.dist-info/METADATA,sha256=JlKP-N2oJkwyWVpQbypp90Xnr_MQQ3oHsHzh9I3hGwI,6722
|
|
8
|
+
clox-0.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
9
|
+
clox-0.2.dist-info/entry_points.txt,sha256=sP4Rmoe-DxYGjlF_Tld6nghbt_u-fK8h9ZUQFmO8TJs,45
|
|
10
|
+
clox-0.2.dist-info/top_level.txt,sha256=5DxGH-4VNfYkM8vbfngObh6-jpFEoSW4M90EvDGfhSw,5
|
|
11
|
+
clox-0.2.dist-info/RECORD,,
|
clox-0.1.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
clox/__init__.py,sha256=gErclFSjUDschQpngWqOBGkBKt1jwd-Ww8B9iJmlU5s,108
|
|
2
|
-
clox/__main__.py,sha256=9oJYc1WXu4ZMrjKny_2-4Cgu46-VWHuE9xOqD1iJY0E,109
|
|
3
|
-
clox/functions.py,sha256=auoQrYu-dbFYoxxUpO2rILUvQP4OhQ5497gyBSLcKgQ,3289
|
|
4
|
-
clox/params.py,sha256=e6w8otviH0lPKIsfeyoC5yuH4YYsgCXls_2hKTc1xPM,766
|
|
5
|
-
clox-0.1.dist-info/AUTHORS.md,sha256=1T_gvCIPkHMdGX9e6dg9eich7OiqlYkE6hSk8tieihQ,116
|
|
6
|
-
clox-0.1.dist-info/LICENSE,sha256=WoAsqqZ_lNVBGdyxjwh7YnVNXKfOB-qYVrRhrn-e-_4,1072
|
|
7
|
-
clox-0.1.dist-info/METADATA,sha256=Fsl1FcPmVi_Og76AInSa4C1A_VgUBayEMJuuqMujAiU,6484
|
|
8
|
-
clox-0.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
9
|
-
clox-0.1.dist-info/entry_points.txt,sha256=sP4Rmoe-DxYGjlF_Tld6nghbt_u-fK8h9ZUQFmO8TJs,45
|
|
10
|
-
clox-0.1.dist-info/top_level.txt,sha256=5DxGH-4VNfYkM8vbfngObh6-jpFEoSW4M90EvDGfhSw,5
|
|
11
|
-
clox-0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|