Commit 4d8277c5 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Pamhyr2: Fix pep8.

No related merge requests found
Pipeline #54770 passed with stages
in 6 minutes and 46 seconds
Showing with 13 additions and 2 deletions
+13 -2
......@@ -48,6 +48,7 @@ class SetCommand(QUndoCommand):
for key in self._new:
f[key] = self._new[key]
class AddCommand(QUndoCommand):
def __init__(self, files, row):
QUndoCommand.__init__(self)
......@@ -65,6 +66,7 @@ class AddCommand(QUndoCommand):
else:
self._files.insert(self._row, self._new)
class DelCommand(QUndoCommand):
def __init__(self, files, row):
QUndoCommand.__init__(self)
......
......@@ -28,6 +28,7 @@ from View.AdditionalFiles.List import ListModel
from View.AdditionalFiles.Translate import AddFileTranslate
from View.AdditionalFiles.Edit.Window import EditAddFileWindow
class AddFileListWindow(PamhyrWindow):
_pamhyr_ui = "AdditionalFileList"
_pamhyr_name = "Additional files"
......
......@@ -48,6 +48,7 @@ class SetCommand(QUndoCommand):
for key in self._new:
f[key] = self._new[key]
class AddCommand(QUndoCommand):
def __init__(self, lines, row):
QUndoCommand.__init__(self)
......@@ -65,6 +66,7 @@ class AddCommand(QUndoCommand):
else:
self._lines.insert(self._row, self._new)
class DelCommand(QUndoCommand):
def __init__(self, lines, row):
QUndoCommand.__init__(self)
......
......@@ -234,14 +234,19 @@ def timestamp(dt: datetime):
return (dt - datetime(1970, 1, 1)).total_seconds()
return dt.timestamp()
def date_iso_to_timestamp(date: str):
return datetime.isoformat(date)
if type(date) is str:
return datetime.fromisoformat(date).timestamp()
else:
return datetime.isoformat(date)
def date_dmy_to_timestamp(date: str):
if date.count(":") == 0:
ret = datetime.strptime(date, "%d/%m/%y")
elif date.count(".") == 1:
ret= datetime.strptime(date, "%d/%m/%y %H:%M:%S.%f")
ret = datetime.strptime(date, "%d/%m/%y %H:%M:%S.%f")
elif date.count(":") == 1:
ret = datetime.strptime(date, "%d/%m/%y %H:%M")
elif date.count(":") == 2:
......@@ -251,6 +256,7 @@ def date_dmy_to_timestamp(date: str):
return ret.timestamp()
def old_pamhyr_date_to_timestamp(date: str):
v = date.split(":")
if len(v) != 4:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment