chibi-command 2.1.0__tar.gz → 2.2.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.
Files changed (70) hide show
  1. {chibi_command-2.1.0 → chibi_command-2.2.0}/HISTORY.rst +30 -9
  2. {chibi_command-2.1.0 → chibi_command-2.2.0}/PKG-INFO +41 -16
  3. {chibi_command-2.1.0 → chibi_command-2.2.0}/README.rst +10 -6
  4. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/__init__.py +4 -1
  5. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/common.py +1 -1
  6. chibi_command-2.2.0/chibi_command/disk/lsblk.py +38 -0
  7. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/rpm.py +1 -1
  8. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command.egg-info/PKG-INFO +41 -16
  9. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command.egg-info/SOURCES.txt +1 -0
  10. {chibi_command-2.1.0 → chibi_command-2.2.0}/setup.cfg +1 -1
  11. {chibi_command-2.1.0 → chibi_command-2.2.0}/setup.py +1 -1
  12. {chibi_command-2.1.0 → chibi_command-2.2.0}/AUTHORS.rst +0 -0
  13. {chibi_command-2.1.0 → chibi_command-2.2.0}/CONTRIBUTING.rst +0 -0
  14. {chibi_command-2.1.0 → chibi_command-2.2.0}/LICENSE +0 -0
  15. {chibi_command-2.1.0 → chibi_command-2.2.0}/MANIFEST.in +0 -0
  16. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/archilinux/__init__.py +0 -0
  17. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/archilinux/pacman.py +0 -0
  18. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/archilinux/yay.py +0 -0
  19. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/centos/__init__.py +0 -0
  20. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/centos/dnf.py +0 -0
  21. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/centos/iptable.py +0 -0
  22. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/centos/yum.py +0 -0
  23. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/db.py +0 -0
  24. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/dd.py +0 -0
  25. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/disk/__init__.py +0 -0
  26. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/disk/dd.py +0 -0
  27. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/disk/format.py +0 -0
  28. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/disk/mount.py +0 -0
  29. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/echo.py +0 -0
  30. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/ffmpeg.py +0 -0
  31. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/file.py +0 -0
  32. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/image/__init__.py +0 -0
  33. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/image/convert.py +0 -0
  34. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/image/qr.py +0 -0
  35. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/lxc/__init__.py +0 -0
  36. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/lxc/delegate.py +0 -0
  37. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/lxc/lxc.py +0 -0
  38. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/mpd.py +0 -0
  39. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/network/__init__.py +0 -0
  40. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/network/ifconfig.py +0 -0
  41. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/network/interfaces.py +0 -0
  42. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/network/iwconfig.py +0 -0
  43. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/network/nmap.py +0 -0
  44. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/network/nmcli.py +0 -0
  45. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/nix/__init__.py +0 -0
  46. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/nix/locale.py +0 -0
  47. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/nix/systemd.py +0 -0
  48. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/nix/systemd_run.py +0 -0
  49. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/nix/user.py +0 -0
  50. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/qr.py +0 -0
  51. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/rabbitmq.py +0 -0
  52. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/rsync.py +0 -0
  53. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/ssh.py +0 -0
  54. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/sysctl.py +0 -0
  55. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/wmctrl.py +0 -0
  56. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command/xfce4.py +0 -0
  57. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command.egg-info/dependency_links.txt +0 -0
  58. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command.egg-info/not-zip-safe +0 -0
  59. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command.egg-info/requires.txt +0 -0
  60. {chibi_command-2.1.0 → chibi_command-2.2.0}/chibi_command.egg-info/top_level.txt +0 -0
  61. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/Makefile +0 -0
  62. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/authors.rst +0 -0
  63. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/conf.py +0 -0
  64. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/contributing.rst +0 -0
  65. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/history.rst +0 -0
  66. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/index.rst +0 -0
  67. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/installation.rst +0 -0
  68. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/make.bat +0 -0
  69. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/readme.rst +0 -0
  70. {chibi_command-2.1.0 → chibi_command-2.2.0}/docs/usage.rst +0 -0
@@ -2,49 +2,70 @@
2
2
  History
3
3
  =======
4
4
 
5
+ ********************
6
+ 2.2.0 ( 2026-03-20 )
7
+ ********************
8
+
9
+ * se agrego el comando lsblk en chibi_command.disk.lsblk
10
+
11
+ ********************
12
+ 2.1.1 ( 2025-05-22 )
13
+ ********************
14
+
15
+ * usar el RPM.query() hace que el comando sea captivo
16
+
17
+ ********************
5
18
  2.1.0 ( 2025-05-21 )
