-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.py
executable file
·132 lines (96 loc) · 3.14 KB
/
script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/env python3
'''
from config import config
# init System
system = System()
system.apply(config)
'''
from pathlib import Path
from core.base_cmd import BaseCmd
from core.configurator import BaseConfigurator, Configurator
from core.pkg_managers.flatpak import Flatpak
from core.system import FakeSystem
from core.utils.enums import Systems, PKGManagers, DE
from core.settings import settingsObj, init_settings
#system = System()
""" settings.init() """
""" settingsObj.init() """
""" init_settings() """
#print(settings.localization['lang'])
""" cmd = BaseCmd() """
#cmd.run('ls -a /')
#cmd.root.run('cp -rf /usr/share/themes/. /home/$USER/test', password='7991')
#cmd.run('ls -l', password='7991', root=True)
#cmd.run('ls -l')
""" result = cmd.run('lb -a /')
output, error = cmd.decode(result)
print(f'Errors: {error}, Outputs: {output}') """
""" result = cmd.root_run('lb -a /', password='7991')
#print(result.stdout.decode('utf-8'))
output, error = cmd.decode(result)
print(f'Errors: {error}, Outputs: {output}') """
""" result = cmd.root_run('lb -a /', password='7991')
output, error = cmd.decode(result)
print(f'Errors: {error}, Outputs: {output}')
"""
'''
Для того чтобы передать набор опций в конфигурацию, необходимо обратиться к пакетному менеджеру
и классу уоманды и выбрать опцию:
Manager.Operation.option(args)
'''
#fake_sys = FakeSystem(os_name=Systems.ubuntu, de=DE.gnome)
cnf = Configurator()
#print(cnf.system)
#cnf.run('ls -a /')
# Test flatpak configurations
cnf.flatpak.install('org.gabmus.hydrapaper', [Flatpak.Install.subpath(Path('/usr/bin/')), Flatpak.Install.user()])
cnf.flatpak.remove('org.gabmus.hydrapaper', [Flatpak.Uninstall.user()])
cnf.flatpak.update()
cnf.flatpak.add_repo('flathub', 'https://flathub.org/repo/flathub.flatpakrepo')
cnf.flatpak.remove_repo('flathub')
cnf.flatpak.purge('org.gabmus.hydrapaper')
cnf.flatpak.build_cmd(Flatpak.Config(), [Flatpak.Config.user()], head_options=[Flatpak.verbose()])
cnf.flatpak.install('org.gabmus.hydrapaper')
# Test base configurations
cnf.install('gimp')
cnf.update()
""" cnf.flatpak.update() """
#cnf.run('ls -a /')
#cnf.sudo.run('ls -a /')
""" cnf.update_configuration()
print(cnf) """
configuration = cnf._extract_configs(os_name=Systems.manjaro, de=DE.gnome)
for el in configuration:
print(el)
#print(cnf.system.de)
#cnf.manager
#cnf.apply()
#cmd.a_run('ls -a /', password='7991')
#cmd.shellroot_run_cmd('ls -a /', password='7991')
"""
cmd.chained_run('ls -a', 'grep venv')
cnf.run('ls -a').run('grep venv')
cnf.install('package', 'package1')
cnf.ubuntu.apt.install()
cnf.ubuntu.install()
cnf.ubuntu.snap.instal()
cnf.restart()
cnf.flatpak.install('package_id')
cnf.flatpak.chain('aaa').chain('aaa').cmd
cnf.flatpak(args).install(args, app)
cnf.snap.install('package')
cnf.add_extension('extension_url')
cnf.add_env(key = key, value = value)
cnf.apply()
cnf.flatpak.install('package_id')
cnf.ubuntu.snap.install(p)
cnf.fedora.flatpak.install(p)
sudo snap install p
sudo flatpak install p
"""
'''
conf = Configurator()
conf.install()
conf.delete()
conf.apply(system)
'''