clox 0.1__py3-none-any.whl → 0.3__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 +35 -8
- clox/params.py +6 -2
- clox-0.3.dist-info/AUTHORS.md +11 -0
- {clox-0.1.dist-info → clox-0.3.dist-info}/METADATA +49 -6
- clox-0.3.dist-info/RECORD +11 -0
- {clox-0.1.dist-info → clox-0.3.dist-info}/WHEEL +1 -1
- clox-0.1.dist-info/AUTHORS.md +0 -6
- clox-0.1.dist-info/RECORD +0 -11
- {clox-0.1.dist-info → clox-0.3.dist-info}/LICENSE +0 -0
- {clox-0.1.dist-info → clox-0.3.dist-info}/entry_points.txt +0 -0
- {clox-0.1.dist-info → clox-0.3.dist-info}/top_level.txt +0 -0
clox/functions.py
CHANGED
|
@@ -8,9 +8,11 @@ import datetime
|
|
|
8
8
|
import argparse
|
|
9
9
|
import pytz
|
|
10
10
|
from art import tprint
|
|
11
|
+
from .params import HORIZONTAL_TIME_FORMATS, VERTICAL_TIME_FORMATS
|
|
11
12
|
from .params import TIMEZONES_LIST, CLOX_VERSION
|
|
12
13
|
from .params import ADDITIONAL_INFO, EXIT_MESSAGE
|
|
13
|
-
from .params import FACES_MAP, FACES_LIST
|
|
14
|
+
from .params import FACES_MAP, FACES_LIST
|
|
15
|
+
from .params import HORIZONTAL_FACES_LIST_EXAMPLE, VERTICAL_FACES_LIST_EXAMPLE
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
def clear_screen():
|
|
@@ -38,16 +40,23 @@ def get_face(index):
|
|
|
38
40
|
return FACES_MAP[index]
|
|
39
41
|
|
|
40
42
|
|
|
41
|
-
def show_faces_list():
|
|
43
|
+
def show_faces_list(vertical=False):
|
|
42
44
|
"""
|
|
43
45
|
Show faces list.
|
|
44
46
|
|
|
47
|
+
:param vertical: vertical mode flag
|
|
48
|
+
:type vertical: bool
|
|
45
49
|
:return: None
|
|
46
50
|
"""
|
|
47
|
-
|
|
51
|
+
mode = "Horizontal"
|
|
52
|
+
example = HORIZONTAL_FACES_LIST_EXAMPLE
|
|
53
|
+
if vertical:
|
|
54
|
+
example = VERTICAL_FACES_LIST_EXAMPLE
|
|
55
|
+
mode = "Vertical"
|
|
56
|
+
print("Faces list ({0}):\n".format(mode))
|
|
48
57
|
for i in sorted(FACES_MAP):
|
|
49
58
|
print('Face {}\n'.format(i))
|
|
50
|
-
tprint(
|
|
59
|
+
tprint(example, font=get_face(i))
|
|
51
60
|
print('=' * 80)
|
|
52
61
|
|
|
53
62
|
|
|
@@ -62,7 +71,7 @@ def show_timezones_list():
|
|
|
62
71
|
print("{0}. {1}".format(index, timezone))
|
|
63
72
|
|
|
64
73
|
|
|
65
|
-
def run_clock(timezone=None, v_shift=0, h_shift=0, face=1):
|
|
74
|
+
def run_clock(timezone=None, v_shift=0, h_shift=0, face=1, no_blink=False, vertical=False):
|
|
66
75
|
"""
|
|
67
76
|
Run clock.
|
|
68
77
|
|
|
@@ -74,9 +83,17 @@ def run_clock(timezone=None, v_shift=0, h_shift=0, face=1):
|
|
|
74
83
|
:type h_shift: int
|
|
75
84
|
:param face: face index
|
|
76
85
|
:type face: int
|
|
86
|
+
:param no_blink: no-blink flag
|
|
87
|
+
:type no_blink: bool
|
|
88
|
+
:param vertical: vertical mode flag
|
|
89
|
+
:type vertical: bool
|
|
77
90
|
:return: None
|
|
78
91
|
"""
|
|
92
|
+
format_index = 0
|
|
79
93
|
timezone_str = timezone
|
|
94
|
+
time_formats = HORIZONTAL_TIME_FORMATS
|
|
95
|
+
if vertical:
|
|
96
|
+
time_formats = VERTICAL_TIME_FORMATS
|
|
80
97
|
if timezone is None:
|
|
81
98
|
tz = None
|
|
82
99
|
timezone_str = "Local"
|
|
@@ -89,11 +106,13 @@ def run_clock(timezone=None, v_shift=0, h_shift=0, face=1):
|
|
|
89
106
|
clear_screen()
|
|
90
107
|
print('\n' * v_shift, end='')
|
|
91
108
|
print(" " * h_shift, end='')
|
|
92
|
-
current_time = datetime.datetime.now(tz=tz).strftime(
|
|
109
|
+
current_time = datetime.datetime.now(tz=tz).strftime(time_formats[format_index])
|
|
93
110
|
tprint(current_time, font=face, sep="\n" + " " * h_shift)
|
|
94
111
|
print(" " * h_shift, end='')
|
|
95
112
|
print("Timezone: {0}".format(timezone_str))
|
|
96
113
|
time.sleep(1)
|
|
114
|
+
if not no_blink:
|
|
115
|
+
format_index = int(not format_index)
|
|
97
116
|
|
|
98
117
|
|
|
99
118
|
def main():
|
|
@@ -111,15 +130,23 @@ def main():
|
|
|
111
130
|
parser.add_argument('--face', help='face', type=int, choices=FACES_LIST, default=1)
|
|
112
131
|
parser.add_argument('--faces-list', help='faces list', nargs="?", const=1)
|
|
113
132
|
parser.add_argument('--timezones-list', help='timezones list', nargs="?", const=1)
|
|
133
|
+
parser.add_argument('--no-blink', help='disable blinking mode', nargs="?", const=1)
|
|
134
|
+
parser.add_argument('--vertical', help='vertical mode', nargs="?", const=1)
|
|
114
135
|
args = parser.parse_args()
|
|
115
136
|
if args.version:
|
|
116
137
|
print(CLOX_VERSION)
|
|
117
138
|
elif args.faces_list:
|
|
118
|
-
show_faces_list()
|
|
139
|
+
show_faces_list(vertical=args.vertical)
|
|
119
140
|
elif args.timezones_list:
|
|
120
141
|
show_timezones_list()
|
|
121
142
|
else:
|
|
122
143
|
try:
|
|
123
|
-
run_clock(
|
|
144
|
+
run_clock(
|
|
145
|
+
timezone=args.timezone,
|
|
146
|
+
h_shift=args.h_shift,
|
|
147
|
+
v_shift=args.v_shift,
|
|
148
|
+
face=args.face,
|
|
149
|
+
no_blink=args.no_blink,
|
|
150
|
+
vertical=args.vertical)
|
|
124
151
|
except (KeyboardInterrupt, EOFError):
|
|
125
152
|
print(EXIT_MESSAGE)
|
clox/params.py
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
"""clox params."""
|
|
3
3
|
import pytz
|
|
4
4
|
|
|
5
|
-
CLOX_VERSION = "0.
|
|
5
|
+
CLOX_VERSION = "0.3"
|
|
6
6
|
|
|
7
7
|
ADDITIONAL_INFO = "Additional information: Press `Ctrl+C` to exit."
|
|
8
8
|
EXIT_MESSAGE = "See you. Bye!"
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
HORIZONTAL_FACES_LIST_EXAMPLE = "12:34"
|
|
11
|
+
VERTICAL_FACES_LIST_EXAMPLE = "12\n34"
|
|
12
|
+
|
|
13
|
+
HORIZONTAL_TIME_FORMATS = ['%H:%M', '%H:%M.']
|
|
14
|
+
VERTICAL_TIME_FORMATS = ['%H\n%M', '%H\n%M.']
|
|
11
15
|
|
|
12
16
|
TIMEZONES_LIST = pytz.all_timezones
|
|
13
17
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Core Developers
|
|
2
|
+
----------
|
|
3
|
+
- [@sepandhaghighi](http://github.com/sepandhaghighi)
|
|
4
|
+
|
|
5
|
+
# Other Contributors
|
|
6
|
+
----------
|
|
7
|
+
- [@boreshnavard](https://github.com/boreshnavard) **
|
|
8
|
+
- [@sadrasabouri](https://github.com/sadrasabouri)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
** Graphic designer
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: clox
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3
|
|
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.3
|
|
7
7
|
Author: Sepand Haghighi
|
|
8
8
|
Author-email: me@sepand.tech
|
|
9
9
|
License: MIT
|
|
@@ -33,9 +33,23 @@ License-File: LICENSE
|
|
|
33
33
|
License-File: AUTHORS.md
|
|
34
34
|
Requires-Dist: art>=5.3
|
|
35
35
|
Requires-Dist: pytz>=2019.2
|
|
36
|
+
Dynamic: author
|
|
37
|
+
Dynamic: author-email
|
|
38
|
+
Dynamic: classifier
|
|
39
|
+
Dynamic: description
|
|
40
|
+
Dynamic: description-content-type
|
|
41
|
+
Dynamic: download-url
|
|
42
|
+
Dynamic: home-page
|
|
43
|
+
Dynamic: keywords
|
|
44
|
+
Dynamic: license
|
|
45
|
+
Dynamic: project-url
|
|
46
|
+
Dynamic: requires-dist
|
|
47
|
+
Dynamic: requires-python
|
|
48
|
+
Dynamic: summary
|
|
36
49
|
|
|
37
50
|
|
|
38
51
|
<div align="center">
|
|
52
|
+
<img src="https://github.com/sepandhaghighi/clox/raw/main/otherfiles/logo.png" width="450">
|
|
39
53
|
<h1>Clox: A Geeky Clock for Terminal Enthusiasts</h1>
|
|
40
54
|
<br/>
|
|
41
55
|
<a href="https://badge.fury.io/py/clox"><img src="https://badge.fury.io/py/clox.svg" alt="PyPI version"></a>
|
|
@@ -89,13 +103,13 @@ Clox is a terminal-based clock application designed for terminal enthusiasts who
|
|
|
89
103
|
## Installation
|
|
90
104
|
|
|
91
105
|
### Source Code
|
|
92
|
-
- Download [Version 0.
|
|
106
|
+
- Download [Version 0.3](https://github.com/sepandhaghighi/clox/archive/v0.3.zip) or [Latest Source](https://github.com/sepandhaghighi/clox/archive/dev.zip)
|
|
93
107
|
- `pip install .`
|
|
94
108
|
|
|
95
109
|
### PyPI
|
|
96
110
|
|
|
97
111
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
98
|
-
- `pip install clox==0.
|
|
112
|
+
- `pip install clox==0.3`
|
|
99
113
|
|
|
100
114
|
|
|
101
115
|
## Usage
|
|
@@ -141,6 +155,20 @@ clox --timezone="Etc/GMT+7"
|
|
|
141
155
|
clox --v-shift=20 --h-shift=30
|
|
142
156
|
```
|
|
143
157
|
|
|
158
|
+
### No Blink
|
|
159
|
+
|
|
160
|
+
Disable blinking mode
|
|
161
|
+
|
|
162
|
+
```console
|
|
163
|
+
clox --no-blink
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Vertical Mode
|
|
167
|
+
|
|
168
|
+
```console
|
|
169
|
+
clox --vertical
|
|
170
|
+
```
|
|
171
|
+
|
|
144
172
|
## Issues & Bug Reports
|
|
145
173
|
|
|
146
174
|
Just fill an issue and describe it. We'll check it ASAP!
|
|
@@ -191,6 +219,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
191
219
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
192
220
|
|
|
193
221
|
## [Unreleased]
|
|
222
|
+
## [0.3] - 2025-01-10
|
|
223
|
+
### Added
|
|
224
|
+
- Logo
|
|
225
|
+
- `--vertical` argument
|
|
226
|
+
### Changed
|
|
227
|
+
- `show_faces_list` function updated
|
|
228
|
+
- `AUTHORS.md` updated
|
|
229
|
+
## [0.2] - 2025-01-01
|
|
230
|
+
### Added
|
|
231
|
+
- Blink mode
|
|
232
|
+
- `--no-blink` argument
|
|
233
|
+
### Changed
|
|
234
|
+
- `README.md` updated
|
|
194
235
|
## [0.1] - 2024-12-24
|
|
195
236
|
### Added
|
|
196
237
|
- `--v-shift` and `--h-shift` arguments
|
|
@@ -200,7 +241,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
200
241
|
- `TIMEZONES.md`
|
|
201
242
|
- `FACES.md`
|
|
202
243
|
|
|
203
|
-
[Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.
|
|
244
|
+
[Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.3...dev
|
|
245
|
+
[0.3]: https://github.com/sepandhaghighi/clox/compare/v0.2...v0.3
|
|
246
|
+
[0.2]: https://github.com/sepandhaghighi/clox/compare/v0.1...v0.2
|
|
204
247
|
[0.1]: https://github.com/sepandhaghighi/clox/compare/e9b49e2...v0.1
|
|
205
248
|
|
|
206
249
|
|
|
@@ -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=BJQhThthfJhr6TCF8VV-nEjl30Gq0ZAYdP3GAe1m1yk,4354
|
|
4
|
+
clox/params.py,sha256=7vbJ-z7PlkqyVqlgbGJP1-o0Izc_6KSZ3ygnbPrO70E,899
|
|
5
|
+
clox-0.3.dist-info/AUTHORS.md,sha256=lmtnd18MnfgB57jdvfJbC0JHN3iARf2Ov4pY5kPGJC8,242
|
|
6
|
+
clox-0.3.dist-info/LICENSE,sha256=WoAsqqZ_lNVBGdyxjwh7YnVNXKfOB-qYVrRhrn-e-_4,1072
|
|
7
|
+
clox-0.3.dist-info/METADATA,sha256=ZBDNDzs2vULZcNTEAy-Sp-4kooMmkhxGh9DyZES7NG8,7341
|
|
8
|
+
clox-0.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
9
|
+
clox-0.3.dist-info/entry_points.txt,sha256=sP4Rmoe-DxYGjlF_Tld6nghbt_u-fK8h9ZUQFmO8TJs,45
|
|
10
|
+
clox-0.3.dist-info/top_level.txt,sha256=5DxGH-4VNfYkM8vbfngObh6-jpFEoSW4M90EvDGfhSw,5
|
|
11
|
+
clox-0.3.dist-info/RECORD,,
|
clox-0.1.dist-info/AUTHORS.md
DELETED
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
|