tmscli 0.4.0__tar.gz → 0.5.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tmscli
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: runs minesweeper in your terminal, type rules for how to play
5
5
  Description-Content-Type: text/markdown
6
6
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "tmscli"
7
- version = "0.4.0"
7
+ version = "0.5.0"
8
8
  description = "runs minesweeper in your terminal, type rules for how to play"
9
9
  readme="README.md"
10
10
  dependencies = []
@@ -12,7 +12,7 @@
12
12
  <div class="header-inner">
13
13
  <div class="logo">tmscli</div>
14
14
  <nav>
15
- <a href="index.html">main</a>
15
+ <a href="index.html" class="active">main</a>
16
16
  <a href="about.html">about</a>
17
17
  <a href="install.html">installation + usage</a>
18
18
  <a href="screenshots.html">screenshots</a>
@@ -1,11 +1,32 @@
1
1
  import random
2
2
  import argparse
3
3
  import importlib.metadata
4
+ colors=['\033[31m','\033[32m','\033[33m','\033[34m','\033[35m','\033[36m','\033[37m','\033[38m','\033[39m']
5
+ MINE='\033[30m'
6
+ FLAG='\033[29m'
7
+ RESET = '\033[0m'
8
+
4
9
  class minesweeper():
5
10
  def __init__(self,size,num):
6
11
  self.size=size
7
12
  self.num=num
8
13
  ['uncovered?','flagged?','display']
14
+ def colored(self,string):
15
+ new=f'|'
16
+ c=0
17
+ for i in string:
18
+ c+=1
19
+ if i != '|':
20
+ if i in ['0','1','2','3','4','5','6','7','8']:
21
+ new+=f'{colors[int(i)]}{i}{RESET}'
22
+ elif i == 'M':
23
+ new+=f'{MINE}{i}{RESET}'
24
+ elif i == 'F':
25
+ new+=f'{FLAG}{i}{RESET}'
26
+ else:
27
+ new+=' '
28
+ new+='|'
29
+ return new
9
30
  def print_board(self,board):
10
31
  top=' '+(self.size*2)*'_'
11
32
  print(top)
@@ -18,7 +39,7 @@ class minesweeper():
18
39
  buffer+='F'+' '
19
40
  else:
20
41
  buffer+=' '+' '
21
- print(buffer[:-1]+'|')
42
+ print(self.colored(buffer[:-1]+'|'))
22
43
  bottom=' '+(len(top)-1)*'-'
23
44
  print(bottom)
24
45
  def get_mines(self):
@@ -58,11 +79,15 @@ class minesweeper():
58
79
  board[i][j][2]=c
59
80
  return board
60
81
  def print_ending(self,board):
82
+ top=' '+(self.size*2)*'_'
83
+ print(top)
61
84
  for i in board:
62
85
  buffer=''
63
86
  for j in i:
64
87
  buffer+=str(j[2])+' '
65
- print(buffer)
88
+ print(self.colored(buffer))
89
+ bottom=' '+(len(top)-1)*'-'
90
+ print(bottom)
66
91
  exit()
67
92
  def check_success(self,board):
68
93
  for i in board:
@@ -155,7 +180,7 @@ def main_loop(board):
155
180
  terminal_minesweeper.print_ending(board)
156
181
  def run():
157
182
  try:
158
- __version__ = importlib.metadata.version("your-package-name")
183
+ __version__ = importlib.metadata.version("tmscli")
159
184
  except importlib.metadata.PackageNotFoundError:
160
185
  __version__ = "0.0.0-dev"
161
186
  p=argparse.ArgumentParser(description='Minesweeper CLI')
@@ -192,7 +217,6 @@ def run():
192
217
  mines=terminal_minesweeper.get_mines()
193
218
  board=terminal_minesweeper.create_starting_board(mines)
194
219
  main_loop(board)
195
-
196
220
  def print_rules():
