def uninstall(self, *args): message = "Are you sure you want to uninstall aTools?" confirm = cmds.confirmDialog(title='Confirm', message=message, button=['Yes', 'No'], defaultButton='No', cancelButton='No', dismissString='No') if confirm == 'Yes': from aTools.animTools.animBar import animBarUI reload(animBarUI) #aToolsPath = aToolsMod.getaToolsPath(2) aToolsFolder = aToolsMod.getaToolsPath() #if aToolsPath in sys.path: sys.path.remove(aToolsPath) G.deferredManager.sendToQueue(G.aToolsBar.delWindows, 1, "uninstall_delWindows") G.deferredManager.sendToQueue( lambda *args: setup.install('', True), 1, "uninstall_install") #delete files if os.path.isdir(aToolsFolder): shutil.rmtree(aToolsFolder) cmds.warning( "Uninstall complete! If you want to install aTools in the future, go to %s." % SITE_URL)
def updateaTools(self, downloadUrl, offline=None, *args): aToolsPath = aToolsMod.getaToolsPath(2) aToolsFolder = aToolsMod.getaToolsPath() oldaToolsFolder = "%saTools.old" % aToolsPath tmpZipFile = "%stmp.zip" % aToolsPath #delete temp if os.path.isfile(tmpZipFile): os.remove(tmpZipFile) if os.path.isdir(oldaToolsFolder): shutil.rmtree(oldaToolsFolder) output = utilMod.download("aToolsProgressBar", downloadUrl, tmpZipFile) if not output: cmds.warning("Atools - Update failed.") return #rename aTools to old if os.path.isdir(aToolsFolder): os.rename(aToolsFolder, oldaToolsFolder) #uncompress file zfobj = zipfile.ZipFile(tmpZipFile) for name in zfobj.namelist(): uncompressed = zfobj.read(name) # save uncompressed data to disk filename = utilMod.formatPath("%s%s" % (aToolsPath, name)) d = os.path.dirname(filename) if not os.path.exists(d): os.makedirs(d) if filename.endswith(os.sep): continue output = open(filename, 'wb') output.write(uncompressed) output.close() #delete temp zfobj.close() if os.path.isfile(tmpZipFile): os.remove(tmpZipFile) if os.path.isdir(oldaToolsFolder): shutil.rmtree(oldaToolsFolder) setup.install(offline=offline) #refresh G.GT_wasUpdated = True refreshATools()
def updateaTools(self, downloadUrl, offline=None, *args): aToolsPath = aToolsMod.getaToolsPath(2) aToolsFolder = aToolsMod.getaToolsPath() oldaToolsFolder = "%saTools.old"%aToolsPath tmpZipFile = "%stmp.zip"%aToolsPath #delete temp if os.path.isfile(tmpZipFile): os.remove(tmpZipFile) if os.path.isdir(oldaToolsFolder): shutil.rmtree(oldaToolsFolder) output = utilMod.download("aToolsProgressBar", downloadUrl, tmpZipFile) if not output: cmds.warning("Atools - Update failed.") return #rename aTools to old if os.path.isdir(aToolsFolder): os.rename(aToolsFolder, oldaToolsFolder) #uncompress file zfobj = zipfile.ZipFile(tmpZipFile) for name in zfobj.namelist(): uncompressed = zfobj.read(name) # save uncompressed data to disk filename = utilMod.formatPath("%s%s"%(aToolsPath, name)) d = os.path.dirname(filename) if not os.path.exists(d): os.makedirs(d) if filename.endswith(os.sep): continue output = open(filename,'wb') output.write(uncompressed) output.close() #delete temp zfobj.close() if os.path.isfile(tmpZipFile): os.remove(tmpZipFile) if os.path.isdir(oldaToolsFolder): shutil.rmtree(oldaToolsFolder) setup.install(offline=offline) #refresh G.GT_wasUpdated = True refreshATools()
def uninstall(self, *args): message = "Are you sure you want to uninstall aTools?" confirm = cmds.confirmDialog( title='Confirm', message=message, button=['Yes','No'], defaultButton='No', cancelButton='No', dismissString='No' ) if confirm == 'Yes': from aTools.animTools.animBar import animBarUI; reload(animBarUI) #aToolsPath = aToolsMod.getaToolsPath(2) aToolsFolder = aToolsMod.getaToolsPath() #if aToolsPath in sys.path: sys.path.remove(aToolsPath) G.deferredManager.sendToQueue(G.aToolsBar.delWindows, 1, "uninstall_delWindows") G.deferredManager.sendToQueue(lambda *args:setup.install('', True), 1, "uninstall_install") #delete files if os.path.isdir(aToolsFolder): shutil.rmtree(aToolsFolder) cmds.warning("Uninstall complete! If you want to install aTools in the future, go to %s."%SITE_URL)
from aTools.generalTools import tumbleOnObjects; reload(tumbleOnObjects) from aTools.animTools import animationCrashRecovery; reload(animationCrashRecovery) from aTools.animTools import framePlaybackRange; reload(framePlaybackRange) from aTools.animTools import jumpToSelectedKey; reload(jumpToSelectedKey) import sys import urllib2 import shutil import zipfile import os import webbrowser animationCrashRecovery = animationCrashRecovery.AnimationCrashRecovery() tumbleOnObjects = tumbleOnObjects.TumbleOnObjects() versionInfoPath = "%sversion_info.txt"%aToolsMod.getaToolsPath(inScriptsFolder=False) versionInfoContents = utilMod.readFile(versionInfoPath) VERSION = versionInfoContents[0].split(" ")[-1].replace("\n", "") WHATISNEW = "".join(versionInfoContents[1:]) KEYSLIST = ["Up", "Down", "Left", "Right", "", "Page_Up", "Page_Down", "Home", "End", "Insert", "", "Return", "Space", "", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"] SITE_URL = "http://camiloalan.wix.com/atoolswebsite" ATOOLS_FOLDER = "https://dl.dropboxusercontent.com/u/7614713/aTools/" UPDATE_URL = "%slatest_version.txt"%ATOOLS_FOLDER DOWNLOAD_URL = "%saTools.zip"%ATOOLS_FOLDER lastUsedVersion = aToolsMod.loadInfoWithUser("userPrefs", "lastUsedVersion") HELP_URL = "http://camiloalan.wix.com/atoolswebsite#!help/cjg9" DONATE_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RQLT89A239K6"