Skip to content

Commit

Permalink
correction for PLI and OV
Browse files Browse the repository at this point in the history
  • Loading branch information
jbleyel committed Aug 10, 2023
1 parent 40e8585 commit c4a06af
Showing 1 changed file with 46 additions and 28 deletions.
74 changes: 46 additions & 28 deletions DistroBuildInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,31 @@
# Changelog:
# 1.0 Initial version
# 1.1 add global blacklist / add filters
# 1.2 corrections for models / machines

__version__ = "1.1"
__version__ = "1.2"


import requests
import re
import shutil

MACHINEARM = "dreamone dreamtwo og2s4k iziboxx4 ustym4ks2ottx novaler4kpro sx88v2 sfx6008 zgemmah82h gbquad4k gbue4k zgemmah7 pulse4kmini pulse4k sf8008 vusolo4k osmio4kplus beyonwizv2 mutant51 mutant66se gbtrio4kpro ip8 novaler4kse axmultiboxse anadolmultiboxse og2ott4k mutant66se sx988 ustym4kottpremium ferguson4k force4 protek4k dinobot4kmini axashis4kcombo axashis4kcomboplus dinobot4kplus zgemmah9s zgemmah9t zgemmah92s zgemmah92h ax51 anadol4k anadol4kv2 anadol4kcombo dinobot4k dinobot4kse e4hdultra lunix34k dm900 galaxy4k tmtwin4k vimastec1500 sf4008 bre2ze4k revo4k force3uhd force3uhdplus gi11000 beyonwizu4 dual pulse4k hitube4kpro dinobot4ktwin maxytecmultise iziboxelite4k vipersingle zgemmah9combose zgemmah92hse zgemmai55se anadolmultitwin axmulticombo axmultitwin protek4kx2 vipertwin vuuno4k vuultimo4k turing sf8008m osmini4k gbx34k viper4k51 ax61 gbip4k iziboxx3 arivatwin arivacombo dinobot4kelite jdhdduo zgemmah102s zgemmah102h zgemmah10combo iziboxecohd iziboxone4k hitube4k viper4kv20 vuzero4k vuduo4kse dm920 vuuno4kse gbue4k zgemmah9twin axashistwin anadolprohd5 zgemmah9twinse spycatminiv2 anadolmulti maxytecmulti gbtrio4k axashisc4k viper4k protek4kx1 ustym4kpro iziboxone4kplus viper4kv40 axashistwinplus zgemmah9sse hitube4kplus viper4kv30 novaler4k zgemmah11s zgemmah112h osmio4k zgemmah9combo vuduo4k ax60 zgemmai55plus mutant60 lunix4k"
MACHINEMIPSEL = "dm800se dm500hd gb800solo zgemmah4 viperslim tiviaraplus zgemmah6 dm520 dm8000 dm7020hd dm7020hdv2 dm800sev2 dm500hdv2 dm7080 dm820 vipert2c vipercombo vipercombohdd evoslimse evoslimt2c formuler1tc formuler3ip formuler4ip zgemmah2splus zgemmah52splus tiviarmin mbmicrov2 zgemmah52s zgemmah52tc zgemmah32tc vimastec1000 e4hdcombo formuler4turbo mutant530c sf238 9911lx twinboxlcdci5 novaip novacombo novatwin evominiplus mutant11 9910lx sf208 sf228 e4hdhybrid zgemmai55 zgemmah5 sf98 galaxym6 odinplus zgemmaslc 9900lx et7x00mini evomini zgemmahs zgemmah2s zgemmah2h e4hd t2cable xpeedlxcs2 xpeedlxcc mutant500c odin2hybrid mbmicro sf108 twinboxlcd singleboxlcd triplex quadbox2400 formuler1 vizyonvita mutant1100 mutant1200 mutant1265 mutant1500 mutant2400 formuler3 axase3c formuler4 axase3 evoe3hd geniuse3hd evo genius starsatlx axodinc axodin classm maram9 et9x00 et6x00 et5x00 et4x00 et8500 et8000 et10000 et7x00 x1plus xcombo tyrant zgemmash1 zgemmash2 zgemmas2s zgemmass x2plus xp1000mk xp1000plus enibox xp1000max sf8 enfinity mago marvel1 bre2ze zgemmah3ac zgemmah5ac optimussos3plus osninopro lunix lunixco osnino osninoplus purehdse alphatriple evoslim tmnanom3 bre2zet2c force2nano gbultraueh gbx3h sf128 sf138 osmega spycatminiplus tmnanosem2plus force2plushv gbx2 osminiplus gbultraue gbquad gb800se gb800ue gb800seplus gb800ueplus gbipbox gbx1 gbx3 vuduo2 vusolose vusolo2 vuzero vuuno vuduo vuultimo vusolo mbhybrid gbquadplus force2se mbtwinplus opticumtt beyonwizt2 osmini sf3038 spycat spycatmini bwidowx atemionemesis beyonwizt4 sezammarvel xpeedlx3 mbultra sezam5000hd sezam1000hd mbmini mbtwin beyonwizt3 xpeedlx1 xpeedlx2 mbminiplus atemio5x00 ventonhdx atemio6000 atemio6100 atemio6200 tmnanose tmnanosem2 tmnanosecombo optimussos force2 force2plus megaforce2 tmnano2super tm2t tmnano tmnano2t tmsingle tmtwin tmnano3t iqonios100hd iqonios200hd roxxs200hd mediaart200hd iqonios300hd force1 force1plus megaforce1plus optimussos1plus optimussos2plus optimussos1 optimussos2 mediabox iqonios300hdv2 worldvisionf1 worldvisionf1plus fusionhd fusionhdse purehd sogno8800hd uniboxhde 9920lx"

machines = set(MACHINEARM.split() + MACHINEMIPSEL.split())

#machines = ["zgemmah7", "classm", "starsatlx"]

filters = {
"Open8eIGHT": r'(sx|sf|xp1000plus)',
"OpenDROID": r'(zgemmah2h)',
"TeamBlue": r'(gb)',
"EGAMI": r'(zgemmah|novaler)'
}

BLACKLIST = ['dreamone', 'dreamtwo', 'zgemmah10combo', 'enfinity', 'marvel1', 'ch625dt', 'uniboxhde', 'protek4kx1', '7220s', 'starsatlx', 'ew7356', 'gb7356', 'xc7362', 'beyonwizt3', '7210s', 'mutant66se', 'evoslimse', 'x2plus', 'force2se', 'inihde2', 'anadolprohd5', 'force2plus', 'mago', 'zgemmah102s', 'anadolmultitwin', 'e3hd', '7400s', 'twinboxlcdci5', 'yh73625', 'mutant1265', 'tyrant', 'ch62lc', 'beyonwizt4', 'u56', 'zgemmah9combose', 'novaip', 'u571', 'odinm9', 'geniuse3hd', 'tm2t', 'axmultitwin', 'ew7362', 'gb7362', 'novaler4kpro', 'gi11000', 'vg1000', 'mediaart200hd', 'mbmini', 'iziboxx4', 'u57', 'novacombo', '7100s', 'force2', 'inihdp', 'yh625tc', 'xp1000max', 'sogno8800hd', 'viper4kv30', 'ew7358', 'dags7252', 'force2plushv', 'tmnano3t', 'turing', 'i55se', 'x1plus', 'yh7362', 'xpeedlx2', 'lunixco', 'g100', 'blackbox7405', 'zgemmah112h', 'genius', 'u42', 'iqonios300hd', 'revo4k', 'tmnano2super', 'ferguson4k', 'dags7356', 'galaxy4k', 'protek4k', 'mbminiplus', 'dagsmv200', 'alphatriple', 'maxytecmultise', 'purehd', 'ch625lc', 'u5pvr', 'iqonios300hdv2', 'dags73625', 'gb73625', 'sezam1000hd', 'vg5000', 'megaforce1plus', 'u55', 'sf238', 'gbmv200', 'dags72604', '7225s', 'axodinc', 'axashistwinplus', 'force4', 'evoe3hd', 'beyonwizu4', 'evomini', 'jj7362', 'iziboxone4kplus', 'zgemmah5ac', 'mediabox', 'fusionhdse', 'dags7362', 'u5', 'sezam5000hd', '7000s', 'yh625dt', 'force1plus', 'vizyonvita', 'sezammarvel', 'yh62tc', 'purehdse', 'dags7335', 'gb7358', 'mbtwinplus', 'roxxs200hd', 'u533', 'inihde', 't2cable', '9911lx', 'tmnano', 'mutant1100', 'gb7325', 'odinm7', '7215s', 'viperslim', 'zgemmah2splus', 'vg2000', 'mbtwin', 'mutant530c', '9920lx', 'u532', 'gb7252', 'mbhybrid', 'optimussos', 'u41', 'u43', 'dinobot4kse', 'tmnano2t', 'force3uhd', '9910lx', 'force1', 'iqonios200hd', 'axase3c', 'xpeedlx1', 'zgemmah102h', 'enibox', 'g300', 'protek4kx2', 'galaxym6', 'u52', 'u51', 'vipert2c', 'zgemmah3ac', 'xc7346', 'mbmicrov2', 'force3uhdplus', 'mbmicro', 'classm', 'beyonwizt2', 'zgemmai55se', 'ventonhdx', 'axase3', 'iqonios100hd', 'dinobot4kelite', '7005s', 'vimastec1500', 'evo', '7300s', 'u45', 'vipersingle', 'gb72604', '7105s', 'vimastec1000', 'evoslimt2c', 'novatwin', 'ultramini', 'g101', 'megaforce2', 'fusionhd', '8100s', 'evominiplus', 'inihdx', 'force2nano', 'u53', 'mbultra']
BLACKLIST = ['force2se', '9900lx', 'zgemmah10combo', 'force1', 't2cable', 'zgemmah102s', 'beyonwizt3', 'axmultitwin', 'beyonwizt4', 'classm', 'maxytecmultise', 'force1plus', 'optimussos', 'xp1000max', 'axashistwinplus', 'vipersingle', 'twinboxlcdci5', 'xpeedlx1', 'mago', 'sezam5000hd', 'viperslim', 'mutant530c', 'enfinity', 'beyonwizu4', 'beyonwizv2', 'mutant1265', 'mbminiplus', 'anadolprohd5', 'galaxym6', 'evomini', '9911lx', 'og2ott4k', 'purehdse', 'roxxs200hd', 'fusionhdse', 'tm2t', 'iqonios100hd', 'lunixco', '9920lx', 'evominiplus', 'mutant66se', 'zgemmah5ac', 'x1plus', 'dm7020hd', 'og2s4k', 'mbmicro', 'mbultra', 'galaxy4k', 'ustym4ks2ottx', 'genius', 'zgemmah9combose', 'gi11000', 'vimastec1000', 'tiviarmin', 'mbtwinplus', 'enibox', 'mutant1100', 'novaip', 'revo4k', 'viper4kv30', 'zgemmah2splus', 'mbtwin', 'marvel1', 'tmnano2super', 'sezammarvel', 'zgemmai55se', 'evoslimse', 'fusionhd', 'sezam1000hd', 'geniuse3hd', 'xpeedlx2', 'iqonios200hd', 'axase3c', 'tmnano3t', 'anadolmultitwin', 'sogno8800hd', 'vizyonvita', 'mbmini', 'axodinc', 'vimastec1500', 'evo', 'dm800sev2', 'novaler4kpro', 'beyonwizt2', 'mediaart200hd', 'mediabox', 'x2plus', 'mbmicrov2', 'force2plushv', 'purehd', 'ferguson4k', 'ustym4kottpremium', 'dm800se', 'dreamone', 'evoe3hd', 'tmnano2t', 'dm7080', 'force3uhd', 'mbhybrid', 'tyrant', 'vipert2c', 'megaforce1plus', 'zgemmah112h', 'protek4kx2', 'novatwin', 'protek4kx1', 'dm500hdv2', 'axase3', 'force4', 'sf238', 'tmnano', 'dinobot4kelite', 'force3uhdplus', 'force2nano', 'uniboxhde', 'novacombo', '9910lx', 'iqonios300hd', 'turing', 'dm8000', 'alphatriple', 'iziboxone4kplus', 'zgemmah102h', 'zgemmah3ac', 'iziboxx4', 'protek4k', 'megaforce2', 'force2plus', 'iqonios300hdv2', 'ventonhdx', 'force2', 'dreamtwo', 'dm500hd', 'starsatlx', 'dinobot4kse', 'evoslimt2c']
BLACKLIST_MODEL = ['dags73625', 'xc7362', 'ch625lc', 'u57', 'dags7362', 'gb73625', '7000s', 'dags7335', 'dags7356', 'inihde', '7100s', 'dags7252', '7400s', 'dreamone', 'odinm7', 'vg2000', 'ew7356', 'yh625dt', 'gbmv200', 'gb7252', 'e3hd', 'g300', 'gb7325', '7005s', 'ultramini', '7225s', 'u51', 'inihde2', 'yh7362', 'u533', 'vg5000', '7220s', 'ew7358', 'inihdp', 'gb7358', '7105s', '7210s', 'gb7356', 'u42', 'inihdx', 'u571', 'u56', 'blackbox7405', 'u5', 'yh73625', 'u5pvr', 'u55', 'g100', 'yh62tc', 'jj7362', 'ch62lc', 'gb7362', 'odinm9', '7215s', 'u52', 'i55se', 'vg1000', 'u45', 'u41', 'u53', 'dags72604', '7300s', 'u532', 'xc7346', 'gb72604', 'u43', 'ew7362', 'dreamtwo', '8100s', 'yh625tc', 'ch625dt', 'g101']


