Updated code and added icons to the repo.
This commit is contained in:
parent
6666da6770
commit
06404f5ff4
6 changed files with 19 additions and 17 deletions
BIN
arch.png
Normal file
BIN
arch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
deb.png
Normal file
BIN
deb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
flatpak.png
Normal file
BIN
flatpak.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
36
osupdater.py
36
osupdater.py
|
@ -3,48 +3,50 @@
|
||||||
import wx
|
import wx
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
class Example(wx.Frame):
|
|
||||||
|
|
||||||
|
class Example(wx.Frame):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(Example, self).__init__(*args, **kwargs)
|
super(Example, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
self.InitUI()
|
self.initui()
|
||||||
|
|
||||||
def InitUI(self):
|
def initui(self):
|
||||||
|
|
||||||
menubar = wx.MenuBar()
|
menubar = wx.MenuBar()
|
||||||
fileMenu = wx.Menu()
|
filemenu = wx.Menu()
|
||||||
fileItem = fileMenu.Append(wx.ID_EXIT, 'Quit', 'Quit application')
|
fileitem = filemenu.Append(wx.ID_EXIT, 'Quit', 'Quit application')
|
||||||
menubar.Append(fileMenu, '&File')
|
menubar.Append(filemenu, '&File')
|
||||||
self.SetMenuBar(menubar)
|
self.SetMenuBar(menubar)
|
||||||
|
|
||||||
self.Bind(wx.EVT_MENU, self.OnQuit, fileItem)
|
self.Bind(wx.EVT_MENU, self.onquit, fileitem)
|
||||||
|
|
||||||
self.SetSize((300, 200))
|
self.SetSize((300, 200))
|
||||||
self.SetTitle('OS Updater')
|
self.SetTitle('OS Updater')
|
||||||
self.Centre()
|
self.Centre()
|
||||||
|
|
||||||
pnl = wx.Panel(self)
|
pnl = wx.Panel(self)
|
||||||
updateFlatpakButton = wx.Button(pnl, label='Update Flatpaks',pos=(20,20))
|
updateflatpakbutton = wx.Button(pnl, label='Update Flatpaks', pos=(20, 20))
|
||||||
updateFlatpakButton.Bind(wx.EVT_BUTTON,self.OnFlatpakUpdate)
|
updateflatpakbutton.Bind(wx.EVT_BUTTON, self.onflatpakupdate)
|
||||||
updateRPMButton = wx.Button(pnl, label='Update RPMs',pos=(20,60))
|
updaterpmbutton = wx.Button(pnl, label='Update RPMs', pos=(20, 60))
|
||||||
updateRPMButton.Bind(wx.EVT_BUTTON,self.OnRPMUpdate)
|
updaterpmbutton.Bind(wx.EVT_BUTTON, self.onrpmupdate)
|
||||||
|
|
||||||
def OnFlatpakUpdate(self, e):
|
def onflatpakupdate(self, e):
|
||||||
subprocess.run(["flatpak", "update", "--user"])
|
subprocess.run(["flatpak", "update", "-y"])
|
||||||
|
|
||||||
def OnRPMUpdate(self, e):
|
def onrpmupdate(self, e):
|
||||||
subprocess.run(["sudo", "dnf", "update", "-y"])
|
subprocess.run(["sudo", "dnf", "update", "-y"])
|
||||||
|
|
||||||
def OnQuit(self, e):
|
def onquit(self, e):
|
||||||
self.Close()
|
self.Close()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
app = wx.App()
|
app = wx.App(0)
|
||||||
ex = Example(None)
|
ex = Example(None)
|
||||||
ex.Show()
|
ex.Show()
|
||||||
app.MainLoop()
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
BIN
rpm.png
Normal file
BIN
rpm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
snap.png
Normal file
BIN
snap.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
Loading…
Add table
Add a link
Reference in a new issue