Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Convertir.py
blob: b5f65290f1514a0cf71b01d3674b876acc5b6b84 (plain)
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time, os, sys

print "Quinteti!"
print "RECUERDE QUE LAS IMÁGENES DEBEN ESTAR EN SVG"
print "PARA CORRECTO FUNCIONAMIENTO LOS DIRECTORIOS AL FINAL DEBEN TENER LA PALABRA 'Vector'"
sys.stdout.write('\x1B[31m')
print "EJEMPLO: RojoVector"
sys.stdout.write('\x1B[0m')
time.sleep(2)
lista = os.listdir('.')
lista.remove('convertir.py')
for x in lista:
	if "png" in x.lower():
		lista.remove(x)
	else:
		print '['+x+']'
color = raw_input("Seleccione un color:")
if os.path.exists(color):
	try:
		os.mkdir(color+'PNG')
	except:
		pass
try:
	for x in os.listdir(color):
		print "Convirtiendo: " + x
		os.system('rsvg ' + color + '/' + x + " " + color + "PNG/" + x[:-4]+'.png')
except OSError:
	print "EL DIRECTORIO ESPECIFICADO NO EXISTE"
	exit("INTENTE EJECUTAR DE NUEVO EL SCRIPT Y SELECCIONANDO OTRO")