added FLOappStore Update
This commit is contained in:
parent
0e6e8047f4
commit
bb8fe76b68
BIN
FLO_appStore
BIN
FLO_appStore
Binary file not shown.
@ -3,6 +3,8 @@ This is a Tkinter(Python 3) based gui app,which lets users to download/install,u
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
1. Linux operating system(working on a cross platform version).
|
1. Linux operating system(working on a cross platform version).
|
||||||
|
2. git (to install git):
|
||||||
|
sudo apt-get install git
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
1. Clone/download this repository. (https://github.com/sairajzero/FLO-appStore/)
|
1. Clone/download this repository. (https://github.com/sairajzero/FLO-appStore/)
|
||||||
|
|||||||
20
main.py
20
main.py
@ -6,8 +6,17 @@ import os
|
|||||||
import webbrowser
|
import webbrowser
|
||||||
import json
|
import json
|
||||||
import math
|
import math
|
||||||
|
import socket
|
||||||
|
|
||||||
|
|
||||||
|
def isConnected():
|
||||||
|
try:
|
||||||
|
socket.create_connection(("www.github.com", 80))
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
messagebox.showerror('FLOappStore', "Unable to Connect to GitHub!\nPlease check Internet connectivity and firewall!")
|
||||||
|
return False
|
||||||
|
|
||||||
class FLOappStore:
|
class FLOappStore:
|
||||||
def __init__(self, root):
|
def __init__(self, root):
|
||||||
self.root = root
|
self.root = root
|
||||||
@ -90,6 +99,7 @@ class FLOappStore:
|
|||||||
|
|
||||||
def execute(self,app):
|
def execute(self,app):
|
||||||
print(app["name"])
|
print(app["name"])
|
||||||
|
isConnected()
|
||||||
self.appWin = Toplevel()
|
self.appWin = Toplevel()
|
||||||
self.appWin.title(app["name"])
|
self.appWin.title(app["name"])
|
||||||
#self.appWin.geometry("500x100")
|
#self.appWin.geometry("500x100")
|
||||||
@ -114,6 +124,8 @@ class FLOappStore:
|
|||||||
def downloadApp(self,app):
|
def downloadApp(self,app):
|
||||||
self.appWin.destroy()
|
self.appWin.destroy()
|
||||||
subprocess.Popen(['rm', '-rf', app['location']])
|
subprocess.Popen(['rm', '-rf', app['location']])
|
||||||
|
if(not isConnected()):
|
||||||
|
return
|
||||||
subprocess.Popen("gnome-terminal -- git clone %s"%(app["github"]),cwd="apps/",shell=True)
|
subprocess.Popen("gnome-terminal -- git clone %s"%(app["github"]),cwd="apps/",shell=True)
|
||||||
messagebox.showinfo(app['name'], f"Downloading {app['name']}...\n Please Wait until the downloader closes")
|
messagebox.showinfo(app['name'], f"Downloading {app['name']}...\n Please Wait until the downloader closes")
|
||||||
|
|
||||||
@ -124,7 +136,9 @@ class FLOappStore:
|
|||||||
|
|
||||||
def updateApp(self,app):
|
def updateApp(self,app):
|
||||||
self.appWin.destroy()
|
self.appWin.destroy()
|
||||||
subprocess.Popen("gnome-terminal -- git fetch --all",cwd=app['location'],shell=True)
|
if(not isConnected()):
|
||||||
|
return
|
||||||
|
subprocess.Popen("gnome-terminal -- git pull --all",cwd=app['location'],shell=True)
|
||||||
subprocess.Popen("gnome-terminal -- git reset --hard HEAD ",cwd=app['location'],shell=True)
|
subprocess.Popen("gnome-terminal -- git reset --hard HEAD ",cwd=app['location'],shell=True)
|
||||||
messagebox.showinfo(app['name'], f"Updating {app['name']}...\n Please Wait until the updater closes")
|
messagebox.showinfo(app['name'], f"Updating {app['name']}...\n Please Wait until the updater closes")
|
||||||
|
|
||||||
@ -139,6 +153,10 @@ class FLOappStore:
|
|||||||
self.appWin.destroy()
|
self.appWin.destroy()
|
||||||
webbrowser.open(app["url"],new=1)
|
webbrowser.open(app["url"],new=1)
|
||||||
|
|
||||||
|
if(isConnected()):
|
||||||
|
subprocess.call("git pull",shell=True)
|
||||||
|
else:
|
||||||
|
exit(0)
|
||||||
with open('AppData.json',encoding='utf-8') as F:
|
with open('AppData.json',encoding='utf-8') as F:
|
||||||
apps=json.loads(F.read())["Dapps"]
|
apps=json.loads(F.read())["Dapps"]
|
||||||
root = Tk()
|
root = Tk()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user