I broke some code here but it's fine, implemented getLatestVersion_by_number
This commit is contained in:
parent
3412152ca3
commit
c968608e51
@ -144,7 +144,7 @@ def key_filter(dict_to_filter, type_to_grab, **kwargs):
|
||||
search = re.search(str(type_to_grab), str(value))
|
||||
if search != None:
|
||||
print("Match!")
|
||||
#print(key)
|
||||
print(key, value)
|
||||
output_version.append(key)
|
||||
output_query.append(value)
|
||||
|
||||
@ -154,8 +154,7 @@ def key_filter(dict_to_filter, type_to_grab, **kwargs):
|
||||
elif return_both == True:
|
||||
#Tie the lists back together, and return it
|
||||
return_dict = {}
|
||||
return_list_count = len(key)
|
||||
for item in range(return_list_count):
|
||||
for item in range(len(output_query)):
|
||||
return_dict[output_query[item]] = output_version[item]
|
||||
return return_dict
|
||||
|
||||
@ -180,6 +179,11 @@ def getLatestVersion_by_number(project, version, **kwargs):
|
||||
for key, value in versions_to_target.items():
|
||||
mc_mod_release = re.split('-+', key)
|
||||
all_mc_mod_release.append(mc_mod_release)
|
||||
if len(all_mc_mod_release) == 1:
|
||||
all_mc_mod_release = []
|
||||
for key, value in versions_to_target.items():
|
||||
mc_mod_release = re.split('\++', key)
|
||||
all_mc_mod_release.append(mc_mod_release)
|
||||
print(all_mc_mod_release)
|
||||
# Okay, take the last entry in the contents inside each mc_mod_release and output the higest value
|
||||
versions_to_parse_2 = []
|
||||
@ -189,7 +193,9 @@ def getLatestVersion_by_number(project, version, **kwargs):
|
||||
latest_version = max(versions_to_parse_2)
|
||||
print(latest_version)
|
||||
#Finally, key_filter for the latest build version
|
||||
latest_version_id = key_filter(version_numbers, version+"-"+latest_version)
|
||||
latest_version_id = key_filter(version_numbers, latest_version)
|
||||
print(type(latest_version_id))
|
||||
print(latest_version_id)
|
||||
return str(latest_version_id[0])
|
||||
|
||||
def getForMinecraftVersion(project, version, stability):
|
||||
|
Loading…
x
Reference in New Issue
Block a user