6
- --------------------
19
+ ********************
7
20
 
8
21
  * se agrego el snippet para saber la ip local Ip.get_my_local_ip()
9
22
  * se agregaron los argumentos para queries de changelog de rpm RPM.query().changelog().run( 'some.rpm' )
10
23
 
24
+ ********************
11
25
  2.0.0 ( 2025-05-15 )
12
- --------------------
26
+ ********************
13
27
 
14
28
  * se migro el uso de git a https://github.com/dem4ply/chibi_git
15
29
 
30
+ ********************
16
31
  1.1.3 ( 2025-03-12 )
17
- --------------------
32
+ ********************
18
33
 
19
34
  * se agrego repr a los results de los comandos
20
35
  * correcion con el f string que faltaba en un logger debug
21
36
 
37
+ ********************
22
38
  1.1.0 ( 2024-10-18 )
23
- --------------------
39
+ ********************
24
40
 
25
41
  * comando ping
26
42
 
43
+ ********************
27
44
  1.0.0 ( 2024-10-18 )
28
- --------------------
45
+ ********************
29
46
 
30
47
  * se cambio el comportamiento para que tire una excepcion cada vez que un comando falla
31
48
 
49
+ ********************
32
50
  0.9.0 ( 2024-10-17 )
33
- --------------------
51
+ ********************
34
52
 
35
53
  * comando de ssh
36
54
 
55
+ ********************
37
56
  0.8.0 ( 2024-10-17 )
38
- --------------------
57
+ ********************
39
58
 
40
59
  * se agrego comandos para archlinux ( pacman y yay )
41
60
 
61
+ ******************
42
62
  0.6.0 (2020-02-19)
43
- ------------------
63
+ ******************
44
64
 
45
65
  * se agrego cp en chibi_command.commnon
46
66
 
67
+ ******************
47
68
  0.0.1 (2020-02-19)
48
- ------------------
69
+ ******************
49
70
 
50
71
  * First release on PyPI.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chibi_command
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: run terminal commands
5
5
  Home-page: https://github.com/dem4ply/chibi_command
6
6
  Author: Dem4ply
@@ -60,15 +60,19 @@ run terminal commands
60
60
  * Documentation: https://chibi-command.readthedocs.io.
61
61
 
62
62
 
63
- Features
64
- --------
63
+ ***
64
+ Use
65
+ ***
65
66
 
66
- * TODO
67
+ use lsblk
67
68
 
68
- Credits
69
- -------
69
+ .. code-block:: python
70
+
71
+ from chibi_command.disk.lsblk import Lsblk
72
+
73
+ blocks = Lsblk().run().result
74
+ assert blocks[ 'sda' ].childs[ 'name' ]
70
75
 
71
- This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
72
76
 
73
77
  .. _Cookiecutter: https://github.com/audreyr/cookiecutter
74
78
  .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
@@ -78,49 +82,70 @@ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypack
78
82
  History
79
83
  =======
80
84
 
85
+ ********************
86
+ 2.2.0 ( 2026-03-20 )
87
+ ********************
88
+
89
+ * se agrego el comando lsblk en chibi_command.disk.lsblk
90
+
91
+ ********************
92
+ 2.1.1 ( 2025-05-22 )
93
+ ********************
94
+
95
+ * usar el RPM.query() hace que el comando sea captivo
96
+
97
+ ********************
81
98
  2.1.0 ( 2025-05-21 )
82
- --------------------
99
+ ********************
83
100
 
84
101
  * se agrego el snippet para saber la ip local Ip.get_my_local_ip()
85
102
  * se agregaron los argumentos para queries de changelog de rpm RPM.query().changelog().run( 'some.rpm' )
86
103
 
104
+ ********************
87
105
  2.0.0 ( 2025-05-15 )
88
- --------------------
106
+ ********************
89
107
 
90
108
  * se migro el uso de git a https://github.com/dem4ply/chibi_git
91
109
 
110
+ ********************
92
111
  1.1.3 ( 2025-03-12 )
93
- --------------------
112
+ ********************
94
113
 
95
114
  * se agrego repr a los results de los comandos
96
115
  * correcion con el f string que faltaba en un logger debug
97
116
 
117
+ ********************
98
118
  1.1.0 ( 2024-10-18 )
