Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc99461

Browse files
committed
fix some problems
1 parent 1b1524c commit cc99461

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

oclp_r/efi_builder/networking/wireless.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _on_model(self) -> None:
4949
On-Model Hardware Detection Handling
5050
"""
5151

52-
logging.info(self.trans.wireless()[f"- Found Wireless Device {utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}"].format(utilities=utilities, computer=self.computer))
52+
logging.info(self.trans["- Found Wireless Device {0}:{1}"].format(utilities.friendly_hex(self.computer.wifi.vendor_id), utilities.friendly_hex(self.computer.wifi.device_id)))
5353
self.config["#Revision"]["Hardware-Wifi"] = f"{utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}"
5454

5555
if isinstance(self.computer.wifi, device_probe.Broadcom):
@@ -61,15 +61,15 @@ def _on_model(self) -> None:
6161
# This works around OCLP spoofing the Wifi card and therefore unable to actually detect the correct device
6262
if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirportBrcmNIC and self.constants.validate is False and self.computer.wifi.country_code:
6363
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path)
64-
logging.info(self.trans.wireless()["- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}"].format(computer=self.computer))
64+
logging.info(self.trans["- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}"].format(computer=self.computer))
6565
if self.computer.wifi.pci_path:
6666
arpt_path = self.computer.wifi.pci_path
67-
logging.info(self.trans.wireless()["- Found ARPT device at {arpt_path}"].format(arpt_path=arpt_path))
67+
logging.info(self.trans["- Found ARPT device at {arpt_path}"].format(arpt_path=arpt_path))
6868
self.config["DeviceProperties"]["Add"][arpt_path] = {"brcmfx-country": self.computer.wifi.country_code}
6969
else:
7070
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" brcmfx-country={self.computer.wifi.country_code}"
7171
if self.constants.enable_wake_on_wlan is True:
72-
logging.info(self.trans.wireless()["- Enabling Wake on WLAN support"])
72+
logging.info(self.trans["- Enabling Wake on WLAN support"])
7373
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" -brcmfxwowl"
7474
elif self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4360:
7575
self._wifi_fake_id()
@@ -97,20 +97,20 @@ def _prebuilt_assumption(self) -> None:
9797
if not "Wireless Model" in smbios_data.smbios_dictionary[self.model]:
9898
return
9999
if smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm4360:
100-
logging.info(self.trans.wireless()["- Enabling BCM943224 and BCM94331 Networking Support"])
100+
logging.info(self.trans["- Enabling BCM943224 and BCM94331 Networking Support"])
101101
self._wifi_fake_id()
102102
elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm4331:
103-
logging.info(self.trans.wireless()["- Enabling BCM94328 Networking Support"])
103+
logging.info(self.trans["- Enabling BCM94328 Networking Support"])
104104
support.BuildSupport(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path)
105105
support.BuildSupport(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path)
106106
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortBrcm4331.kext")["Enabled"] = True
107107
elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm43224:
108-
logging.info(self.trans.wireless()["- Enabling BCM94328 Networking Support"])
108+
logging.info(self.trans["- Enabling BCM94328 Networking Support"])
109109
support.BuildSupport(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path)
110110
support.BuildSupport(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path)
111111
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AppleAirPortBrcm43224.kext")["Enabled"] = True
112112
elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Atheros.Chipsets.AirPortAtheros40:
113-
logging.info(self.trans.wireless()["- Enabling Atheros Networking Support"])
113+
logging.info(self.trans["- Enabling Atheros Networking Support"])
114114
support.BuildSupport(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path)
115115
support.BuildSupport(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path)
116116
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True
@@ -137,7 +137,7 @@ def _wowl_handling(self) -> None:
137137
if support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AirportBrcmFixup.kext")["Enabled"] is False:
138138
return
139139

140-
logging.info(self.trans.wireless()["- Enabling Wake on WLAN support"])
140+
logging.info(self.trans["- Enabling Wake on WLAN support"])
141141
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" -brcmfxwowl"
142142

143143

@@ -153,10 +153,10 @@ def _wifi_fake_id(self) -> None:
153153
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AirportBrcmFixup.kext/Contents/PlugIns/AirPortBrcmNIC_Injector.kext")["Enabled"] = True
154154
if not self.constants.custom_model and self.computer.wifi and self.computer.wifi.pci_path:
155155
arpt_path = self.computer.wifi.pci_path
156-
logging.info(self.trans.wireless()["- Found ARPT device at {arpt_path}"].format(arpt_path=arpt_path))
156+
logging.info(self.trans["- Found ARPT device at {arpt_path}"].format(arpt_path=arpt_path))
157157
else:
158158
if not self.model in smbios_data.smbios_dictionary:
159-
logging.info(self.trans.wireless()["No known PCI pathing for this model"])
159+
logging.info(self.trans["No known PCI pathing for this model"])
160160
return
161161
if "nForce Chipset" in smbios_data.smbios_dictionary[self.model]:
162162
# Nvidia chipsets all have the same path to ARPT
@@ -172,8 +172,8 @@ def _wifi_fake_id(self) -> None:
172172
# Assumes we have a laptop with Intel chipset
173173
# iMac11,x-12,x also apply
174174
arpt_path = "PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)"
175-
logging.info(self.trans.wireless()["- Using known ARPT Path: {arpt_path}"].format(arpt_path=arpt_path))
175+
logging.info(self.trans["- Using known ARPT Path: {arpt_path}"].format(arpt_path=arpt_path))
176176

177177
if not self.constants.custom_model and self.computer.wifi and self.constants.validate is False and self.computer.wifi.country_code:
178-
logging.info(self.trans.wireless()["- Applying fake ID for WiFi, setting Country Code: {self.computer.wifi.country_code}"].format(computer=self.computer))
178+
logging.info(self.trans["- Applying fake ID for WiFi, setting Country Code: {self.computer.wifi.country_code}"].format(computer=self.computer))
179179
self.config["DeviceProperties"]["Add"][arpt_path] = {"brcmfx-country": self.computer.wifi.country_code}

oclp_r/support/translate_language.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,7 +2867,7 @@ def wired(self):
28672867
def wireless(self):
28682868
if self.language_point=="English":
28692869
trans={
2870-
"- Found Wireless Device {utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}":"- Found Wireless Device {utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}",
2870+
"- Found Wireless Device {0}:{1}":"- Found Wireless Device {0}:{1}",
28712871
"- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}":"- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}",
28722872
"- Found ARPT device at {arpt_path}":"- Found ARPT device at {arpt_path}",
28732873
"- Enabling Wake on WLAN support":"- Enabling Wake on WLAN support",
@@ -2880,7 +2880,7 @@ def wireless(self):
28802880
}
28812881
elif self.language_point=="简体中文":
28822882
trans={
2883-
"- Found Wireless Device {utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}":"- 发现无线设备 {utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}",
2883+
"- Found Wireless Device {0}:{1}":"- 发现无线设备 {0}:{1}",
28842884
"- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}":"- 设置无线网卡的国家代码:{self.computer.wifi.country_code}",
28852885
"- Found ARPT device at {arpt_path}":"- 在 {arpt_path} 发现 ARPT 设备",
28862886
"- Enabling Wake on WLAN support":"- 启用无线局域网唤醒支持",

oclp_r/support/validation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ def _build_dumps(self) -> None:
104104
for model in self.valid_dumps:
105105
self.constants.computer = model
106106
self.constants.custom_model = ""
107-
logging.info(self.trans["Validating dumped model: {model}"].format(self.constants.computer.real_model))
107+
logging.info(self.trans["Validating dumped model: {model}"].format(model=self.constants.computer.real_model))
108108
build.BuildOpenCore(self.constants.computer.real_model, self.constants)
109109
result = subprocess.run([self.constants.ocvalidate_path, f"{self.constants.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
110110
if result.returncode != 0:
111111
logging.info(self.trans["Error on build!"])
112112
subprocess_wrapper.log(result)
113-
raise Exception(self.trans["Validation failed for predefined model: {model}"].format(self.constants.computer.real_model))
113+
raise Exception(self.trans["Validation failed for predefined model: {model}"].format(model=self.constants.computer.real_model))
114114
else:
115-
logging.info(self.trans["Validation succeeded for predefined model: {model}"].format(self.constants.computer.real_model))
115+
logging.info(self.trans["Validation succeeded for predefined model: {model}"].format(model=self.constants.computer.real_model))
116116

117117

118118
def _validate_root_patch_files(self, major_kernel: int, minor_kernel: int) -> None:

0 commit comments

Comments
 (0)