Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mwclient
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
Container Registry
Model registry
Operate
Environments
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
WebU
shared
mwclient
Commits
a6464a37
Commit
a6464a37
authored
15 years ago
by
Bryan Tong Minh
Browse files
Options
Downloads
Patches
Plain Diff
* Allow arbitrary data to be passed to page.save
* Fix mwclient on WMF wikis
parent
53767dd5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mwclient/RELEASE-NOTES.txt
+2
-0
2 additions, 0 deletions
mwclient/RELEASE-NOTES.txt
mwclient/client.py
+3
-0
3 additions, 0 deletions
mwclient/client.py
mwclient/page.py
+5
-1
5 additions, 1 deletion
mwclient/page.py
with
10 additions
and
1 deletion
mwclient/RELEASE-NOTES.txt
+
2
−
0
View file @
a6464a37
...
...
@@ -6,6 +6,8 @@ This is mwclient 0.6.3. The following are the release notes for this version.
Mwclient 0.6.3 is unreleased.
* Added domain parameter to login.
* Applied edit fix to page_nowriteapi
* Allow arbitrary data to be passed to page.save
* Fix mwclient on WMF wikis
== Changes in version 0.6.2 ==
Mwclient was released on 2 May 2009.
...
...
This diff is collapsed.
Click to expand it.
mwclient/client.py
+
3
−
0
View file @
a6464a37
...
...
@@ -96,8 +96,11 @@ class Site(object):
if
self
.
site
[
'
generator
'
].
startswith
(
'
MediaWiki
'
):
version
=
self
.
site
[
'
generator
'
][
10
:].
split
(
'
.
'
)
# FIXME! Fix those awful two hacks
if
len
(
version
)
==
2
and
version
[
1
].
endswith
(
'
alpha
'
):
self
.
version
=
(
int
(
version
[
0
]),
int
(
version
[
1
][:
-
5
]),
'
alpha
'
)
elif
len
(
version
)
==
2
and
version
[
1
].
endswith
(
'
alpha-wmf
'
):
self
.
version
=
(
int
(
version
[
0
]),
int
(
version
[
1
][:
-
5
]),
'
alpha-wmf
'
)
elif
len
(
version
)
==
3
and
'
rc
'
in
version
[
2
]:
self
.
version
=
(
int
(
version
[
0
]),
int
(
version
[
1
]),
version
[
2
])
elif
len
(
version
)
==
3
:
...
...
This diff is collapsed.
Click to expand it.
mwclient/page.py
+
5
−
1
View file @
a6464a37
...
...
@@ -108,7 +108,7 @@ class Page(object):
self
.
edit_time
=
time
.
gmtime
()
return
self
.
text
def
save
(
self
,
text
=
u
''
,
summary
=
u
''
,
minor
=
False
,
bot
=
True
):
def
save
(
self
,
text
=
u
''
,
summary
=
u
''
,
minor
=
False
,
bot
=
True
,
**
kwargs
):
if
not
self
.
site
.
logged_in
and
self
.
site
.
force_login
:
# Should we really check for this?
raise
errors
.
LoginError
(
self
.
site
)
...
...
@@ -129,6 +129,8 @@ class Page(object):
if
self
.
edit_time
:
data
[
'
starttimestamp
'
]
=
time
.
strftime
(
'
%Y%m%d%H%M%S
'
,
self
.
edit_time
)
if
bot
:
data
[
'
bot
'
]
=
'
1
'
data
.
update
(
kwargs
)
try
:
result
=
self
.
site
.
api
(
'
edit
'
,
title
=
self
.
name
,
text
=
text
,
summary
=
summary
,
token
=
self
.
get_token
(
'
edit
'
),
...
...
@@ -143,6 +145,8 @@ class Page(object):
raise
errors
.
ProtectedPageError
(
self
,
e
.
code
,
e
.
info
)
else
:
raise
if
result
[
'
edit
'
]
==
'
Success
'
:
self
.
last_rev_time
=
client
.
parse_timestamp
(
result
[
'
newtimestamp
'
])
return
result
[
'
edit
'
]
def
get_expanded
(
self
):
...
...
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