variablesplus 1.0.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.
- variablesplus-1.0.0/LICENSE +21 -0
- variablesplus-1.0.0/PKG-INFO +17 -0
- variablesplus-1.0.0/README.md +5 -0
- variablesplus-1.0.0/pyproject.toml +14 -0
- variablesplus-1.0.0/setup.cfg +4 -0
- variablesplus-1.0.0/setup.py +10 -0
- variablesplus-1.0.0/variablesplus.egg-info/PKG-INFO +17 -0
- variablesplus-1.0.0/variablesplus.egg-info/SOURCES.txt +10 -0
- variablesplus-1.0.0/variablesplus.egg-info/dependency_links.txt +1 -0
- variablesplus-1.0.0/variablesplus.egg-info/top_level.txt +1 -0
- variablesplus-1.0.0/vp/__init__.py +1 -0
- variablesplus-1.0.0/vp/variables_plus.py +41 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Egglord-from-TPT
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: variablesplus
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A Python package for variables plus
|
|
5
|
+
Author: Egglord
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.7
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
Dynamic: requires-python
|
|
12
|
+
|
|
13
|
+
# variables_plus
|
|
14
|
+
|
|
15
|
+
A simple Python library to create, clear, and delete global variables.
|
|
16
|
+
|
|
17
|
+
This is my first library :D
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "variablesplus"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "A Python package for variables plus"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name="Egglord" }
|
|
13
|
+
]
|
|
14
|
+
license = { text = "MIT" }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: variablesplus
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A Python package for variables plus
|
|
5
|
+
Author: Egglord
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.7
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
Dynamic: requires-python
|
|
12
|
+
|
|
13
|
+
# variables_plus
|
|
14
|
+
|
|
15
|
+
A simple Python library to create, clear, and delete global variables.
|
|
16
|
+
|
|
17
|
+
This is my first library :D
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
vp
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .core import variables_plus, vp
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
def variables_plus(cmd):
|
|
2
|
+
cmd=cmd.strip()
|
|
3
|
+
a=""
|
|
4
|
+
b=""
|
|
5
|
+
if cmd.startswith("clear(") and cmd.endswith(")"):
|
|
6
|
+
if cmd[6:-1] == "":
|
|
7
|
+
for i in globals():
|
|
8
|
+
if not i.startswith("__") and not callable(i) and not i.startswith("<function") and not i:
|
|
9
|
+
globals()[i]=""
|
|
10
|
+
else:
|
|
11
|
+
try:
|
|
12
|
+
for i in globals():
|
|
13
|
+
if not i.startswith("__") and not callable(i) and not i.startswith("<function") and not i:
|
|
14
|
+
if i==cmd[6:-1]:
|
|
15
|
+
globals()[i]=""
|
|
16
|
+
except Exception:
|
|
17
|
+
raise TypeError("Invalid variable! Enter a variables name or leave it blank to clear the variable(s).")
|
|
18
|
+
elif cmd.startswith("create(") and cmd.endswith(")"):
|
|
19
|
+
if not cmd[7:-1] == "":
|
|
20
|
+
try:
|
|
21
|
+
a,b=cmd[7:-1].split("=", 1)
|
|
22
|
+
globals()[a]=b
|
|
23
|
+
except Exception:
|
|
24
|
+
raise TypeError("I don't even know what you did wrong, but you did something wrong.")
|
|
25
|
+
else:
|
|
26
|
+
raise TypeError("You can't create a blank variable.")
|
|
27
|
+
elif cmd.startswith("delete(") and cmd.endswith(")"):
|
|
28
|
+
if not cmd[7:-1] == "":
|
|
29
|
+
for i in globals():
|
|
30
|
+
if not i.startswith("__") and not callable(i):
|
|
31
|
+
if i==cmd[7:-1]:
|
|
32
|
+
try:
|
|
33
|
+
del globals()[i]
|
|
34
|
+
break
|
|
35
|
+
except Exception:
|
|
36
|
+
raise TypeError("Variable", i, "doesn't exist.")
|
|
37
|
+
else:
|
|
38
|
+
raise SyntaxError("You can't delete a blank variable.")
|
|
39
|
+
else:
|
|
40
|
+
raise TypeError("Invalid command! Use variables_plus(clear()), variables_plus(create()) or variables_plus(delete()). You can also shorten 'variables_plus' to 'vp'.")
|
|
41
|
+
vp=variables_plus
|