From 91ce53d25d72157ff1f16cc589af10a1e8f5f14f Mon Sep 17 00:00:00 2001 From: gutosie Date: Sat, 22 Jan 2022 16:02:41 +0200 Subject: [PATCH] Add files via upload --- NeoBoot/files/devices.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/NeoBoot/files/devices.py b/NeoBoot/files/devices.py index fdef05c..4984459 100644 --- a/NeoBoot/files/devices.py +++ b/NeoBoot/files/devices.py @@ -167,7 +167,7 @@ class ManagerDevice(Screen): d2 = device name = _('HARD DISK: ') mypixmap = '' + LinkNeoBoot + '/images/dev_hdd.png' - model = file('/sys/block/' + device2 + '/device/model').read() + model = open('/sys/block/' + device2 + '/device/model').read() model = str(model).replace('\n', '') des = '' if devicetype.find('usb') != -1: @@ -292,11 +292,11 @@ class ManagerDevice(Screen): self.device_uuid = 'UUID=' + result.split('UUID=')[1].split(' ')[0].replace('"', '') if not path.exists(self.mountp): mkdir(self.mountp, 493) - file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if '/media/hdd' not in l]) + open('/etc/fstab.tmp', 'w').writelines([l for l in open('/etc/fstab').readlines() if '/media/hdd' not in l]) rename('/etc/fstab.tmp', '/etc/fstab') - file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if self.device not in l]) + open('/etc/fstab.tmp', 'w').writelines([l for l in open('/etc/fstab').readlines() if self.device not in l]) rename('/etc/fstab.tmp', '/etc/fstab') - file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if self.device_uuid not in l]) + open('/etc/fstab.tmp', 'w').writelines([l for l in open('/etc/fstab').readlines() if self.device_uuid not in l]) rename('/etc/fstab.tmp', '/etc/fstab') out = open('/etc/fstab', 'a') line = self.device_uuid + '\t/media/hdd\tauto\tdefaults\t0 0\n' @@ -382,7 +382,7 @@ class DevicesConf(Screen, ConfigListScreen): d2 = device name = _('HARD DISK: ') mypixmap = '' + LinkNeoBoot + '/images/dev_hdd.png' - model = file('/sys/block/' + device2 + '/device/model').read() + model = open('/sys/block/' + device2 + '/device/model').read() model = str(model).replace('\n', '') des = '' if devicetype.find('usb') != -1: @@ -492,9 +492,9 @@ class DevicesConf(Screen, ConfigListScreen): self.device_type = 'ntfs' if not path.exists(self.mountp): mkdir(self.mountp, 493) - file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if self.device not in l]) + open('/etc/fstab.tmp', 'w').writelines([l for l in open('/etc/fstab').readlines() if self.device not in l]) rename('/etc/fstab.tmp', '/etc/fstab') - file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if self.device_uuid not in l]) + open('/etc/fstab.tmp', 'w').writelines([l for l in open('/etc/fstab').readlines() if self.device_uuid not in l]) rename('/etc/fstab.tmp', '/etc/fstab') out = open('/etc/fstab', 'a') line = self.device_uuid + '\t' + self.mountp + '\t' + self.device_type + '\tdefaults\t0 0\n'