clox 0.4__py3-none-any.whl → 0.5__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 CHANGED
@@ -8,8 +8,9 @@ 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, DATE_FORMAT
12
- from .params import TIMEZONES_LIST, CLOX_VERSION
11
+ from .params import HORIZONTAL_TIME_24H_FORMATS, VERTICAL_TIME_24H_FORMATS
12
+ from .params import HORIZONTAL_TIME_12H_FORMATS, VERTICAL_TIME_12H_FORMATS
13
+ from .params import TIMEZONES_LIST, CLOX_VERSION, DATE_FORMAT
13
14
  from .params import ADDITIONAL_INFO, EXIT_MESSAGE
14
15
  from .params import FACES_MAP, FACES_LIST
15
16
  from .params import HORIZONTAL_FACES_LIST_EXAMPLE, VERTICAL_FACES_LIST_EXAMPLE
@@ -84,7 +85,16 @@ def show_timezones_list():
84
85
  print("{0}. {1}".format(index, timezone))
85
86
 
86
87
 
87
- def run_clock(timezone=None, v_shift=0, h_shift=0, face=1, no_blink=False, vertical=False):
88
+ def run_clock(
89
+ timezone=None,
90
+ v_shift=0,
91
+ h_shift=0,
92
+ face=1,
93
+ no_blink=False,
94
+ vertical=False,
95
+ hide_date=False,
96
+ hide_timezone=False,
97
+ am_pm=False):
88
98
  """
89
99
  Run clock.
90
100
 
@@ -100,13 +110,19 @@ def run_clock(timezone=None, v_shift=0, h_shift=0, face=1, no_blink=False, verti
100
110
  :type no_blink: bool
101
111
  :param vertical: vertical mode flag
102
112
  :type vertical: bool
113
+ :param hide_date: hide date flag
114
+ :type hide_date: bool
115
+ :param hide_timezone: hide timezone flag
116
+ :type hide_timezone: bool
117
+ :param am_pm: AM/PM mode flag
118
+ :type am_pm: bool
103
119
  :return: None
104
120
  """
105
121
  format_index = 0
106
122
  timezone_str = timezone
107
- time_formats = HORIZONTAL_TIME_FORMATS
123
+ time_formats = HORIZONTAL_TIME_12H_FORMATS if am_pm else HORIZONTAL_TIME_24H_FORMATS
108
124
  if vertical:
109
- time_formats = VERTICAL_TIME_FORMATS
125
+ time_formats = VERTICAL_TIME_12H_FORMATS if am_pm else VERTICAL_TIME_24H_FORMATS
110
126
  if timezone is None:
111
127
  tz = None
112
128
  timezone_str = "Local"
@@ -123,10 +139,12 @@ def run_clock(timezone=None, v_shift=0, h_shift=0, face=1, no_blink=False, verti
123
139
  current_time = datetime_now.strftime(time_formats[format_index])
124
140
  current_date = datetime_now.strftime(DATE_FORMAT)
125
141
  tprint(current_time, font=face, sep="\n" + " " * h_shift)
126
- print(" " * h_shift, end='')
127
- print(current_date)
128
- print(" " * h_shift, end='')
129
- print("Timezone: {0}".format(timezone_str))
142
+ if not hide_date:
143
+ print(" " * h_shift, end='')
144
+ print(current_date)
145
+ if not hide_timezone:
146
+ print(" " * h_shift, end='')
147
+ print("Timezone: {0}".format(timezone_str))
130
148
  time.sleep(1)
131
149
  if not no_blink:
132
150
  format_index = int(not format_index)
@@ -150,6 +168,9 @@ def main():
150
168
  parser.add_argument('--timezones-list', help='timezones list', nargs="?", const=1)
151
169
  parser.add_argument('--no-blink', help='disable blinking mode', nargs="?", const=1)
152
170
  parser.add_argument('--vertical', help='vertical mode', nargs="?", const=1)
171
+ parser.add_argument('--hide-date', help='hide date', nargs="?", const=1)
172
+ parser.add_argument('--hide-timezone', help='hide timezone', nargs="?", const=1)
173
+ parser.add_argument('--am-pm', help='AM/PM mode', nargs="?", const=1)
153
174
  args = parser.parse_args()
154
175
  if args.version:
155
176
  print(CLOX_VERSION)
@@ -167,6 +188,9 @@ def main():
167
188
  v_shift=args.v_shift,
168
189
  face=args.face,
169
190
  no_blink=args.no_blink,
170
- vertical=args.vertical)
191
+ vertical=args.vertical,
192
+ hide_date=args.hide_date,
193
+ hide_timezone=args.hide_timezone,
194
+ am_pm=args.am_pm)
171
195
  except (KeyboardInterrupt, EOFError):