197
221
  place='''
198
222
  y------>
@@ -28,7 +28,7 @@
28
28
 
29
29
  <div class="embed-card">
30
30
  <iframe
31
- src="https://www.programiz.com/online-compiler/0cfPcHKGhg10y"
31
+ src="https://onecompiler.com/python/456p63wg4"
32
32
  title="tmscli on Programiz"
33
33
  loading="lazy"
34
34
  allow="clipboard-write"
@@ -39,7 +39,7 @@
39
39
 
40
40
  <p class="embed-fallback">
41
41
  If the embed doesn't load, open it directly:
42
- <a href="https://www.programiz.com/online-compiler/0cfPcHKGhg10y" target="_blank" rel="noopener">
42
+ <a href="https://onecompiler.com/python/456p63wg4" target="_blank" rel="noopener">
43
43
  programiz.com/online-compiler/0cfPcHKGhg10y
44
44
  </a>
45
45
  </p>
@@ -25,13 +25,6 @@
25
25
  <main class="container">
26
26
  <h1>screenshots</h1>
27
27
  <p class="subhead">See tmscli in action — straight from the terminal.</p>
28
-
29
- <!--
30
- Add your screenshots below.
31
- Each .screenshot-card is one entry. Duplicate the block as needed.
32
- Replace the <img> src with your actual image path, e.g. "img/fresh-board.png"
33
- -->
34
-
35
28
  <div class="screenshot-grid">
36
29
 
37
30
  <div class="screenshot-card">
@@ -264,51 +264,6 @@ footer {
264
264
  margin-top: 1rem;
265
265
  }
266
266
 
267
- /* responsive */
268
- @media (max-width: 700px) {
269
- .header-inner {
270
- flex-direction: column;
271
- gap: 0.8rem;
272
- align-items: flex-start;
273
- padding: 1rem 1.5rem;
274
- }
275
-
276
- nav {
277
- gap: 1.2rem;
278
- width: 100%;
279
- }
280
-
281
- .container {
282
- padding: 0 1.5rem;
283
- margin-top: 1.5rem;
284
- }
285
-
286
- h1 {
287
- font-size: 2rem;
288
- }
289
-
290
- .subhead {
291
- font-size: 1rem;
292
- padding-left: 0.8rem;
293
- }
294
-
295
- .card-grid {
296
- grid-template-columns: 1fr;
297
- gap: 1.2rem;
298
- }
299
-
300
- .install-card,
301
- .about-section,
302
- .usage-section,
303
- .lorem-block {
304
- padding: 1.5rem 1.2rem 0.8rem;
305
- }
306
-
307
- pre {
308
- padding: 0.8rem 1rem;
309
- font-size: 0.85rem;
310
- }
311
- }
312
267
  .changelog-entry {
313
268
  background: #ffffff;
314
269
  padding: 1.8rem 2rem 1.2rem;
@@ -355,24 +310,7 @@ footer {
355
310
  margin-top: 0.8rem;
356
311
  }
357
312
 
358
- /* responsive for new pages */
359
- @media (max-width: 700px) {
360
- .screenshot-grid {
361
- grid-template-columns: 1fr;
362
- gap: 1.2rem;
363
- }
364
-
365
- .screenshot-card,
366
- .changelog-entry {
367
- padding: 1.5rem 1.2rem 0.8rem;
368
- }
369
313
 
370
- .screenshot-card pre {
371
- font-size: 0.7rem;
372
- padding: 0.8rem;
373
- }
374
- }
375
- /* ---- tables & lists (usage page) ---- */
376
314
 
377
315
  .flags-table {
378
316
  width: 100%;
@@ -429,16 +367,6 @@ footer {
429
367
  border-bottom: none;
430
368
  }
431
369
 
432
- @media (max-width: 700px) {
433
- .flags-table {
434
- font-size: 0.85rem;
435
- }
436
-
437
- .flags-table th,
438
- .flags-table td {
439
- padding: 0.6rem 0.7rem;
440
- }
441
- }
442
370
  .embed-card {
443
371
  background: #ffffff;
444
372
  border: 1px solid #e1eef5;
@@ -467,9 +395,3 @@ footer {
467
395
  font-weight: 500;
468
396
  word-break: break-all;
469
397
  }
470
-
471
- @media (max-width: 700px) {
472
- .embed-frame {
473
- height: 550px;
474
- }
475
- }
tmscli-0.5.0/update.sh ADDED
@@ -0,0 +1,34 @@
1
+ #!/bin/bash
2
+
3
+ # Exit immediately if any command fails
4
+ set -e
5
+
6
+ read commit
7
+ read pypi
8
+ if [ "$pypi" == "yes" ]; then
9
+
10
+ echo "* Building the package with Hatch..."
11
+ hatch build
12
+
13
+ echo "* Publishing the package to PyPI..."
14
+ hatch publish
15
+
16
+ fi
17
+ if [ "$commit" == "yes" ]; then
18
+ echo "* Pulling latest changes from remote Git repository..."
19
+ git pull || echo " Pull skipped or failed, continuing..."
20
+
21
+ echo "* Staging changes..."
22
+ git add .
23
+
24
+ echo "* Committing changes..."
25
+ read reason
26
+ git commit -m "$reason"
27
+
28
+ echo "* Pushing changes to remote..."
29
+ git push
30
+ fi
31
+
32
+ echo "* Updating current installed module"
33
+ pip install --upgrade tmscli
34
+ echo "* All steps completed successfully!"
tmscli-0.4.0/update.sh DELETED
@@ -1,34 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Exit immediately if any command fails
4
- set -e
5
-
6
- read commit
7
- read pypi
8
- if [ "$pypi" == "yes" ]; then
9
-
10
- echo "Building the package with Hatch..."
11
- hatch build
12
-
13
- echo "Publishing the package to PyPI..."
14
- hatch publish
15
-
16
- fi
17
- if [ "$commit" == "yes" ]; then
18
- echo "Pulling latest changes from remote Git repository..."
19
- git pull || echo "Pull skipped or failed, continuing..."
20
-
21
- echo "Staging changes..."
22
- git add .
23
-
24
- echo "Committing changes..."
25
- read reason
26
- git commit -m "$reason"
27
-
28
- echo "Pushing changes to remote..."
29
- git push
30
- fi
31
-
32
- echo "Updating current installed module"
33
- pip install --upgrade tmscli
34
- echo "All steps completed successfully!"
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