Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Linting: Harmonize docstrings and comments
039e0620ad05d673a2ef9aa501e9a509219671c9
# Linting: Remove all trailing whitespaces
2c2b067f072856f2579c644b5f7858da0275be3c
# [core] attribute: Apply linting
b8c173ddd490dc3bf28b193697d675e44616c6f5
# Linting: Remove trailing whitespaces
Expand Down
3 changes: 1 addition & 2 deletions meshroom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ class MeshroomExitStatus(IntEnum):
"""
SUCCESS = 0
ERROR = 1
# In some farm tools jobs are automatically re-tried,
# using ERROR_NO_RETRY will try to prevent that
# In some farm tools jobs are automatically re-tried, using ERROR_NO_RETRY will try to prevent that
ERROR_NO_RETRY = -999 # It's actually -999 % 256 => 25


Expand Down
2 changes: 1 addition & 1 deletion meshroom/common/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def add(self, obj):
assert key is not None
assert key not in self._objects
self._objects[key] = obj

def rename(self, oldKey: str, newKey: str):
""" Rename an element in the dict model

Expand Down
2 changes: 1 addition & 1 deletion meshroom/submitters/localFarmSubmitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def createTask(self, meshroomFile: str, node) -> CreatedTask:
if c._status.status == Status.SUCCESS:
iterationsToIgnore.append(c.range.iteration)
chunkParams = {
"start": 0, "end": nbBlocks - 1, "step": 1,
"start": 0, "end": nbBlocks - 1, "step": 1,
"ignoreIterations": iterationsToIgnore,
"chunkCmdArgs": cmdArgs
}
Expand Down
20 changes: 10 additions & 10 deletions meshroom/ui/components/filepath.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ def asStr(path):
@Slot(str, result=str)
@Slot(QUrl, result=str)
def basename(self, path):
""" Returns the final component of a pathname """
""" Returns the final component of a pathname. """
return os.path.basename(self.asStr(path))

@Slot(str, result=str)
@Slot(QUrl, result=str)
def dirname(self, path):
""" Returns the directory component of a pathname """
""" Returns the directory component of a pathname. """
return os.path.dirname(self.asStr(path))

@Slot(str, result=str)
@Slot(QUrl, result=str)
def extension(self, path):
""" Returns the extension (.ext) of a pathname """
""" Returns the extension (.ext) of a pathname. """
return os.path.splitext(self.asStr(path))[-1]

@Slot(str, result=str)
@Slot(QUrl, result=str)
def removeExtension(self, path):
""" Returns the pathname without its extension (.ext)"""
""" Returns the pathname without its extension (.ext). """
return os.path.splitext(self.asStr(path))[0]

@Slot(str, result=bool)
Expand All @@ -67,29 +67,29 @@ def accessible(self, path):
@Slot(str, result=bool)
@Slot(QUrl, result=bool)
def isFile(self, path):
""" Test whether a path is a regular file """
""" Test whether a path is a regular file. """
return os.path.isfile(self.asStr(path))

@Slot(str, result=bool)
@Slot(QUrl, result=bool)
def exists(self, path):
""" Test whether a path exists """
""" Test whether a path exists. """
return os.path.exists(self.asStr(path))

@Slot(QUrl, result=str)
def urlToString(self, url):
""" Convert QUrl to a string using 'QUrl.toLocalFile' method """
""" Convert QUrl to a string using 'QUrl.toLocalFile' method. """
return self.asStr(url)

@Slot(str, result=QUrl)
def stringToUrl(self, path):
""" Convert a path (string) to a QUrl using 'QUrl.fromLocalFile' method """
""" Convert a path (string) to a QUrl using 'QUrl.fromLocalFile' method. """
return QUrl.fromLocalFile(path)

@Slot(str, result=str)
@Slot(QUrl, result=str)
def normpath(self, path):
""" Returns native normalized path """
""" Returns native normalized path. """
return os.path.normpath(self.asStr(path))

@Slot(str, result=str)
Expand Down Expand Up @@ -122,7 +122,7 @@ def resolve(self, path, vp):
return resolved

return fileUtils.resolvePath(vp, path)

@Slot(str, result="QVariantList")
@Slot(str, str, result="QVariantList")
def getFilenamesFromFolder(self, folderPath: str, extension: str = None):
Expand Down
16 changes: 9 additions & 7 deletions meshroom/ui/components/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def dateStr(self, fullDate=False):

class MessageController(QObject):
"""
Handles messages sent from the Python side to the StatusBar component
Handles messages sent from the Python side to the StatusBar component.
"""

message = Signal(str, str, int)
Expand All @@ -30,17 +30,17 @@ def __init__(self, parent):
self._messages = []

def sendMessage(self, msg, status, duration):
""" Sends a message that will be displayed on the status bar """
""" Sends a message that will be displayed on the status bar. """
self.message.emit(msg, status, duration)

@Slot(str, str)
def storeMessage(self, msg, status):
""" Adds a new message in the stack """
""" Adds a new message in the stack. """
self._messages.append(Message(msg, status or "info"))
self.messagesChanged.emit() # Notify QML that messages have changed

def _getMessagesDict(self, fullDate=False):
""" Get a dict with all stored messages """
""" Get a dict with all stored messages. """
messages = []
for msg in self._messages:
messages.append({
Expand All @@ -51,14 +51,16 @@ def _getMessagesDict(self, fullDate=False):
return messages

def getMessages(self):
""" Get the messages with simple date information.
"""
Get the messages with simple date information.
Reverse the list to make sure we see the most recent item on top
"""
return self._getMessagesDict()[::-1]

@Slot(result=str)
def getMessagesAsString(self):
""" Return messages for clipboard copy
"""
Return messages for clipboard copy.
.. note::
Could also do `json.dumps(self._getMessagesDict(fullDate=True), indent=4)`
"""
Expand All @@ -69,7 +71,7 @@ def getMessagesAsString(self):

@Slot()
def clearMessages(self):
""" Clear all stored messages """
""" Clear all stored messages. """
self._messages.clear()
self.messagesChanged.emit()

Expand Down
Loading
Loading