Work done on rust version
This commit is contained in:
parent
2075d3515f
commit
ebbbf18236
233 changed files with 708 additions and 116 deletions
52
in_development/python/osupdater.py
Executable file
52
in_development/python/osupdater.py
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/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", "-y"])
|
||||
|
||||
def onrpmupdate(self, e):
|
||||
subprocess.run(["sudo", "dnf", "update", "-y"])
|
||||
|
||||
def onquit(self, e):
|
||||
self.Close()
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
app = wx.App(0)
|
||||
ex = Example(None)
|
||||
ex.Show()
|
||||
app.MainLoop()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue