Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
52318cbd
Commit
52318cbd
authored
Apr 10, 2011
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove debugging prints
parent
6ea42bbc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
9 deletions
+1
-9
fs/osfs/__init__.py
+1
-1
fs/wrapfs/limitsizefs.py
+0
-8
No files found.
fs/osfs/__init__.py
View file @
52318cbd
...
...
@@ -168,7 +168,7 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
prefix
+=
os
.
path
.
sep
if
not
os
.
path
.
normcase
(
path
)
.
startswith
(
prefix
):
raise
ValueError
(
"path not within this FS:
%
s (
%
s)"
%
(
os
.
path
.
normcase
(
path
),
prefix
))
return
path
[
len
(
self
.
root_path
):]
return
normpath
(
path
[
len
(
self
.
root_path
):])
def
getmeta
(
self
,
meta_name
,
default
=
NoDefaultMeta
):
...
...
fs/wrapfs/limitsizefs.py
View file @
52318cbd
...
...
@@ -70,7 +70,6 @@ class LimitSizeFS(WrapFS):
self
.
_set_file_size
(
path
,
None
,
1
)
else
:
self
.
cur_size
-=
size
print
"OPEN, SIZE NOW"
,
self
.
cur_size
size
=
0
self
.
_set_file_size
(
path
,
0
,
1
)
return
LimitSizeFile
(
f
,
mode
,
size
,
self
,
path
)
...
...
@@ -115,27 +114,21 @@ class LimitSizeFS(WrapFS):
with
self
.
_size_lock
:
try
:
(
cur_size
,
_
)
=
self
.
_file_sizes
[
path
]
print
"...LOADED"
,
cur_size
except
KeyError
:
print
"...NOT LOADED"
try
:
cur_size
=
self
.
getsize
(
path
)
except
ResourceNotFoundError
:
cur_size
=
0
self
.
_set_file_size
(
path
,
cur_size
,
1
)
print
"WRITING"
,
path
,
size
,
cur_size
diff
=
size
-
cur_size
if
diff
>
0
:
if
self
.
cur_size
+
diff
>
self
.
max_size
:
raise
StorageSpaceError
(
"write"
)
self
.
cur_size
+=
diff
print
"WRITE, CUR SIZE NOW"
,
self
.
cur_size
self
.
_set_file_size
(
path
,
size
)
print
self
.
_file_sizes
[
path
]
return
size
elif
diff
<
0
and
shrink
:
self
.
cur_size
+=
diff
print
"WRITE, CUR SIZE NOW"
,
self
.
cur_size
self
.
_set_file_size
(
path
,
size
)
return
size
else
:
...
...
@@ -164,7 +157,6 @@ class LimitSizeFS(WrapFS):
size
=
self
.
getsize
(
path
)
super
(
LimitSizeFS
,
self
)
.
remove
(
path
)
self
.
cur_size
-=
size
print
"REMOVE, SIZE NOW"
,
self
.
cur_size
self
.
_file_sizes
.
pop
(
path
,
None
)
def
removedir
(
self
,
path
,
recursive
=
False
,
force
=
False
):
...
...
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