mirror of
https://github.com/grp/Wii.py.git
synced 2025-06-19 07:15:49 -04:00
Added delKeyByValue function
This commit is contained in:
parent
2c24ecf200
commit
f332764450
25
other.py
25
other.py
@ -126,6 +126,31 @@ class CONF:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return 'Key not found'
|
return 'Key not found'
|
||||||
|
|
||||||
|
def delKeyByValue(self, value):
|
||||||
|
try:
|
||||||
|
for key in self.keys.keys():
|
||||||
|
if self.keys.get(key) == value:
|
||||||
|
del self.keys[key]
|
||||||
|
self.keyNames.remove(key)
|
||||||
|
self.totalKeys -=1
|
||||||
|
|
||||||
|
|
||||||
|
self.conf = ''
|
||||||
|
|
||||||
|
for key in self.keys:
|
||||||
|
self.conf += key
|
||||||
|
self.conf += '='
|
||||||
|
self.conf += self.keys[key]
|
||||||
|
self.conf += '\r\n'
|
||||||
|
|
||||||
|
self.fp.seek(0)
|
||||||
|
self.fp.write(self.xorConf(self.conf))
|
||||||
|
self.fp.write('\x00' * (0x100 - len(self.conf)))
|
||||||
|
|
||||||
|
self.lastKeyOffset = self.conf.rfind('\r\n') + 2
|
||||||
|
except KeyError:
|
||||||
|
return 'Key not found'
|
||||||
|
|
||||||
class iplsave:
|
class iplsave:
|
||||||
"""This class performs all iplsave.bin related things. It includes functions to add a title to the list, remove a title based upon position or title, and move a title from one position to another."""
|
"""This class performs all iplsave.bin related things. It includes functions to add a title to the list, remove a title based upon position or title, and move a title from one position to another."""
|
||||||
class IPLSAVE_Entry(Struct):
|
class IPLSAVE_Entry(Struct):
|
||||||
|
Loading…
Reference in New Issue
Block a user