talimat.py

This commit is contained in:
milisarge 2017-04-18 17:57:31 +03:00
parent 0a04ae28ea
commit d3719344c1

View file

@ -96,18 +96,20 @@ class Talimat():
blok=False blok=False
onblok=False onblok=False
for satir in satirlar: for satir in satirlar:
if "md5sums=(" in satir or "sha256sums=('": if "md5sums=(" in satir or "sha256sums=('" in satir:
onblok=True onblok=True
if onblok is True and "')" in satir: if onblok is True and "')" in satir:
blok=True blok=True
continue continue
if blok and satir.rstrip()!="" and satir.rstrip()!="}": if blok and satir.rstrip()!="" and satir.rstrip()!="}":
if (satir not in self.derleme) and ("pkgver()" not in satir) and ("prepare()" not in satir) and ("build()" not in satir) and ("package()" not in satir): if (satir not in self.derleme) and ("pkgver()" not in satir) and ("prepare()" not in satir) and ("build()" not in satir) and ("package()" not in satir):
'''
satir=satir.replace("pkgdir","PKG") satir=satir.replace("pkgdir","PKG")
satir=satir.replace("srcdir","SRC") satir=satir.replace("srcdir","SRC")
satir=satir.replace("pkgname","name") satir=satir.replace("pkgname","name")
satir=satir.replace("pkgver","version") satir=satir.replace("pkgver","version")
satir=satir.replace("pkgrel","release") satir=satir.replace("pkgrel","release")
'''
self.derleme+=satir+"\n" self.derleme+=satir+"\n"
else: else:
return "blok için gecersiz tip!" return "blok için gecersiz tip!"
@ -302,7 +304,10 @@ class renk:
class Arge: class Arge:
def indir(self,link): def indir(self,link):
paket=link.split("?h=")[1] if "packages/" in link:
paket=link.split("?h=packages/")[1]
else:
paket=link.split("?h=")[1]
print renk.tamamb+paket+" indiriliyor..."+renk.son print renk.tamamb+paket+" indiriliyor..."+renk.son
try: try:
veri = urllib2.urlopen(link) veri = urllib2.urlopen(link)