99
- --------------------
119
+ ********************
100
120
 
101
121
  * comando ping
102
122
 
123
+ ********************
103
124
  1.0.0 ( 2024-10-18 )
104
- --------------------
125
+ ********************
105
126
 
106
127
  * se cambio el comportamiento para que tire una excepcion cada vez que un comando falla
107
128
 
129
+ ********************
108
130
  0.9.0 ( 2024-10-17 )
109
- --------------------
131
+ ********************
110
132
 
111
133
  * comando de ssh
112
134
 
135
+ ********************
113
136
  0.8.0 ( 2024-10-17 )
114
- --------------------
137
+ ********************
115
138
 
116
139
  * se agrego comandos para archlinux ( pacman y yay )
117
140
 
141
+ ******************
118
142
  0.6.0 (2020-02-19)
119
- ------------------
143
+ ******************
120
144
 
121
145
  * se agrego cp en chibi_command.commnon
122
146
 
147
+ ******************
123
148
  0.0.1 (2020-02-19)
124
- ------------------
149
+ ******************
125
150
 
126
151
  * First release on PyPI.
@@ -20,15 +20,19 @@ run terminal commands
20
20
  * Documentation: https://chibi-command.readthedocs.io.
21
21
 
22
22
 
23
- Features
24
- --------
23
+ ***
24
+ Use
25
+ ***
25
26
 
26
- * TODO
27
+ use lsblk
27
28
 
28
- Credits
29
- -------
29
+ .. code-block:: python
30
+
31
+ from chibi_command.disk.lsblk import Lsblk
32
+
33
+ blocks = Lsblk().run().result
34
+ assert blocks[ 'sda' ].childs[ 'name' ]
30
35
 
31
- This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
32
36
 
33
37
  .. _Cookiecutter: https://github.com/audreyr/cookiecutter
34
38
  .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
@@ -7,7 +7,7 @@ import logging
7
7
 
8
8
  __author__ = """dem4ply"""
9
9
  __email__ = 'dem4ply@gmail.com'
10
- __version__ = '2.1.0'
10
+ __version__ = '2.2.0'
11
11
 
12
12
  logger = logging.getLogger( 'chibi.command' )
13
13
 
@@ -57,6 +57,9 @@ class Command_result:
57
57
 
58
58
 
59
59
  class Command_json_result( Command_result ):
60
+ """
61
+ parsea el resultado de un comando si es un json
62
+ """
60
63
  def parse_result( self ):
61
64
  result = json.loads( self.result )
62
65
  result = Atlas( result )
@@ -33,7 +33,7 @@ class Ping_result( Command_result ):
33
33
  self.pings.append( ping )
34
34
  for item in numbers:
35
35
  k, v = item.split( '=' )
36
- if k == 'time':
36
+ if k == 'time' or k == 'tiempo':
37
37
  ping[ k ] = float( v )
38
38
  else:
39
39
  ping[ k ] = int( v )
@@ -0,0 +1,38 @@
1
+ from chibi_command import Command
2
+ import json
3
+
4
+ from chibi.atlas import Chibi_atlas
5
+
6
+ from chibi_command import Command, Command_result, Command_json_result
7
+
8
+
9
+ class Block( Chibi_atlas ):
10
+ def __init__( self, *args, **kw ):
11
+ super().__init__( *args, **kw )
12
+ childs = self.pop( 'children', None )
13
+ if childs:
14
+ self.childs = childs
15
+
16
+
17
+ class Blocks( Chibi_atlas ):
18
+ def __init__( self, *args, **kw ):
19
+ super().__init__( *args, **kw )
20
+ self.childs = [ Block( c ) for c in self.pop( 'children' ) ]
21
+
22
+
23
+ class Lsblk_result( Command_json_result ):
24
+ def parse_result( self ):
25
+ super().parse_result()
26
+ result = self.result
27
+ result = { b.name: Blocks( b ) for b in result.blockdevices }
28
+ self.result = result
29
+
30
+ def __getitem__( self, key ):
31
+ return self.result[ key ]
32
+
33
+
34
+ class Lsblk( Command ):
35
+ command = 'lsblk'
36
+ captive = True
37
+ args = ( '-f', '--json' )
38
+ result_class = Lsblk_result
@@ -13,7 +13,7 @@ class RPM( Command ):
13
13
 
14
14
  @Chibi_hybrid
15
15
  def query( cls ):
16
- return cls( '-q' )
16
+ return cls( '-q', captive=True )
17
17
 
