mirror of https://gitlab.com/pamhyr/pamhyr2
Pamhyr2: Fix pep8.
parent
b9fddcf78c
commit
4d8277c5c2
|
|
@ -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)
|
||||
|
|
|
|||
10
src/tools.py
10
src/tools.py
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue