Exemple #1
0
 def confirmDestructiveIfNecessary(self, files_in_zip):
     for file_name, file_path in files_in_zip:
         target = os.path.join(util.this_path(), 'plugins', file_name)
         if os.path.isfile(target):
             return self.confirmDestructive()
         elif os.path.isdir(target):
             return self.confirmDestructive()
Exemple #2
0
 def removePluginsToBeOverwritten(self, files_in_zip):
     for file_name, file_path in files_in_zip:
         target = os.path.join(util.this_path(), 'plugins', file_name)
         if os.path.isfile(target):
             os.unlink(target)
         elif os.path.isdir(target):
             shutil.rmtree(target)
Exemple #3
0
 def confirmDestructiveIfNecessary(self, files_in_zip):
     for file_name, file_path in files_in_zip:
         target = os.path.join(util.this_path(), 'plugins', file_name)
         if os.path.isfile(target):
             return self.confirmDestructive()
         elif os.path.isdir(target):
             return self.confirmDestructive()
Exemple #4
0
 def removePluginsToBeOverwritten(self, files_in_zip):
     for file_name, file_path in files_in_zip:
         target = os.path.join(util.this_path(), 'plugins', file_name)
         if os.path.isfile(target):
             os.unlink(target)
         elif os.path.isdir(target):
             shutil.rmtree(target)
Exemple #5
0
 def linuxAuthedMvPluginsIntoPluginsFolder(self, files_in_zip):
     args = ['gksudo', 'cp', '-fR']
     args.extend(file_path for file_name, file_path in files_in_zip)
     args.append(util.this_path() + '/plugins')
     proc = subprocess.Popen(args)
     retval = self.waitForProcExit(proc)
     if retval != 0:
         self.failWithMsg('cp failed with code %i' % retval)
Exemple #6
0
 def linuxAuthedMvPluginsIntoPluginsFolder(self, files_in_zip):
     args = ['gksudo', 'cp', '-fR']
     args.extend(file_path for file_name, file_path in files_in_zip)
     args.append(util.this_path()+'/plugins')
     proc = subprocess.Popen(args)
     retval = self.waitForProcExit(proc)
     if retval != 0:
         self.failWithMsg('cp failed with code %i'%retval)
 def linuxAuthedMvPluginsIntoPluginsFolder(self, files_in_zip):
     args = ["gksudo", "cp", "-fR"]
     args.extend(file_path for file_name, file_path in files_in_zip)
     args.append(util.this_path() + "/plugins")
     proc = subprocess.Popen(args)
     retval = self.waitForProcExit(proc)
     if retval != 0:
         self.failWithMsg("cp failed with code %i" % retval)
 def addPlugin(self):
     fdialog = QFileDialog(self.widget, "Install Plugin", util.this_path(), "Cadnano Plugins (*.cnp)")
     fdialog.setAcceptMode(QFileDialog.AcceptOpen)
     fdialog.setWindowFlags(Qt.Sheet)
     fdialog.setWindowModality(Qt.WindowModal)
     fdialog.filesSelected.connect(self.addPluginAtPath)
     self.fileopendialog = fdialog
     fdialog.open()
Exemple #9
0
 def addPlugin(self):
     fdialog = QFileDialog(self.widget, "Install Plugin", util.this_path(),
                           "Cadnano Plugins (*.cnp)")
     fdialog.setAcceptMode(QFileDialog.AcceptOpen)
     fdialog.setWindowFlags(Qt.Sheet)
     fdialog.setWindowModality(Qt.WindowModal)
     fdialog.filesSelected.connect(self.addPluginAtPath)
     self.fileopendialog = fdialog
     fdialog.open()
Exemple #10
0
 def darwinAuthedMvPluginsIntoPluginsFolder(self, files_in_zip):
     envirn = {"DST": util.this_path() + '/plugins'}
     srcstr = ''
     for i in range(len(files_in_zip)):
         file_name, file_path = files_in_zip[i]
         srcstr += ' \\"$SRC' + str(i) + '\\"'
         envirn['SRC' + str(i)] = file_path
     proc = subprocess.Popen(['osascript','-e',\
                       'do shell script "cp -fR ' + srcstr +\
                       ' \\"$DST\\"" with administrator privileges'],\
                       env=envirn)
     retval = self.waitForProcExit(proc)
     if retval != 0:
         self.failWithMsg('cp failed with code %i' % retval)
Exemple #11
0
 def darwinAuthedMvPluginsIntoPluginsFolder(self, files_in_zip):
     envirn={"DST":util.this_path()+'/plugins'}
     srcstr = ''
     for i in range(len(files_in_zip)):
         file_name, file_path = files_in_zip[i]
         srcstr += ' \\"$SRC' + str(i) + '\\"'
         envirn['SRC'+str(i)] = file_path
     proc = subprocess.Popen(['osascript','-e',\
                       'do shell script "cp -fR ' + srcstr +\
                       ' \\"$DST\\"" with administrator privileges'],\
                       env=envirn)
     retval = self.waitForProcExit(proc)
     if retval != 0:
         self.failWithMsg('cp failed with code %i'%retval)
 def darwinAuthedMvPluginsIntoPluginsFolder(self, files_in_zip):
     envirn = {"DST": util.this_path() + "/plugins"}
     srcstr = ""
     for i in range(len(files_in_zip)):
         file_name, file_path = files_in_zip[i]
         srcstr += ' \\"$SRC' + str(i) + '\\"'
         envirn["SRC" + str(i)] = file_path
     proc = subprocess.Popen(
         ["osascript", "-e", 'do shell script "cp -fR ' + srcstr + ' \\"$DST\\"" with administrator privileges'],
         env=envirn,
     )
     retval = self.waitForProcExit(proc)
     if retval != 0:
         self.failWithMsg("cp failed with code %i" % retval)
Exemple #13
0
 def movePluginsIntoPluginsFolder(self, files_in_zip):
     for file_name, file_path in files_in_zip:
         target = os.path.join(util.this_path(), 'plugins', file_name)
         shutil.move(file_path, target)
Exemple #14
0
 def movePluginsIntoPluginsFolder(self, files_in_zip):
     for file_name, file_path in files_in_zip:
         target = os.path.join(util.this_path(), 'plugins', file_name)
         shutil.move(file_path, target)