Commit 9b40d54e authored by Alexander Schulze-Schwering's avatar Alexander Schulze-Schwering

Merge branch 'develop' into feature/356_multiple-caffe-versions

parents 99cb77c6 fc07873a
......@@ -88,7 +88,8 @@ returns a list containing the paths to all .h5 or .hdf5 files that are specified
@author j_stru18
@param path : a string that is supposed to be a valid path for a HDF5TXT file
@ensure: if filePath points to a valid file, it has to a textfile
@param filePath : a string that is supposed to be a valid path for a HDF5TXT file
@return a list that contains all .h5 and .hdf5 files in the HDF5TXT
def getHdf5List(filePath):
......@@ -105,6 +106,23 @@ def getHdf5List(filePath):
Log.error("HDF5 textfile contained invalid path {}".format(line), DBUTIL_LOGGER_ID)
return pathList
returns a list containing all lines of the file that filePath points at
@author: j_stru18
@param filePath : a string that is supposed to be a path for a txt file
@return: a list that contains all lines of that file
def getLinesAsList(filePath):
pathList = []
if os.path.exists(filePath):
pathList = [line for line in open(filePath)]
return pathList
Given the name of a file, this method returns its type
This diff is collapsed.
......@@ -344,7 +344,7 @@ class TableEditor(QtWidgets.QDialog):
def reload(self, row=0, column=0):
""" reloads all path avalibilities """
""" reloads all path avalabilities """
if column == 0:
for index in range(self.table.rowCount()):
item = self.table.item(index, 0)
......@@ -367,13 +367,14 @@ class TableEditor(QtWidgets.QDialog):
if len(path) > 0:
path, extension = os.path.splitext(path)
path = path + ".txt" # ensure .txt is the suffix
self.path = path
txtfile = open(path, "w+")
for index in range(self.table.rowCount()):
line = self.table.item(index, 0).text()
if self.checkIfExists(line):
QtWidgets.QMessageBox.information(self,"File Saved"),"File saved at \"{}\"".format(path)))
def keyReleaseEvent(self, QKeyEvent):
if QKeyEvent.key() == QtCore.Qt.Key_Delete:
......@@ -190,7 +190,7 @@ class UiMainWindow(QtWidgets.QMainWindow):
if "max_iter" in changedItems:
activeSession = self.viewManager.project.getActiveSession()
if not activeSession.isRemote():
def disableEditing(self, state):
......@@ -83,7 +83,8 @@ class LayerHelper:
mylayer = []
for nid in network["layerOrder"]:
if network["layers"][nid]["type"].name() in layertypes:
type = network["layers"][nid]["type"].name()
if type in layertypes:
params = network["layers"][nid]["parameters"]
layername = params["name"]
# since names can be ambiguous append the phase
......@@ -91,10 +92,12 @@ class LayerHelper:
for incl in params["include"]:
if unicode("phase") in incl:
layername += " (" + incl["phase"] + ")"
if unicode("data_param") in params and unicode("source") in params["data_param"]:
layerpath = params["data_param"]["source"]
same = False
dataParamType = "hdf5_data_param" if type == "HDF5Data" else "data_param"
if unicode(dataParamType) in params and unicode("source") in params[dataParamType]:
layerpath = params[dataParamType]["source"]
same = (os.path.realpath(dbpath) == os.path.realpath(layerpath))
mylayer.append([nid, layername, same])
mylayer.append([nid, layername, same])
return mylayer
......@@ -542,7 +542,7 @@ class NetworkManager(QObject):
# Add one to the count of all layers in the application
self.layerCount += 1
def addBottomBlob(self, layerID, blobName):
def addBottomBlob(self, layerID, blobName=""):
'Adds a bottom entry to the layer with the given id'
def intern(stateDict):
network = stateDict["network"]
......@@ -3,7 +3,6 @@ from PyQt5.QtWidgets import QDialog, QPushButton, QMessageBox, QAction, QGridLay
from gui.prototxt_editor import text_edit
class EditorWidget(QDialog):
'''This Editor enables text-based changes of Prototxt files. Connect to the sinal sgSave to get the savedata'''
......@@ -46,6 +45,7 @@ class EditorWidget(QDialog):
sgSave = pyqtSignal(['QString'])
sgClose = pyqtSignal()
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment