Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
d2c1df88
Commit
d2c1df88
authored
Aug 08, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update utility script to create course groups
parent
27cd9ef9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
utility-scripts/create_groups.py
+12
-1
No files found.
utility-scripts/create_groups.py
View file @
d2c1df88
...
...
@@ -18,6 +18,7 @@ except Exception as err:
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
,
Group
from
path
import
path
from
lxml
import
etree
data_dir
=
settings
.
DATA_DIR
print
"data_dir =
%
s"
%
data_dir
...
...
@@ -26,7 +27,17 @@ for course_dir in os.listdir(data_dir):
# print course_dir
if
not
os
.
path
.
isdir
(
path
(
data_dir
)
/
course_dir
):
continue
gname
=
'staff_
%
s'
%
course_dir
cxfn
=
path
(
data_dir
)
/
course_dir
/
'course.xml'
coursexml
=
etree
.
parse
(
cxfn
)
cxmlroot
=
coursexml
.
getroot
()
course
=
cxmlroot
.
get
(
'course'
)
if
course
is
None
:
print
"oops, can't get course id for
%
s"
%
course_dir
continue
print
"course=
%
s for course_dir=
%
s"
%
(
course
,
course_dir
)
gname
=
'staff_
%
s'
%
course
if
Group
.
objects
.
filter
(
name
=
gname
):
print
"group exists for
%
s"
%
gname
continue
...
...
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