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)}'))
Atualizar o macOS no Mac - Opencore Legacy Patcher
Crie alias para as tarefas que possuam longas linhas de comando - bash e zsh
Criando um gateway de internet com o Debian
Configuração básica do Conky para mostrar informações sobre a sua máquina no Desktop
Aprenda a criar músicas com Inteligência Artificial usando Suno AI
Instalando e usando o Dconf Editor, o "regedit" para Linux
Como instalar o navegador TOR no seu Linux
Instalando Zoom Client no Ubuntu 24.04 LTS
O jogo Minecraft crasha antes mesmo de iniciar, porem o erro só ocorre... (2)
Sistema da Coréia do Norte - Red Star OS (69)
HD SSD inacessível: scsi error badly formed scsi parameters (2)