Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
edx
course-discovery
Commits
b57a5996
Commit
b57a5996
authored
Dec 18, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to argparse for management command argument parsing
parent
5d160985
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
course_discovery/apps/courses/management/commands/refresh_all_courses.py
+8
-8
No files found.
course_discovery/apps/courses/management/commands/refresh_all_courses.py
View file @
b57a5996
import
logging
import
logging
from
optparse
import
make_option
from
django.core.management
import
BaseCommand
,
CommandError
from
django.core.management
import
BaseCommand
,
CommandError
...
@@ -11,13 +10,14 @@ logger = logging.getLogger(__name__)
...
@@ -11,13 +10,14 @@ logger = logging.getLogger(__name__)
class
Command
(
BaseCommand
):
class
Command
(
BaseCommand
):
help
=
'Refresh course data from external sources.'
help
=
'Refresh course data from external sources.'
option_list
=
BaseCommand
.
option_list
+
(
def
add_arguments
(
self
,
parser
):
make_option
(
'--access_token'
,
parser
.
add_argument
(
action
=
'store'
,
'--access_token'
,
dest
=
'access_token'
,
action
=
'store'
,
default
=
None
,
dest
=
'access_token'
,
help
=
'OAuth2 access token used to authenticate API calls.'
),
default
=
None
,
)
help
=
'OAuth2 access token used to authenticate API calls.'
)
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
access_token
=
options
.
get
(
'access_token'
)
access_token
=
options
.
get
(
'access_token'
)
...
...
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