Enviado em 10/09/2021 - 10:29h
#!/usr/bin/env python
from subprocess import Popen, PIPE
import sys, os, re, zipfile
def unpack( ):
ply = os.path.abspath('../Personalization/User_Extensions')
arch = os.listdir(ply)
comp = [x for x in arch if not os.path.isdir(f'{ply}/{x}')]
r = ''
while (r != 's') or (r != 'n'):
r = input('\nANTES DE COMEÇAR A PERSONALIZAÇÃO DO SISTEMA COM AS EXTENSÕES, \nCOLOQUE O ARQUIVO COMPACTADO COM A EXTENSÃO QUE DESEJA USAR NO \nSISTEMA DENTRO DO DIRETÓRIO New_System/Personalization/User_Extensions. \nDESEJA CONTINUAR O PROCEDIMENTO? (S/N) \n').lower( )
if r == 'n':
break
if r == 's':
print('\nESCOLHA A EXTENSÃO QUE DESEJA INSTALAR:')
for x in range(len(comp)):
print(f'{x + 1} - {comp[x]}')
ch = input('> ')
ext = comp[int(ch) - 1]
fl = os.popen(f'unzip -p {ply}/{ext} metadata.json').read( ).strip( )
n = re.split("[, \"'{[\_/!?:;*]+", fl)
uid = n[n.index('uuid') + 1]
if not dest.split('/')[-1] in arch:
print('NÃO TEM.')
os.popen(f'mkdir {os.path.join(ply, uid)}')
else:
print('TEM.')
with zipfile.ZipFile(f'{os.path.join(ply, ext)}', "r") as z:
z.extractall('{os.path.join(ply, uid)}')
print(os.listdir(f'{os.path.join(ply, uid)}'))
break
print(os.listdir(f'{os.path.join(ply, uid)}'))
Customizar a Instalação do Linux Debian com Preseed
Atualizando o Passado: Linux no Lenovo G460 em 2025
aaPanel - Um Painel de Hospedagem Gratuito e Poderoso
Um modo leve de ouvir/ver áudio/vídeo da internet em máquinas pererecas
Resolver algumas mensagens de erro do SSH
Instalar módulo de segurança do Banco do Brasil Warsaw do tipo .run
Bora fazer um teste? mbti (17)
Alerta Google Chrome 138.0.7204.10... [RESOLVIDO] (6)