clox 0.3__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,11 +8,25 @@ 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
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
17
+ from .params import CLOX_OVERVIEW, CLOX_REPO
18
+
19
+
20
+ def clox_info():
21
+ """
22
+ Print clox details.
23
+
24
+ :return: None
25
+ """
26
+ tprint("Clox")
27
+ tprint("V:" + CLOX_VERSION)
28
+ print(CLOX_OVERVIEW)
29
+ print(CLOX_REPO)
16
30
 
17
31
 
18
32
  def clear_screen():
@@ -71,7 +85,16 @@ def show_timezones_list():
71
85
  print("{0}. {1}".format(index, timezone))
72
86
 
73
87
 
74
- 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):
75
98
  """
76
99
  Run clock.
77
100
 
@@ -87,13 +110,19 @@ def run_clock(timezone=None, v_shift=0, h_shift=0, face=1, no_blink=False, verti
87
110
  :type no_blink: bool
88
111
  :param vertical: vertical mode flag
89
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
90
119
  :return: None
91
120
  """
92
121
  format_index = 0
93
122
  timezone_str = timezone
94
- time_formats = HORIZONTAL_TIME_FORMATS
123
+ time_formats = HORIZONTAL_TIME_12H_FORMATS if am_pm else HORIZONTAL_TIME_24H_FORMATS
95
124
  if vertical:
96
- time_formats = VERTICAL_TIME_FORMATS
125
+ time_formats = VERTICAL_TIME_12H_FORMATS if am_pm else VERTICAL_TIME_24H_FORMATS
97
126
  if timezone is None:
98
127
  tz = None
99
128
  timezone_str = "Local"
@@ -106,10 +135,16 @@ def run_clock(timezone=None, v_shift=0, h_shift=0, face=1, no_blink=False, verti
106
135
  clear_screen()
107
136
  print('\n' * v_shift, end='')
108
137
  print(" " * h_shift, end='')
109
- current_time = datetime.datetime.now(tz=tz).strftime(time_formats[format_index])
138
+ datetime_now = datetime.datetime.now(tz=tz)
139
+ current_time = datetime_now.strftime(time_formats[format_index])
140
+ current_date = datetime_now.strftime(DATE_FORMAT)
110
141
  tprint(current_time, font=face, sep="\n" + " " * h_shift)
111
- print(" " * h_shift, end='')
112
- 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))
113
148
  time.sleep(1)
114
149
  if not no_blink:
115
150
  format_index = int(not format_index)
@@ -127,14 +162,20 @@ def main():
127
162
  parser.add_argument('--v-shift', help='vertical shift', type=int, default=0)
128
163
  parser.add_argument('--h-shift', help='horizontal shift', type=int, default=0)
129
164
  parser.add_argument('--version', help='version', nargs="?", const=1)
165
+ parser.add_argument('--info', help='info', nargs="?", const=1)
130
166
  parser.add_argument('--face', help='face', type=int, choices=FACES_LIST, default=1)
131
167
  parser.add_argument('--faces-list', help='faces list', nargs="?", const=1)
132
168
  parser.add_argument('--timezones-list', help='timezones list', nargs="?", const=1)
133
169
  parser.add_argument('--no-blink', help='disable blinking mode', nargs="?", const=1)
134
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)
135
174
  args = parser.parse_args()
136
175
  if args.version:
137
176
  print(CLOX_VERSION)
177
+ elif args.info:
178
+ clox_info()
138
179
  elif args.faces_list:
139
180
  show_faces_list(vertical=args.vertical)
140
181
  elif args.timezones_list:
@@ -147,6 +188,9 @@ def main():
147
188
  v_shift=args.v_shift,
148
189
  face=args.face,
149
190
  no_blink=args.no_blink,
150
- 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)
151
195
  except (KeyboardInterrupt, EOFError):
152
196
  print(EXIT_MESSAGE)
clox/params.py CHANGED
@@ -2,7 +2,15 @@
2
2
  """clox params."""
3
3
  import pytz
4
4
 
5
- CLOX_VERSION = "0.3"
5
+ CLOX_VERSION = "0.5"
6
+
7
+ CLOX_OVERVIEW = '''
8
+ Clox is a terminal-based clock application designed for terminal enthusiasts who appreciate simplicity,
9
+ elegance, and productivity within their command-line environment. Whether you're coding, monitoring tasks,
10
+ or simply enjoying the terminal aesthetic, Clox brings a stylish and customizable time display to your workspace.
11
+ '''
12
+
13
+ CLOX_REPO = "Repo : https://github.com/sepandhaghighi/clox"
6
14
 
7
15
  ADDITIONAL_INFO = "Additional information: Press `Ctrl+C` to exit."
8
16
  EXIT_MESSAGE = "See you. Bye!"
@@ -10,8 +18,11 @@ EXIT_MESSAGE = "See you. Bye!"
10
18
  HORIZONTAL_FACES_LIST_EXAMPLE = "12:34"
11
19
  VERTICAL_FACES_LIST_EXAMPLE = "12\n34"
12
20
 
13
- HORIZONTAL_TIME_FORMATS = ['%H:%M', '%H:%M.']
14
- 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.']
25
+ DATE_FORMAT = "%A, %B %d, %Y"
15
26
 
16
27
  TIMEZONES_LIST = pytz.all_timezones
17
28
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: clox
3
- Version: 0.3
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.3
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.3](https://github.com/sepandhaghighi/clox/archive/v0.3.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.3`
112
+ - `pip install clox==0.5`
113
113
 
114
114
 
115
115
  ## Usage
@@ -122,6 +122,12 @@ Clox is a terminal-based clock application designed for terminal enthusiasts who
122
122
  clox --version
123
123
  ```
124
124
 
125
+ ### Info
126
+
127
+ ```console
128
+ clox --info
129
+ ```
130
+
125
131
  ### Basic
126
132
 
127
133
  ℹ️ Press `Ctrl + C` to exit
@@ -163,12 +169,44 @@ Disable blinking mode
163
169
  clox --no-blink
164
170
  ```
165
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
+
166
196
  ### Vertical Mode
167
197
 
168
198
  ```console
169
199
  clox --vertical
170
200
  ```
171
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
+
172
210
  ## Issues & Bug Reports
173
211
 
174
212
  Just fill an issue and describe it. We'll check it ASAP!
@@ -219,6 +257,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
219
257
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
220
258
 
221
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
267
+ ## [0.4] - 2025-01-18
268
+ ### Added
269
+ - Date
270
+ - `--info` argument
222
271
  ## [0.3] - 2025-01-10
223
272
  ### Added
224
273
  - Logo
@@ -241,7 +290,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
241
290
  - `TIMEZONES.md`
242
291
  - `FACES.md`
243
292
 
244
- [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.3...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
295
+ [0.4]: https://github.com/sepandhaghighi/clox/compare/v0.3...v0.4
245
296
  [0.3]: https://github.com/sepandhaghighi/clox/compare/v0.2...v0.3
246
297
  [0.2]: https://github.com/sepandhaghighi/clox/compare/v0.1...v0.2
247
298
  [0.1]: https://github.com/sepandhaghighi/clox/compare/e9b49e2...v0.1
@@ -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.3.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=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,,
File without changes
File without changes
File without changes
File without changes