Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
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
configuration
Commits
2c02b97f
Commit
2c02b97f
authored
Aug 02, 2017
by
Shirley He
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
figure out file reading
parent
ba67f1e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
util/generate_permutations.py
+17
-11
No files found.
util/generate_permutations.py
View file @
2c02b97f
...
...
@@ -5,20 +5,26 @@ import json
from
argparse
import
ArgumentParser
from
pprint
import
pprint
from
itertools
import
product
import
sys
def
parse_args
():
parser
=
ArgumentParser
(
description
=
'Create course permutations'
)
parser
.
add_argument
(
'--fields'
,
action
=
''
,
nargs
=
3
)
# # def parse_args():
# parser = ArgumentParser(description='Create course permutations')
# parser.add_argument('--fields', action='', nargs=3)
#
# # def generate_course_permutations():
# with open('permutations.json') as permutation_options:
# permutation_data = json.load(permutation_options)
#
# start_dates = permutation_data["permutation_data"]["start"]
# availability = permutation_data["permutation_data"]['availability']
#
# permutation_generation = [start_dates, availability]
#
# print list(product(*permutation_generation))
with
open
(
sys
.
argv
[
1
],
'r'
)
as
permutation_file
:
def
generate_course_permutations
():
with
open
(
'permutations.json'
)
as
permutation_options
:
permutation_data
=
json
.
load
(
permutation_options
)
print
permutation_file
.
read
()[
2
]
start_dates
=
permutation_data
[
"permutation_data"
][
"start"
]
availability
=
permutation_data
[
"permutation_data"
][
'availability'
]
permutation_generation
=
[
start_dates
,
availability
]
print
list
(
product
(
*
permutation_generation
))
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