pytionlib 0.1.0__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.
pytionlib/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .main import *
|
pytionlib/main.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
class Action:
|
|
2
|
+
def __init__(self, func, *args):
|
|
3
|
+
self.func = func
|
|
4
|
+
self.args = args
|
|
5
|
+
self.used = False
|
|
6
|
+
|
|
7
|
+
def run(self):
|
|
8
|
+
self.used = True
|
|
9
|
+
self.func(*self.args)
|
|
10
|
+
|
|
11
|
+
def __del__(self):
|
|
12
|
+
if not self.used:
|
|
13
|
+
self.run()
|
|
14
|
+
|
|
15
|
+
def say(str=""):
|
|
16
|
+
return Action(print, str)
|
|
17
|
+
|
|
18
|
+
def repeat(action="", num=0):
|
|
19
|
+
if not isinstance(action, Action):
|
|
20
|
+
raise TypeError("Acction command expected")
|
|
21
|
+
|
|
22
|
+
action.used = True
|
|
23
|
+
|
|
24
|
+
for i in range(num):
|
|
25
|
+
action.run()
|
|
26
|
+
|
|
27
|
+
def math(expression=""):
|
|
28
|
+
if isinstance(expression, str):
|
|
29
|
+
return eval(expression)
|
|
30
|
+
else:
|
|
31
|
+
return expression
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pytionlib
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A library that adds some actions
|
|
5
|
+
Author: Behind Games
|
|
6
|
+
Requires-Python: >=3.8
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# pytionlib
|
|
10
|
+
|
|
11
|
+
A library that adds some actions
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
pip install pytionlib
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
from pytionlib import *
|
|
20
|
+
|
|
21
|
+
say("launching...")
|
|
22
|
+
say(math("2 + 2"))
|
|
23
|
+
repeat(say("repeating...", 5))
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
pytionlib/__init__.py,sha256=zDr350exO14Ii8Pj3TXwPuRxIDrEjrg43CpjYABDqh4,19
|
|
2
|
+
pytionlib/main.py,sha256=1xqYeqY7k6zdl3L1HGn-Zo3kWkuyQRBGhVW5aExbXS0,675
|
|
3
|
+
pytionlib-0.1.0.dist-info/METADATA,sha256=a6NjI739B8VpP2CEm1kYujV0Lk0M2PPmzf2bNdsm10M,395
|
|
4
|
+
pytionlib-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
5
|
+
pytionlib-0.1.0.dist-info/top_level.txt,sha256=zyr-y-6IleD6Q6NwYqbrvrdOD-ecQz0xNomY_yo9LcA,10
|
|
6
|
+
pytionlib-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pytionlib
|