Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
quiver-frontend-local
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
subugoe
OCR-D
quiver-frontend-local
Commits
2027dd2a
Commit
2027dd2a
authored
5 years ago
by
Konstantin Baierer
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://github.com/kba/ocrd-kwalitee
parents
c55b2a4a
6bd85bcd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwalitee/cli.py
+8
-2
8 additions, 2 deletions
kwalitee/cli.py
with
8 additions
and
2 deletions
kwalitee/cli.py
+
8
−
2
View file @
2027dd2a
import
click
import
click
from
pathlib
import
Path
from
ocrd.decorators
import
ocrd_loglevel
from
ocrd.decorators
import
ocrd_loglevel
from
ocrd_utils
import
getLogger
from
ocrd_utils
import
getLogger
from
yaml
import
safe_load
from
yaml
import
safe_load
...
@@ -66,8 +67,9 @@ def pull_all(ctx):
...
@@ -66,8 +67,9 @@ def pull_all(ctx):
Generate JSON
Generate JSON
'''
)
'''
)
@click.option
(
'
-o
'
,
'
--output
'
,
help
=
"
Output file. Omit to print to STDOU
"
)
@pass_ctx
@pass_ctx
def
generate_json
(
ctx
):
def
generate_json
(
ctx
,
output
=
None
):
ret
=
[]
ret
=
[]
_check_cloned
(
ctx
)
_check_cloned
(
ctx
)
for
repo
in
ctx
.
repos
:
for
repo
in
ctx
.
repos
:
...
@@ -75,4 +77,8 @@ def generate_json(ctx):
...
@@ -75,4 +77,8 @@ def generate_json(ctx):
repo
.
clone
()
repo
.
clone
()
ret
.
append
(
repo
.
to_json
())
ret
.
append
(
repo
.
to_json
())
# print('%s %s -> %s' % (repo.path.is_dir(), repo.url, repo.path))
# print('%s %s -> %s' % (repo.path.is_dir(), repo.url, repo.path))
print
(
json
.
dumps
(
ret
,
indent
=
4
,
sort_keys
=
True
))
json_str
=
json
.
dumps
(
ret
,
indent
=
4
,
sort_keys
=
True
)
if
output
:
Path
(
output
).
write_text
(
json_str
)
else
:
print
(
json_str
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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