chemql-python 1.0.2__py3-none-any.whl → 1.0.3__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.
chemql/__init__.py CHANGED
@@ -40,12 +40,28 @@ __all__ = [
40
40
  "__version__"
41
41
  ]
42
42
 
43
- __version__ = "1.0.2"
43
+ __version__ = "1.0.3"
44
44
 
45
45
 
46
46
  _shell_process = None
47
47
 
48
48
 
49
+ def enable_ansi():
50
+ """Enable ANSI escape code support on Windows and Unix-like terminals."""
51
+ if os.name == 'nt':
52
+ import ctypes
53
+ kernel32 = ctypes.windll.kernel32
54
+ # STD_OUTPUT_HANDLE = -11
55
+ handle = kernel32.GetStdHandle(-11)
56
+ mode = ctypes.c_ulong()
57
+ if kernel32.GetConsoleMode(handle, ctypes.byref(mode)):
58
+ # ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004
59
+ new_mode = mode.value | 0x0004
60
+ kernel32.SetConsoleMode(handle, new_mode)
61
+
62
+
63
+ enable_ansi()
64
+
49
65
  def get_shell():
50
66
  global _shell_process
51
67
 
@@ -81,7 +97,7 @@ def run_shell_command(command):
81
97
  try:
82
98
  if os.name == "nt":
83
99
  # Run the command, then print a unique completion marker.
84
- shell.stdin.write(
100
+ shell.stdin.write( #type:ignore
85
101
  f"{command}\r\n"
86
102
  f"echo {marker}\r\n"
87
103
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chemql-python
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: A chemistry-focused query language and REPL
5
5
  Author-email: Mohammad Rakibul Islam <rakibulofficial1017@gmail.com>
6
6
  Requires-Python: >=3.10
@@ -1,4 +1,4 @@
1
- chemql/__init__.py,sha256=qKC-xi2NrsNahVsbsPJopByzy86UzKLbzO9SWSW_N-M,109826
1
+ chemql/__init__.py,sha256=jqIszCTM4FumW0K6e-0w6joyjAV5M2cEMJZRb3a03oA,110370
2
2
  chemql/__main__.py,sha256=3Q52s0hyuouhvSSqFEQFDr6mtJ-azkCwI2AD4c7f7A8,28
3
3
  chemql/data/BondEnergies.json,sha256=QZN3iWZrD8125jV41EG1GiRohBtP0CzAP_EDQTfaEKc,8269
4
4
  chemql/data/MoleculeBonds.json,sha256=Iw2shYxJScH_tI80IytBYoqVDSbgT7OSqPJUIgKZme4,84262
@@ -8,9 +8,9 @@ chemql/data/Reactions.json,sha256=BFpkKEWwLzG54ot96BVOWwU3btpimRJlOM57yGclGgc,15
8
8
  chemql/data/THIRD_PARTY_LICENSES/PeriodicTableJSON.txt,sha256=9wih5q8s58qR3vJEGpooa4ESyAGZHcmGvzwMMkMHNKk,322
9
9
  chemql/data/THIRD_PARTY_LICENSES/RHEA.txt,sha256=nXTeCP6vJBW5B_mtaVGFLr0w7vnjrSTBnv6_eOk3KKo,634
10
10
  chemql/html/periodic_table.html,sha256=ftVgXWjRO2AsTAGEekTrvgE5ZvcwRfoby9UWoixc9Y8,361560
11
- chemql_python-1.0.2.dist-info/licenses/LICENSE,sha256=o4ywHC0EwRy2zgIASiRD2sK3Vcsf7LBcTHjDvoJgRE0,1079
12
- chemql_python-1.0.2.dist-info/METADATA,sha256=UXpbvKOb58-R9xDb2cIuAsXJp0d5bUDiNRCozeLnxes,11613
13
- chemql_python-1.0.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
14
- chemql_python-1.0.2.dist-info/entry_points.txt,sha256=j98ObVWR743an524z24AiWeRsppag-py5cc7l0D0HkI,39
15
- chemql_python-1.0.2.dist-info/top_level.txt,sha256=9UzHwnk_F6W19Q9nayaFgVyAELQXXwoYjeBgB6MWNr8,7
16
- chemql_python-1.0.2.dist-info/RECORD,,
11
+ chemql_python-1.0.3.dist-info/licenses/LICENSE,sha256=o4ywHC0EwRy2zgIASiRD2sK3Vcsf7LBcTHjDvoJgRE0,1079
12
+ chemql_python-1.0.3.dist-info/METADATA,sha256=lMmaN22uB4EFR7ot8_i_QJgtvXOFQ2792WvGEsjl224,11613
13
+ chemql_python-1.0.3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
14
+ chemql_python-1.0.3.dist-info/entry_points.txt,sha256=j98ObVWR743an524z24AiWeRsppag-py5cc7l0D0HkI,39
15
+ chemql_python-1.0.3.dist-info/top_level.txt,sha256=9UzHwnk_F6W19Q9nayaFgVyAELQXXwoYjeBgB6MWNr8,7
16
+ chemql_python-1.0.3.dist-info/RECORD,,