chibi-command 2.1.1__tar.gz → 2.3.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 (71) hide show
  1. {chibi_command-2.1.1 → chibi_command-2.3.0}/HISTORY.rst +33 -10
  2. {chibi_command-2.1.1 → chibi_command-2.3.0}/PKG-INFO +44 -17
  3. {chibi_command-2.1.1 → chibi_command-2.3.0}/README.rst +10 -6
  4. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/__init__.py +4 -1
  5. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/common.py +1 -1
  6. chibi_command-2.3.0/chibi_command/disk/e2label.py +6 -0
  7. chibi_command-2.3.0/chibi_command/disk/lsblk.py +38 -0
  8. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/rsync.py +10 -0
  9. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command.egg-info/PKG-INFO +44 -17
  10. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command.egg-info/SOURCES.txt +2 -0
  11. {chibi_command-2.1.1 → chibi_command-2.3.0}/setup.cfg +1 -1
  12. {chibi_command-2.1.1 → chibi_command-2.3.0}/setup.py +1 -1
  13. {chibi_command-2.1.1 → chibi_command-2.3.0}/AUTHORS.rst +0 -0
  14. {chibi_command-2.1.1 → chibi_command-2.3.0}/CONTRIBUTING.rst +0 -0
  15. {chibi_command-2.1.1 → chibi_command-2.3.0}/LICENSE +0 -0
  16. {chibi_command-2.1.1 → chibi_command-2.3.0}/MANIFEST.in +0 -0
  17. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/archilinux/__init__.py +0 -0
  18. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/archilinux/pacman.py +0 -0
  19. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/archilinux/yay.py +0 -0
  20. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/centos/__init__.py +0 -0
  21. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/centos/dnf.py +0 -0
  22. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/centos/iptable.py +0 -0
  23. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/centos/yum.py +0 -0
  24. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/db.py +0 -0
  25. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/dd.py +0 -0
  26. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/disk/__init__.py +0 -0
  27. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/disk/dd.py +0 -0
  28. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/disk/format.py +0 -0
  29. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/disk/mount.py +0 -0
  30. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/echo.py +0 -0
  31. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/ffmpeg.py +0 -0
  32. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/file.py +0 -0
  33. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/image/__init__.py +0 -0
  34. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/image/convert.py +0 -0
  35. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/image/qr.py +0 -0
  36. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/lxc/__init__.py +0 -0
  37. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/lxc/delegate.py +0 -0
  38. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/lxc/lxc.py +0 -0
  39. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/mpd.py +0 -0
  40. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/network/__init__.py +0 -0
  41. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/network/ifconfig.py +0 -0
  42. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/network/interfaces.py +0 -0
  43. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/network/iwconfig.py +0 -0
  44. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/network/nmap.py +0 -0
  45. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/network/nmcli.py +0 -0
  46. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/nix/__init__.py +0 -0
  47. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/nix/locale.py +0 -0
  48. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/nix/systemd.py +0 -0
  49. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/nix/systemd_run.py +0 -0
  50. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/nix/user.py +0 -0
  51. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/qr.py +0 -0
  52. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/rabbitmq.py +0 -0
  53. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/rpm.py +0 -0
  54. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/ssh.py +0 -0
  55. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/sysctl.py +0 -0
  56. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/wmctrl.py +0 -0
  57. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command/xfce4.py +0 -0
  58. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command.egg-info/dependency_links.txt +0 -0
  59. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command.egg-info/not-zip-safe +0 -0
  60. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command.egg-info/requires.txt +0 -0
  61. {chibi_command-2.1.1 → chibi_command-2.3.0}/chibi_command.egg-info/top_level.txt +0 -0
  62. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/Makefile +0 -0
  63. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/authors.rst +0 -0
  64. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/conf.py +0 -0
  65. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/contributing.rst +0 -0
  66. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/history.rst +0 -0
  67. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/index.rst +0 -0
  68. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/installation.rst +0 -0
  69. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/make.bat +0 -0
  70. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/readme.rst +0 -0
  71. {chibi_command-2.1.1 → chibi_command-2.3.0}/docs/usage.rst +0 -0
@@ -2,54 +2,77 @@
2
2
  History
3
3
  =======
4
4
 
5
+ ********************
6
+ 2.3.0 ( 2026-03-20 )
7
+ ********************
8
+
9
+ * se agrego la opcion de ignore-existing para rsync
10
+ * se agrego el comando e2label
11
+
12
+ ********************
13
+ 2.2.0 ( 2026-03-20 )
14
+ ********************
15
+
16
+ * se agrego el comando lsblk en chibi_command.disk.lsblk
17
+
18
+ ********************
5
19
  2.1.1 ( 2025-05-22 )
