Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ValUnifer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IPIPAN
ValUnifer
Commits
3dc849a3
Commit
3dc849a3
authored
1 year ago
by
dcz
Browse files
Options
Downloads
Patches
Plain Diff
Dumping unified frames to xml scripts.
parent
9b562850
Branches
Branches containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/management/commands/create_tei.py
+47
-0
47 additions, 0 deletions
common/management/commands/create_tei.py
common/management/commands/valunifier_tei.py
+522
-0
522 additions, 0 deletions
common/management/commands/valunifier_tei.py
with
569 additions
and
0 deletions
common/management/commands/create_tei.py
0 → 100644
+
47
−
0
View file @
3dc849a3
#-*- coding:utf-8 -*-
import
datetime
import
os
from
django.core.management.base
import
BaseCommand
from
optparse
import
make_option
from
unifier.models
import
UnifiedFrame
from
django.contrib.auth.models
import
User
from
users.models
import
Assignment
from
common.valunifier_tei
import
createteixml
BASEPATH
=
'
.
'
class
Command
(
BaseCommand
):
args
=
''
help
=
'
Export ValUnifier in TEI format
'
def
add_arguments
(
self
,
parser
):
parser
.
add_argument
(
'
-i
'
,
'
--individual
'
,
action
=
'
store_true
'
,
help
=
'
Gen individual files.
'
)
def
handle
(
self
,
**
options
):
now
=
datetime
.
datetime
.
now
().
strftime
(
'
%Y%m%d
'
)
if
not
options
[
'
individual
'
]:
print
(
"
Full dictionary
"
)
outfile
=
'
valunifier_
'
+
now
+
'
.xml
'
outpath
=
os
.
path
.
join
(
BASEPATH
,
outfile
)
frames
=
UnifiedFrame
.
objects
.
all
()
createteixml
(
outpath
,
frames
)
else
:
for
user
in
User
.
objects
.
all
():
print
(
"
Part for
"
+
user
.
username
)
frames
=
[]
for
assignment
in
Assignment
.
objects
.
filter
(
user
=
user
):
if
assignment
.
subject_ct
.
model_class
()
==
UnifiedFrame
:
frames
.
append
(
assignment
.
subject_ct
.
get_object_for_this_type
(
id
=
assignment
.
subject_id
))
outfile
=
user
.
username
+
'
_
'
+
now
+
'
.xml
'
outpath
=
os
.
path
.
join
(
BASEPATH
,
outfile
)
if
len
(
frames
)
>
0
:
createteixml
(
outpath
,
frames
)
This diff is collapsed.
Click to expand it.
common/management/commands/valunifier_tei.py
0 → 100644
+
522
−
0
View file @
3dc849a3
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment