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
7efa4873
Commit
7efa4873
authored
Sep 09, 2013
by
willmcgugan@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
errno constants
parent
4e059083
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
fs/commands/fsserve.py
+5
-4
No files found.
fs/commands/fsserve.py
View file @
7efa4873
...
...
@@ -5,6 +5,7 @@ import sys
from
fs.opener
import
opener
from
fs.commands.runner
import
Command
from
fs.utils
import
print_fs
import
errno
class
FSServe
(
Command
):
...
...
@@ -13,13 +14,13 @@ class FSServe(Command):
Serves the contents of PATH with one of a number of methods"""
def
get_optparse
(
self
):
optparse
=
super
(
FSServe
,
self
)
.
get_optparse
()
optparse
=
super
(
FSServe
,
self
)
.
get_optparse
()
optparse
.
add_option
(
'-t'
,
'--type'
,
dest
=
'type'
,
type
=
"string"
,
default
=
"http"
,
help
=
"Server type to create (http, rpc, sftp)"
,
metavar
=
"TYPE"
)
optparse
.
add_option
(
'-a'
,
'--addr'
,
dest
=
'addr'
,
type
=
"string"
,
default
=
"127.0.0.1"
,
help
=
"Server address"
,
metavar
=
"ADDR"
)
optparse
.
add_option
(
'-p'
,
'--port'
,
dest
=
'port'
,
type
=
"int"
,
help
=
"Port number"
,
metavar
=
""
)
help
=
"Port number"
,
metavar
=
""
)
return
optparse
def
do_run
(
self
,
options
,
args
):
...
...
@@ -90,10 +91,10 @@ Serves the contents of PATH with one of a number of methods"""
self
.
error
(
"Server type '
%
s' not recognised
\n
"
%
options
.
type
)
except
IOError
,
e
:
if
e
.
errno
==
13
:
if
e
.
errno
==
errno
.
EACCES
:
self
.
error
(
'Permission denied
\n
'
)
return
1
else
:
else
:
self
.
error
(
str
(
e
)
+
'
\n
'
)
return
1
...
...
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