Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
librestash
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nik | Klampfradler
librestash
Commits
b5ca2933
Verified
Commit
b5ca2933
authored
7 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Move formatting code to new module.
parent
41924045
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
librestash/cmd.py
+2
-3
2 additions, 3 deletions
librestash/cmd.py
librestash/lib/exporters/formatters.py
+6
-0
6 additions, 0 deletions
librestash/lib/exporters/formatters.py
with
8 additions
and
3 deletions
librestash/cmd.py
+
2
−
3
View file @
b5ca2933
from
argparse
import
ArgumentParser
import
json
import
logging
from
.lib.adaptors.gpx
import
GpxImporter
from
.lib.exporters.caches
import
CacheExporter
from
.lib.exporters.formatters
import
caches_to_json
from
.lib.config
import
get_default_config_path
,
get_config
from
.lib.model
import
get_db
from
.lib.util
import
json_serialise
logger
=
logging
.
getLogger
(
'
librestash
'
)
...
...
@@ -45,4 +44,4 @@ def export_caches():
data
=
exporter
.
export
(
found_by
=
args
.
found_by
)
if
args
.
format
==
'
json
'
:
print
(
json
.
dumps
(
data
,
default
=
json_serialise
))
print
(
caches_to_json
(
data
))
This diff is collapsed.
Click to expand it.
librestash/lib/exporters/formatters.py
0 → 100644
+
6
−
0
View file @
b5ca2933
import
json
from
..util
import
json_serialise
def
caches_to_json
(
data
):
return
json
.
dumps
(
data
,
default
=
json_serialise
)
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