chibi-command 1.1.2__tar.gz → 2.1.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.
- {chibi_command-1.1.2 → chibi_command-2.1.0}/HISTORY.rst +17 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/PKG-INFO +20 -2
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/__init__.py +2 -2
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/network/interfaces.py +21 -0
- chibi_command-2.1.0/chibi_command/rpm.py +30 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command.egg-info/PKG-INFO +20 -2
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command.egg-info/SOURCES.txt +0 -1
- {chibi_command-1.1.2 → chibi_command-2.1.0}/setup.cfg +1 -1
- {chibi_command-1.1.2 → chibi_command-2.1.0}/setup.py +1 -1
- chibi_command-1.1.2/chibi_command/git.py +0 -115
- chibi_command-1.1.2/chibi_command/rpm.py +0 -11
- {chibi_command-1.1.2 → chibi_command-2.1.0}/AUTHORS.rst +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/CONTRIBUTING.rst +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/LICENSE +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/MANIFEST.in +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/README.rst +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/archilinux/__init__.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/archilinux/pacman.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/archilinux/yay.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/centos/__init__.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/centos/dnf.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/centos/iptable.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/centos/yum.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/common.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/db.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/dd.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/disk/__init__.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/disk/dd.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/disk/format.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/disk/mount.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/echo.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/ffmpeg.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/file.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/image/__init__.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/image/convert.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/image/qr.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/lxc/__init__.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/lxc/delegate.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/lxc/lxc.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/mpd.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/network/__init__.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/network/ifconfig.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/network/iwconfig.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/network/nmap.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/network/nmcli.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/nix/__init__.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/nix/locale.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/nix/systemd.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/nix/systemd_run.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/nix/user.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/qr.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/rabbitmq.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/rsync.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/ssh.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/sysctl.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/wmctrl.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command/xfce4.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command.egg-info/dependency_links.txt +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command.egg-info/not-zip-safe +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command.egg-info/requires.txt +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/chibi_command.egg-info/top_level.txt +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/Makefile +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/authors.rst +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/conf.py +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/contributing.rst +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/history.rst +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/index.rst +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/installation.rst +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/make.bat +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/readme.rst +0 -0
- {chibi_command-1.1.2 → chibi_command-2.1.0}/docs/usage.rst +0 -0
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
History
|
|
3
3
|
=======
|
|
4
4
|
|
|
5
|
+
2.1.0 ( 2025-05-21 )
|
|
6
|
+
--------------------
|
|
7
|
+
|
|
8
|
+
* se agrego el snippet para saber la ip local Ip.get_my_local_ip()
|
|
9
|
+
* se agregaron los argumentos para queries de changelog de rpm RPM.query().changelog().run( 'some.rpm' )
|
|
10
|
+
|
|
11
|
+
2.0.0 ( 2025-05-15 )
|
|
12
|
+
--------------------
|
|
13
|
+
|
|
14
|
+
* se migro el uso de git a https://github.com/dem4ply/chibi_git
|
|
15
|
+
|
|
16
|
+
1.1.3 ( 2025-03-12 )
|
|
17
|
+
--------------------
|
|
18
|
+
|
|
19
|
+
* se agrego repr a los results de los comandos
|
|
20
|
+
* correcion con el f string que faltaba en un logger debug
|
|
21
|
+
|
|
5
22
|
1.1.0 ( 2024-10-18 )
|
|
6
23
|
--------------------
|
|
7
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: chibi_command
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: run terminal commands
|
|
5
5
|
Home-page: https://github.com/dem4ply/chibi_command
|
|
6
6
|
Author: Dem4ply
|
|
@@ -34,6 +34,7 @@ Dynamic: description
|
|
|
34
34
|
Dynamic: home-page
|
|
35
35
|
Dynamic: keywords
|
|
36
36
|
Dynamic: license
|
|
37
|
+
Dynamic: license-file
|
|
37
38
|
Dynamic: requires-dist
|
|
38
39
|
Dynamic: summary
|
|
39
40
|
|
|
@@ -77,6 +78,23 @@ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypack
|
|
|
77
78
|
History
|
|
78
79
|
=======
|
|
79
80
|
|
|
81
|
+
2.1.0 ( 2025-05-21 )
|
|
82
|
+
--------------------
|
|
83
|
+
|
|
84
|
+
* se agrego el snippet para saber la ip local Ip.get_my_local_ip()
|
|
85
|
+
* se agregaron los argumentos para queries de changelog de rpm RPM.query().changelog().run( 'some.rpm' )
|
|
86
|
+
|
|
87
|
+
2.0.0 ( 2025-05-15 )
|
|
88
|
+
--------------------
|
|
89
|
+
|
|
90
|
+
* se migro el uso de git a https://github.com/dem4ply/chibi_git
|
|
91
|
+
|
|
92
|
+
1.1.3 ( 2025-03-12 )
|
|
93
|
+
--------------------
|
|
94
|
+
|
|
95
|
+
* se agrego repr a los results de los comandos
|
|
96
|
+
* correcion con el f string que faltaba en un logger debug
|
|
97
|
+
|
|
80
98
|
1.1.0 ( 2024-10-18 )
|
|
81
99
|
--------------------
|
|
82
100
|
|
|
@@ -7,7 +7,7 @@ import logging
|
|
|
7
7
|
|
|
8
8
|
__author__ = """dem4ply"""
|
|
9
9
|
__email__ = 'dem4ply@gmail.com'
|
|
10
|
-
__version__ = '
|
|
10
|
+
__version__ = '2.1.0'
|
|
11
11
|
|
|
12
12
|
logger = logging.getLogger( 'chibi.command' )
|
|
13
13
|
|
|
@@ -123,7 +123,7 @@ class Command:
|
|
|
123
123
|
if isinstance( stdin, str ):
|
|
124
124
|
stdin = PIPE
|
|
125
125
|
arguments = self.build_tuple( *args, **kw )
|
|
126
|
-
logger.debug( 'tuplas del comando: "{str(arguments)}"' )
|
|
126
|
+
logger.debug( f'tuplas del comando: "{str(arguments)}"' )
|
|
127
127
|
arguments = tuple( map( lambda x: str( x ), arguments ) )
|
|
128
128
|
proc = Popen(
|
|
129
129
|
arguments, stdin=stdin, stdout=self.stdout, stderr=self.stderr )
|
|
@@ -59,6 +59,11 @@ class Interface_result( Command_result ):
|
|
|
59
59
|
self.result = Network.load_from_string( self.result )
|
|
60
60
|
|
|
61
61
|
|
|
62
|
+
class get_my_ip_result( Command_result ):
|
|
63
|
+
def parse_result( self ):
|
|
64
|
+
self.result = self.result.split()[6].strip()
|
|
65
|
+
|
|
66
|
+
|
|
62
67
|
class Ip( Command ):
|
|
63
68
|
command = 'ip'
|
|
64
69
|
captive = True
|
|
@@ -73,6 +78,22 @@ class Ip( Command ):
|
|
|
73
78
|
self.add_args( 'addr' )
|
|
74
79
|
return self
|
|
75
80
|
|
|
81
|
+
@classmethod
|
|
82
|
+
def get_my_local_ip( cls, dns='8.8.8.8' ):
|
|
83
|
+
"""
|
|
84
|
+
regresa la ip local del adaptador que se usa para conectar al dns
|
|
85
|
+
|
|
86
|
+
Parameters
|
|
87
|
+
----------
|
|
88
|
+
dns: str
|
|
89
|
+
ip del dns que se conectara para resolver que adaptador se usara
|
|
90
|
+
"""
|
|
91
|
+
command = cls(
|
|
92
|
+
'route', 'get', dns, captive=True,
|
|
93
|
+
result_class=get_my_ip_result )
|
|
94
|
+
result = command.run()
|
|
95
|
+
return result.result
|
|
96
|
+
|
|
76
97
|
|
|
77
98
|
class Iw( Command ):
|
|
78
99
|
command = 'iw'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from chibi_command import Command
|
|
2
|
+
from chibi_hybrid.chibi_hybrid import Chibi_hybrid
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class RPM( Command ):
|
|
6
|
+
command = 'rpm'
|
|
7
|
+
captive = False
|
|
8
|
+
kw_format = '--{key} {value}'
|
|
9
|
+
|
|
10
|
+
@classmethod
|
|
11
|
+
def rpm_import( cls, repository ):
|
|
12
|
+
return cls( **{ 'import': repository } )()
|
|
13
|
+
|
|
14
|
+
@Chibi_hybrid
|
|
15
|
+
def query( cls ):
|
|
16
|
+
return cls( '-q' )
|
|
17
|
+
|
|
18
|
+
@query.instancemethod
|
|
19
|
+
def query( self ):
|
|
20
|
+
self.add_args( '-q' )
|
|
21
|
+
return self
|
|
22
|
+
|
|
23
|
+
@Chibi_hybrid
|
|
24
|
+
def changelog( cls ):
|
|
25
|
+
return cls( '--changelog' )
|
|
26
|
+
|
|
27
|
+
@changelog.instancemethod
|
|
28
|
+
def changelog( self ):
|
|
29
|
+
self.add_args( '--changelog' )
|
|
30
|
+
return self
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: chibi_command
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: run terminal commands
|
|
5
5
|
Home-page: https://github.com/dem4ply/chibi_command
|
|
6
6
|
Author: Dem4ply
|
|
@@ -34,6 +34,7 @@ Dynamic: description
|
|
|
34
34
|
Dynamic: home-page
|
|
35
35
|
Dynamic: keywords
|
|
36
36
|
Dynamic: license
|
|
37
|
+
Dynamic: license-file
|
|
37
38
|
Dynamic: requires-dist
|
|
38
39
|
Dynamic: summary
|
|
39
40
|
|
|
@@ -77,6 +78,23 @@ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypack
|
|
|
77
78
|
History
|
|
78
79
|
=======
|
|
79
80
|
|
|
81
|
+
2.1.0 ( 2025-05-21 )
|
|
82
|
+
--------------------
|
|
83
|
+
|
|
84
|
+
* se agrego el snippet para saber la ip local Ip.get_my_local_ip()
|
|
85
|
+
* se agregaron los argumentos para queries de changelog de rpm RPM.query().changelog().run( 'some.rpm' )
|
|
86
|
+
|
|
87
|
+
2.0.0 ( 2025-05-15 )
|
|
88
|
+
--------------------
|
|
89
|
+
|
|
90
|
+
* se migro el uso de git a https://github.com/dem4ply/chibi_git
|
|
91
|
+
|
|
92
|
+
1.1.3 ( 2025-03-12 )
|
|
93
|
+
--------------------
|
|
94
|
+
|
|
95
|
+
* se agrego repr a los results de los comandos
|
|
96
|
+
* correcion con el f string que faltaba en un logger debug
|
|
97
|
+
|
|
80
98
|
1.1.0 ( 2024-10-18 )
|
|
81
99
|
--------------------
|
|
82
100
|
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
# from git import Repo
|
|
3
|
-
from chibi.file import Chibi_path
|
|
4
|
-
from chibi_command import Command
|
|
5
|
-
from chibi_requests import Chibi_url
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
logger = logging.getLogger( 'chibi_command.git' )
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Git( Command ):
|
|
12
|
-
command = 'git'
|
|
13
|
-
captive = False
|
|
14
|
-
|
|
15
|
-
@staticmethod
|
|
16
|
-
def get_repo_name( url ):
|
|
17
|
-
url = Chibi_url( url )
|
|
18
|
-
name = url.base_name.rsplit( '.git', 1 )[0]
|
|
19
|
-
logger.debug( name )
|
|
20
|
-
raise NotImplementedError()
|
|
21
|
-
|
|
22
|
-
@classmethod
|
|
23
|
-
def repo( cls, src ):
|
|
24
|
-
if src is None:
|
|
25
|
-
src = Chibi_path.current_dir()
|
|
26
|
-
raise NotImplementedError
|
|
27
|
-
# return Repo( src )
|
|
28
|
-
|
|
29
|
-
@classmethod
|
|
30
|
-
def clone( cls, url, dest=None, **kw ):
|
|
31
|
-
"""
|
|
32
|
-
clona el repositorio de la url
|
|
33
|
-
|
|
34
|
-
Parameters
|
|
35
|
-
==========
|
|
36
|
-
url: string
|
|
37
|
-
url del repositorio
|
|
38
|
-
dest: string ( optional )
|
|
39
|
-
destino de donde se clonara el repositorio
|
|
40
|
-
por default es el directorio de trabajo
|
|
41
|
-
"""
|
|
42
|
-
if dest is not None:
|
|
43
|
-
dest = Chibi_path( dest )
|
|
44
|
-
command = cls( 'clone', url, dest, **kw )
|
|
45
|
-
else:
|
|
46
|
-
command = cls( 'clone', url, **kw )
|
|
47
|
-
return command.run()
|
|
48
|
-
|
|
49
|
-
@classmethod
|
|
50
|
-
def pull( cls, src=None, **kw ):
|
|
51
|
-
"""
|
|
52
|
-
hace pull a un repositorio
|
|
53
|
-
|
|
54
|
-
Parameters
|
|
55
|
-
==========
|
|
56
|
-
src: string
|
|
57
|
-
ruta del repositorio que se quiere hacer pull
|
|
58
|
-
"""
|
|
59
|
-
if src is not None:
|
|
60
|
-
src = Chibi_path( src )
|
|
61
|
-
command = cls(
|
|
62
|
-
f'--git-dir={src}/.git', f'--work-tree={src}',
|
|
63
|
-
'pull' )
|
|
64
|
-
else:
|
|
65
|
-
command = cls( 'pull', **kw )
|
|
66
|
-
return command.run()
|
|
67
|
-
|
|
68
|
-
@classmethod
|
|
69
|
-
def checkout( cls, branch=None, src=None, **kw ):
|
|
70
|
-
if src is not None:
|
|
71
|
-
src = Chibi_path( src )
|
|
72
|
-
if not src.exists:
|
|
73
|
-
logger.error( f"el directorio {src} no existe" )
|
|
74
|
-
return
|
|
75
|
-
if branch is not None:
|
|
76
|
-
if src:
|
|
77
|
-
command = cls(
|
|
78
|
-
f'--git-dir={src}/.git', f'--work-tree={src}',
|
|
79
|
-
'checkout', branch, **kw )
|
|
80
|
-
else:
|
|
81
|
-
command = cls( 'checkout', branch, **kw )
|
|
82
|
-
else:
|
|
83
|
-
if src:
|
|
84
|
-
command = cls(
|
|
85
|
-
f'--git-dir={src}/.git', f'--work-tree={src}',
|
|
86
|
-
'checkout', **kw )
|
|
87
|
-
else:
|
|
88
|
-
command = cls( 'checkout', **kw )
|
|
89
|
-
return command.run()
|
|
90
|
-
|
|
91
|
-
@classmethod
|
|
92
|
-
def checkout_track( cls, branch=None, src=None, **kw ):
|
|
93
|
-
if src is not None:
|
|
94
|
-
src = Chibi_path( src )
|
|
95
|
-
if not src.exists:
|
|
96
|
-
logger.error( f"el directorio {src} no existe" )
|
|
97
|
-
return
|
|
98
|
-
if branch is not None:
|
|
99
|
-
if src:
|
|
100
|
-
command = cls(
|
|
101
|
-
f'--git-dir={src}/.git', f'--work-tree={src}',
|
|
102
|
-
'checkout', '--track', branch, **kw )
|
|
103
|
-
else:
|
|
104
|
-
command = cls( 'checkout', '--track', branch, **kw )
|
|
105
|
-
return command.run()
|
|
106
|
-
else:
|
|
107
|
-
if src:
|
|
108
|
-
command = cls(
|
|
109
|
-
f'--git-dir={src}/.git', f'--work-tree={src}',
|
|
110
|
-
'checkout', **kw )
|
|
111
|
-
else:
|
|
112
|
-
raise NotImplementedError(
|
|
113
|
-
f"branch={branch}, src={src}, kw={kw}" )
|
|
114
|
-
return command.run()
|
|
115
|
-
raise NotImplementedError( f"branch={branch}, src={src}, kw={kw}" )
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|