rendered paste bodyfrom po import it
import commands
import os
import re
def CreateProfile():
print it.createNewProfile
askCreate = raw_input(it.ask)
if askCreate == it.yes or askCreate == it.yesor:
profileName = raw_input(it.askName)
profileEmail = raw_input(it.askEmail)
os.system('echo "Name: ' + profileName + '\nEmail: ' + profileEmail + '" > /usr/share/applications/aqx_make/profile')
elif askCreate == it.no or askCreate == it.nor:
print it.notContinued
exit
else:
exit
def CreatePack():
askStart = raw_input(it.START)
if askStart == it.createDirAqx or askStart == it.createDirAqxOr:
testDirCreate = commands.getoutput(testCreateDir)
if testDirCreate == "Error":
print it.errorTestDir
else:
getdir = commands.getoutput(createdir)
namePack = raw_input(it.namePack)
depens = raw_input(it.depens)
conflicts = raw_input(it.conflicts)
valori = re.split(' ', namePack)
idPack = valori[0]
versione = valori[1]
idFile = 'Aqx/ID' + idPack
x = re.compile(r'\[(\d+)\]')
print it.loading_conf
f = open('Aqx/conf.aq', 'w'); f.write(valori[0] + ";" + depens + ";" + conflicts + ";");
changelog = open('Aqx/changelog', 'w'); changelog.write(idPack + "\n *Initial Release\n" + getdir)
version = open('Aqx/version', 'w'); version.write(versione)
ID = open(idFile, 'w');
testdir = "./test "
testCreateDir = "./testc"
createdir = "./cdir"
print it.welcome
test = commands.getoutput(testdir)
if test == "Error":
CreateProfile()
elif test != "Error":
CreatePack()