Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@QtCore.pyqtSlot()
def on_actionOpen_triggered(self):
getExistingDirectory = QtGui.QFileDialog.getExistingDirectory
path = getExistingDirectory(self, caption="Open recording, track, or animal",
directory=self.path)
path = str(path)
if path == '':
return
self.path = os.path.normpath(os.path.join(path, os.pardir)) # update with path's parent
head, tail = os.path.split(path)
if tail[0].isnumeric(): # asume it's a recording
self.open_recording(path)
elif tail.startswith('tr'): # assume it's a track
self.open_track(path)
else:
self.open_animal(path) # assume it's an animal
@QtCore.pyqtSlot()
def on_action_ptc22_triggered(self):
path = os.path.join(SLABPATH, 'ptc22')
self.open_animal(path)
@QtCore.pyqtSlot()
def on_actionAboutNeuropy_triggered(self):
lf = open('../LICENSE', 'r')
LICENSE = lf.read()
lf.close()
ipverstr = ('%d.%d.%d.%s' % IPython.version_info).rstrip('.')
system = """<p>Python %s, IPython %s, Qt %s, PyQt %s<br>
%s</p>""" % (platform.python_version(), ipverstr,
QtCore.QT_VERSION_STR, QtCore.PYQT_VERSION_STR,
platform.platform())
text = """
<h2><a href="http://neuropy.github.io">neuropy</a> %s</h2>
<p>A tool for neuronal spike, stimulus, and LFP data analysis</p>
<p>Copyright © 2006-2017 <a href="http://mspacek.github.io">Martin Spacek</a><br>
<a href="http://swindale.ecc.ubc.ca">Swindale</a> Lab,</p>
@QtCore.pyqtSlot()
def on_action_ptc17_triggered(self):
path = os.path.join(SLABPATH, 'ptc17')
self.open_animal(path)
@QtCore.pyqtSlot()
def on_action_pvc107_triggered(self):
path = os.path.join(BLABPATH, 'PVCre_0107')
self.open_animal(path)
@QtCore.pyqtSlot()
def on_actionShell_triggered(self):
ipshell()
@QtCore.pyqtSlot()
def on_action_ptc21_triggered(self):
path = os.path.join(SLABPATH, 'ptc21')
self.open_animal(path)
@QtCore.pyqtSlot()
def on_action_ptc15_triggered(self):
path = os.path.join(SLABPATH, 'ptc15')
self.open_animal(path)
@QtCore.pyqtSlot()
def on_actionAboutQt_triggered(self):
QtGui.QMessageBox.aboutQt(self)
@QtCore.pyqtSlot()
def on_action_pvc113_triggered(self):
path = os.path.join(BLABPATH, 'PVCre_0113')
self.open_animal(path)