mirror of
https://github.com/Akascape/Datamosher-Pro.git
synced 2025-12-13 11:49:57 +01:00
Add files via upload
This commit is contained in:
@@ -7,10 +7,10 @@ import pkg_resources
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
import shutil
|
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
|
||||||
DIRPATH = os.path.dirname(os.path.realpath(__file__))
|
DIRPATH = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
#Checking the required folders
|
#Checking the required folders
|
||||||
folders= ["Assets","FFglitch","DatamoshLib","pymosh"]
|
folders= ["Assets","FFglitch","DatamoshLib","pymosh"]
|
||||||
missingfolder=[]
|
missingfolder=[]
|
||||||
@@ -32,10 +32,10 @@ missingset=[*missing,]
|
|||||||
|
|
||||||
#Download the modules if not installed
|
#Download the modules if not installed
|
||||||
if missing:
|
if missing:
|
||||||
res=input("Some modules are not installed \n do you want to download and install them? (Y/N): ")
|
res = input("Some modules are not installed... \n do you want to download and install them now? (Y/N): ")
|
||||||
while not ((res=="Y") or (res=="y") or (res=="N") or (res=="n")):
|
while not ((res=="Y") or (res=="y") or (res=="N") or (res=="n")):
|
||||||
print("Please choose a valid option!")
|
print("Please choose a valid option!")
|
||||||
res=input("Some modules are not installed \n do you want to download and install them? (Y/N): ")
|
res = input("Some modules are not installed... \n do you want to download and install them now? (Y/N): ")
|
||||||
if res=="Y" or res=="y":
|
if res=="Y" or res=="y":
|
||||||
try:
|
try:
|
||||||
print("Installing modules...")
|
print("Installing modules...")
|
||||||
@@ -50,34 +50,38 @@ if missing:
|
|||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
elif res=="N" or res=="n":
|
elif res=="N" or res=="n":
|
||||||
print("Without the modules you can't use this program. Please install them first! \nThis are the required one: "+str(required)
|
print("Without the modules you can't open this program. Please install them first! \nThis are the required one: "+str(required)
|
||||||
+"\nUse 'pip install module_name' to download modules one by one")
|
+"\nUse 'pip install module_name' to download modules one by one manually")
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
else:
|
else:
|
||||||
print("All modules installed!")
|
print("All required modules installed!")
|
||||||
|
|
||||||
#Check FFglitch Status
|
#Check FFglitch Status
|
||||||
def checkffglitch():
|
def checkffglitch():
|
||||||
print("Checking FFglitch:")
|
print("Checking FFglitch:")
|
||||||
print("Running ffgac...")
|
print("Running ffgac...")
|
||||||
ffgac=str(DIRPATH).replace(os.sep, '/')+"/FFglitch/ffgac"
|
ffgac = os.path.join(DIRPATH,"FFglitch","ffgac")
|
||||||
ffedit=str(DIRPATH).replace(os.sep, '/')+"/FFglitch/ffedit"
|
ffedit = os.path.join(DIRPATH,"FFglitch","ffedit")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.Popen(f'"{ffgac}" -version', shell=True)
|
subprocess.Popen(f'"{ffgac}" -version', shell=True)
|
||||||
except:
|
except:
|
||||||
print("permission denied! Please give permission to ffgac to execute.")
|
print("permission denied! Please give permission to ffgac!")
|
||||||
|
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
print("Running ffedit...")
|
print("Running ffedit...")
|
||||||
try:
|
try:
|
||||||
subprocess.Popen(f'"{ffedit}" -version', shell=True)
|
subprocess.Popen(f'"{ffedit}" -version', shell=True)
|
||||||
except:
|
except:
|
||||||
print("permission denied! Please give permission to ffedit to execute.")
|
print("permission denied! Please give permission to ffedit!")
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
print("Done...")
|
print("Done...")
|
||||||
|
|
||||||
#Download ffglitch if not available
|
#Download ffglitch if not available
|
||||||
if (os.path.exists("FFglitch/ffgac") or os.path.exists("FFglitch/ffgac.exe")) and (os.path.exists("FFglitch/ffedit") or os.path.exists("FFglitch/ffedit.exe")):
|
if (os.path.exists(os.path.join("FFglitch","ffgac")) or
|
||||||
|
os.path.exists(os.path.join("FFglitch","ffgac.exe"))) and (os.path.exists(os.path.join("FFglitch","ffedit"))
|
||||||
|
or os.path.exists(os.path.join("FFglitch","ffedit.exe"))):
|
||||||
checkffglitch()
|
checkffglitch()
|
||||||
else:
|
else:
|
||||||
print("ffgac/ffedit not found inside ffglitch folder, you cannot run the ffglitch modes without these programs")
|
print("ffgac/ffedit not found inside ffglitch folder, you cannot run the ffglitch modes without these programs")
|
||||||
@@ -85,6 +89,7 @@ else:
|
|||||||
while not ((res2=="Y") or (res2=="y") or (res2=="N") or (res2=="n")):
|
while not ((res2=="Y") or (res2=="y") or (res2=="N") or (res2=="n")):
|
||||||
print("Please choose a valid option!")
|
print("Please choose a valid option!")
|
||||||
res2 = input("Do you want to download ffglitch now? (Y/N): ")
|
res2 = input("Do you want to download ffglitch now? (Y/N): ")
|
||||||
|
|
||||||
if res2=="Y" or res2=="y":
|
if res2=="Y" or res2=="y":
|
||||||
print("Downloading FFglitch... (size: approx 17MB)")
|
print("Downloading FFglitch... (size: approx 17MB)")
|
||||||
if sys.platform.startswith("win"): #download ffglitch for windows
|
if sys.platform.startswith("win"): #download ffglitch for windows
|
||||||
@@ -99,20 +104,21 @@ else:
|
|||||||
response = requests.get(URL)
|
response = requests.get(URL)
|
||||||
open("FFglitch//ffglitch.zip", "wb").write(response.content)
|
open("FFglitch//ffglitch.zip", "wb").write(response.content)
|
||||||
except:
|
except:
|
||||||
print("Unable to download ffglitch from site! Check your connection or download it manually from https://github.com/Akascape/FFglitch-0.9.3-executables \nand paste the files (ffgac and ffedit) inside FFglitch folder.")
|
print("Unable to download ffglitch from site! Check your connection or download it manually from: | https://github.com/Akascape/FFglitch-0.9.3-executables |")
|
||||||
|
print("Paste the files (ffgac and ffedit) inside FFglitch folder.")
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
print("Exctracting the files...")
|
print("Exctracting the files...")
|
||||||
try:
|
try:
|
||||||
with ZipFile('FFglitch/ffglitch.zip', 'r') as zip:
|
with ZipFile(os.path.join('FFglitch','ffglitch.zip'), 'r') as zip:
|
||||||
zip.extractall('FFglitch/')
|
zip.extractall('FFglitch/')
|
||||||
except:
|
except:
|
||||||
print("Failed to extract ffglitch.zip, please extract it manually in the FFglitch folder.")
|
print("Failed to extract ffglitch.zip, please extract it manually in the FFglitch folder.")
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
if os.path.exists("FFglitch/ffgac") or os.path.exists("FFglitch/ffgac.exe"):
|
if os.path.exists(os.path.join("FFglitch","ffgac")) or os.path.exists(os.path.join("FFglitch","ffgac.exe")):
|
||||||
os.remove("FFglitch//ffglitch.zip")
|
os.remove(os.path.join("FFglitch","ffglitch.zip"))
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
checkffglitch()
|
checkffglitch()
|
||||||
print("FFglitch setup complete!")
|
print("FFglitch setup complete!")
|
||||||
|
|||||||
Reference in New Issue
Block a user