6
- --------------------
20
+ ********************
7
21
 
8
22
  * usar el RPM.query() hace que el comando sea captivo
9
23
 
24
+ ********************
10
25
  2.1.0 ( 2025-05-21 )
11
- --------------------
26
+ ********************
12
27
 
13
28
  * se agrego el snippet para saber la ip local Ip.get_my_local_ip()
14
29
  * se agregaron los argumentos para queries de changelog de rpm RPM.query().changelog().run( 'some.rpm' )
15
30
 
31
+ ********************
16
32
  2.0.0 ( 2025-05-15 )
17
- --------------------
33
+ ********************
18
34
 
19
35
  * se migro el uso de git a https://github.com/dem4ply/chibi_git
20
36
 
37
+ ********************
21
38
  1.1.3 ( 2025-03-12 )
22
- --------------------
39
+ ********************
23
40
 
24
41
  * se agrego repr a los results de los comandos
25
42
  * correcion con el f string que faltaba en un logger debug
26
43
 
44
+ ********************
27
45
  1.1.0 ( 2024-10-18 )
28
- --------------------
46
+ ********************
29
47
 
30
48
  * comando ping
31
49
 
50
+ ********************
32
51
  1.0.0 ( 2024-10-18 )
33
- --------------------
52
+ ********************
34
53
 
35
54
  * se cambio el comportamiento para que tire una excepcion cada vez que un comando falla
36
55
 
56
+ ********************
37
57
  0.9.0 ( 2024-10-17 )
38
- --------------------
58
+ ********************
39
59
 
40
60
  * comando de ssh
41
61
 
62
+ ********************
42
63
  0.8.0 ( 2024-10-17 )
43
- --------------------
64
+ ********************
44
65
 
45
66
  * se agrego comandos para archlinux ( pacman y yay )
46
67
 
68
+ ******************
47
69
  0.6.0 (2020-02-19)
48
- ------------------
70
+ ******************
49
71
 
50
72
  * se agrego cp en chibi_command.commnon
51
73
 
74
+ ******************
52
75
  0.0.1 (2020-02-19)
53
- ------------------
76
+ ******************
54
77
 
55
78
  * First release on PyPI.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chibi_command
3
- Version: 2.1.1
3
+ Version: 2.3.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,54 +82,77 @@ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypack
78
82
  History
79
83
  =======
80
84
 
85
+ ********************
86
+ 2.3.0 ( 2026-03-20 )
87
+ ********************
88
+
89
+ * se agrego la opcion de ignore-existing para rsync
90
+ * se agrego el comando e2label
91
+
92
+ ********************
93
+ 2.2.0 ( 2026-03-20 )
94
+ ********************
95
+
96
+ * se agrego el comando lsblk en chibi_command.disk.lsblk
97
+
98
+ ********************
81
99
  2.1.1 ( 2025-05-22 )
82
- --------------------
100
+ ********************
83
101
 
84
102
  * usar el RPM.query() hace que el comando sea captivo
85
103
 
104
+ ********************
86
105
  2.1.0 ( 2025-05-21 )
87
- --------------------
106
+ ********************
88
107
 
89
108
  * se agrego el snippet para saber la ip local Ip.get_my_local_ip()
90
109
  * se agregaron los argumentos para queries de changelog de rpm RPM.query().changelog().run( 'some.rpm' )
91
110
 
111
+ ********************
92
112
  2.0.0 ( 2025-05-15 )
93
- --------------------
113
+ ********************
94
114
 
95
115
  * se migro el uso de git a https://github.com/dem4ply/chibi_git
96
116
 
117
+ ********************
97
118
  1.1.3 ( 2025-03-12 )
98
- --------------------
119
+ ********************
99
120
 
100
121
  * se agrego repr a los results de los comandos
101
122
  * correcion con el f string que faltaba en un logger debug
102
123
 
124
+ ********************
103
125
  1.1.0 ( 2024-10-18 )
104
- --------------------
126
+ ********************
105
127
 
106
128
  * comando ping
107
129
 
130
+ ********************
108
131
  1.0.0 ( 2024-10-18 )
109
- --------------------
132
+ ********************
110
133
 
111
134
  * se cambio el comportamiento para que tire una excepcion cada vez que un comando falla
112
135
 
136
+ ********************
113
137
  0.9.0 ( 2024-10-17 )
114
- --------------------
138
+ ********************
115
139
 
116
140
  * comando de ssh
117
141
 
142
+ ********************
118
143
  0.8.0 ( 2024-10-17 )
119
- --------------------
144
+ ********************
120
145
 
121
146
  * se agrego comandos para archlinux ( pacman y yay )
