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
5c328781
Commit
5c328781
authored
17 years ago
by
Bryan Tong Minh
Browse files
Options
Downloads
Patches
Plain Diff
Add cmtitle compatibility
parent
11915509
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mwclient/compatibility.py
+8
-1
8 additions, 1 deletion
mwclient/compatibility.py
mwclient/listing.py
+5
-2
5 additions, 2 deletions
mwclient/listing.py
with
13 additions
and
3 deletions
mwclient/compatibility.py
+
8
−
1
View file @
5c328781
...
@@ -22,4 +22,11 @@ def iiprop(post_112):
...
@@ -22,4 +22,11 @@ def iiprop(post_112):
if
post_112
:
if
post_112
:
return
'
timestamp|user|comment|url|size|sha1|metadata
'
return
'
timestamp|user|comment|url|size|sha1|metadata
'
else
:
else
:
return
'
timestamp|user|comment|url|size|sha1
'
return
'
timestamp|user|comment|url|size|sha1
'
\ No newline at end of file
def
cmtitle
(
page
,
new_format
,
prefix
=
''
):
if
new_format
:
return
prefix
+
'
title
'
,
page
.
name
else
:
return
prefix
+
'
category
'
,
page
.
strip_namespace
(
page
.
name
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
mwclient/listing.py
+
5
−
2
View file @
5c328781
...
@@ -119,7 +119,9 @@ class GeneratorList(List):
...
@@ -119,7 +119,9 @@ class GeneratorList(List):
class
Category
(
page
.
Page
,
GeneratorList
):
class
Category
(
page
.
Page
,
GeneratorList
):
def
__init__
(
self
,
site
,
name
,
info
=
None
,
namespace
=
None
):
def
__init__
(
self
,
site
,
name
,
info
=
None
,
namespace
=
None
):
page
.
Page
.
__init__
(
self
,
site
,
name
,
info
)
page
.
Page
.
__init__
(
self
,
site
,
name
,
info
)
kwargs
=
{
'
gcmcategory
'
:
self
.
strip_namespace
(
self
.
name
)}
kwargs
=
{}
kwargs
.
update
((
compatibility
.
cmtitle
(
self
,
self
.
site
.
require
(
1
,
12
,
raise_error
=
False
),
prefix
=
'
gcm
'
),
))
if
namespace
:
kwargs
[
'
gcmnamespace
'
]
=
namespace
if
namespace
:
kwargs
[
'
gcmnamespace
'
]
=
namespace
GeneratorList
.
__init__
(
self
,
site
,
'
categorymembers
'
,
'
cm
'
,
**
kwargs
)
GeneratorList
.
__init__
(
self
,
site
,
'
categorymembers
'
,
'
cm
'
,
**
kwargs
)
def
__repr__
(
self
):
def
__repr__
(
self
):
...
@@ -128,7 +130,8 @@ class Category(page.Page, GeneratorList):
...
@@ -128,7 +130,8 @@ class Category(page.Page, GeneratorList):
dir
=
'
asc
'
,
start
=
None
,
end
=
None
,
generator
=
True
):
dir
=
'
asc
'
,
start
=
None
,
end
=
None
,
generator
=
True
):
prefix
=
self
.
get_prefix
(
'
cm
'
,
generator
)
prefix
=
self
.
get_prefix
(
'
cm
'
,
generator
)
kwargs
=
dict
(
self
.
generate_kwargs
(
prefix
,
prop
=
prop
,
namespace
=
namespace
,
kwargs
=
dict
(
self
.
generate_kwargs
(
prefix
,
prop
=
prop
,
namespace
=
namespace
,
sort
=
sort
,
dir
=
dir
,
start
=
start
,
end
=
end
))
sort
=
sort
,
dir
=
dir
,
start
=
start
,
end
=
end
,
*
(
compatibility
.
cmtitle
(
self
,
self
.
site
.
require
(
1
,
12
,
raise_error
=
False
)),
)))
return
self
.
get_list
(
generator
)(
self
.
site
,
'
categorymembers
'
,
'
cm
'
,
**
kwargs
)
return
self
.
get_list
(
generator
)(
self
.
site
,
'
categorymembers
'
,
'
cm
'
,
**
kwargs
)
class
PageList
(
GeneratorList
):
class
PageList
(
GeneratorList
):
...
...
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