clox 0.5__tar.gz → 0.6__tar.gz

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.

@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
+ ## [0.6] - 2025-02-25
9
+ ### Added
10
+ - `--calendar` argument
11
+ ### Changed
12
+ - `README.md` updated
8
13
  ## [0.5] - 2025-02-14
9
14
  ### Added
10
15
  - `--hide-date` argument
@@ -38,7 +43,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
38
43
  - `TIMEZONES.md`
39
44
  - `FACES.md`
40
45
 
41
- [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.5...dev
46
+ [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.6...dev
47
+ [0.6]: https://github.com/sepandhaghighi/clox/compare/v0.5...v0.6
42
48
  [0.5]: https://github.com/sepandhaghighi/clox/compare/v0.4...v0.5
43
49
  [0.4]: https://github.com/sepandhaghighi/clox/compare/v0.3...v0.4
44
50
  [0.3]: https://github.com/sepandhaghighi/clox/compare/v0.2...v0.3
@@ -1,15 +1,15 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: clox
3
- Version: 0.5
3
+ Version: 0.6
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.5
6
+ Download-URL: https://github.com/sepandhaghighi/clox/tarball/v0.6
7
7
  Author: Sepand Haghighi
8
8
  Author-email: me@sepand.tech
9
9
  License: MIT
10
10
  Project-URL: Source, https://github.com/sepandhaghighi/clox
11
11
  Keywords: clock time timer timezone terminal cli geek clox
12
- Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Development Status :: 4 - Beta
13
13
  Classifier: Natural Language :: English
14
14
  Classifier: License :: OSI Approved :: MIT License
15
15
  Classifier: Operating System :: OS Independent
@@ -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.5](https://github.com/sepandhaghighi/clox/archive/v0.5.zip) or [Latest Source](https://github.com/sepandhaghighi/clox/archive/dev.zip)
106
+ - Download [Version 0.6](https://github.com/sepandhaghighi/clox/archive/v0.6.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.5`
112
+ - `pip install clox==0.6`
113
113
 
114
114
 
115
115
  ## Usage
@@ -199,6 +199,16 @@ clox --am-pm
199
199
  clox --vertical
200
200
  ```
201
201
 
202
+ ### Calendar Mode
203
+
204
+ In this mode, the calendar will be displayed
205
+
206
+ ℹ️ Valid choices: [`month`, `year`]
207
+
208
+ ```console
209
+ clox --calendar=month
210
+ ```
211
+
202
212
  ## Screen Record
203
213
 
204
214
  <div align="center">
@@ -257,6 +267,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
257
267
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
258
268
 
259
269
  ## [Unreleased]
270
+ ## [0.6] - 2025-02-25
271
+ ### Added
272
+ - `--calendar` argument
273
+ ### Changed
274
+ - `README.md` updated
260
275
  ## [0.5] - 2025-02-14
261
276
  ### Added
262
277
  - `--hide-date` argument
@@ -290,7 +305,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
290
305
  - `TIMEZONES.md`
291
306
  - `FACES.md`
292
307
 
293
- [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.5...dev
308
+ [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.6...dev
309
+ [0.6]: https://github.com/sepandhaghighi/clox/compare/v0.5...v0.6
294
310
  [0.5]: https://github.com/sepandhaghighi/clox/compare/v0.4...v0.5
295
311
  [0.4]: https://github.com/sepandhaghighi/clox/compare/v0.3...v0.4
296
312
  [0.3]: https://github.com/sepandhaghighi/clox/compare/v0.2...v0.3
@@ -53,13 +53,13 @@ Clox is a terminal-based clock application designed for terminal enthusiasts who
53
53
  ## Installation
54
54
 
55
55
  ### Source Code
56
- - Download [Version 0.5](https://github.com/sepandhaghighi/clox/archive/v0.5.zip) or [Latest Source](https://github.com/sepandhaghighi/clox/archive/dev.zip)
56
+ - Download [Version 0.6](https://github.com/sepandhaghighi/clox/archive/v0.6.zip) or [Latest Source](https://github.com/sepandhaghighi/clox/archive/dev.zip)
57
57
  - `pip install .`
58
58
 
59
59
  ### PyPI
60
60
 
61
61
  - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
62
- - `pip install clox==0.5`
62
+ - `pip install clox==0.6`
63
63
 
64
64
 
65
65
  ## Usage
@@ -149,6 +149,16 @@ clox --am-pm
149
149
  clox --vertical
150
150
  ```
151
151
 
152
+ ### Calendar Mode
153
+
154
+ In this mode, the calendar will be displayed
155
+
156
+ ℹ️ Valid choices: [`month`, `year`]
157
+
158
+ ```console
159
+ clox --calendar=month
160
+ ```
161
+
152
162
  ## Screen Record
153
163
 
154
164
  <div align="center">
@@ -4,8 +4,8 @@
4
4
 
5
5
  | Version | Supported |
6
6
  | ------------- | ------------------ |
7
- | 0.5 | :white_check_mark: |
8
- | < 0.5 | :x: |
7
+ | 0.6 | :white_check_mark: |
8
+ | < 0.6 | :x: |
9
9
 
10
10
  ## Reporting a Vulnerability
11
11
 
@@ -3,6 +3,7 @@
3
3
  import os
4
4
  import sys
5
5
  import time
6
+ import calendar
6
7
  import random
7
8
  import datetime
8
9
  import argparse
@@ -12,7 +13,7 @@ from .params import HORIZONTAL_TIME_24H_FORMATS, VERTICAL_TIME_24H_FORMATS
12
13
  from .params import HORIZONTAL_TIME_12H_FORMATS, VERTICAL_TIME_12H_FORMATS
13
14
  from .params import TIMEZONES_LIST, CLOX_VERSION, DATE_FORMAT
14
15
  from .params import ADDITIONAL_INFO, EXIT_MESSAGE
15
- from .params import FACES_MAP, FACES_LIST
16
+ from .params import FACES_MAP, FACES_LIST, CALENDAR_LIST
16
17
  from .params import HORIZONTAL_FACES_LIST_EXAMPLE, VERTICAL_FACES_LIST_EXAMPLE
17
18
  from .params import CLOX_OVERVIEW, CLOX_REPO
18
19
 
@@ -67,9 +68,9 @@ def show_faces_list(vertical=False):
67
68
  if vertical:
68
69
  example = VERTICAL_FACES_LIST_EXAMPLE
69
70
  mode = "Vertical"
70
- print("Faces list ({0}):\n".format(mode))
71
+ print("Faces list ({mode}):\n".format(mode=mode))
71
72
  for i in sorted(FACES_MAP):
72
- print('Face {}\n'.format(i))
73
+ print('Face {index}\n'.format(index=i))
73
74
  tprint(example, font=get_face(i))
74
75
  print('=' * 80)
75
76
 
@@ -82,7 +83,41 @@ def show_timezones_list():
82
83
  """
83
84
  print("Timezones list:\n")
84
85
  for index, timezone in enumerate(TIMEZONES_LIST, 1):
85
- print("{0}. {1}".format(index, timezone))
86
+ print("{index}. {timezone}".format(index=index, timezone=timezone))
87
+
88
+
89
+ def print_calendar(mode="month", timezone=None, v_shift=0, h_shift=0):
90
+ """
91
+ Print calendar.
92
+
93
+ :param mode: calendar mode
94
+ :type mode: str
95
+ :param timezone: timezone
96
+ :type timezone: str
97
+ :param v_shift: vertical shift
98
+ :type v_shift: int
99
+ :param h_shift: horizontal shift
100
+ :type h_shift: int
101
+ :return: None
102
+ """
103
+ tz = None
104
+ timezone_str = "Local"
105
+ if timezone is not None:
106
+ timezone_str = timezone
107
+ tz = pytz.timezone(timezone)
108
+ v_shift = max(0, v_shift)
109
+ h_shift = max(0, h_shift)
110
+ datetime_now = datetime.datetime.now(tz=tz)
111
+ current_date = datetime_now.strftime(DATE_FORMAT)
112
+ print('\n' * v_shift, end='')
113
+ print(" " * h_shift, end='')
114
+ print("Today: {date}".format(date=current_date))
115
+ print(" " * h_shift, end='')
116
+ print("Timezone: {timezone}\n".format(timezone=timezone_str))
117
+ calendar_str = calendar.month(datetime_now.year, datetime_now.month)
118
+ if mode == "year":
119
+ calendar_str = calendar.calendar(datetime_now.year)
120
+ print("\n".join([" " * h_shift + x for x in calendar_str.split("\n")]))
86
121
 
87
122
 
88
123
  def run_clock(
@@ -119,14 +154,13 @@ def run_clock(
119
154
  :return: None
120
155
  """
121
156
  format_index = 0
122
- timezone_str = timezone
123
157
  time_formats = HORIZONTAL_TIME_12H_FORMATS if am_pm else HORIZONTAL_TIME_24H_FORMATS
124
158
  if vertical:
125
159
  time_formats = VERTICAL_TIME_12H_FORMATS if am_pm else VERTICAL_TIME_24H_FORMATS
126
- if timezone is None:
127
- tz = None
128
- timezone_str = "Local"
129
- else:
160
+ tz = None
161
+ timezone_str = "Local"
162
+ if timezone is not None:
163
+ timezone_str = timezone
130
164
  tz = pytz.timezone(timezone)
131
165
  v_shift = max(0, v_shift)
132
166
  h_shift = max(0, h_shift)
@@ -144,7 +178,7 @@ def run_clock(
144
178
  print(current_date)
145
179
  if not hide_timezone:
146
180
  print(" " * h_shift, end='')
147
- print("Timezone: {0}".format(timezone_str))
181
+ print("Timezone: {timezone}".format(timezone=timezone_str))
148
182
  time.sleep(1)
149
183
  if not no_blink:
150
184
  format_index = int(not format_index)
@@ -171,6 +205,7 @@ def main():
171
205
  parser.add_argument('--hide-date', help='hide date', nargs="?", const=1)
172
206
  parser.add_argument('--hide-timezone', help='hide timezone', nargs="?", const=1)
173
207
  parser.add_argument('--am-pm', help='AM/PM mode', nargs="?", const=1)
208
+ parser.add_argument('--calendar', help='calendar mode', type=str, choices=CALENDAR_LIST)
174
209
  args = parser.parse_args()
175
210
  if args.version:
176
211
  print(CLOX_VERSION)
@@ -180,6 +215,8 @@ def main():
180
215
  show_faces_list(vertical=args.vertical)
181
216
  elif args.timezones_list:
182
217
  show_timezones_list()
218
+ elif args.calendar:
219
+ print_calendar(mode=args.calendar, timezone=args.timezone, h_shift=args.h_shift, v_shift=args.v_shift)
183
220
  else:
184
221
  try:
185
222
  run_clock(
@@ -2,7 +2,7 @@
2
2
  """clox params."""
3
3
  import pytz
4
4
 
5
- CLOX_VERSION = "0.5"
5
+ CLOX_VERSION = "0.6"
6
6
 
7
7
  CLOX_OVERVIEW = '''
8
8
  Clox is a terminal-based clock application designed for terminal enthusiasts who appreciate simplicity,
@@ -56,3 +56,5 @@ FACES_MAP = {
56
56
  }
57
57
 
58
58
  FACES_LIST = [-1] + sorted(FACES_MAP)
59
+
60
+ CALENDAR_LIST = ["month", "year"]
@@ -1,15 +1,15 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: clox
3
- Version: 0.5
3
+ Version: 0.6
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.5
6
+ Download-URL: https://github.com/sepandhaghighi/clox/tarball/v0.6
7
7
  Author: Sepand Haghighi
8
8
  Author-email: me@sepand.tech
9
9
  License: MIT
10
10
  Project-URL: Source, https://github.com/sepandhaghighi/clox
11
11
  Keywords: clock time timer timezone terminal cli geek clox
12
- Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Development Status :: 4 - Beta
13
13
  Classifier: Natural Language :: English
14
14
  Classifier: License :: OSI Approved :: MIT License
15
15
  Classifier: Operating System :: OS Independent
@@ -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.5](https://github.com/sepandhaghighi/clox/archive/v0.5.zip) or [Latest Source](https://github.com/sepandhaghighi/clox/archive/dev.zip)
106
+ - Download [Version 0.6](https://github.com/sepandhaghighi/clox/archive/v0.6.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.5`
112
+ - `pip install clox==0.6`
113
113
 
114
114
 
115
115
  ## Usage
@@ -199,6 +199,16 @@ clox --am-pm
199
199
  clox --vertical
200
200
  ```
201
201
 
202
+ ### Calendar Mode
203
+
204
+ In this mode, the calendar will be displayed
205
+
206
+ ℹ️ Valid choices: [`month`, `year`]
207
+
208
+ ```console
209
+ clox --calendar=month
210
+ ```
211
+
202
212
  ## Screen Record
203
213
 
204
214
  <div align="center">
@@ -257,6 +267,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
257
267
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
258
268
 
259
269
  ## [Unreleased]
270
+ ## [0.6] - 2025-02-25
271
+ ### Added
272
+ - `--calendar` argument
273
+ ### Changed
274
+ - `README.md` updated
260
275
  ## [0.5] - 2025-02-14
261
276
  ### Added
262
277
  - `--hide-date` argument
@@ -290,7 +305,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
290
305
  - `TIMEZONES.md`
291
306
  - `FACES.md`
292
307
 
293
- [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.5...dev
308
+ [Unreleased]: https://github.com/sepandhaghighi/clox/compare/v0.6...dev
309
+ [0.6]: https://github.com/sepandhaghighi/clox/compare/v0.5...v0.6
294
310
  [0.5]: https://github.com/sepandhaghighi/clox/compare/v0.4...v0.5
295
311
  [0.4]: https://github.com/sepandhaghighi/clox/compare/v0.3...v0.4
296
312
  [0.3]: https://github.com/sepandhaghighi/clox/compare/v0.2...v0.3
@@ -29,7 +29,7 @@ def read_description():
29
29
  setup(
30
30
  name='clox',
31
31
  packages=['clox'],
32
- version='0.5',
32
+ version='0.6',
33
33
  description='A Geeky Clock for Terminal Enthusiasts',
34
34
  long_description=read_description(),
35
35
  long_description_content_type='text/markdown',
@@ -37,7 +37,7 @@ setup(
37
37
  author='Sepand Haghighi',
38
38
  author_email='me@sepand.tech',
39
39
  url='https://github.com/sepandhaghighi/clox',
40
- download_url='https://github.com/sepandhaghighi/clox/tarball/v0.5',
40
+ download_url='https://github.com/sepandhaghighi/clox/tarball/v0.6',
41
41
  keywords="clock time timer timezone terminal cli geek clox",
42
42
  project_urls={
43
43
  'Source': 'https://github.com/sepandhaghighi/clox'
@@ -45,7 +45,7 @@ setup(
45
45
  install_requires=get_requires(),
46
46
  python_requires='>=3.6',
47
47
  classifiers=[
48
- 'Development Status :: 3 - Alpha',
48
+ 'Development Status :: 4 - Beta',
49
49
  'Natural Language :: English',
50
50
  'License :: OSI Approved :: MIT License',
51
51
  'Operating System :: OS Independent',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes