First commit
This commit is contained in:
parent
39aa92032e
commit
6666da6770
2 changed files with 157 additions and 0 deletions
50
osupdater.py
Executable file
50
osupdater.py
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import wx
|
||||
import subprocess
|
||||
|
||||
class Example(wx.Frame):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Example, self).__init__(*args, **kwargs)
|
||||
|
||||
self.InitUI()
|
||||
|
||||
def InitUI(self):
|
||||
|
||||
menubar = wx.MenuBar()
|
||||
fileMenu = wx.Menu()
|
||||
fileItem = fileMenu.Append(wx.ID_EXIT, 'Quit', 'Quit application')
|
||||
menubar.Append(fileMenu, '&File')
|
||||
self.SetMenuBar(menubar)
|
||||
|
||||
self.Bind(wx.EVT_MENU, self.OnQuit, fileItem)
|
||||
|
||||
self.SetSize((300, 200))
|
||||
self.SetTitle('OS Updater')
|
||||
self.Centre()
|
||||
|
||||
pnl = wx.Panel(self)
|
||||
updateFlatpakButton = wx.Button(pnl, label='Update Flatpaks',pos=(20,20))
|
||||
updateFlatpakButton.Bind(wx.EVT_BUTTON,self.OnFlatpakUpdate)
|
||||
updateRPMButton = wx.Button(pnl, label='Update RPMs',pos=(20,60))
|
||||
updateRPMButton.Bind(wx.EVT_BUTTON,self.OnRPMUpdate)
|
||||
|
||||
def OnFlatpakUpdate(self, e):
|
||||
subprocess.run(["flatpak", "update", "--user"])
|
||||
|
||||
def OnRPMUpdate(self, e):
|
||||
subprocess.run(["sudo", "dnf", "update", "-y"])
|
||||
|
||||
def OnQuit(self, e):
|
||||
self.Close()
|
||||
|
||||
def main():
|
||||
|
||||
app = wx.App()
|
||||
ex = Example(None)
|
||||
ex.Show()
|
||||
app.MainLoop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue