ftagger 0.1.0__tar.gz → 0.1.2__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.4
2
2
  Name: ftagger
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Simple command-line file tagger
5
5
  Author-email: Charlie O'Dwyer <charlieodwyer2289@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ftagger"
3
- version = "0.1.0"
3
+ version = "0.1.2"
4
4
  description = "Simple command-line file tagger"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -249,25 +249,20 @@ def reset_data() -> None:
249
249
 
250
250
  with open(globals.FMPREVIOUSCOMMAND, "w") as file:
251
251
  default_data: dict = {
252
- "0": [
253
- "/home/charlie/.local/bin/fm",
254
- "la"
255
- ],
256
- "1": [
257
- "/home/charlie/.local/bin/fm",
258
- "undo"
259
- ],
260
- "2": [
261
- "/home/charlie/.local/bin/fm",
262
- "efdsfs"
263
- ],
264
- "3": [
265
- "/home/charlie/.local/bin/fm",
266
- "efdsfs"
267
- ],
268
- "4": [
269
- "/home/charlie/Projects/fm/.venv/bin/fm",
270
- "rd"
271
- ]
272
- }
252
+ "0": [
253
+ "Default",
254
+ ],
255
+ "1": [
256
+ "Default",
257
+ ],
258
+ "2": [
259
+ "Default",
260
+ ],
261
+ "3": [
262
+ "Default",
263
+ ],
264
+ "4": [
265
+ "Default",
266
+ ]
267
+ }
273
268
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ftagger
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Simple command-line file tagger
5
5
  Author-email: Charlie O'Dwyer <charlieodwyer2289@gmail.com>
6
6
  License-Expression: MIT
@@ -1,7 +1,6 @@
1
1
  LICENSE.txt
2
2
  README.md
3
3
  pyproject.toml
4
- src/__init__.py
5
4
  src/ansi_codes.py
6
5
  src/commands.py
7
6
  src/globals.py
@@ -1,4 +1,3 @@
1
- __init__
2
1
  ansi_codes
3
2
  commands
4
3
  globals
@@ -1,5 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
+ FMDATA = Path.home() / ".fmdata"
3
4
  FMDEFAULT = f"{Path.home()}/.fmdata/.fmdefault"
4
5
  FMALIASES = f"{Path.home()}/.fmdata/.fmaliases"
5
6
  FMALIASLOOKUP = f"{Path.home()}/.fmdata/.fmaliaslookup"
@@ -69,6 +69,8 @@ def undo() -> None:
69
69
 
70
70
 
71
71
  def main() -> None:
72
+ check_for_first_run()
73
+
72
74
  command: list[str] = argv
73
75
 
74
76
 
@@ -0,0 +1,79 @@
1
+ import ansi_codes as ac
2
+ import json
3
+
4
+ from globals import *
5
+
6
+
7
+ def check_for_first_run():
8
+ if not FMDATA.exists():
9
+ with open(globals.FMALIASLOOKUP, "w") as file:
10
+ json.dump({}, file, indent=4)
11
+
12
+
13
+ with open(globals.FMALIASES, "w") as file:
14
+ json.dump({}, file, indent=4)
15
+
16
+
17
+ with open(globals.FMDEFAULT, "w") as file:
18
+ default_data: dict = {
19
+ "--help": "help",
20
+ "at": "add_tag",
21
+ "rt": "remove_tag",
22
+ "gi": "get_items_by_tag",
23
+ "gt": "get_tags",
24
+ "li": "list_items_and_tags",
25
+ "rc": "recursive_add_tag",
26
+ "rr": "recursive_remove_tag",
27
+ "ca": "create_alias",
28
+ "ra": "remove_alias",
29
+ "la": "list_aliases",
30
+ "rd": "reset_data",
31
+ "un": "undo"
32
+ }
33
+
34
+ json.dump(default_data, file, indent=4)
35
+
36
+
37
+ with open(globals.FMUNDOLOOKUP) as file:
38
+ default_data: dict = {
39
+ "at": "rt",
40
+ "rt": "at",
41
+ "rc": "rr",
42
+ "rr": "rc",
43
+ "ca": "ra",
44
+ "ra": "ca",
45
+ "tag": "rt"
46
+ }
47
+
48
+
49
+ with open(globals.FMPREVIOUSCOMMAND, "w") as file:
50
+ default_data: dict = {
51
+ "0": [
52
+ "Default",
53
+ ],
54
+ "1": [
55
+ "Default",
56
+ ],
57
+ "2": [
58
+ "Default",
59
+ ],
60
+ "3": [
61
+ "Default",
62
+ ],
63
+ "4": [
64
+ "Default",
65
+ ]
66
+ }
67
+
68
+
69
+ def error(text: str) -> None:
70
+ print(f"{ac.red}{text}{ac.clear}")
71
+
72
+
73
+ def debug(text: str) -> None:
74
+ print(f"{ac.green}{text}{ac.clear}")
75
+
76
+
77
+ def info(*text: str) -> None:
78
+ for line in text:
79
+ print(line)
File without changes
@@ -1,13 +0,0 @@
1
- import ansi_codes as ac
2
-
3
- def error(text: str) -> None:
4
- print(f"{ac.red}{text}{ac.clear}")
5
-
6
-
7
- def debug(text: str) -> None:
8
- print(f"{ac.green}{text}{ac.clear}")
9
-
10
-
11
- def info(*text: str) -> None:
12
- for line in text:
13
- print(line)
File without changes
File without changes
File without changes
File without changes