Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
djnro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
djnro
Commits
b0d86558
Commit
b0d86558
authored
Oct 30, 2015
by
Zenon Mousmoulas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply the same management command output verbosity enhancements from
aff0d789
to parse_institution_xml
parent
f81c223b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
edumanage/management/commands/parse_institution_xml.py
edumanage/management/commands/parse_institution_xml.py
+9
-4
No files found.
edumanage/management/commands/parse_institution_xml.py
View file @
b0d86558
...
...
@@ -42,6 +42,11 @@ class Command(BaseCommand):
if
args
is
None
or
len
(
args
)
!=
1
:
raise
CommandError
(
'You must supply a file name'
)
if
int
(
options
[
'verbosity'
])
>
0
:
write
=
self
.
stdout
.
write
else
:
write
=
lambda
*
args
:
None
self
.
parse_and_create
(
args
[
0
])
def
parse_and_create
(
self
,
instxmlfile
):
...
...
@@ -54,7 +59,7 @@ class Command(BaseCommand):
created_inst_details
=
False
instcontactslist
=
[]
for
instdetails
in
institution
:
self
.
stdout
.
write
(
'Parsing: %s
\n
'
%
(
instdetails
.
tag
))
write
(
'Parsing: %s
\n
'
%
(
instdetails
.
tag
))
if
instdetails
.
tag
==
'country'
:
continue
if
instdetails
.
tag
==
'type'
:
...
...
@@ -64,7 +69,7 @@ class Command(BaseCommand):
ertype
=
int
(
type
)
)
institution_obj
.
save
()
self
.
stdout
.
write
(
'Created inst %s
\n
'
%
institution_obj
.
pk
)
write
(
'Created inst %s
\n
'
%
institution_obj
.
pk
)
continue
if
instdetails
.
tag
==
'inst_realm'
:
inst_realm
=
instdetails
.
text
...
...
@@ -218,7 +223,7 @@ class Command(BaseCommand):
if
loc_wired_txt
in
(
'true'
,
'1'
):
loc_wired
=
True
if
not
parsedLocation
:
self
.
stdout
.
write
(
'Creating location:
\n
'
)
write
(
'Creating location:
\n
'
)
try
:
serviceloc
=
ServiceLoc
(
institutionid
=
institution_obj
,
...
...
@@ -244,6 +249,6 @@ class Command(BaseCommand):
)
t
.
save
()
except
Exception
as
e
:
self
.
stdout
.
write
(
'ERROR: %s
\n
'
%
e
)
write
(
'ERROR: %s
\n
'
%
e
)
continue
return
True
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