def getmodels(BUILDMACHINE):
Expand Down Expand Up @@ -190,8 +195,8 @@ def getmodels(BUILDMACHINE):
MACHINE = "dags7252"
elif (BUILDMACHINE == "force4") or (BUILDMACHINE == "lunix4k"):
MACHINE = "dags72604"
elif (BUILDMACHINE == "dual"):
MACHINE = "dagsmv200"
# elif (BUILDMACHINE == "dual"):
# MACHINE = "dagsmv200"
elif (BUILDMACHINE == "gb800se") or (BUILDMACHINE == "gb800ue"):
MACHINE = "gb7325"
elif (BUILDMACHINE == "gb800seplus") or (BUILDMACHINE == "gb800ueplus") or (BUILDMACHINE == "gbipbox"):
Expand Down Expand Up @@ -281,13 +286,16 @@ def getmodels(BUILDMACHINE):
return MACHINE


models = []
models_mapping = {}
for machine in machines:
model = getmodels(machine)
if model not in models:
models.append(model)
if model in models_mapping:
models_mapping[model].append(machine)
else:
models_mapping[model] = [machine]


models = set(models)
#models = set(models)

FEED_URLS1 = [
("OpenViX", "https://www.openvix.co.uk/json/%s", "machinebuild"),
Expand All @@ -305,14 +313,14 @@ def getmodels(BUILDMACHINE):
("OpenVision", "https://images.openvision.dedyn.io/json/%s", "model")
]

