Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
grumpy
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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
grumpy
Commits
0f4a1a11
Commit
0f4a1a11
authored
Dec 26, 2016
by
Dylan Trotter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alphabetize StatResult functions.
parent
94df6066
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
lib/os/__init__.py
lib/os/__init__.py
+5
-5
lib/os_test.py
lib/os_test.py
+1
-1
No files found.
lib/os/__init__.py
View file @
0f4a1a11
...
@@ -80,16 +80,16 @@ class StatResult(object):
...
@@ -80,16 +80,16 @@ class StatResult(object):
# TODO: Make this a decorator once they're implemented.
# TODO: Make this a decorator once they're implemented.
st_mode
=
property
(
st_mode
)
st_mode
=
property
(
st_mode
)
def
st_size
(
self
):
return
self
.
_info
.
Size
()
# TODO: Make this a decorator once they're implemented.
st_size
=
property
(
st_size
)
def
st_mtime
(
self
):
def
st_mtime
(
self
):
return
float
(
self
.
_info
.
ModTime
().
UnixNano
())
/
Second
return
float
(
self
.
_info
.
ModTime
().
UnixNano
())
/
Second
# TODO: Make this a decorator once they're implemented.
# TODO: Make this a decorator once they're implemented.
st_mtime
=
property
(
st_mtime
)
st_mtime
=
property
(
st_mtime
)
def
st_size
(
self
):
return
self
.
_info
.
Size
()
# TODO: Make this a decorator once they're implemented.
st_size
=
property
(
st_size
)
def
stat
(
filepath
):
def
stat
(
filepath
):
info
,
err
=
Stat
(
filepath
)
info
,
err
=
Stat
(
filepath
)
...
...
lib/os_test.py
View file @
0f4a1a11
...
@@ -169,9 +169,9 @@ def TestStatFile():
...
@@ -169,9 +169,9 @@ def TestStatFile():
os
.
remove
(
path
)
os
.
remove
(
path
)
assert
not
stat
.
S_ISDIR
(
st
.
st_mode
)
assert
not
stat
.
S_ISDIR
(
st
.
st_mode
)
assert
stat
.
S_IMODE
(
st
.
st_mode
)
==
0o600
assert
stat
.
S_IMODE
(
st
.
st_mode
)
==
0o600
assert
st
.
st_size
==
0
# System time and mtime may have different precision so give 10 sec leeway.
# System time and mtime may have different precision so give 10 sec leeway.
assert
st
.
st_mtime
+
10
>
t
assert
st
.
st_mtime
+
10
>
t
assert
st
.
st_size
==
0
def
TestStatDir
():
def
TestStatDir
():
...
...
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