Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CodiMD export script
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
stgroup
misc
CodiMD export script
Commits
ea60182e
Commit
ea60182e
authored
2 years ago
by
Martin Morgenstern
Browse files
Options
Downloads
Patches
Plain Diff
Url-quote document ids in HTTP requests
parent
e68d36ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
codimd_export.py
+2
-1
2 additions, 1 deletion
codimd_export.py
with
2 additions
and
1 deletion
codimd_export.py
+
2
−
1
View file @
ea60182e
...
...
@@ -7,6 +7,7 @@ import json
import
sys
from
pathlib
import
Path
from
urllib.error
import
HTTPError
from
urllib.parse
import
quote
from
urllib.request
import
Request
,
urlopen
if
not
sys
.
platform
.
startswith
(
"
win
"
):
...
...
@@ -44,7 +45,7 @@ def main(instance_url, session_id, export_to):
num_ok
=
num_fail
=
0
for
row
in
data
[
"
history
"
]:
document_id
=
row
[
"
id
"
]
document_url
=
f
"
{
instance_url
}
/
{
document_id
}
"
document_url
=
f
"
{
instance_url
}
/
{
quote
(
document_id
)
}
"
try
:
contents
=
slurp
(
f
"
{
document_url
}
/download
"
,
session_id
)
with
open
(
Path
(
target_dir
,
f
"
{
document_id
}
.md
"
),
mode
=
"
wb
"
)
as
stream
:
...
...
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