hyprconf2lua 1.8.0__tar.gz → 1.8.1__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.
Files changed (23) hide show
  1. {hyprconf2lua-1.8.0/src/hyprconf2lua.egg-info → hyprconf2lua-1.8.1}/PKG-INFO +1 -1
  2. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/pyproject.toml +1 -1
  3. hyprconf2lua-1.8.1/src/hyprconf2lua/__init__.py +1 -0
  4. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/codegen.py +15 -1
  5. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/lexer.py +2 -2
  6. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/parser.py +5 -5
  7. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1/src/hyprconf2lua.egg-info}/PKG-INFO +1 -1
  8. hyprconf2lua-1.8.0/src/hyprconf2lua/__init__.py +0 -1
  9. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/LICENSE +0 -0
  10. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/README.md +0 -0
  11. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/setup.cfg +0 -0
  12. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/__main__.py +0 -0
  13. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/ast.py +0 -0
  14. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/cli.py +0 -0
  15. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/converter.py +0 -0
  16. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/mappings.py +0 -0
  17. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/SOURCES.txt +0 -0
  18. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/dependency_links.txt +0 -0
  19. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/entry_points.txt +0 -0
  20. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/requires.txt +0 -0
  21. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/top_level.txt +0 -0
  22. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/tests/test_converter.py +0 -0
  23. {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/tests/test_issue54.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyprconf2lua
3
- Version: 1.8.0
3
+ Version: 1.8.1
4
4
  Summary: Convert Hyprland hyprlang .conf files to Lua .lua config format (v0.55+)
5
5
  Author: hyprconf2lua contributors
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hyprconf2lua"
7
- version = "1.8.0"
7
+ version = "1.8.1"
8
8
  description = "Convert Hyprland hyprlang .conf files to Lua .lua config format (v0.55+)"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -0,0 +1 @@
1
+ __version__ = "1.8.1"
@@ -55,7 +55,8 @@ class Codegen:
55
55
 
56
56
  def generate(self, config: ConfigFile) -> str:
57
57
  self.lines = []
58
- self.emit("-- Generated by hyprconf2lua v1.4.0")
58
+ import hyprconf2lua
59
+ self.emit(f"-- Generated by hyprconf2lua v{hyprconf2lua.__version__}")
59
60
  self.emit("-- https://github.com/Prateek-squadron/hyprconf2lua")
60
61
  self.emit("-- Manual review may be needed for complex directives")
61
62
  self.emit("")
@@ -618,6 +619,19 @@ class Codegen:
618
619
  if dispatcher == "pass":
619
620
  return f'{func}({{ window = {self.quote(params[0]) if params else "nil"} }})'
620
621
 
622
+ if dispatcher == "fullscreen":
623
+ if params and params[0] == "1":
624
+ return f'{func}({{ mode = 1 }})'
625
+ elif params and params[0] == "0":
626
+ return f'{func}()'
627
+ return f'{func}()'
628
+
629
+ if dispatcher == "splitratio":
630
+ nums = params[0].split() if params else []
631
+ x = nums[0] if len(nums) > 0 else "0"
632
+ y = nums[1] if len(nums) > 1 else "0"
633
+ return f'{func}({{ x = {x}, y = {y}, relative = true }})'
634
+
621
635
  if dispatcher == "resizeactive":
622
636
  nums = params[0].split() if params else []
623
637
  x = nums[0] if len(nums) > 0 else "0"
@@ -14,7 +14,7 @@ TOKEN_SPECS = [
14
14
  ("COLON", r":"),
15
15
  ("SHELL_EXP", r"\$\{[^}\n]*\}"),
16
16
  ("DOLLAR", r"\$"),
17
- ("STRING", r'"([^"\\]|\\.)*"'),
17
+ ("STRING", r'"([^"\\]|\\.)*"|\'([^\'\\]|\\.)*\''),
18
18
  ("CONT", r"\\[ \t]*\n"),
19
19
  ("IDENT", r'[^\s#"={},:!]+'),
20
20
  ("NEWLINE", r"\n"),
@@ -71,7 +71,7 @@ def tokenize(source: str) -> List[Token]:
71
71
  elif kind == "MISMATCH":
72
72
  raise LexerError(f"Unexpected character: {value!r}", line, _col(pos))
73
73
  elif kind == "STRING":
74
- tokens.append(Token("STRING", value[1:-1], line, _col(pos)))
74
+ tokens.append(Token("STRING", value, line, _col(pos)))
75
75
  else:
76
76
  tokens.append(Token(kind, value, line, _col(pos)))
77
77
 
@@ -15,7 +15,7 @@ BIND_FLAG_MAP = {
15
15
  "bindn": "n",
16
16
  "bindo": "",
17
17
  "bindm": "m",
18
- "binde": "",
18
+ "binde": "e",
19
19
  "bindt": "t",
20
20
  "bindi": "i",
21
21
  "bindp": "p",
@@ -212,8 +212,8 @@ class Parser:
212
212
  current.append("$" + var_t.value)
213
213
  else:
214
214
  t = self.advance()
215
- if keep_string_quotes and t.type == "STRING":
216
- current.append('"' + t.value + '"')
215
+ if t.type == "STRING" and not keep_string_quotes:
216
+ current.append(t.value[1:-1])
217
217
  else:
218
218
  current.append(t.value)
219
219
  remaining = self._join_tokens(current)
@@ -445,8 +445,8 @@ class Parser:
445
445
  parts.append("$" + var_t.value)
446
446
  else:
447
447
  t = self.advance()
448
- if keep_string_quotes and t.type == "STRING":
449
- parts.append('"' + t.value + '"')
448
+ if t.type == "STRING" and not keep_string_quotes:
449
+ parts.append(t.value[1:-1])
450
450
  else:
451
451
  parts.append(t.value)
452
452
  return self._join_tokens(parts)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyprconf2lua
3
- Version: 1.8.0
3
+ Version: 1.8.1
4
4
  Summary: Convert Hyprland hyprlang .conf files to Lua .lua config format (v0.55+)
5
5
  Author: hyprconf2lua contributors
6
6
  License: MIT
@@ -1 +0,0 @@
1
- __version__ = "1.8.0"
File without changes
File without changes
File without changes