Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ergsite
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
aa
ergsite
Commits
facf5ff5
Commit
facf5ff5
authored
Jan 10, 2018
by
murtaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wikifeedr
parent
08f37555
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
m/scripts/mediawikifeeder.py
+0
-0
m/scripts/mediawikiutils.py
+7
-2
No files found.
m/scripts/mediawikifeeder.py
View file @
facf5ff5
This diff is collapsed.
Click to expand it.
m/scripts/mediawikiutils.py
View file @
facf5ff5
...
...
@@ -98,7 +98,7 @@ def ensure_unique_wiki_pagename (wiki, name):
return
name
n
+=
1
def
upload_file_to_wiki
(
wiki
,
path
,
filename
=
None
,
description
=
""
,
phpuploader
=
None
):
def
upload_file_to_wiki
(
wiki
,
path
,
filename
=
None
,
description
=
""
,
phpuploader
=
None
,
user
=
None
):
""" Takes a file path and ensures the file is uploaded to the wiki
Returns the wiki page object corresponding to the (previous) Image object
"""
...
...
@@ -130,7 +130,12 @@ def upload_file_to_wiki (wiki, path, filename=None, description="", phpuploader=
print
(
'[upload_file_to_wiki]: copying file to temporary directory'
,
tmpdirname
,
file
=
sys
.
stderr
)
shutil
.
copy
(
path
,
tpath
)
print
(
'[upload_file_to_wiki]: using importImages.php'
,
tmpdirname
,
file
=
sys
.
stderr
)
subprocess
.
call
([
"php"
,
phpuploader
,
"--skip-dupes"
,
"--comment"
,
description
,
tmpdirname
])
uargs
=
[
"php"
,
phpuploader
,
"--skip-dupes"
,
"--comment"
,
description
]
if
user
!=
None
:
uargs
.
append
(
"--user"
)
uargs
.
append
(
user
)
uargs
.
append
(
tmpdirname
)
subprocess
.
call
(
uargs
)
# TODO: ADD description / comment with link to containing item?! ... or source
# TODO: Using tmp.png is going to cause trouble!!!!
# shutil.move(tpath, path)
...
...
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