Skip to content

Commit

Permalink
[python] small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Huevos committed Jan 24, 2025
1 parent b115bf1 commit d6ba776
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/python/Components/Harddisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ def enumerateBlockDevices(self):
continue
description = self.getUserfriendlyDeviceName(partition, physicalDevice)
print(f"[Harddisk][enumerateBlockDevices]### Found partition '{partition}', description='{description}', device='{physicalDevice}' mountpoint='{self.getMountpoint(partition)}.")
if boxModel in ("dm900", "dm920") and partition == "mmcblk0p3" and self.getMountpoint(partition) == None:
if boxModel in ("dm900", "dm920") and partition == "mmcblk0p3" and self.getMountpoint(partition) is None:
mountpoint = "/media/data/"
newFstab = fileReadLines("/etc/fstab")
newFstab.append("/dev/mmcblk0p3 /media/data ext4 rw, relatime,data=ordered 0 0")
Expand Down
1 change: 0 additions & 1 deletion lib/python/Components/OnlineUpdateCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import Components.Task

import socket
import sys
from urllib.request import urlopen, Request

error = 0
Expand Down
8 changes: 4 additions & 4 deletions lib/python/Components/SystemInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,22 @@ def deleteItem(self, item):

BoxInfo = BoxInformation()

#This line makes the BoxInfo backwards compatible with SystemInfo without duplicating the dictionary.
# This line makes the BoxInfo backwards compatible with SystemInfo without duplicating the dictionary.
SystemInfo = BoxInfo.boxInfo


ARCHITECTURE = BoxInfo.getItem("architecture")
BRAND = BoxInfo.getItem("brand")
MODEL = BoxInfo.getItem("model")
SOC_FAMILY = BoxInfo.getItem("socfamily")
SOC_BRAND = split('(\d.*)', SOC_FAMILY)[0]
CHIPSET = split('(\d.*)', SOC_FAMILY)[1]
SOC_BRAND = split(r'(\d.*)', SOC_FAMILY)[0]
CHIPSET = split(r'(\d.*)', SOC_FAMILY)[1]
DISPLAYTYPE = BoxInfo.getItem("displaytype")
MTDROOTFS = BoxInfo.getItem("mtdrootfs")
DISPLAYMODEL = BoxInfo.getItem("displaymodel")
DISPLAYBRAND = BoxInfo.getItem("displaybrand")
MACHINEBUILD = BoxInfo.getItem("machinebuild")
OEA = split('(\d.*)', BoxInfo.getItem("oe"))[1]
OEA = split(r'(\d.*)', BoxInfo.getItem("oe"))[1]


def getBoxType(): # this function mimics the function of the same name in branding module
Expand Down
5 changes: 2 additions & 3 deletions lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

from os import mkdir, remove
from os import listdir, mkdir, rmdir
from os.path import exists, ismount, join
from os import listdir, mkdir, remove, rmdir
from os.path import exists, isfile, ismount, join
from twisted.internet import reactor
from twisted.internet.protocol import Factory, Protocol

Expand Down
3 changes: 1 addition & 2 deletions lib/python/Plugins/SystemPlugins/ViX/RestoreWizard.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from os import listdir, path, stat

from Components.About import about
from Components.config import config
from Components.Console import Console
from Components.Pixmap import Pixmap
from Components.SystemInfo import SystemInfo
from Screens.MessageBox import MessageBox
from Screens.Rc import Rc
from Screens.WizardLanguage import WizardLanguage
from Tools.Directories import fileExists, fileHas, resolveFilename, SCOPE_PLUGINS
from Tools.Directories import fileHas, resolveFilename, SCOPE_PLUGINS
from Tools.Multiboot import bootmviSlot, createInfo


Expand Down
1 change: 0 additions & 1 deletion lib/python/skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ def parseParameter(s):

def parseScale(s):
# Replaces "f" with skin factor in non-coordinte fields and evaluates the formula
orig = s
try:
val = int(s)
except ValueError:
Expand Down

0 comments on commit d6ba776

Please sign in to comment.