model_machines = {}

for machine in set(list(machines) + list(models)):
model_machines[machine] = []
machine_distros = {}
black_machines = []
for machine in machines:
machine_distros[machine] = []
black_machines.append(machine)

for feed in FEED_URLS1:
distro = feed[0]
white = []
print("Check %s" % distro)
filter = filters.get(distro)
for machine in machines:
Expand All @@ -322,33 +330,43 @@ def getmodels(BUILDMACHINE):
url = feed[1] % machine
x = requests.get(url)
if x and x.text and len(x.text) > 10:
model_machines[machine].append(distro)
white.append(machine)
if machine in black_machines:
black_machines.remove(machine)
machine_distros[machine].append(distro)
# print("Distro:%s -> %s" % (distro, white))

black_models = []
for model in models_mapping:
black_models.append(model)

for feed in FEED_URLS2:
distro = feed[0]
white = []
print("Check %s" % distro)
filter = filters.get(distro)
for machine in models:
if machine in BLACKLIST:
for model in models_mapping:
if model in BLACKLIST_MODEL:
continue
if not filter or re.match(filter, machine):
url = feed[1] % machine
# print("Check model %s" % model)
if not filter or re.match(filter, model):
url = feed[1] % model
x = requests.get(url)
if x and x.text and len(x.text) > 10:
model_machines[machine].append(distro)
white.append(machine)
if model in black_models:
black_models.remove(model)
for machine in models_mapping[model]:
machine_distros[machine].append(distro)
# print("Distro:%s -> %s" % (distro, white))

black = []
#print(black_models)
#print(black_machines)

corrections = [
("dual", "dagsmv200")
]

for machine in model_machines.items():
for machine in machine_distros.items():
with open("Rel/%s" % machine[0], "w") as fd:
if not machine[1]:
black.append(machine[0])
fd.write(" ".join(machine[1]))

with open("Rel/black.lst", "w") as fd:
fd.write("\n".join(black))
for correction in corrections:
shutil.copy2("Rel/%s" % correction[0], "Rel/%s" % correction[1])

0 comments on commit c4a06af

Please sign in to comment.