122
147
 
148
+ ******************
123
149
  0.6.0 (2020-02-19)
124
- ------------------
150
+ ******************
125
151
 
126
152
  * se agrego cp en chibi_command.commnon
127
153
 
154
+ ******************
128
155
  0.0.1 (2020-02-19)
129
- ------------------
156
+ ******************
130
157
 
131
158
  * 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.1'
10
+ __version__ = '2.3.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,6 @@
1
+ from chibi_command import Command
2
+
3
+
4
+ class E2label( Command ):
5
+ command = 'e2label'
6
+ captive = False
@@ -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
@@ -99,3 +99,13 @@ class Rsync( Command ):
99
99
  def checksum( self ):
100
100
  self.options( '--checksum' )
101
101
  return self
102
+
103
+ @Chibi_hybrid
104
+ def ignore_existing( cls ):
105
+ instance = cls.options( '--ignore-existing' )
106
+ return instance
107
+
108
+ @ignore_existing.instancemethod
109
+ def ignore_existing( self ):
110
+ self.options( '--ignore-existing' )
111
+ return self
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chibi_command
3
- Version: 2.1.1
3
+ Version: 2.3.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,54 +82,77 @@ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypack
78
82
  History
79
83
  =======
80
84
 
85
+ ********************
86
+ 2.3.0 ( 2026-03-20 )
87
+ ********************
88
+
89
+ * se agrego la opcion de ignore-existing para rsync
90
+ * se agrego el comando e2label
91
+
92
+ ********************
93
+ 2.2.0 ( 2026-03-20 )
94
+ ********************
95
+
96
+ * se agrego el comando lsblk en chibi_command.disk.lsblk
97
+
98
+ ********************
81
99
  2.1.1 ( 2025-05-22 )
82
- --------------------
100
+ ********************
83
101
 
84
102
  * usar el RPM.query() hace que el comando sea captivo
85
103
 
104
+ ********************
86
105
  2.1.0 ( 2025-05-21 )
87
- --------------------
106
+ ********************
88
107
 
89
108
  * se agrego el snippet para saber la ip local Ip.get_my_local_ip()
90
109
  * se agregaron los argumentos para queries de changelog de rpm RPM.query().changelog().run( 'some.rpm' )
91
110
 
111
+ ********************
92
112
  2.0.0 ( 2025-05-15 )
93
- --------------------
113
+ ********************
94
114
 
95
115
  * se migro el uso de git a https://github.com/dem4ply/chibi_git
96
116
 
117
+ ********************
97
118
  1.1.3 ( 2025-03-12 )
98
- --------------------
119
+ ********************
99
120
 
100
121
  * se agrego repr a los results de los comandos
101
122
  * correcion con el f string que faltaba en un logger debug
102
123
 
124
+ ********************
103
125
  1.1.0 ( 2024-10-18 )
104
- --------------------
126
+ ********************
105
127
 
106
128
  * comando ping
107
129
 
130
+ ********************
108
131
  1.0.0 ( 2024-10-18 )
109
- --------------------
132
+ ********************
110
133
 
111
134
  * se cambio el comportamiento para que tire una excepcion cada vez que un comando falla
112
135
 
136
+ ********************
113
137
  0.9.0 ( 2024-10-17 )
114
- --------------------
138
+ ********************
115
139
 
116
140
  * comando de ssh
117
141
 
142
+ ********************
118
143
  0.8.0 ( 2024-10-17 )
119
- --------------------
144
+ ********************
120
145
 
121
146
  * se agrego comandos para archlinux ( pacman y yay )
122
147
 
148
+ ******************
123
149
  0.6.0 (2020-02-19)
124
- ------------------
150
+ ******************
125
151
 
126
152
  * se agrego cp en chibi_command.commnon
127
153
 
154
+ ******************
128
155
  0.0.1 (2020-02-19)
129
- ------------------
156
+ ******************
130
157
 
131
158
  * First release on PyPI.
@@ -37,7 +37,9 @@ chibi_command/centos/iptable.py
37
37
  chibi_command/centos/yum.py
38
38
  chibi_command/disk/__init__.py
39
39
  chibi_command/disk/dd.py
40
+ chibi_command/disk/e2label.py
40
41
  chibi_command/disk/format.py
42
+ chibi_command/disk/lsblk.py
41
43
  chibi_command/disk/mount.py
42
44
  chibi_command/image/__init__.py
43
45
  chibi_command/image/convert.py
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 2.1.1
2
+ current_version = 2.3.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.1',
46
+ version='2.3.0',
47
47
  zip_safe=False,
48
48
  )
File without changes
File without changes
File without changes