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
83a2c470
Commit
83a2c470
authored
Sep 19, 2008
by
willmcgugan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some docstrings
parent
ffef69d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
fs/fs.py
+33
-0
No files found.
fs/fs.py
View file @
83a2c470
...
...
@@ -95,6 +95,13 @@ class SystemError(FSError): pass
class
ResourceInvalid
(
FSError
):
pass
def
silence_fserrors
(
f
,
*
args
,
**
kwargs
):
"""Perform a function call and return None if any FSError exceptions are thrown/
f -- Function to call
args -- Parameters to f
kwargs -- Keyword parameters to f
"""
try
:
return
f
(
*
args
,
**
kwargs
)
except
FSError
:
...
...
@@ -320,15 +327,41 @@ class FS(object):
raise
UnsupportedError
(
"UNSUPPORTED"
)
def
makedir
(
self
,
path
,
mode
=
0777
,
recursive
=
False
,
allow_recreate
=
False
):
"""Make a directory on the file system.
path -- Path of directory
mode -- Permissions
recursive -- If True, also create intermediate directories
allow_recreate -- If True, then re-creating a directory wont throw an exception
"""
raise
UnsupportedError
(
"UNSUPPORTED"
)
def
remove
(
self
,
path
):
"""Remove a resource from the filesystem.
path -- Path of the resource to remove
"""
raise
UnsupportedError
(
"UNSUPPORTED"
)
def
removedir
(
self
,
path
,
recursive
=
False
):
"""Remove a directory
path -- Path of the directory to remove
recursive -- If True, then blank parent directories will be removed
"""
raise
UnsupportedError
(
"UNSUPPORTED"
)
def
rename
(
self
,
src
,
dst
):
"""Renames a file or directory
src -- Path to rename
dst -- New name (not a path)
"""
raise
UnsupportedError
(
"UNSUPPORTED"
)
def
getinfo
(
self
,
path
):
...
...
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