Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.toolbox
Commits
8d620cae
Commit
8d620cae
authored
Jan 30, 2020
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! Add support for Python 3
This is another fixup for commit
1c8269b2
.
parent
d634f700
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
slapos/runner/fileBrowser.py
slapos/runner/fileBrowser.py
+3
-2
No files found.
slapos/runner/fileBrowser.py
View file @
8d620cae
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
# pylint: disable-msg=W0311,C0301,C0103,C0111
# pylint: disable-msg=W0311,C0301,C0103,C0111
import
datetime
import
datetime
import
md5
import
hashlib
import
os
import
os
import
re
import
re
import
shutil
import
shutil
...
@@ -13,6 +13,7 @@ import fnmatch
...
@@ -13,6 +13,7 @@ import fnmatch
import
werkzeug
import
werkzeug
from
slapos.runner.utils
import
realpath
,
tail
,
isText
from
slapos.runner.utils
import
realpath
,
tail
,
isText
from
slapos.util
import
str2bytes
class
FileBrowser
(
object
):
class
FileBrowser
(
object
):
...
@@ -59,7 +60,7 @@ class FileBrowser(object):
...
@@ -59,7 +60,7 @@ class FileBrowser(object):
realfile
=
os
.
path
.
join
(
realdir
,
f
)
realfile
=
os
.
path
.
join
(
realdir
,
f
)
mdate
=
datetime
.
datetime
.
fromtimestamp
(
os
.
path
.
getmtime
(
realfile
)
mdate
=
datetime
.
datetime
.
fromtimestamp
(
os
.
path
.
getmtime
(
realfile
)
).
strftime
(
"%Y-%d-%m %I:%M"
)
).
strftime
(
"%Y-%d-%m %I:%M"
)
md5sum
=
md5
.
md5
(
realfile
).
hexdigest
()
md5sum
=
hashlib
.
md5
(
str2bytes
(
realfile
)
).
hexdigest
()
if
not
os
.
path
.
isdir
(
realfile
):
if
not
os
.
path
.
isdir
(
realfile
):
size
=
os
.
path
.
getsize
(
realfile
)
size
=
os
.
path
.
getsize
(
realfile
)
regex
=
re
.
compile
(
"(^.*)
\
.(.*)
"
, re.VERBOSE)
regex
=
re
.
compile
(
"(^.*)
\
.(.*)
"
, re.VERBOSE)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment