mirror of
https://github.com/outbackdingo/OpCore-Simplify.git
synced 2026-08-25 14:53:06 +00:00
Use a generic method instead of creating an additional special case
This commit is contained in:
+2
-2
@@ -97,8 +97,8 @@ class OCPE:
|
||||
while True:
|
||||
self.u.head("Select macOS Version")
|
||||
print("")
|
||||
for index, macos_version_name in enumerate(os_data.get_macos_names(supported_macos_version[0], supported_macos_version[-1]), start=int(supported_macos_version[0][:2])):
|
||||
print("{}. {}".format(index, macos_version_name))
|
||||
for darwin_version in range(int(supported_macos_version[0][:2]), int(supported_macos_version[-1][:2]) + 1):
|
||||
print("{}. {}".format(darwin_version, os_data.get_macos_name_by_darwin(str(darwin_version))))
|
||||
print("")
|
||||
print("Please enter the macOS version you want to select:")
|
||||
print("- To select a major version, enter the number (e.g., 19).")
|
||||
|
||||
@@ -22,13 +22,6 @@ def get_latest_darwin_version():
|
||||
def get_lowest_darwin_version():
|
||||
return "{}.{}.{}".format(macos_versions[0].darwin_version, 0, 0)
|
||||
|
||||
def get_macos_names(min_darwin, max_darwin):
|
||||
return [
|
||||
"macOS {} {}{}".format(data.name, data.macos_version, "" if data.release_status == "final" else " (Beta)")
|
||||
for data in macos_versions
|
||||
if int(min_darwin[:2]) <= data.darwin_version <= int(max_darwin[:2])
|
||||
]
|
||||
|
||||
def get_macos_name_by_darwin(darwin_version):
|
||||
for data in macos_versions:
|
||||
if data.darwin_version == int(darwin_version[:2]):
|
||||
|
||||
Reference in New Issue
Block a user