172
196
  print(EXIT_MESSAGE)
clox/params.py CHANGED
@@ -2,7 +2,7 @@
2
2
  """clox params."""
3
3
  import pytz
4
4
 
5
- CLOX_VERSION = "0.4"
5
+ CLOX_VERSION = "0.5"
6
6
 
7
7
  CLOX_OVERVIEW = '''
8
8
  Clox is a terminal-based clock application designed for terminal enthusiasts who appreciate simplicity,
@@ -18,8 +18,10 @@ EXIT_MESSAGE = "See you. Bye!"
18
18
  HORIZONTAL_FACES_LIST_EXAMPLE = "12:34"
19
19
  VERTICAL_FACES_LIST_EXAMPLE = "12\n34"
20
20
 
21
- HORIZONTAL_TIME_FORMATS = ['%H:%M', '%H:%M.']
22
- VERTICAL_TIME_FORMATS = ['%H\n%M', '%H\n%M.']
21
+ HORIZONTAL_TIME_24H_FORMATS = ['%H:%M', '%H:%M.']
22
+ VERTICAL_TIME_24H_FORMATS = ['%H\n%M', '%H\n%M.']
23
+ HORIZONTAL_TIME_12H_FORMATS = ['%I:%M %p', '%I:%M %p.']
24
+ VERTICAL_TIME_12H_FORMATS = ['%I\n%M\n%p', '%I\n%M\n%p.']
23
25
  DATE_FORMAT = "%A, %B %d, %Y"
24
26
 
25
27
  TIMEZONES_LIST = pytz.all_timezones
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: clox
3
- Version: 0.4
3
+ Version: 0.5
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.4
6
+ Download-URL: https://github.com/sepandhaghighi/clox/tarball/v0.5
7
7
  Author: Sepand Haghighi
8
8
  Author-email: me@sepand.tech
9
9
  License: MIT
@@ -103,13 +103,13 @@ Clox is a terminal-based clock application designed for terminal enthusiasts who
103
103
  ## Installation
104
104
 
105
105
  ### Source Code
106
- - Download [Version 0.4](https://github.com/sepandhaghighi/clox/archive/v0.4.zip) or [Latest Source](https://github.com/sepandhaghighi/clox/archive/dev.zip)
106
+ - Download [Version 0.5](https://github.com/sepandhaghighi/clox/archive/v0.5.zip) or [Latest Source](https://github.com/sepandhaghighi/clox/archive/dev.zip)
107
107
  - `pip install .`
108
108
 
109
109
  ### PyPI
110
110
 
111
111
  - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
112
- - `pip install clox==0.4`
112
+ - `pip install clox==0.5`
113
113
 
114
114
 
115
115
  ## Usage
@@ -169,12 +169,44 @@ Disable blinking mode
169
169
  clox --no-blink
170
170
  ```
171
171
 
172
+ ### Hide Date
173
+
174
+ In this mode, the date will not be shown
175
+
176
+ ```console
177
+ clox --hide-date
178
+ ```
179
+
180
+ ### Hide Timezone
181
+
182
+ In this mode, the timezone will not be shown
183
+
184
+ ```console
185
+ clox --hide-timezone
186
+ ```
187
+
188
+ ### AM/PM Mode
189
+
190
+ In this mode, the clock will be displayed in 12-hour format
191
+
192
+ ```console
193
+ clox --am-pm
194
+ ```
195
+
172
196
  ### Vertical Mode
173
197
 
174
198
  ```console
175
199
  clox --vertical
176
200
  ```
177
201
 
202
+ ## Screen Record
203
+
204
+ <div align="center">
205
+
206
+ <img src="https://github.com/sepandhaghighi/clox/raw/main/otherfiles/help.gif">
207
+
208
+ </div>
209
+
178
210
  ## Issues & Bug Reports
179
211
 
180
212
  Just fill an issue and describe it. We'll check it ASAP!
@@ -225,6 +257,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
225
257
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
226
258
 
227
259
  ## [Unreleased]
260
+ ## [0.5] - 2025-02-14
261
+ ### Added
262
+ - `--hide-date` argument
263
+ - `--hide-timezone` argument
264
+ - `--am-pm` argument
265
+ ### Changed
266
+ - `README.md` updated
228
267
  ## [0.4] - 2025-01-18
229
268
  ### Added
230
269
  - Date
@@ -251,7 +290,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
251
290
  - `TIMEZONES.md`
252
291
  - `FACES.md`
253
292
 
254
- [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.4...dev
293
+ [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.5...dev
294
+ [0.5]: https://github.com/sepandhaghighi/clox/compare/v0.4...v0.5
255
295
  [0.4]: https://github.com/sepandhaghighi/clox/compare/v0.3...v0.4
256
296
  [0.3]: https://github.com/sepandhaghighi/clox/compare/v0.2...v0.3
257
297
  [0.2]: https://github.com/sepandhaghighi/clox/compare/v0.1...v0.2
@@ -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=xjDIgkdSchyTO3vXAdKQFebP_j4bRicJ0GQo_C23SUw,5778
4
+ clox/params.py,sha256=CCeBPUq-Dou4gRB0uwIs-iD3zEyER1QtxvsHxvseARg,1462
5
+ clox-0.5.dist-info/AUTHORS.md,sha256=lmtnd18MnfgB57jdvfJbC0JHN3iARf2Ov4pY5kPGJC8,242
6
+ clox-0.5.dist-info/LICENSE,sha256=WoAsqqZ_lNVBGdyxjwh7YnVNXKfOB-qYVrRhrn-e-_4,1072
7
+ clox-0.5.dist-info/METADATA,sha256=MfTIhRcWGGnMn-7nb2Z_VbO2xSGpttx3vT_Q4MFReLI,8138
8
+ clox-0.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
+ clox-0.5.dist-info/entry_points.txt,sha256=sP4Rmoe-DxYGjlF_Tld6nghbt_u-fK8h9ZUQFmO8TJs,45
10
+ clox-0.5.dist-info/top_level.txt,sha256=5DxGH-4VNfYkM8vbfngObh6-jpFEoSW4M90EvDGfhSw,5
11
+ clox-0.5.dist-info/RECORD,,
clox-0.4.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=M_nQUhDj15fQMDg8kk8D0qE3NBhEzmCqYQOT_KwHNuI,4853
4
- clox/params.py,sha256=4pJUD1ni02oNE_hxIMF7d-PeVvfFlsfKY1Z5HjXKq9E,1340
5
- clox-0.4.dist-info/AUTHORS.md,sha256=lmtnd18MnfgB57jdvfJbC0JHN3iARf2Ov4pY5kPGJC8,242
6
- clox-0.4.dist-info/LICENSE,sha256=WoAsqqZ_lNVBGdyxjwh7YnVNXKfOB-qYVrRhrn-e-_4,1072
7
- clox-0.4.dist-info/METADATA,sha256=GI4KRV6m3peEREQOp6PEaPUb7caNVaz12WmmVsN3eNk,7504
8
- clox-0.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
- clox-0.4.dist-info/entry_points.txt,sha256=sP4Rmoe-DxYGjlF_Tld6nghbt_u-fK8h9ZUQFmO8TJs,45
10
- clox-0.4.dist-info/top_level.txt,sha256=5DxGH-4VNfYkM8vbfngObh6-jpFEoSW4M90EvDGfhSw,5
11
- clox-0.4.dist-info/RECORD,,
File without changes
File without changes
File without changes
File without changes