18
18
  @query.instancemethod
19
19
  def query( self ):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chibi_command
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: run terminal commands
5
5
  Home-page: https://github.com/dem4ply/chibi_command
6
6
  Author: Dem4ply
@@ -60,15 +60,19 @@ run terminal commands
60
60
  * Documentation: https://chibi-command.readthedocs.io.
61
61
 
62
62
 
63
- Features
64
- --------
63
+ ***
64
+ Use
65
+ ***
65
66
 
66
- * TODO
67
+ use lsblk
67
68
 
68
- Credits
69
- -------
69
+ .. code-block:: python
70
+
71
+ from chibi_command.disk.lsblk import Lsblk
72
+
73
+ blocks = Lsblk().run().result
74
+ assert blocks[ 'sda' ].childs[ 'name' ]
70
75
 
71
- This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
72
76
 
73
77
  .. _Cookiecutter: https://github.com/audreyr/cookiecutter
74
78
  .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
@@ -78,49 +82,70 @@ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypack
78
82
  History
79
83
  =======
80
84
 
85
+ ********************
86
+ 2.2.0 ( 2026-03-20 )
87
+ ********************
88
+
89
+ * se agrego el comando lsblk en chibi_command.disk.lsblk
90
+
91
+ ********************
92
+ 2.1.1 ( 2025-05-22 )
93
+ ********************
94
+
95
+ * usar el RPM.query() hace que el comando sea captivo
96
+
97
+ ********************
81
98
  2.1.0 ( 2025-05-21 )
82
- --------------------
99
+ ********************
83
100
 
84
101
  * se agrego el snippet para saber la ip local Ip.get_my_local_ip()
85
102
  * se agregaron los argumentos para queries de changelog de rpm RPM.query().changelog().run( 'some.rpm' )
86
103
 
104
+ ********************
87
105
  2.0.0 ( 2025-05-15 )
88
- --------------------
106
+ ********************
89
107
 
90
108
  * se migro el uso de git a https://github.com/dem4ply/chibi_git
91
109
 
110
+ ********************
92
111
  1.1.3 ( 2025-03-12 )
93
- --------------------
112
+ ********************
94
113
 
95
114
  * se agrego repr a los results de los comandos
96
115
  * correcion con el f string que faltaba en un logger debug
97
116
 
117
+ ********************
98
118
  1.1.0 ( 2024-10-18 )
99
- --------------------
119
+ ********************
100
120
 
101
121
  * comando ping
102
122
 
123
+ ********************
103
124
  1.0.0 ( 2024-10-18 )
104
- --------------------
125
+ ********************
105
126
 
106
127
  * se cambio el comportamiento para que tire una excepcion cada vez que un comando falla
107
128
 
129
+ ********************
108
130
  0.9.0 ( 2024-10-17 )
109
- --------------------
131
+ ********************
110
132
 
111
133
  * comando de ssh
112
134
 
135
+ ********************
113
136
  0.8.0 ( 2024-10-17 )
114
- --------------------
137
+ ********************
115
138
 
116
139
  * se agrego comandos para archlinux ( pacman y yay )
117
140
 
141
+ ******************
118
142
  0.6.0 (2020-02-19)
119
- ------------------
143
+ ******************
120
144
 
121
145
  * se agrego cp en chibi_command.commnon
122
146
 
147
+ ******************
123
148
  0.0.1 (2020-02-19)
124
- ------------------
149
+ ******************
125
150
 
126
151
  * First release on PyPI.
@@ -38,6 +38,7 @@ chibi_command/centos/yum.py
38
38
  chibi_command/disk/__init__.py
39
39
  chibi_command/disk/dd.py
40
40
  chibi_command/disk/format.py
41
+ chibi_command/disk/lsblk.py
41
42
  chibi_command/disk/mount.py
42
43
  chibi_command/image/__init__.py
43
44
  chibi_command/image/convert.py
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 2.1.0
2
+ current_version = 2.2.0
3
3
  commit = True
4
4
  tag = True
5
5
 
@@ -43,6 +43,6 @@ setup(
43
43
  name='chibi_command',
44
44
  packages=find_packages(include=['chibi_command', 'chibi_command.*']),
45
45
  url='https://github.com/dem4ply/chibi_command',
46
- version='2.1.0',
46
+ version='2.2.0',
47
47
  zip_safe=False,
48
48
  )
File without changes
File without changes
File without changes