zeushell 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.1
2
2
  Name: zeushell
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: A small Python package published to PyPI
5
5
  Author-email: Zeus <zeus@gmail.com>
6
6
  License: MIT
@@ -18,8 +18,7 @@ Write functions — run them as shell commands.
18
18
  - Function-based command system
19
19
  - Interactive shell runtime
20
20
  - Customizable shell prompt
21
- - Safe function registry (no exec)
22
-
21
+ - Safe function registry
23
22
  ## Install
24
23
 
25
24
  ```bash
@@ -31,7 +30,7 @@ pip install zeushell
31
30
  ```python
32
31
  from zeushell import function, name, run
33
32
 
34
- @function("hello")
33
+ @function()
35
34
  def hi(user):
36
35
  return f"Hello {user}"
37
36
 
@@ -42,8 +41,8 @@ run()
42
41
  Shell:
43
42
 
44
43
  ```
45
- zeushell: hello Tom
46
- Hello Tom
44
+ zeushell: hi Tom
45
+ hi Tom
47
46
  ```
48
47
 
49
48
  ## License
@@ -8,8 +8,7 @@ Write functions — run them as shell commands.
8
8
  - Function-based command system
9
9
  - Interactive shell runtime
10
10
  - Customizable shell prompt
11
- - Safe function registry (no exec)
12
-
11
+ - Safe function registry
13
12
  ## Install
14
13
 
15
14
  ```bash
@@ -21,7 +20,7 @@ pip install zeushell
21
20
  ```python
22
21
  from zeushell import function, name, run
23
22
 
24
- @function("hello")
23
+ @function()
25
24
  def hi(user):
26
25
  return f"Hello {user}"
27
26
 
@@ -32,8 +31,8 @@ run()
32
31
  Shell:
33
32
 
34
33
  ```
35
- zeushell: hello Tom
36
- Hello Tom
34
+ zeushell: hi Tom
35
+ hi Tom
37
36
  ```
38
37
 
39
38
  ## License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "zeushell"
3
- version = "0.1.0"
3
+ version = "0.1.2"
4
4
  description = "A small Python package published to PyPI"
5
5
  authors = [
6
6
  {name = "Zeus", email = "zeus@gmail.com"}
@@ -1,8 +1,14 @@
1
1
  def name(a):
2
+ global shellname
2
3
  shellname=a
3
- def function(name):
4
+ def function():
4
5
  def dd(func):
5
- exec(name+"="+func.__name__)
6
+ try:
7
+ funclist
8
+ except:
9
+ global funclist
10
+ funclist=[]
11
+ funclist.append(func.__name__)
6
12
  return func
7
13
  try:
8
14
  a=open("ss.txt","r")
@@ -14,7 +20,7 @@ def function(name):
14
20
  w=open("ss.txt","w")
15
21
  w.write(s+name+"\n")
16
22
  w.close()
17
- return name
23
+ return dd
18
24
  def run():
19
25
  class ZeushellError(Exception):
20
26
  pass
@@ -38,14 +44,13 @@ def run():
38
44
  srtin+=i
39
45
  while True:
40
46
  ino=input(shellname)
41
- s=[]
42
- aaaa=""
43
- for i in ino:
44
- if i==" ":
45
- s.append(aaaa)
46
- else:
47
- aaaa+=i
47
+ s=ino.split()
48
+ if s==[]:
49
+ continue
48
50
  aaaaa=s[0]
51
+ if aaaaa not in funclist:
52
+ print('You didn\'t have '+aaaaa+' function')
53
+ continue
49
54
  s=s[1:]
50
55
  s=str(s).replace("[","(").replace("]",")")
51
56
  exec(aaaa+s)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zeushell
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: A small Python package published to PyPI
5
5
  Author-email: Zeus <zeus@gmail.com>
6
6
  License: MIT
@@ -18,8 +18,7 @@ Write functions — run them as shell commands.
18
18
  - Function-based command system
19
19
  - Interactive shell runtime
20
20
  - Customizable shell prompt
21
- - Safe function registry (no exec)
22
-
21
+ - Safe function registry
23
22
  ## Install
24
23
 
25
24
  ```bash
@@ -31,7 +30,7 @@ pip install zeushell
31
30
  ```python
32
31
  from zeushell import function, name, run
33
32
 
34
- @function("hello")
33
+ @function()
35
34
  def hi(user):
36
35
  return f"Hello {user}"
37
36
 
@@ -42,8 +41,8 @@ run()
42
41
  Shell:
43
42
 
44
43
  ```
45
- zeushell: hello Tom
46
- Hello Tom
44
+ zeushell: hi Tom
45
+ hi Tom
47
46
  ```
48
47
 
49
48
  ## License
File without changes