コード例 #1
0
 def removePluginsToBeOverwritten(self, filesInZip):
     for fileName, filePath in filesInZip:
         target = os.path.join(cadnano.path(), 'plugins', fileName)
         if os.path.isfile(target):
             os.unlink(target)
         elif os.path.isdir(target):
             shutil.rmtree(target)
コード例 #2
0
 def confirmDestructiveIfNecessary(self, filesInZip):
     for fileName, filePath in filesInZip:
         target = os.path.join(cadnano.path(), 'plugins', fileName)
         if os.path.isfile(target):
             return self.confirmDestructive()
         elif os.path.isdir(target):
             return self.confirmDestructive()
コード例 #3
0
 def linuxAuthedMvPluginsIntoPluginsFolder(self, filesInZip):
     args = ['gksudo', 'cp', '-fR']
     args.extend(filePath for fileName, filePath in filesInZip)
     args.append(cadnano.path()+'/plugins')
     proc = subprocess.Popen(args)
     retval = self.waitForProcExit(proc)
     if retval != 0:
         self.failWithMsg('cp failed with code %i'%retval)
コード例 #4
0
ファイル: preferences.py プロジェクト: vdt/cadnano2
 def addPlugin(self):
     fdialog = QFileDialog(self.widget, "Install Plugin", cadnano.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()
コード例 #5
0
ファイル: preferences.py プロジェクト: basnijholt/cadnano2
 def addPlugin(self):
     fdialog = QFileDialog(
                 self.widget,
                 "Install Plugin",
                 cadnano.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()
コード例 #6
0
 def darwinAuthedMvPluginsIntoPluginsFolder(self, filesInZip):
     envirn={"DST":cadnano.path()+'/plugins'}
     srcstr = ''
     for i in range(len(filesInZip)):
         fileName, filePath = filesInZip[i]
         srcstr += ' \\"$SRC' + str(i) + '\\"'
         envirn['SRC'+str(i)] = filePath
     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)
コード例 #7
0
 def movePluginsIntoPluginsFolder(self, filesInZip):
     for fileName, filePath in filesInZip:
         target = os.path.join(cadnano.path(), 'plugins', fileName)
         shutil.move(filePath, target)