[MediaWiki-commits] [Gerrit] User.php: Update 'setEmailWithConfirmation' for notification... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: User.php: Update 'setEmailWithConfirmation' for notification email .. User.php: Update 'setEmailWithConfirmation' for notification email In order to minimise the chances of successful account cracking, a notification email should be sent to the user on their previous registered email address, informing them of the change in the registered email address of their account. Bug: T31856 Change-Id: Ib1ef76d7eb45ed0fa7ee0c2e7e39af21289367d2 --- M includes/user/User.php M languages/i18n/en.json M languages/i18n/qqq.json 3 files changed, 32 insertions(+), 2 deletions(-) Approvals: Parent5446: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/user/User.php b/includes/user/User.php index 68a169a..2e786bd 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -2697,14 +2697,36 @@ return Status::newGood( true ); } + $type = $oldaddr != '' ? 'changed' : 'set'; + $notificationResult = null; + + if ( $wgEmailAuthentication ) { + // Send the user an email notifying the user of the change in registered + // email address on their previous email address + if ( $type == 'changed' ) { + $change = $str != '' ? 'changed' : 'removed'; + $notificationResult = $this->sendMail( + wfMessage( 'notificationemail_subject_' . $change )->text(), + wfMessage( 'notificationemail_body_' . $change, + $this->getRequest()->getIP(), + $this->getName(), + $str )->text() + ); + } + } + $this->setEmail( $str ); if ( $str !== '' && $wgEmailAuthentication ) { // Send a confirmation request to the new address if needed - $type = $oldaddr != '' ? 'changed' : 'set'; $result = $this->sendConfirmationMail( $type ); + + if ( $notificationResult !== null ) { + $result->merge( $notificationResult ); + } + if ( $result->isGood() ) { - // Say to the caller that a confirmation mail has been sent + // Say to the caller that a confirmation and notification mail has been sent $result->value = 'eauth'; } } else { diff --git a/languages/i18n/en.json b/languages/i18n/en.json index fea9fbd..5526e2e 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -3344,6 +3344,10 @@ "confirmemail_body_set": "Someone, probably you, from IP address $1,\nhas set the email address of the account \"$2\" to this address on {{SITENAME}}.\n\nTo confirm that this account really does belong to you and activate\nemail features on {{SITENAME}}, open this link in your browser:\n\n$3\n\nIf the account does *not* belong to you, follow this link\nto cancel the email address confirmation:\n\n$5\n\nThis confirmation code will expire at $4.", "confirmemail_invalidated": "Email address confirmation canceled", "invalidateemail": "Cancel email confirmation", + "notificationemail_subject_changed": "{{SITENAME}} registered email address has been changed", + "notificationemail_subject_removed": "{{SITENAME}} registered email address has been removed", + "notificationemail_body_changed": "Someone, probably you, from IP address $1,\nhas changed the email address of the account \"$2\" to \"$3\" on {{SITENAME}}.\n\nIf this was not you, contact a site administrator immediately.", + "notificationemail_body_removed": "Someone, probably you, from IP address $1,\nhas removed the email address of the account \"$2\" on {{SITENAME}}.\n\nIf this was not you, contact a site administrator immediately.", "scarytranscludedisabled": "[Interwiki transcluding is disabled]", "scarytranscludefailed": "[Template fetch failed for $1]", "scarytranscludefailed-httpstatus": "[Template fetch failed for $1: HTTP $2]", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 93a3e79..301e5a6 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -784,6 +784,10 @@ "changeemail-submit": "Submit button on [[Special:ChangeEmail]]", "changeemail-throttled": "Error message shown at [[Special:ChangeEmail]] after the user has tried to login with incorrect password too many times.\n\nThe user has to
[MediaWiki-commits] [Gerrit] labs: Alias floating IPs in wikitextexp project as well - change (operations/puppet)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/282511 Change subject: labs: Alias floating IPs in wikitextexp project as well .. labs: Alias floating IPs in wikitextexp project as well Bug: T132216 Change-Id: Iba9e3aa8fa45f2fe85a1cdb5387a9a8ae8c502be --- M modules/role/manifests/labs/dnsrecursor.pp 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/11/282511/1 diff --git a/modules/role/manifests/labs/dnsrecursor.pp b/modules/role/manifests/labs/dnsrecursor.pp index 2186ca6..fbf73fc 100644 --- a/modules/role/manifests/labs/dnsrecursor.pp +++ b/modules/role/manifests/labs/dnsrecursor.pp @@ -68,6 +68,7 @@ 'toolserver-legacy', 'project-proxy', 'telnet', +'wikitextexp', ], nova_api_url => "http://${nova_controller_hostname}:35357/v2.0;, alias_file => $alias_file, -- To view, visit https://gerrit.wikimedia.org/r/282511 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba9e3aa8fa45f2fe85a1cdb5387a9a8ae8c502be Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] textInputWidget: Consolidate selectors around same property ... - change (oojs/ui)
VolkerE has uploaded a new change for review. https://gerrit.wikimedia.org/r/282510 Change subject: textInputWidget: Consolidate selectors around same property rules .. textInputWidget: Consolidate selectors around same property rules Consolidate selectors around same property rules in textInputWidget. Change-Id: I507c44e490a9e9c35d672e011f65cc205f7db045 --- M src/styles/widgets/TextInputWidget.less 1 file changed, 4 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/10/282510/1 diff --git a/src/styles/widgets/TextInputWidget.less b/src/styles/widgets/TextInputWidget.less index 09b474d..2f90e82 100644 --- a/src/styles/widgets/TextInputWidget.less +++ b/src/styles/widgets/TextInputWidget.less @@ -72,29 +72,19 @@ display: block; } - > .oo-ui-iconElement-icon { + > .oo-ui-iconElement-icon, + &-labelPosition-before > .oo-ui-labelElement-label { left: 0; } - > .oo-ui-indicatorElement-indicator { + > .oo-ui-indicatorElement-indicator, + &-labelPosition-after > .oo-ui-labelElement-label { right: 0; } > .oo-ui-labelElement-label { position: absolute; top: 0; - } - - &-labelPosition-after { - > .oo-ui-labelElement-label { - right: 0 - } - } - - &-labelPosition-before { - > .oo-ui-labelElement-label { - left: 0 - } } .theme-oo-ui-textInputWidget(); -- To view, visit https://gerrit.wikimedia.org/r/282510 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I507c44e490a9e9c35d672e011f65cc205f7db045 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: VolkerE___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] MediaWiki theme: Use disabled color variable for disabled label - change (oojs/ui)
VolkerE has uploaded a new change for review. https://gerrit.wikimedia.org/r/282508 Change subject: MediaWiki theme: Use disabled color variable for disabled label .. MediaWiki theme: Use disabled color variable for disabled label Replace custom color value with disabled color variable in order to have both, input value color and label of disabled textInputWidget unified. Change-Id: Ie970625a400942e132bb45a2e34f2884163b66dc --- M src/themes/mediawiki/widgets.less 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/08/282508/1 diff --git a/src/themes/mediawiki/widgets.less b/src/themes/mediawiki/widgets.less index bb936d7..a874776 100644 --- a/src/themes/mediawiki/widgets.less +++ b/src/themes/mediawiki/widgets.less @@ -637,7 +637,7 @@ opacity: @opacity-disabled; } .oo-ui-labelElement-label { - color: #ddd; + color: @color-disabled; text-shadow: @text-shadow-disabled; } } -- To view, visit https://gerrit.wikimedia.org/r/282508 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie970625a400942e132bb45a2e34f2884163b66dc Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: VolkerE___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Normalize `input[type="search"]` - change (mediawiki/core)
VolkerE has uploaded a new change for review. https://gerrit.wikimedia.org/r/282507 Change subject: Normalize `input[type="search"]` .. Normalize `input[type="search"]` Limiting property `-webkit-appearance` to `input[type="search"]` only, as it's the element this rule is targeting for instead of unnecessarily applying it to all `.mw-ui-input` elements. Also adding rule to remove proprietary IE 10-11 clear button. Bringing it on par with OOjs UI. Change-Id: Id375fdb86bf7ef3cfbb2f7e198d59be4947e4edb --- M resources/src/mediawiki.ui/components/inputs.less 1 file changed, 17 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/07/282507/1 diff --git a/resources/src/mediawiki.ui/components/inputs.less b/resources/src/mediawiki.ui/components/inputs.less index d0633ae..af050eb 100644 --- a/resources/src/mediawiki.ui/components/inputs.less +++ b/resources/src/mediawiki.ui/components/inputs.less @@ -27,8 +27,6 @@ // // Styleguide 1.1. .mw-ui-input { - // turn off default input styling for input[type="search"] fields - -webkit-appearance: none; .box-sizing( border-box ); display: block; width: 100%; @@ -74,6 +72,23 @@ border-color: @colorGray14; color: @colorGray12; } + + // Normalize styling for `` + &[type="search"] { + // Correct the odd appearance in Chrome and Safari 5. + -webkit-appearance: textfield; + + // Remove proprietary clear button in IE 10-11. + &::-ms-clear { + display: none; + } + + // Remove the inner padding and cancel buttons in Chrome on OS X and Safari on OS X. + &::-webkit-search-cancel-button, + &::-webkit-search-decoration { + -webkit-appearance: none; + } + } } textarea.mw-ui-input { -- To view, visit https://gerrit.wikimedia.org/r/282507 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id375fdb86bf7ef3cfbb2f7e198d59be4947e4edb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: VolkerE___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [bugfix] Fix deprecation warning for namespace shortcuts - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [bugfix] Fix deprecation warning for namespace shortcuts .. [bugfix] Fix deprecation warning for namespace shortcuts namespaces.CONSTANT gives the Namespace object not the string. Assigning Namespace to a string adds a colon and prepends one for FILE and CATEGORY Namespace because Namespace.__str__ uses the canonical_prefix method whereas the old shortcuts gives the default localized name which is custom_name property. The deprecation warning should follow this issue. Change-Id: Idaa5e28dccbdd0311b617ec8607c4bbc96d88fa7 --- M pywikibot/site.py 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/site.py b/pywikibot/site.py index c421fbf..b8c69ea 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -1168,27 +1168,27 @@ # namespace shortcuts for backwards-compatibility -@deprecated('namespaces.SPECIAL') +@deprecated('namespaces.SPECIAL.custom_name') def special_namespace(self): """Return local name for the Special: namespace.""" return self.namespace(-1) -@deprecated('namespaces.FILE') +@deprecated('namespaces.FILE.custom_name') def image_namespace(self): """Return local name for the File namespace.""" return self.namespace(6) -@deprecated('namespaces.MEDIAWIKI') +@deprecated('namespaces.MEDIAWIKI.custom_name') def mediawiki_namespace(self): """Return local name for the MediaWiki namespace.""" return self.namespace(8) -@deprecated('namespaces.TEMPLATE') +@deprecated('namespaces.TEMPLATE.custom_name') def template_namespace(self): """Return local name for the Template namespace.""" return self.namespace(10) -@deprecated('namespaces.CATEGORY') +@deprecated('namespaces.CATEGORY.custom_name') def category_namespace(self): """Return local name for the Category namespace.""" return self.namespace(14) -- To view, visit https://gerrit.wikimedia.org/r/282180 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idaa5e28dccbdd0311b617ec8607c4bbc96d88fa7 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [doc] Remove template documentation which is not very helpfu... - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [doc] Remove template documentation which is not very helpful here .. [doc] Remove template documentation which is not very helpful here Also move replacements instantiating where it is needed. Change-Id: I78d30fc0642934bfa5aa8b9e48a8d875461881e1 --- M scripts/image.py 1 file changed, 1 insertion(+), 8 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/image.py b/scripts/image.py index c826178..81ec66d 100755 --- a/scripts/image.py +++ b/scripts/image.py @@ -131,14 +131,6 @@ else self.old_image, fallback=True) -# regular expression to find the original template. -# {{vfd}} does the same thing as {{Vfd}}, so both will be found. -# The old syntax, {{msg:vfd}}, will also be found. -# The group 'parameters' will either match the parameters, or an -# empty string if there are none. - -replacements = [] - namespace = self.site.namespaces[6] if namespace.case == 'first-letter': case = re.escape(self.old_image[0].upper() + @@ -156,6 +148,7 @@ else: image_regex = re.compile(r'' + escaped) +replacements = [] if self.new_image: if not self.getOption('loose'): replacements.append((image_regex, -- To view, visit https://gerrit.wikimedia.org/r/282199 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I78d30fc0642934bfa5aa8b9e48a8d875461881e1 Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Mpaa Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] wikibits: Remove methods deprecated since 1.17 and 1.18 - change (mediawiki/core)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/282506 Change subject: [WIP] wikibits: Remove methods deprecated since 1.17 and 1.18 .. [WIP] wikibits: Remove methods deprecated since 1.17 and 1.18 Keeping importScript and friends, and document.write for now. Bug: T122755 Change-Id: I7f9f61ea81ad1efa0b5cff79b5e5f4bbe2d401fe --- M resources/Resources.php M resources/src/mediawiki.legacy/wikibits.js 2 files changed, 18 insertions(+), 163 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/06/282506/1 diff --git a/resources/Resources.php b/resources/Resources.php index 5cc5681..8644884 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1984,7 +1984,6 @@ ], 'mediawiki.legacy.wikibits' => [ 'scripts' => 'resources/src/mediawiki.legacy/wikibits.js', - 'dependencies' => 'mediawiki.util', 'position' => 'top', 'targets' => [ 'desktop', 'mobile' ], ], diff --git a/resources/src/mediawiki.legacy/wikibits.js b/resources/src/mediawiki.legacy/wikibits.js index 38271a0..a2d6e26 100644 --- a/resources/src/mediawiki.legacy/wikibits.js +++ b/resources/src/mediawiki.legacy/wikibits.js @@ -4,159 +4,7 @@ ( function ( mw, $ ) { var msg, win = window, - ua = navigator.userAgent.toLowerCase(), - onloadFuncts = [], loadedScripts = {}; - - /** -* User-agent sniffing. -* -* @deprecated since 1.17 Use jquery.client instead -*/ - - msg = 'Use feature detection or module jquery.client instead.'; - - mw.log.deprecate( win, 'clientPC', ua, msg ); - - // Ignored dummy values - mw.log.deprecate( win, 'is_gecko', false, msg ); - mw.log.deprecate( win, 'is_chrome_mac', false, msg ); - mw.log.deprecate( win, 'is_chrome', false, msg ); - mw.log.deprecate( win, 'webkit_version', false, msg ); - mw.log.deprecate( win, 'is_safari_win', false, msg ); - mw.log.deprecate( win, 'is_safari', false, msg ); - mw.log.deprecate( win, 'webkit_match', false, msg ); - mw.log.deprecate( win, 'is_ff2', false, msg ); - mw.log.deprecate( win, 'ff2_bugs', false, msg ); - mw.log.deprecate( win, 'is_ff2_win', false, msg ); - mw.log.deprecate( win, 'is_ff2_x11', false, msg ); - mw.log.deprecate( win, 'opera95_bugs', false, msg ); - mw.log.deprecate( win, 'opera7_bugs', false, msg ); - mw.log.deprecate( win, 'opera6_bugs', false, msg ); - mw.log.deprecate( win, 'is_opera_95', false, msg ); - mw.log.deprecate( win, 'is_opera_preseven', false, msg ); - mw.log.deprecate( win, 'is_opera', false, msg ); - mw.log.deprecate( win, 'ie6_bugs', false, msg ); - - /** -* DOM utilities for handling of events, text nodes and selecting elements -* -* @deprecated since 1.17 Use jQuery instead -*/ - msg = 'Use jQuery instead.'; - - // Ignored dummy values - mw.log.deprecate( win, 'doneOnloadHook', undefined, msg ); - mw.log.deprecate( win, 'onloadFuncts', [], msg ); - mw.log.deprecate( win, 'runOnloadHook', $.noop, msg ); - mw.log.deprecate( win, 'changeText', $.noop, msg ); - mw.log.deprecate( win, 'killEvt', $.noop, msg ); - mw.log.deprecate( win, 'addHandler', $.noop, msg ); - mw.log.deprecate( win, 'hookEvent', $.noop, msg ); - mw.log.deprecate( win, 'addClickHandler', $.noop, msg ); - mw.log.deprecate( win, 'removeHandler', $.noop, msg ); - mw.log.deprecate( win, 'getElementsByClassName', function () { return []; }, msg ); - mw.log.deprecate( win, 'getInnerText', function () { return ''; }, msg ); - - // Run a function after the window onload event is fired - mw.log.deprecate( win, 'addOnloadHook', function ( hookFunct ) { - if ( onloadFuncts ) { - onloadFuncts.push( hookFunct ); - } else { - // If func queue is gone the event has happened already, - // run immediately instead of queueing. - hookFunct(); - } - }, msg ); - - $( win ).on( 'load', function () { - var i, functs; - - // Don't run twice - if ( !onloadFuncts ) { - return; - } - - // Deference and clear onloadFuncts before running any - // hooks to make sure we don't miss any addOnloadHook - // calls. - functs = onloadFuncts.slice(); - onloadFuncts = undefined; - - // Execute the queued functions - for ( i = 0; i < functs.length; i++ ) { - functs[ i ](); - } - } );
[MediaWiki-commits] [Gerrit] Add dependency on cite role - change (mediawiki/vagrant)
jenkins-bot has submitted this change and it was merged. Change subject: Add dependency on cite role .. Add dependency on cite role Needed to produce CSS for references in Parsoid HTML Change-Id: I64e1c39297727fb9a899554e581184b846e43389 --- M puppet/modules/role/manifests/mobileapp.pp 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/puppet/modules/role/manifests/mobileapp.pp b/puppet/modules/role/manifests/mobileapp.pp index 4c39367..eb00d70 100644 --- a/puppet/modules/role/manifests/mobileapp.pp +++ b/puppet/modules/role/manifests/mobileapp.pp @@ -3,6 +3,7 @@ # for the Wikimedia Android & iOS Mobile apps class role::mobileapp { include ::role::mobilefrontend +include ::role::cite mediawiki::extension { 'MobileApp': require => Mediawiki::Extension['MobileFrontend'], -- To view, visit https://gerrit.wikimedia.org/r/282497 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64e1c39297727fb9a899554e581184b846e43389 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: MhollowayGerrit-Reviewer: BearND Gerrit-Reviewer: BryanDavis Gerrit-Reviewer: Dbrant Gerrit-Reviewer: Dduvall Gerrit-Reviewer: Niedzielski Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [doc] remove lonely comment - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [doc] remove lonely comment .. [doc] remove lonely comment Change-Id: I42135fff6b045f65cbcb629daca2b3827a345204 --- M scripts/template.py 1 file changed, 0 insertions(+), 6 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/template.py b/scripts/template.py index 783da18..854533e 100755 --- a/scripts/template.py +++ b/scripts/template.py @@ -214,12 +214,6 @@ self.options['summary'] = i18n.twtranslate( site, 'template-changing', params) -# regular expression to find the original template. -# {{vfd}} does the same thing as {{Vfd}}, so both will be found. -# The old syntax, {{msg:vfd}}, will also be found. -# The group 'parameters' will either match the parameters, or an -# empty string if there are none. - replacements = [] exceptions = {} builder = textlib._MultiTemplateMatchBuilder(site) -- To view, visit https://gerrit.wikimedia.org/r/282319 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42135fff6b045f65cbcb629daca2b3827a345204 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: John Vandenberg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] resourceloader: Avoid request overhead for legacy modules - change (mediawiki/core)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/282505 Change subject: [WIP] resourceloader: Avoid request overhead for legacy modules .. [WIP] resourceloader: Avoid request overhead for legacy modules Follows-up 0ac4f998. After d790562, legacy modules (added to the top queue) were no longer consistently loaded before the bottom queue due to the top queue being async. The implied dependency was made explicit by 0ac4f998 by awaiting all modules that aren't themselves a legacy module (or a dependency thereof) on the readiness of the legacy modules. This had a negative side-effect of causing an extra HTTP request because we wrongly assumed that the execute() function would not be called before a module from the top queue request finished loading. Thus we wrongly assumed that this waiting would only re-arrange execution (since the legacy modules were already requested in the top queue, it was intended to just ride along the request for that). Instead, what really happened is that the embedded mw.loader.implement() call for user options and tokens naturally triggers the execute() call before the top queue is processed. It thus forces the loader to, at that point, start a request just for the legacy modules (not knowing there is about to be a request for them already as part of the top queue). This could be fixed by moving the top queue to be before the embedded modules and enforcing the embed in a different way. It could also be fixed by debouncing module load calls so they naturally end up as a single request. However for now I'm addressing this by adding legacy modules to the list of modules in the initial load request from the startup module. This naturally makes them available before all others without much overhead. Change-Id: I54f087655e1cde1b8ff1ca5fe56e82f7f7d80965 --- M includes/resourceloader/ResourceLoaderStartUpModule.php M includes/skins/Skin.php M resources/src/mediawiki/mediawiki.js 3 files changed, 23 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/05/282505/1 diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 34866f3..a2cf193 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -109,7 +109,6 @@ 'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ), 'wgResourceLoaderStorageVersion' => $conf->get( 'ResourceLoaderStorageVersion' ), 'wgResourceLoaderStorageEnabled' => $conf->get( 'ResourceLoaderStorageEnabled' ), - 'wgResourceLoaderLegacyModules' => self::getLegacyModules(), 'wgForeignUploadTargets' => $conf->get( 'ForeignUploadTargets' ), 'wgEnableUploads' => $conf->get( 'EnableUploads' ), ]; @@ -308,7 +307,7 @@ */ public static function getStartupModulesUrl( ResourceLoaderContext $context ) { $rl = $context->getResourceLoader(); - $moduleNames = self::getStartupModules(); + $moduleNames = array_merge( self::getStartupModules(), self::getLegacyModules() ); $query = [ 'modules' => ResourceLoader::makePackedModulesString( $moduleNames ), diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index e5b9cb9..3e47583 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -163,8 +163,6 @@ 'content' => [ 'mediawiki.page.ready', ], - // modules that exist for legacy reasons - 'legacy' => ResourceLoaderStartUpModule::getLegacyModules(), // modules relating to search functionality 'search' => [], // modules relating to functionality relating to watching an article diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 9d799db..a5417ff 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -1250,10 +1250,7 @@ registry[ module ].state = 'executing'; runScript = function () { - var script, markModuleReady, nestedAddScript, legacyWait, - // Expand to include dependencies since we have to exclude both legacy modules - // and their dependencies from the legacyWait (to prevent a circular dependency). - legacyModules = resolve( mw.config.get(
[MediaWiki-commits] [Gerrit] OpenStackNovaUser::inRole: Return false if project doesn't e... - change (mediawiki...OpenStackManager)
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/282504 Change subject: OpenStackNovaUser::inRole: Return false if project doesn't exist .. OpenStackNovaUser::inRole: Return false if project doesn't exist Otherwise users making requests like https://wikitech.wikimedia.org/wiki/Hiera:Deployment-memc04 will be given an HTTP 500 instead of HTTP 404, and an exception gets logged because the OpenStackNovaRole code assumes you pass a valid project object instead of null. Change-Id: I7a25aed805823eb9e481c679837e0772e5082987 --- M nova/OpenStackNovaUser.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenStackManager refs/changes/04/282504/1 diff --git a/nova/OpenStackNovaUser.php b/nova/OpenStackNovaUser.php index b3682ee..a791e89 100644 --- a/nova/OpenStackNovaUser.php +++ b/nova/OpenStackNovaUser.php @@ -242,6 +242,9 @@ } $project = OpenStackNovaProject::getProjectByName( $projectname ); + if ( !$project ) { + return false; + } $role = OpenStackNovaRole::getProjectRoleByName( $role, $project ); if ( ! $role ) { return false; -- To view, visit https://gerrit.wikimedia.org/r/282504 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a25aed805823eb9e481c679837e0772e5082987 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/OpenStackManager Gerrit-Branch: master Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Do not validate relevant user name - change (mediawiki/core)
Rillke has uploaded a new change for review. https://gerrit.wikimedia.org/r/282503 Change subject: Do not validate relevant user name .. Do not validate relevant user name - This make Special:Log's behaviour consistent with other special pages, e.g. Special:Contributions. Change-Id: Ic0a9322d920d7514bacac1f29a1da4fe57cae854 --- M includes/logging/LogPager.php M includes/specials/SpecialLog.php 2 files changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/03/282503/1 diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index 410c970..3d04641 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -384,6 +384,8 @@ } /** +* Guaranteed to either return a valid title string or a Zero-Length String +* * @return string */ public function getPerformer() { diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index bbe0e0d..af087a6 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -187,7 +187,8 @@ # Set relevant user if ( $pager->getPerformer() ) { - $this->getSkin()->setRelevantUser( User::newFromName( $pager->getPerformer() ) ); + $performerUser = User::newFromName( $pager->getPerformer(), false ); + $this->getSkin()->setRelevantUser( $performerUser ); } # Show form options -- To view, visit https://gerrit.wikimedia.org/r/282503 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0a9322d920d7514bacac1f29a1da4fe57cae854 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Rillke___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove no longer needed type="search" style reset - change (mediawiki...Metrolook)
Ebrahim has uploaded a new change for review. https://gerrit.wikimedia.org/r/282502 Change subject: Remove no longer needed type="search" style reset .. Remove no longer needed type="search" style reset Depends on I66c7808d02f2b2d5e7091d4fe94b007a22b57568 Bug: T132272 Change-Id: Ia659dfe8e62b4365a57539a1f021463f8d4f1dd0 --- M components/search.less 1 file changed, 0 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Metrolook refs/changes/02/282502/1 diff --git a/components/search.less b/components/search.less index b1f8560..605081e 100644 --- a/components/search.less +++ b/components/search.less @@ -68,17 +68,6 @@ &:-moz-placeholder { color: #999; } - - // Undo the styles Webkit browsers apply to type=search fields, - // we provide our own - -webkit-appearance: textfield; - - &::-webkit-search-decoration, - &::-webkit-search-cancel-button, - &::-webkit-search-results-button, - &::-webkit-search-results-decoration { - -webkit-appearance: textfield; - } } // The buttons. They are displayed in the same position, and if both are -- To view, visit https://gerrit.wikimedia.org/r/282502 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia659dfe8e62b4365a57539a1f021463f8d4f1dd0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Metrolook Gerrit-Branch: master Gerrit-Owner: Ebrahim___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove no longer needed type="search" style reset - change (mediawiki...Vector)
Ebrahim has uploaded a new change for review. https://gerrit.wikimedia.org/r/282500 Change subject: Remove no longer needed type="search" style reset .. Remove no longer needed type="search" style reset Depends on I66c7808d02f2b2d5e7091d4fe94b007a22b57568 Bug: T132272 Change-Id: I1496a5750da3f170112a2841a25c4d9f0ac241ce --- M components/search.less 1 file changed, 0 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector refs/changes/00/282500/1 diff --git a/components/search.less b/components/search.less index 75a0796..ae40ff6 100644 --- a/components/search.less +++ b/components/search.less @@ -71,17 +71,6 @@ &:-moz-placeholder { color: #999; } - - // Undo the styles Webkit browsers apply to type=search fields, - // we provide our own - -webkit-appearance: textfield; - - &::-webkit-search-decoration, - &::-webkit-search-cancel-button, - &::-webkit-search-results-button, - &::-webkit-search-results-decoration { - -webkit-appearance: textfield; - } } // The buttons. They are displayed in the same position, and if both are -- To view, visit https://gerrit.wikimedia.org/r/282500 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1496a5750da3f170112a2841a25c4d9f0ac241ce Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Vector Gerrit-Branch: master Gerrit-Owner: Ebrahim___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove no longer needed type="search" style reset - change (mediawiki...VectorV2)
Ebrahim has uploaded a new change for review. https://gerrit.wikimedia.org/r/282501 Change subject: Remove no longer needed type="search" style reset .. Remove no longer needed type="search" style reset Depends on I66c7808d02f2b2d5e7091d4fe94b007a22b57568 Bug: T132272 Change-Id: Ie706c904975a6ed9da6276c607da3ced9210dcbb --- M components/search.less 1 file changed, 0 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/VectorV2 refs/changes/01/282501/1 diff --git a/components/search.less b/components/search.less index 75a0796..ae40ff6 100644 --- a/components/search.less +++ b/components/search.less @@ -71,17 +71,6 @@ &:-moz-placeholder { color: #999; } - - // Undo the styles Webkit browsers apply to type=search fields, - // we provide our own - -webkit-appearance: textfield; - - &::-webkit-search-decoration, - &::-webkit-search-cancel-button, - &::-webkit-search-results-button, - &::-webkit-search-results-decoration { - -webkit-appearance: textfield; - } } // The buttons. They are displayed in the same position, and if both are -- To view, visit https://gerrit.wikimedia.org/r/282501 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie706c904975a6ed9da6276c607da3ced9210dcbb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/VectorV2 Gerrit-Branch: master Gerrit-Owner: Ebrahim___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove type="search" use from MediaWiki core - change (mediawiki/core)
Ebrahim has uploaded a new change for review. https://gerrit.wikimedia.org/r/282499 Change subject: Remove type="search" use from MediaWiki core .. Remove type="search" use from MediaWiki core Bug: T132272 Change-Id: I66c7808d02f2b2d5e7091d4fe94b007a22b57568 --- M includes/skins/BaseTemplate.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/99/282499/1 diff --git a/includes/skins/BaseTemplate.php b/includes/skins/BaseTemplate.php index 3408db3..cb32ea3 100644 --- a/includes/skins/BaseTemplate.php +++ b/includes/skins/BaseTemplate.php @@ -474,7 +474,7 @@ function makeSearchInput( $attrs = [] ) { $realAttrs = [ - 'type' => 'search', + 'type' => 'text', 'name' => 'search', 'placeholder' => wfMessage( 'searchsuggest-search' )->text(), 'value' => $this->get( 'search', '' ), -- To view, visit https://gerrit.wikimedia.org/r/282499 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I66c7808d02f2b2d5e7091d4fe94b007a22b57568 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ebrahim___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove old beta bits check - change (operations/puppet)
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/282498 Change subject: Remove old beta bits check .. Remove old beta bits check This was pointing at Apaches directly which no longer serve bits.beta.wmflabs.org directly (they give 404s), Varnish on deployment-cache-text04 rewrites the URLs instead now. Change-Id: I8338fe96b34eedf21646a8f9dfb80cde34c02f04 --- M modules/beta/files/shinken.cfg 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/98/282498/1 diff --git a/modules/beta/files/shinken.cfg b/modules/beta/files/shinken.cfg index b82cbdc..1b5c6a3 100644 --- a/modules/beta/files/shinken.cfg +++ b/modules/beta/files/shinken.cfg @@ -28,13 +28,6 @@ } define service { -service_description App Server bits response -hostgroup_name role::mediawiki::appserver -use generic-service -check_command check_http_url!bits.beta.wmflabs.org!/en.wikipedia.beta.wmflabs.org/load.php -} - -define service { service_description Parsoid hostgroup_name role::parsoid::beta use generic-service -- To view, visit https://gerrit.wikimedia.org/r/282498 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8338fe96b34eedf21646a8f9dfb80cde34c02f04 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add dependency on cite role - change (mediawiki/vagrant)
Mholloway has uploaded a new change for review. https://gerrit.wikimedia.org/r/282497 Change subject: Add dependency on cite role .. Add dependency on cite role Needed to produce CSS for references in Parsoid HTML Change-Id: I64e1c39297727fb9a899554e581184b846e43389 --- M puppet/modules/role/manifests/mobileapp.pp 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/97/282497/1 diff --git a/puppet/modules/role/manifests/mobileapp.pp b/puppet/modules/role/manifests/mobileapp.pp index 4c39367..eb00d70 100644 --- a/puppet/modules/role/manifests/mobileapp.pp +++ b/puppet/modules/role/manifests/mobileapp.pp @@ -3,6 +3,7 @@ # for the Wikimedia Android & iOS Mobile apps class role::mobileapp { include ::role::mobilefrontend +include ::role::cite mediawiki::extension { 'MobileApp': require => Mediawiki::Extension['MobileFrontend'], -- To view, visit https://gerrit.wikimedia.org/r/282497 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64e1c39297727fb9a899554e581184b846e43389 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Mholloway___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [pep8] keep lines beneah 80 chars - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: [pep8] keep lines beneah 80 chars .. [pep8] keep lines beneah 80 chars Change-Id: Ib3a6a69caad91de5ce236a01d683c50e9477feee --- M imagereview.py 1 file changed, 35 insertions(+), 25 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/imagereview.py b/imagereview.py index 54fe982..9a34a77 100644 --- a/imagereview.py +++ b/imagereview.py @@ -31,8 +31,6 @@ # # Distributed under the terms of the MIT license. # -# Automatically ported from compat branch by compat2core.py script -# __version__ = '$Id: ad511bf05dad0151d2526eb3f1b48be67e15b440 $' # @@ -254,9 +252,9 @@ r, sep, self.remark = r.partition('=') if r not in DUP_REASONS: valid = False -pywikibot.output(u'\nIgnoriere %s: ' - u'Grund %s wird nicht bearbeitet' - % (self, r if r else u'(keiner angegeben)')) +pywikibot.output( +'\nIgnoriere %s: Grund %s wird nicht bearbeitet' +% (self, r if r else '(keiner angegeben)')) break else: valid = False @@ -295,12 +293,14 @@ if self.getOption('list'): self.dest = u'Benutzer:Quedel/Datei/DÜP-Eingang' self.sort = 1 # timestamp -self.summary = u'Bot: Aktualisiere unbenutzte Dateien, sortiert nach Datum' +self.summary = ('Bot: Aktualisiere unbenutzte Dateien, ' +'sortiert nach Datum') self.filter = True # List unreferences Files only elif self.getOption('check'): self.dest = u'Benutzer:xqbot/DÜP-Log' self.sort = 0 # uploader -self.summary = u'Bot: Aktualisiere bearbeitete Dateien, sortiert nach Uploader' +self.summary = ('Bot: Aktualisiere bearbeitete Dateien, ' +'sortiert nach Uploader') self.filter = False elif self.getOption('review'): pass @@ -527,8 +527,9 @@ pywikibot.output(u'%s has mail enabled.' % user) param['list'] = u'\r\n# '.join( [u"https://de.wikipedia.org/wiki/%s - Problem%s: %s%s" - % (a[2].title(asUrl=True), u'e' if len(a[3][0]) != 1 else u'', -u', '.join(sorted(a[3][0])), + % (a[2].title(asUrl=True), +'e' if len(a[3][0]) != 1 else '', +', '.join(sorted(a[3][0])), hint_str % {'num': a[3][1]} if a[3][1] > 0 else u'') for a in data]) @@ -543,9 +544,10 @@ text = mail_msg % param # upm = pywikibot.User(self.site, u'Xqt') pywikibot.output(text) -if upm.sendMail(subject=u'Bot: Neue Nachricht von der Wikipedia-Dateiüberprüfung an %s' -% user, -text=text): +if upm.sendMail( +subject='Bot: Neue Nachricht von der ' +'Wikipedia-Dateiüberprüfung an {0}'.format(user), +text=text): self.mails += 1 if where: where += u'+Mail' @@ -571,9 +573,11 @@ text = i.get() if self.getOption('check'): if i.hasRefs: -inline = u'\n{{Dateiüberprüfung/benachrichtigt (Verwendung)|~|' +inline = ('\n{{Dateiüberprüfung/benachrichtigt (Verwendung)' + '|~|') for ref in i.usingPages(): -inline += u'\n{{Dateiüberprüfung/benachrichtigt (einzelne Verwendung)|%s}}' % ref.title() +inline += ('\n{{Dateiüberprüfung/benachrichtigt ' + '(einzelne Verwendung)|%s}}' % ref.title()) inline += u'\n}}' else: inline = u'' @@ -596,10 +600,11 @@ reasons = '|'.join(sorted(i.reasons)) if i.remark: reasons += '|7=Hinweis=%s' % i.remark -text = re.sub(u'(?is)\{\{%s *\|(.*?)\}\}' % firstTmpl, - u'{{Dateiüberprüfung/benachrichtigt (Vermerk)|%s|%s|3=}}\n' - u'{{subst:Dateiüberprüfung/benachrichtigt|%s}}%s' % (user, where, reasons, inline), - text) +text = re.sub( +'(?is)\{\{%s *\|(.*?)\}\}' % firstTmpl, +'{{Dateiüberprüfung/benachrichtigt (Vermerk)|%s|%s|3=}}' +
[MediaWiki-commits] [Gerrit] [pep8] keep lines beneah 80 chars - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282496 Change subject: [pep8] keep lines beneah 80 chars .. [pep8] keep lines beneah 80 chars Change-Id: Ib3a6a69caad91de5ce236a01d683c50e9477feee --- M imagereview.py M tox.ini 2 files changed, 36 insertions(+), 25 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/96/282496/1 diff --git a/imagereview.py b/imagereview.py index 54fe982..d6adaf1 100644 --- a/imagereview.py +++ b/imagereview.py @@ -31,8 +31,6 @@ # # Distributed under the terms of the MIT license. # -# Automatically ported from compat branch by compat2core.py script -# __version__ = '$Id: ad511bf05dad0151d2526eb3f1b48be67e15b440 $' # @@ -254,9 +252,9 @@ r, sep, self.remark = r.partition('=') if r not in DUP_REASONS: valid = False -pywikibot.output(u'\nIgnoriere %s: ' - u'Grund %s wird nicht bearbeitet' - % (self, r if r else u'(keiner angegeben)')) +pywikibot.output( +'\nIgnoriere %s: Grund %s wird nicht bearbeitet' +% (self, r if r else '(keiner angegeben)')) break else: valid = False @@ -295,12 +293,14 @@ if self.getOption('list'): self.dest = u'Benutzer:Quedel/Datei/DÜP-Eingang' self.sort = 1 # timestamp -self.summary = u'Bot: Aktualisiere unbenutzte Dateien, sortiert nach Datum' +self.summary = ('Bot: Aktualisiere unbenutzte Dateien, ' +'sortiert nach Datum') self.filter = True # List unreferences Files only elif self.getOption('check'): self.dest = u'Benutzer:xqbot/DÜP-Log' self.sort = 0 # uploader -self.summary = u'Bot: Aktualisiere bearbeitete Dateien, sortiert nach Uploader' +self.summary = ('Bot: Aktualisiere bearbeitete Dateien, ' +'sortiert nach Uploader') self.filter = False elif self.getOption('review'): pass @@ -527,8 +527,9 @@ pywikibot.output(u'%s has mail enabled.' % user) param['list'] = u'\r\n# '.join( [u"https://de.wikipedia.org/wiki/%s - Problem%s: %s%s" - % (a[2].title(asUrl=True), u'e' if len(a[3][0]) != 1 else u'', -u', '.join(sorted(a[3][0])), + % (a[2].title(asUrl=True), +'e' if len(a[3][0]) != 1 else '', +', '.join(sorted(a[3][0])), hint_str % {'num': a[3][1]} if a[3][1] > 0 else u'') for a in data]) @@ -543,9 +544,10 @@ text = mail_msg % param # upm = pywikibot.User(self.site, u'Xqt') pywikibot.output(text) -if upm.sendMail(subject=u'Bot: Neue Nachricht von der Wikipedia-Dateiüberprüfung an %s' -% user, -text=text): +if upm.sendMail( +subject='Bot: Neue Nachricht von der ' +'Wikipedia-Dateiüberprüfung an {0}'.format(user), +text=text): self.mails += 1 if where: where += u'+Mail' @@ -571,9 +573,11 @@ text = i.get() if self.getOption('check'): if i.hasRefs: -inline = u'\n{{Dateiüberprüfung/benachrichtigt (Verwendung)|~|' +inline = ('\n{{Dateiüberprüfung/benachrichtigt (Verwendung)' + '|~|') for ref in i.usingPages(): -inline += u'\n{{Dateiüberprüfung/benachrichtigt (einzelne Verwendung)|%s}}' % ref.title() +inline += ('\n{{Dateiüberprüfung/benachrichtigt ' + '(einzelne Verwendung)|%s}}' % ref.title() inline += u'\n}}' else: inline = u'' @@ -596,10 +600,11 @@ reasons = '|'.join(sorted(i.reasons)) if i.remark: reasons += '|7=Hinweis=%s' % i.remark -text = re.sub(u'(?is)\{\{%s *\|(.*?)\}\}' % firstTmpl, - u'{{Dateiüberprüfung/benachrichtigt (Vermerk)|%s|%s|3=}}\n' - u'{{subst:Dateiüberprüfung/benachrichtigt|%s}}%s' % (user, where, reasons, inline), - text) +text = re.sub( +'(?is)\{\{%s *\|(.*?)\}\}' % firstTmpl, +
[MediaWiki-commits] [Gerrit] Fix wgCopyUploadsDomains on Commons Beta - change (operations/mediawiki-config)
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/282495 Change subject: Fix wgCopyUploadsDomains on Commons Beta .. Fix wgCopyUploadsDomains on Commons Beta Commit 6528c0be has rewritten the wgCopyUploadsDomains setting for commonswiki in Labs. This site is also used by GLAM people for GWT training, so regular whitelisted domains are still needed too. Thanks to Kelson to have reported this issue. Change-Id: Iaac0468b9f532e21db3cf715ef613c0dd4cf3e91 --- M wmf-config/CommonSettings-labs.php M wmf-config/InitialiseSettings-labs.php 2 files changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/95/282495/1 diff --git a/wmf-config/CommonSettings-labs.php b/wmf-config/CommonSettings-labs.php index 59de815..1e4c3d0 100644 --- a/wmf-config/CommonSettings-labs.php +++ b/wmf-config/CommonSettings-labs.php @@ -346,6 +346,11 @@ $wgMessageCacheType = CACHE_ACCEL; +// Let Beta Cluster Commons do upload-from-URL from production Commons. +if ( $wgDBname == 'commonswiki' ) { + $wgCopyUploadsDomains[] = 'upload.wikimedia.org'; +} + // Test of new import source configuration on labs cluster $wgImportSources = false; include( "$wmfConfigDir/import.php" ); diff --git a/wmf-config/InitialiseSettings-labs.php b/wmf-config/InitialiseSettings-labs.php index f5be518..ce66925 100644 --- a/wmf-config/InitialiseSettings-labs.php +++ b/wmf-config/InitialiseSettings-labs.php @@ -640,10 +640,6 @@ 'wmgUseCollection' => array( 'zhwiki' => true, // T128425 ), - // Let Beta Cluster Commons do upload-from-URL from production Commons. - 'wgCopyUploadsDomains' => array( - '+commonswiki' => array( 'upload.wikimedia.org' ) - ), 'wgMaxUploadSize' => array( // Affects URL uploads and chunked uploads (experimental). // Limit on other web uploads is enforced by PHP. -- To view, visit https://gerrit.wikimedia.org/r/282495 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaac0468b9f532e21db3cf715ef613c0dd4cf3e91 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [tox] tox.ini changes - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282494 Change subject: [tox] tox.ini changes .. [tox] tox.ini changes Change-Id: Ia4e7b27185841a778080b6959b120fb7db35346f --- M tox.ini 1 file changed, 17 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/94/282494/1 diff --git a/tox.ini b/tox.ini index f933ea3..6a6582c 100644 --- a/tox.ini +++ b/tox.ini @@ -36,18 +36,23 @@ flake8-putty>=0.2.0 [flake8] -; D102 Missing docstring -; D103 Missing docstring -; D211: No blank lines allowed before class docstring -; E115 expected an indented block (comment) -; E266 too many leading '#' for block comment -; E402 module level import not at top of file (T87409) -; FI10,FI12,FI13,FI15: __future__ import "division", "with_statement", "print_function" and "generator_stop" missing -; FI5: __future__ import "x" present -; P102,P103: string does contain unindexed parameters; see I36355923 -ignore = D102,D103,D211,E115,E266,E402,FI10,FI12,FI15,FI5,P102 -exclude = .tox,.git,./*.egg,ez_setup.py,build,*__init__* -max_line_length = 289 +# D211: No blank lines allowed before class docstring +# E115 expected an indented block (comment) +# E266 too many leading '#' for block comment +# FI10,FI12,FI13,FI15: __future__ import "division", "with_statement", "print_function" and "generator_stop" missing +# FI5: __future__ import "x" present +# P102,P103: string does contain unindexed parameters; see I36355923 +# to be fixed: +# D102: Missing docstring in public method +# D103: Missing docstring in public function +# E402: module level import not at top of file; see T87409 +ignore = E402,D211,E115,E266,FI10,FI12,FI15,FI5,P102 +exclude = .tox,.git,./*.egg,ez_setup.py,build +max_line_length = 100 +accept-encodings = utf-8 +require-code = true +putty-ignore = +afd-notice.py,checkvotes.py,vandalism.py : +D102, D103 [pep8] ignore = E402 -- To view, visit https://gerrit.wikimedia.org/r/282494 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia4e7b27185841a778080b6959b120fb7db35346f Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: Xqt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add note that IP::isInRange() can return unexpected results ... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add note that IP::isInRange() can return unexpected results for invalid args .. Add note that IP::isInRange() can return unexpected results for invalid args Also change to use @note tags in IP class. Bug: T124117 Change-Id: Ia81bb1669f55ebfc559121f5d7166be9e3fa2b6f --- M includes/utils/IP.php 1 file changed, 8 insertions(+), 5 deletions(-) Approvals: Florianschmidtwelzow: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/utils/IP.php b/includes/utils/IP.php index bcc2ed3..4a2205e 100644 --- a/includes/utils/IP.php +++ b/includes/utils/IP.php @@ -73,7 +73,7 @@ /** * Determine if a string is as valid IP address or network (CIDR prefix). * SIIT IPv4-translated addresses are rejected. -* Note: canonicalize() tries to convert translated addresses to IPv4. +* @note canonicalize() tries to convert translated addresses to IPv4. * * @param string $ip Possible IP address * @return bool @@ -84,7 +84,7 @@ /** * Given a string, determine if it as valid IP in IPv6 only. -* Note: Unlike isValid(), this looks for networks too. +* @note Unlike isValid(), this looks for networks too. * * @param string $ip Possible IP address * @return bool @@ -95,7 +95,7 @@ /** * Given a string, determine if it as valid IP in IPv4 only. -* Note: Unlike isValid(), this looks for networks too. +* @note Unlike isValid(), this looks for networks too. * * @param string $ip Possible IP address * @return bool @@ -107,7 +107,7 @@ /** * Validate an IP address. Ranges are NOT considered valid. * SIIT IPv4-translated addresses are rejected. -* Note: canonicalize() tries to convert translated addresses to IPv4. +* @note canonicalize() tries to convert translated addresses to IPv4. * * @param string $ip * @return bool True if it is valid @@ -120,7 +120,7 @@ /** * Validate an IP Block (valid address WITH a valid prefix). * SIIT IPv4-translated addresses are rejected. -* Note: canonicalize() tries to convert translated addresses to IPv4. +* @note canonicalize() tries to convert translated addresses to IPv4. * * @param string $ipblock * @return bool True if it is valid @@ -633,6 +633,9 @@ * @param string $addr The address to check against the given range. * @param string $range The range to check the given address against. * @return bool Whether or not the given address is in the given range. +* +* @note This can return unexpected results for invalid arguments! +* Make sure you pass a valid IP address and IP range. */ public static function isInRange( $addr, $range ) { $hexIP = self::toHex( $addr ); -- To view, visit https://gerrit.wikimedia.org/r/275564 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia81bb1669f55ebfc559121f5d7166be9e3fa2b6f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: GlaisherGerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove a tab from abusefilter-exception-notenoughargs - change (mediawiki...AbuseFilter)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/282493 Change subject: Remove a tab from abusefilter-exception-notenoughargs .. Remove a tab from abusefilter-exception-notenoughargs It seems generally unnecessary, looks weird in translatewiki.net, and is not translated to most languages. Change-Id: If17cd4594b283cbadfda7dd0135cc5a5b2931f25 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/93/282493/1 diff --git a/i18n/en.json b/i18n/en.json index 9017b71..16e737d 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -322,7 +322,7 @@ "abusefilter-exception-noparams": "No parameters given to function \"$2\" at character $1.", "abusefilter-exception-dividebyzero": "Illegal attempt to divide $2 by zero at character $1.", "abusefilter-exception-unrecognisedvar": "Unrecognized variable $2 at character $1.", - "abusefilter-exception-notenoughargs": "Not enough arguments to function $2 called at character $1.\n\tExpected $3 {{PLURAL:$3|argument|arguments}}, got $4", + "abusefilter-exception-notenoughargs": "Not enough arguments to function $2 called at character $1.\nExpected $3 {{PLURAL:$3|argument|arguments}}, got $4", "abusefilter-exception-regexfailure": "Error in regular expression \"$3\" at character $1: \"$2\"", "abusefilter-exception-overridebuiltin": "Illegal overriding of built-in variable \"$2\" at character $1.", "abusefilter-exception-outofbounds": "Requesting non-existent list item $2 (list size = $3) at character $1.", -- To view, visit https://gerrit.wikimedia.org/r/282493 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If17cd4594b283cbadfda7dd0135cc5a5b2931f25 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Amire80___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add spaces inside templates - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: Add spaces inside templates .. Add spaces inside templates Change-Id: I00ba6c94dbbce8aac6a1bac3851342e6275e9937 --- M imagereview.py 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/imagereview.py b/imagereview.py index 17eb097..54fe982 100644 --- a/imagereview.py +++ b/imagereview.py @@ -581,13 +581,13 @@ summary += u', Vorlage:Information ergänzt' inline += """ {{Information -|Beschreibung = -|Quelle = -|Urheber = -|Datum= -|Genehmigung = -|Andere Versionen = -|Anmerkungen = +| Beschreibung = +| Quelle = +| Urheber = +| Datum= +| Genehmigung = +| Andere Versionen = +| Anmerkungen = }} """ # noqa firstTmpl = tmpl.pop(0) -- To view, visit https://gerrit.wikimedia.org/r/282492 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00ba6c94dbbce8aac6a1bac3851342e6275e9937 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add spaces inside templates - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282492 Change subject: Add spaces inside templates .. Add spaces inside templates Change-Id: I00ba6c94dbbce8aac6a1bac3851342e6275e9937 --- M imagereview.py 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/92/282492/1 diff --git a/imagereview.py b/imagereview.py index 17eb097..54fe982 100644 --- a/imagereview.py +++ b/imagereview.py @@ -581,13 +581,13 @@ summary += u', Vorlage:Information ergänzt' inline += """ {{Information -|Beschreibung = -|Quelle = -|Urheber = -|Datum= -|Genehmigung = -|Andere Versionen = -|Anmerkungen = +| Beschreibung = +| Quelle = +| Urheber = +| Datum= +| Genehmigung = +| Andere Versionen = +| Anmerkungen = }} """ # noqa firstTmpl = tmpl.pop(0) -- To view, visit https://gerrit.wikimedia.org/r/282492 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00ba6c94dbbce8aac6a1bac3851342e6275e9937 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: Xqt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [compat2core] replace deprecated parts - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: [compat2core] replace deprecated parts .. [compat2core] replace deprecated parts - image_namespace() -> namespaces.FILE.custom_name - timestamp.toISOformat() -> timestamp.isoformat() Change-Id: I8a3f1d81ca0101a759d05502cfe7d230e1172ef1 --- M imagereview.py 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/imagereview.py b/imagereview.py index eec4996..17eb097 100644 --- a/imagereview.py +++ b/imagereview.py @@ -351,7 +351,7 @@ self.source)) gen = pagegenerators.CategorizedPageGenerator(cat) gen = pagegenerators.NamespaceFilterPageGenerator( -gen, self.site.image_namespace()) +gen, self.site.namespaces.FILE.custom_name) if not self.filter: gen = pagegenerators.PreloadingGenerator(gen) # gen = pagegenerators.ImageGenerator(gen) @@ -627,7 +627,7 @@ pywikibot.output(u'Processing %d images...' % self.total) for image in self.generator: uploader = [image.oldest_file_info.user, -image.oldest_file_info.timestamp.toISOformat()] +image.oldest_file_info.timestamp.isoformat()] sortkey = uploader[self.sort] if sortkey not in table: -- To view, visit https://gerrit.wikimedia.org/r/282491 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a3f1d81ca0101a759d05502cfe7d230e1172ef1 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [compat2core] replace deprecated parts - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282491 Change subject: [compat2core] replace deprecated parts .. [compat2core] replace deprecated parts - image_namespace() -> namespaces.FILE.custom_name - timestamp.toISOformat() -> timestamp.isoformat() Change-Id: I8a3f1d81ca0101a759d05502cfe7d230e1172ef1 --- M imagereview.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/91/282491/1 diff --git a/imagereview.py b/imagereview.py index eec4996..17eb097 100644 --- a/imagereview.py +++ b/imagereview.py @@ -351,7 +351,7 @@ self.source)) gen = pagegenerators.CategorizedPageGenerator(cat) gen = pagegenerators.NamespaceFilterPageGenerator( -gen, self.site.image_namespace()) +gen, self.site.namespaces.FILE.custom_name) if not self.filter: gen = pagegenerators.PreloadingGenerator(gen) # gen = pagegenerators.ImageGenerator(gen) @@ -627,7 +627,7 @@ pywikibot.output(u'Processing %d images...' % self.total) for image in self.generator: uploader = [image.oldest_file_info.user, -image.oldest_file_info.timestamp.toISOformat()] +image.oldest_file_info.timestamp.isoformat()] sortkey = uploader[self.sort] if sortkey not in table: -- To view, visit https://gerrit.wikimedia.org/r/282491 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a3f1d81ca0101a759d05502cfe7d230e1172ef1 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: Xqt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [compat2xore] replace deprecated parts - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: [compat2xore] replace deprecated parts .. [compat2xore] replace deprecated parts - replace ImagePage with FilePage - replace category_namespace() with namespaces.CATEGORY.custom_name - replace getFirstUploader() with [image.oldest_file_info.user, image.oldest_file_info.timestamp.toISOformat()] - replace defaultNamespace=14 with ns=Namespace.CATEGORY - also some changes to tox.ini Change-Id: I3aeb10e591a0b848b8c54eb79f7d4350775c1561 --- M imagereview.py M tox.ini 2 files changed, 11 insertions(+), 6 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/imagereview.py b/imagereview.py index b34eac8..eec4996 100644 --- a/imagereview.py +++ b/imagereview.py @@ -42,6 +42,7 @@ import pywikibot from pywikibot import pagegenerators, textlib +from pywikibot.site import Namespace remark = { '1923': @@ -216,7 +217,7 @@ def __init__(self, site, title, text=None, timestamp=None): """Constructor.""" -pywikibot.ImagePage.__init__(self, site, title) +pywikibot.FilePage.__init__(self, site, title) self._contents = text # NOTE: self.templates is already used by FilePage in core # but it isn't in compat. @@ -346,7 +347,7 @@ def generator(self): cat = pywikibot.Category(self.site, "%s:%s" - % (self.site.category_namespace(), + % (self.site.namespaces.CATEGORY.custom_name, self.source)) gen = pagegenerators.CategorizedPageGenerator(cat) gen = pagegenerators.NamespaceFilterPageGenerator( @@ -625,7 +626,9 @@ if self.getOption('check'): pywikibot.output(u'Processing %d images...' % self.total) for image in self.generator: -uploader = image.getFirstUploader() +uploader = [image.oldest_file_info.user, +image.oldest_file_info.timestamp.toISOformat()] + sortkey = uploader[self.sort] if sortkey not in table: table[sortkey] = [] @@ -645,7 +648,7 @@ |- ''' if self.getOption('check'): -cat = pywikibot.Page(self.site, self.cat, defaultNamespace=14) +cat = pywikibot.Page(self.site, self.cat, ns=Namespace.CATEGORY) try: cattext = cat.get() except pywikibot.NoPage: diff --git a/tox.ini b/tox.ini index 9a78977..f933ea3 100644 --- a/tox.ini +++ b/tox.ini @@ -19,8 +19,9 @@ commands = flake8 {posargs} basepython = python2.7 deps = flake8 - git+https://github.com/pyflakes/pyflakes.git + pyflakes >= 1.1 flake8-docstrings<0.2.2 + flake8-putty>=0.2.0 flake8-coding flake8-future-import flake8-string-format @@ -30,8 +31,9 @@ commands = flake8 {posargs} basepython = python3 deps = flake8 - git+https://github.com/pyflakes/pyflakes.git + pyflakes >= 1.1 flake8-docstrings<0.2.2 + flake8-putty>=0.2.0 [flake8] ; D102 Missing docstring -- To view, visit https://gerrit.wikimedia.org/r/282490 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3aeb10e591a0b848b8c54eb79f7d4350775c1561 Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Show absolute block expiry in user timezone on block logs - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Show absolute block expiry in user timezone on block logs .. Show absolute block expiry in user timezone on block logs For this add an user parameter to Language::translateBlockExpiry. This allows the function to display the absolute block expiry in the user's time zone. Use this when formatting block log entries. This also avoids the use of $wgUser Bug: T131241 Change-Id: If0a1d3c88bb4242a016eb9b2df115413de786149 --- M includes/logging/BlockLogFormatter.php M languages/Language.php M languages/classes/LanguageFi.php 3 files changed, 11 insertions(+), 7 deletions(-) Approvals: Florianschmidtwelzow: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/logging/BlockLogFormatter.php b/includes/logging/BlockLogFormatter.php index aa90d1d..21e40ec 100644 --- a/includes/logging/BlockLogFormatter.php +++ b/includes/logging/BlockLogFormatter.php @@ -58,7 +58,8 @@ // is shown on the correct side of the tooltip text. $durationTooltip = '' . htmlspecialchars( $params[4] ); $params[4] = Message::rawParam( "" . - $this->context->getLanguage()->translateBlockExpiry( $params[4] ) . '' ); + $this->context->getLanguage()->translateBlockExpiry( $params[4], + $this->context->getUser() ) . '' ); $params[5] = isset( $params[5] ) ? self::formatBlockFlags( $params[5], $this->context->getLanguage() ) : ''; } diff --git a/languages/Language.php b/languages/Language.php index f13f9d6..4af4830 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -3966,10 +3966,11 @@ * match up with it. * * @param string $str The validated block duration in English +* @param User $user User object to use timezone from or null for $wgUser * @return string Somehow translated block duration * @see LanguageFi.php for example implementation */ - function translateBlockExpiry( $str ) { + function translateBlockExpiry( $str, User $user = null ) { $duration = SpecialBlock::getSuggestedDurations( $this ); foreach ( $duration as $show => $value ) { if ( strcmp( $str, $value ) == 0 ) { @@ -3995,10 +3996,12 @@ } else { // It's an absolute timestamp. if ( $time === 0 ) { // wfTimestamp() handles 0 as current time instead of epoch. - return $this->timeanddate( '1970010100' ); - } else { - return $this->timeanddate( $time ); + $time = '1970010100'; } + if ( $user ) { + return $this->userTimeAndDate( $time, $user ); + } + return $this->timeanddate( $time ); } } diff --git a/languages/classes/LanguageFi.php b/languages/classes/LanguageFi.php index c3c40ef..867a2f6 100644 --- a/languages/classes/LanguageFi.php +++ b/languages/classes/LanguageFi.php @@ -85,10 +85,10 @@ /** * @param string $str -* @param bool $forContent +* @param User $user User object to use timezone from or null for $wgUser * @return string */ - function translateBlockExpiry( $str, $forContent = false ) { + function translateBlockExpiry( $str, User $user = null ) { /* 'ago', 'now', 'today', 'this', 'next', 'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', -- To view, visit https://gerrit.wikimedia.org/r/281692 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If0a1d3c88bb4242a016eb9b2df115413de786149 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Raimond Spekking Gerrit-Reviewer: Umherirrender Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [compat2xore] replace deprecated parts - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282490 Change subject: [compat2xore] replace deprecated parts .. [compat2xore] replace deprecated parts - replace ImagePage with FilePage - replace category_namespace() with namespaces.CATEGORY.custom_name - replace getFirstUploader() with [image.oldest_file_info.user, image.oldest_file_info.timestamp.toISOformat()] - replace defaultNamespace=14 with ns=Namespace.CATEGORY - also some changes to tox.ini Change-Id: I3aeb10e591a0b848b8c54eb79f7d4350775c1561 --- M imagereview.py M tox.ini 2 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/90/282490/1 diff --git a/imagereview.py b/imagereview.py index b34eac8..d175c96 100644 --- a/imagereview.py +++ b/imagereview.py @@ -41,6 +41,7 @@ from datetime import datetime import pywikibot +from pywikibot.site import Namespace from pywikibot import pagegenerators, textlib remark = { @@ -216,7 +217,7 @@ def __init__(self, site, title, text=None, timestamp=None): """Constructor.""" -pywikibot.ImagePage.__init__(self, site, title) +pywikibot.FilePage.__init__(self, site, title) self._contents = text # NOTE: self.templates is already used by FilePage in core # but it isn't in compat. @@ -346,7 +347,7 @@ def generator(self): cat = pywikibot.Category(self.site, "%s:%s" - % (self.site.category_namespace(), + % (self.site.namespaces.CATEGORY.custom_name, self.source)) gen = pagegenerators.CategorizedPageGenerator(cat) gen = pagegenerators.NamespaceFilterPageGenerator( @@ -625,7 +626,9 @@ if self.getOption('check'): pywikibot.output(u'Processing %d images...' % self.total) for image in self.generator: -uploader = image.getFirstUploader() +uploader = [image.oldest_file_info.user, +image.oldest_file_info.timestamp.toISOformat()] + sortkey = uploader[self.sort] if sortkey not in table: table[sortkey] = [] @@ -645,7 +648,7 @@ |- ''' if self.getOption('check'): -cat = pywikibot.Page(self.site, self.cat, defaultNamespace=14) +cat = pywikibot.Page(self.site, self.cat, ns=Namespace.CATEGORY) try: cattext = cat.get() except pywikibot.NoPage: diff --git a/tox.ini b/tox.ini index 9a78977..f933ea3 100644 --- a/tox.ini +++ b/tox.ini @@ -19,8 +19,9 @@ commands = flake8 {posargs} basepython = python2.7 deps = flake8 - git+https://github.com/pyflakes/pyflakes.git + pyflakes >= 1.1 flake8-docstrings<0.2.2 + flake8-putty>=0.2.0 flake8-coding flake8-future-import flake8-string-format @@ -30,8 +31,9 @@ commands = flake8 {posargs} basepython = python3 deps = flake8 - git+https://github.com/pyflakes/pyflakes.git + pyflakes >= 1.1 flake8-docstrings<0.2.2 + flake8-putty>=0.2.0 [flake8] ; D102 Missing docstring -- To view, visit https://gerrit.wikimedia.org/r/282490 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3aeb10e591a0b848b8c54eb79f7d4350775c1561 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: Xqt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Rephrase watchlistedit-clear-title - change (mediawiki/core)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/282489 Change subject: Rephrase watchlistedit-clear-title .. Rephrase watchlistedit-clear-title Changed "Cleared watchlist" to "Clear watchlist". The title appears before the watchlist is cleared, so it misleads (and scares!) the user to say that it was already cleared. Change-Id: I60582f9aa62c54ba33b83b972de45b31e73b92a7 --- M languages/i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/89/282489/1 diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 6489ca3..db03fd7 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -3434,7 +3434,7 @@ "watchlistedit-raw-done": "Your watchlist has been updated.", "watchlistedit-raw-added": "{{PLURAL:$1|1 title was|$1 titles were}} added:", "watchlistedit-raw-removed": "{{PLURAL:$1|1 title was|$1 titles were}} removed:", - "watchlistedit-clear-title": "Cleared watchlist", + "watchlistedit-clear-title": "Clear watchlist", "watchlistedit-clear-legend": "Clear watchlist", "watchlistedit-clear-explain": "All of the titles will be removed from your watchlist", "watchlistedit-clear-titles": "Titles:", -- To view, visit https://gerrit.wikimedia.org/r/282489 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I60582f9aa62c54ba33b83b972de45b31e73b92a7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Amire80___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] TemplateStyles extension prototype - change (mediawiki...TemplateStyles)
jenkins-bot has submitted this change and it was merged. Change subject: TemplateStyles extension prototype .. TemplateStyles extension prototype This extension adds a tag that, when placed on a template, allows specifying CSS for pages where that template is transcluded. Unlike inline styles, the per-template CSS supports rules with proper selectors, and @media blocks. THIS VERSION DOES NOT CURRENTLY FILTER DECLARATIONS and is therefore unsuitable for wikis where unprivileged users should not be allowed to influcence the pagewide CSS in unrestricted ways! Bug: T483 Change-Id: Ibc1cae3079d164f7ac7bcc7c4ded3f02bb048614 --- A .jscsrc A .jshintrc A CSSParser.php A CSSRenderer.php A Gruntfile.js A TemplateStyles.hooks.php A composer.json A extension.json A i18n/en.json A i18n/qqq.json A package.json A phpcs.xml 12 files changed, 580 insertions(+), 0 deletions(-) Approvals: BryanDavis: Looks good to me, approved Paladox: Looks good to me, but someone else must approve coren: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 000..9d22e3f --- /dev/null +++ b/.jscsrc @@ -0,0 +1,3 @@ +{ + "preset": "wikimedia" +} diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000..66e3d48 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,24 @@ +{ + // Enforcing + "bitwise": true, + "eqeqeq": true, + "freeze": true, + "latedef": true, + "noarg": true, + "nonew": true, + "undef": true, + "unused": true, + "strict": false, + + // Relaxing + "es5": false, + + // Environment + "browser": true, + "jquery": true, + + "globals": { + "mediaWiki": false, + "OO": false + } +} diff --git a/CSSParser.php b/CSSParser.php new file mode 100644 index 000..a43d802 --- /dev/null +++ b/CSSParser.php @@ -0,0 +1,242 @@ + + | .)/xis', $css, $match ); + + $space = false; + foreach ( $match[0] as $t ) { + if ( preg_match( '/^(?:[ \n\t]|\/\*|)/', $t ) ) { + if ( !$space ) { + $space = true; + $this->tokens[] = ' '; + continue; + } + } else { + $space = false; + $this->tokens[] = $t; + } + } + $this->index = 0; + } + + private function peek( $i ) { + if ( $this->index+$i >= count( $this->tokens ) ) + return null; + return $this->tokens[$this->index+$i]; + } + + private function consume( $num = 1 ) { + if ( $num > 0 ) { + if ( $this->index+$num >= count( $this->tokens ) ) + $num = count( $this->tokens ) - $this->index; + $text = implode( array_slice( $this->tokens, $this->index, $num ) ); + $this->index += $num; + return $text; + } + return ''; + } + + private function consumeTo( $delim ) { + $consume = 0; + while ( !in_array( $this->peek( $consume ), $delim ) ) + $consume++; + return $this->consume( $consume ); + } + + private function consumeWS() { + $consume = 0; + while ( $this->peek( $consume ) === ' ' ) + $consume++; + return $this->consume( $consume ); + } + + /** +* Parses: +* decl: WS* IDENT WS* ':' TOKEN* ';' +* | WS* IDENT ';' -> skip +* ; +* +* Returns: +* [ name => value ] +*/ + private function parseDecl() { + $this->consumeWS(); + $name = $this->consume(); + $this->consumeWS(); + if ( $this->peek( 0 )!=':' ) { + $this->consumeTo( [';', '}', null] ); + if ( $this->peek( 0 ) == ';' ) { + $this->consume(); + $this->consumeWS(); + } + return null; + } + $this->consume(); + $this->consumeWS(); + $value = $this->consumeTo( [';', '}', null] ); + if ( $this->peek( 0 ) == ';' ) { + $value .= $this->consume(); + $this->consumeWS(); + } +
[MediaWiki-commits] [Gerrit] Add icinga monitoring for varnish statistics daemons - change (operations/puppet)
Adedommelin has uploaded a new change for review. https://gerrit.wikimedia.org/r/282488 Change subject: Add icinga monitoring for varnish statistics daemons .. Add icinga monitoring for varnish statistics daemons This patch doesn't register a check for the "varnish" process itself as it there are already HTTP probes defined. Bug: T131760 Change-Id: I3e97dee81ef304578e1abfec5180bfa1f64a70fd --- M modules/varnish/manifests/logging/media.pp M modules/varnish/manifests/logging/reqstats.pp M modules/varnish/manifests/logging/rls.pp M modules/varnish/manifests/logging/statsd.pp M modules/varnish/manifests/logging/xcps.pp 5 files changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/88/282488/1 diff --git a/modules/varnish/manifests/logging/media.pp b/modules/varnish/manifests/logging/media.pp index d6c8f33..0fb0b7b 100644 --- a/modules/varnish/manifests/logging/media.pp +++ b/modules/varnish/manifests/logging/media.pp @@ -37,4 +37,10 @@ enable => true, }, } + +nrpe::monitor_service { "varnishmedia": +ensure => present, +description => "Varnish traffic logger - varnishmedia", +nrpe_command => "/usr/lib/nagios/plugins/check_procs -w 1:1 -a '/usr/local/bin/varnishmedia' -u root", +} } diff --git a/modules/varnish/manifests/logging/reqstats.pp b/modules/varnish/manifests/logging/reqstats.pp index 0f3a882..fe6bf98 100644 --- a/modules/varnish/manifests/logging/reqstats.pp +++ b/modules/varnish/manifests/logging/reqstats.pp @@ -63,4 +63,10 @@ enable => true, }, } + +nrpe::monitor_service { "varnishreqstats": +ensure => present, +description => "Varnish traffic logger - varnishreqstats", +nrpe_command => "/usr/lib/nagios/plugins/check_procs -w 1:1 -a '/usr/local/bin/varnishreqstats' -u root", +} } diff --git a/modules/varnish/manifests/logging/rls.pp b/modules/varnish/manifests/logging/rls.pp index c416f9b..d053b2e 100644 --- a/modules/varnish/manifests/logging/rls.pp +++ b/modules/varnish/manifests/logging/rls.pp @@ -37,4 +37,10 @@ enable => true, }, } + +nrpe::monitor_service { "varnishrls": +ensure => present, +description => "Varnish traffic logger - varnishrls", +nrpe_command => "/usr/lib/nagios/plugins/check_procs -w 1:1 -a '/usr/local/bin/varnishrls' -u root", +} } diff --git a/modules/varnish/manifests/logging/statsd.pp b/modules/varnish/manifests/logging/statsd.pp index 46d5ec9..4a3e536 100644 --- a/modules/varnish/manifests/logging/statsd.pp +++ b/modules/varnish/manifests/logging/statsd.pp @@ -64,4 +64,10 @@ enable => true, }, } + +nrpe::monitor_service { "varnishstatsd": +ensure => present, +description => "Varnish traffic logger - varnishstatsd", +nrpe_command => "/usr/lib/nagios/plugins/check_procs -w 1:1 -a '/usr/local/bin/varnishstatsd' -u root", +} } diff --git a/modules/varnish/manifests/logging/xcps.pp b/modules/varnish/manifests/logging/xcps.pp index 92a9c6c..68f2ff9 100644 --- a/modules/varnish/manifests/logging/xcps.pp +++ b/modules/varnish/manifests/logging/xcps.pp @@ -37,4 +37,10 @@ enable => true, }, } + +nrpe::monitor_service { "varnishxcps": +ensure => present, +description => "Varnish traffic logger - varnishxcps", +nrpe_command => "/usr/lib/nagios/plugins/check_procs -w 1:1 -a '/usr/local/bin/varnishxcps' -u root", +} } -- To view, visit https://gerrit.wikimedia.org/r/282488 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e97dee81ef304578e1abfec5180bfa1f64a70fd Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Adedommelin___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] CirrusSearch on Labs uses the full Elasticsearch cluster again - change (operations/mediawiki-config)
Gehel has submitted this change and it was merged. Change subject: CirrusSearch on Labs uses the full Elasticsearch cluster again .. CirrusSearch on Labs uses the full Elasticsearch cluster again To test HTTP connection pooling, CirrusSearch was configured to use a single Elasticsearch node. Now that this change is in production, time to go back to the full cluster. Bug: T130219 Change-Id: Iecfe29b3fc16b5280792d94e04115ec0d4161129 --- M wmf-config/LabsServices.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Gehel: Looks good to me, approved EBernhardson: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/wmf-config/LabsServices.php b/wmf-config/LabsServices.php index d1bc0ae..8e71405 100644 --- a/wmf-config/LabsServices.php +++ b/wmf-config/LabsServices.php @@ -17,9 +17,9 @@ 'search' => array( // These MUST match the installed SSL certs 'deployment-elastic05.deployment-prep.eqiad.wmflabs', -// 'deployment-elastic06.deployment-prep.eqiad.wmflabs', -// 'deployment-elastic07.deployment-prep.eqiad.wmflabs', -// 'deployment-elastic08.deployment-prep.eqiad.wmflabs', + 'deployment-elastic06.deployment-prep.eqiad.wmflabs', + 'deployment-elastic07.deployment-prep.eqiad.wmflabs', + 'deployment-elastic08.deployment-prep.eqiad.wmflabs', ), 'ocg' => 'http://deployment-pdf01:8000', 'urldownloader' => 'http://deployment-urldownloader.deployment-prep.eqiad.wmflabs:8080', -- To view, visit https://gerrit.wikimedia.org/r/282359 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iecfe29b3fc16b5280792d94e04115ec0d4161129 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: GehelGerrit-Reviewer: DCausse Gerrit-Reviewer: EBernhardson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Gehel Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [tox] pep8/257 and other tests - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: [tox] pep8/257 and other tests .. [tox] pep8/257 and other tests cleanup several scripts. Change-Id: Ib3c245f7de4ad06591bd3afa34e02a0d690dcf61 --- M afd-notice.py M checkvotes.py M imagereview.py M tests/imagereview_tests.py M tests/vandalism_tests.py M tox.ini M vandalism.py 7 files changed, 84 insertions(+), 44 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/afd-notice.py b/afd-notice.py index 4740dc2..5acdf78 100644 --- a/afd-notice.py +++ b/afd-notice.py @@ -18,14 +18,14 @@ # # Distributed under the terms of the MIT license. # -from __future__ import absolute_import, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals __version__ = '$Id: b8b58400a557856fe9df819978e4b30036e4a643 $' # -from collections import Counter import pickle import time +from collections import Counter import pywikibot from pywikibot import config, pagegenerators, textlib @@ -270,6 +270,14 @@ def main(): +""" +Process command line arguments and invoke bot. + +If args is an empty list, sys.argv is used. + +@param args: command line arguments +@type args: list of unicode +""" options = {} for arg in pywikibot.handle_args(): options[arg[1:]] = True diff --git a/checkvotes.py b/checkvotes.py index 06ec3d7..b6f9eb2 100644 --- a/checkvotes.py +++ b/checkvotes.py @@ -16,7 +16,7 @@ -sg Check arbcom election """ -from __future__ import print_function, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals __version__ = '$Id: b7d0f7af1cfce7db63fe73ddf71d24191b41d14a $' # @@ -182,6 +182,9 @@ class CheckBot(object): + +"""CheckBot to check votings.""" + # Edit summary message that should be used. msg = { 'de': 'Bot: Stimmberechtigung geprüft', @@ -190,7 +193,9 @@ def __init__(self, generator, template, dry, always, blockinfo): """ -Constructor. Parameters: +Constructor. + +Parameters: * generator - The page generator that determines on which pages to work on. * dry - If True, doesn't do any real changes, but only shows diff --git a/imagereview.py b/imagereview.py index 38af78d..b34eac8 100644 --- a/imagereview.py +++ b/imagereview.py @@ -3,6 +3,7 @@ # """ This bot script is developed for the image review processing on de-wiki. + See https://de.wikipedia.org/wiki/Wikipedia:D%C3%9CP for it This script is run by [[de:user:xqt]]. @@ -24,7 +25,7 @@ -total: Only check the given number of files """ -from __future__ import print_function, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals # # (C) xqt, 2012-2016 # @@ -308,9 +309,7 @@ raise NotImplementedError('Invalid option') def setOptions(self, **kwargs): -""" -Sets the instance options -""" +"""Set the instance options.""" # contains the options overriden from defaults self.options = {} @@ -327,6 +326,7 @@ def getOption(self, option): """ Get the current value of an option. + @param option: key defined in Bot.availableOptions """ try: @@ -365,9 +365,7 @@ yield page def save(self, page, newText, summary=None): -""" -Saves the page to the wiki, if the user accepts the changes made. -""" +"""Save the page to the wiki, if the user accepts the changes made.""" done = False try: oldtext = page.get() @@ -409,12 +407,14 @@ return done def inform_user(self, user, data): -""" data = [title(asLink=True), +""" +Inform user. + +data = [title(asLink=True), [user, timestamp], DUP_Image{},, -] - +] """ # verstorbene ignoreUser = set() @@ -580,13 +580,13 @@ summary += u', Vorlage:Information ergänzt' inline += """ {{Information -|Beschreibung = -|Quelle = -|Urheber = -|Datum= -|Genehmigung = -|Andere Versionen = -|Anmerkungen = +|Beschreibung = +|Quelle = +|Urheber = +|Datum= +|Genehmigung = +|Andere Versionen = +|Anmerkungen = }} """ # noqa firstTmpl = tmpl.pop(0) diff --git a/tests/imagereview_tests.py b/tests/imagereview_tests.py index 014a276..8290071 100644 --- a/tests/imagereview_tests.py +++ b/tests/imagereview_tests.py @@ -5,7 +5,7 @@ # # Distributed under the terms of the MIT license. # -from __future__ import absolute_import, unicode_literals
[MediaWiki-commits] [Gerrit] Switch Special:FileDuplicateSearch to OOUI - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Switch Special:FileDuplicateSearch to OOUI .. Switch Special:FileDuplicateSearch to OOUI Bug: T117745 Change-Id: I7541244cd06b6ea5c71e7f1e540474e8ae3740b5 --- M includes/specials/SpecialFileDuplicateSearch.php M languages/i18n/en.json M languages/i18n/qqq.json 3 files changed, 1 insertion(+), 5 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, but someone else must approve Florianschmidtwelzow: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 20c0762..bb82d03 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -118,19 +118,17 @@ 'id' => 'filename', 'size' => 50, 'value' => $this->filename, - 'cssclass' => 'mw-ui-input-inline' ], ]; $hiddenFields = [ 'title' => $this->getPageTitle()->getPrefixedDBkey(), ]; - $htmlForm = HTMLForm::factory( 'inline', $formFields, $this->getContext() ); + $htmlForm = HTMLForm::factory( 'ooui', $formFields, $this->getContext() ); $htmlForm->addHiddenFields( $hiddenFields ); $htmlForm->setAction( wfScript() ); $htmlForm->setMethod( 'get' ); $htmlForm->setSubmitProgressive(); $htmlForm->setSubmitTextMsg( $this->msg( 'fileduplicatesearch-submit' ) ); - $htmlForm->setWrapperLegendMsg( 'fileduplicatesearch-legend' ); // The form should be visible always, even if it was submitted (e.g. to perform another action). // To bypass the callback validation of HTMLForm, use prepareForm() and displayForm(). diff --git a/languages/i18n/en.json b/languages/i18n/en.json index cbf2462..7b10ec8 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -3585,7 +3585,6 @@ "redirect-not-exists": "Value not found", "fileduplicatesearch": "Search for duplicate files", "fileduplicatesearch-summary": "Search for duplicate files based on hash values.", - "fileduplicatesearch-legend": "Search for a duplicate", "fileduplicatesearch-filename": "Filename:", "fileduplicatesearch-submit": "Search", "fileduplicatesearch-info": "$1 × $2 pixelFile size: $3MIME type: $4", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index a2e803e..cc12e8b 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -3761,7 +3761,6 @@ "redirect-not-exists": "Used as error message in [[Special:Redirect]]", "fileduplicatesearch": "Name of special page [[Special:FileDuplicateSearch]].", "fileduplicatesearch-summary": "Summary of [[Special:FileDuplicateSearch]]", - "fileduplicatesearch-legend": "Legend of the fieldset around the input form of [[Special:FileDuplicateSearch]]", "fileduplicatesearch-filename": "Input form of [[Special:FileDuplicateSearch]]:\n\n{{Identical|Filename}}", "fileduplicatesearch-submit": "Button label on [[Special:FileDuplicateSearch]].\n\n{{Identical|Search}}", "fileduplicatesearch-info": "Information beneath the thumbnail on the right side shown after a successful search via [[Special:FileDuplicateSearch]].\n\nParameters:\n* $1 - width of the file\n* $2 - height of the file\n* $3 - File size\n* $4 - MIME type", -- To view, visit https://gerrit.wikimedia.org/r/273761 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7541244cd06b6ea5c71e7f1e540474e8ae3740b5 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: CsyogiGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Catrope Gerrit-Reviewer: Csyogi Gerrit-Reviewer: Esanders Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: VolkerE Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] SpecialLog: Don't put assignment within another expression - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: SpecialLog: Don't put assignment within another expression .. SpecialLog: Don't put assignment within another expression Change-Id: I0a0cd9ee0647e8778d2e835cc02c571a83b3a8c2 --- M includes/specials/SpecialLog.php 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Florianschmidtwelzow: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index 7132207..85728ef 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -147,7 +147,8 @@ private function parseParams( FormOptions $opts, $par ) { # Get parameters - $parms = explode( '/', ( $par = ( $par !== null ) ? $par : '' ) ); + $par = $par !== null ? $par : ''; + $parms = explode( '/', $par ); $symsForAll = [ '*', 'all' ]; if ( $parms[0] != '' && ( in_array( $par, $this->getConfig()->get( 'LogTypes' ) ) || in_array( $par, $symsForAll ) ) -- To view, visit https://gerrit.wikimedia.org/r/281735 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a0cd9ee0647e8778d2e835cc02c571a83b3a8c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz DziewońskiGerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Hygiene: add parameters to raw types - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/282487 Change subject: Hygiene: add parameters to raw types .. Hygiene: add parameters to raw types Change-Id: If5c595e6c30dbe4ce32aae4e0cc8466f9d20a1d7 --- M app/src/main/java/org/wikipedia/ParcelableLruCache.java 1 file changed, 14 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/87/282487/1 diff --git a/app/src/main/java/org/wikipedia/ParcelableLruCache.java b/app/src/main/java/org/wikipedia/ParcelableLruCache.java index aca4b2c..988c39f 100644 --- a/app/src/main/java/org/wikipedia/ParcelableLruCache.java +++ b/app/src/main/java/org/wikipedia/ParcelableLruCache.java @@ -21,13 +21,13 @@ * * V can either be a String, Parcelable or a List */ -public class ParcelableLruCache extends LruCacheimplements Parcelable { +public class ParcelableLruCache extends LruCache implements Parcelable { private static final int TYPE_LIST = 1; private static final int TYPE_PARCELABLE = 2; private static final int TYPE_STRING = 3; private final int type; -public ParcelableLruCache(int maxSize, Class valueClass) { +public ParcelableLruCache(int maxSize, Class valueClass) { super(maxSize); if (valueClass.equals(String.class)) { type = TYPE_STRING; @@ -47,12 +47,15 @@ for (String key : keys) { switch (type) { case TYPE_LIST: +//noinspection unchecked put(key, (V) contents.getParcelableArrayList(key)); break; case TYPE_PARCELABLE: +//noinspection unchecked put(key, (V) contents.getParcelable(key)); break; case TYPE_STRING: +//noinspection unchecked put(key, (V) contents.getString(key)); break; default: @@ -75,7 +78,9 @@ for (Map.Entry entry : snapshot.entrySet()) { switch (type) { case TYPE_LIST: -bundle.putParcelableArrayList(entry.getKey(), (ArrayList)entry.getValue()); +//noinspection unchecked +bundle.putParcelableArrayList(entry.getKey(), +(ArrayList) entry.getValue()); break; case TYPE_PARCELABLE: bundle.putParcelable(entry.getKey(), (Parcelable) entry.getValue()); @@ -90,16 +95,16 @@ dest.writeBundle(bundle); } -public static final Parcelable.Creator CREATOR -= new Parcelable.Creator() { +public static final Parcelable.Creator CREATOR += new Parcelable.Creator () { @Override -public ParcelableLruCache createFromParcel(Parcel in) { -return new ParcelableLruCache(in); +public ParcelableLruCache createFromParcel(Parcel in) { +return new ParcelableLruCache<>(in); } @Override -public ParcelableLruCache[] newArray(int size) { -return new ParcelableLruCache[size]; +public ParcelableLruCache[] newArray(int size) { +return new ParcelableLruCache[size]; } }; } -- To view, visit https://gerrit.wikimedia.org/r/282487 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If5c595e6c30dbe4ce32aae4e0cc8466f9d20a1d7 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix load of ArticlePlaceholder - change (wikidata/build-resources)
Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/282486 Change subject: Fix load of ArticlePlaceholder .. Fix load of ArticlePlaceholder Bug: T131728 Change-Id: Iad619c5f2b1b0ebfa5a2023189b83706fb536a78 --- M Wikidata.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/build-resources refs/changes/86/282486/1 diff --git a/Wikidata.php b/Wikidata.php old mode 100644 new mode 100755 index 3975436..30e4e67 --- a/Wikidata.php +++ b/Wikidata.php @@ -62,7 +62,7 @@ include_once "$wgWikidataBaseDir/extensions/Wikibase/client/WikibaseClient.php"; if ( !empty( $wmgUseArticlePlaceholder ) ) { - include_once "$wgWikidataBaseDir/extensions/ArticlePlaceholder/ArticlePlaceholder.php"; + wfLoadExtension( 'ArticlePlaceholder', "$wgWikidataBaseDir/extensions/ArticlePlaceholder/extension.json" ); } } -- To view, visit https://gerrit.wikimedia.org/r/282486 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad619c5f2b1b0ebfa5a2023189b83706fb536a78 Gerrit-PatchSet: 1 Gerrit-Project: wikidata/build-resources Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add stupidly simple check to alert if JobQueue is not running - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: Add stupidly simple check to alert if JobQueue is not running .. Add stupidly simple check to alert if JobQueue is not running Bug: T131981 Change-Id: Ia14e6116d5c39bc92ee6a7f9a7c791377a844cc2 --- M puppet/modules/wiki/templates/wikimaintenance.erb 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/puppet/modules/wiki/templates/wikimaintenance.erb b/puppet/modules/wiki/templates/wikimaintenance.erb index 10cf036..9fedd72 100644 --- a/puppet/modules/wiki/templates/wikimaintenance.erb +++ b/puppet/modules/wiki/templates/wikimaintenance.erb @@ -1,5 +1,6 @@ # file managed by puppet @weekly www-data find /www/translatewiki.net/docroot/images/thumb/ -name "*.png" -type f -print0 | nice xargs -0 -P4 -I{} optipng -o7 {} 1> /dev/null @weekly <%= @user %> nice php /srv/mediawiki/targets/production/maintenance/generateSitemap.php --fspath /www/translatewiki.net/docroot/sitemap/ --skip-redirects --urlpath https://translatewiki.net/sitemap/ -48 6,10,16,20 * * * <%= @user %> /home/betawiki/config/bin/autosync.sh > /dev/null -48 7,13,21 * * * <%= @user %> /home/betawiki/config/bin/autosync-mediawiki.sh > /dev/null +48 6,10,16,20 * * * <%= @user %> <%= @config %>/bin/autosync.sh > /dev/null +48 7,13,21 * * * <%= @user %> <%= @config %>/bin/autosync-mediawiki.sh > /dev/null +*/10 * * * <%= @user %> test -z "$(service mw-jobrunner status | grep running -o)" && <%= @config %>/bin/udpcast JobQueue is not running -- To view, visit https://gerrit.wikimedia.org/r/282485 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia14e6116d5c39bc92ee6a7f9a7c791377a844cc2 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: NikerabbitGerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add stupidly simple check to alert if JobQueue is not running - change (translatewiki)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/282485 Change subject: Add stupidly simple check to alert if JobQueue is not running .. Add stupidly simple check to alert if JobQueue is not running Bug: T131981 Change-Id: Ia14e6116d5c39bc92ee6a7f9a7c791377a844cc2 --- M puppet/modules/wiki/templates/wikimaintenance.erb 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/85/282485/1 diff --git a/puppet/modules/wiki/templates/wikimaintenance.erb b/puppet/modules/wiki/templates/wikimaintenance.erb index 10cf036..9fedd72 100644 --- a/puppet/modules/wiki/templates/wikimaintenance.erb +++ b/puppet/modules/wiki/templates/wikimaintenance.erb @@ -1,5 +1,6 @@ # file managed by puppet @weekly www-data find /www/translatewiki.net/docroot/images/thumb/ -name "*.png" -type f -print0 | nice xargs -0 -P4 -I{} optipng -o7 {} 1> /dev/null @weekly <%= @user %> nice php /srv/mediawiki/targets/production/maintenance/generateSitemap.php --fspath /www/translatewiki.net/docroot/sitemap/ --skip-redirects --urlpath https://translatewiki.net/sitemap/ -48 6,10,16,20 * * * <%= @user %> /home/betawiki/config/bin/autosync.sh > /dev/null -48 7,13,21 * * * <%= @user %> /home/betawiki/config/bin/autosync-mediawiki.sh > /dev/null +48 6,10,16,20 * * * <%= @user %> <%= @config %>/bin/autosync.sh > /dev/null +48 7,13,21 * * * <%= @user %> <%= @config %>/bin/autosync-mediawiki.sh > /dev/null +*/10 * * * <%= @user %> test -z "$(service mw-jobrunner status | grep running -o)" && <%= @config %>/bin/udpcast JobQueue is not running -- To view, visit https://gerrit.wikimedia.org/r/282485 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia14e6116d5c39bc92ee6a7f9a7c791377a844cc2 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Nikerabbit___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace erroneously removed cite styles - change (apps...wikipedia)
jenkins-bot has submitted this change and it was merged. Change subject: Replace erroneously removed cite styles .. Replace erroneously removed cite styles Generating these requires the 'cite' role in mw-vagrant, which I didn't have before (leading to an error generating the CSS). Thus, I removed the reference from the CSS generation script. This puts back the needed styles. I'll update the mobileapp role in a follow-up patch to require the cite role. Bug: T132253 Change-Id: I7a9c8ef804301bc81932886a2aec74fe96ba3f84 --- M app/src/main/assets/preview.css M app/src/main/assets/styles.css M scripts/make-css-assets.bash 3 files changed, 166 insertions(+), 2 deletions(-) Approvals: Dbrant: Looks good to me, approved jenkins-bot: Verified diff --git a/app/src/main/assets/preview.css b/app/src/main/assets/preview.css index 8c85468..84e0395 100644 --- a/app/src/main/assets/preview.css +++ b/app/src/main/assets/preview.css @@ -467,6 +467,88 @@ display: block !important; width: auto !important; } +}/* CSS for Parsoid Cite extension */ + +/* Style for s */ +span.mw-ref { + vertical-align: super; + line-height: 1; + font-size: smaller; + /* Make sure the brackets and the numbers aren't jumbled after LTR words in RTL wikis */ + unicode-bidi: embed; +} + +/* With a group set */ +span.mw-ref a[data-mw-group]::after { + content: "[" attr(data-mw-group) " " counter(mw-Ref, decimal) "]"} + +/* Groups with special appearance */ +span.mw-ref a[data-mw-group="decimal"]::after { + content: "[" counter(mw-Ref, decimal) "]"; +} +span.mw-ref a[data-mw-group="lower-alpha"]::after { + content: "[" counter(mw-Ref, lower-alpha) "]"; +} +span.mw-ref a[data-mw-group="upper-alpha"]::after { + content: "[" counter(mw-Ref, upper-alpha) "]"; +} +span.mw-ref a[data-mw-group="lower-greek"]::after { + content: "[" counter(mw-Ref, lower-greek) "]"; +} +span.mw-ref a[data-mw-group="lower-roman"]::after { + content: "[" counter(mw-Ref, lower-roman) "]"; +} +span.mw-ref a[data-mw-group="upper-roman"]::after { + content: "[" counter(mw-Ref, upper-roman) "]"; +} +span.mw-ref a[data-mw-group="error-test"]::after { + content: "[" counter(mw-Ref, symbols(cyclic "first" "second" "last!")) "]"; +} + +/* Without a group */ +span.mw-ref a::after { + content: "[" counter(mw-Ref, decimal) "]"; +} + +/* Hide the default rendering in browsers that support content + * generation by selecting for ::after pseudo-element.*/ +x-thereisnoelementwiththisname::after, span.mw-reflink-text { + display: none; +} + +/* Style for linkbacks from to s */ +ol.mw-references { + counter-reset: mw-ref-linkback; +} + +ol.mw-references li { + counter-increment: mw-ref-linkback; +} + +[rel="mw:referencedBy"] { + counter-reset: mw-ref-linkback -1; +} + +[rel="mw:referencedBy"]::before { + content: "↑ "; +} + +span[rel="mw:referencedBy"] a::before { + counter-increment: mw-ref-linkback; + content: counters(mw-ref-linkback, ".", decimal); + vertical-align: super; + line-height: 1; + font-size: smaller; +} + +span[rel="mw:referencedBy"] a::after { + content: " "; +} + +/* Hide the default rendering in browsers that support content + * generation by selecting for ::after pseudo-element.*/ +x-thereisnoelementwiththisname[rel="mw:referencedBy"]::before, span.mw-linkback-text { + display: none; }/* Hide the stupid editlink */ .edit-page { display: none; diff --git a/app/src/main/assets/styles.css b/app/src/main/assets/styles.css index ad191a6..e29697a 100644 --- a/app/src/main/assets/styles.css +++ b/app/src/main/assets/styles.css @@ -467,6 +467,88 @@ display: block !important; width: auto !important; } +}/* CSS for Parsoid Cite extension */ + +/* Style for s */ +span.mw-ref { + vertical-align: super; + line-height: 1; + font-size: smaller; + /* Make sure the brackets and the numbers aren't jumbled after LTR words in RTL wikis */ + unicode-bidi: embed; +} + +/* With a group set */ +span.mw-ref a[data-mw-group]::after { + content: "[" attr(data-mw-group) " " counter(mw-Ref, decimal) "]"} + +/* Groups with special appearance */ +span.mw-ref a[data-mw-group="decimal"]::after { + content: "[" counter(mw-Ref, decimal) "]"; +} +span.mw-ref a[data-mw-group="lower-alpha"]::after { + content: "[" counter(mw-Ref, lower-alpha) "]"; +} +span.mw-ref a[data-mw-group="upper-alpha"]::after { + content: "[" counter(mw-Ref, upper-alpha) "]"; +} +span.mw-ref a[data-mw-group="lower-greek"]::after { + content: "[" counter(mw-Ref, lower-greek) "]"; +} +span.mw-ref a[data-mw-group="lower-roman"]::after { + content: "[" counter(mw-Ref, lower-roman) "]"; +} +span.mw-ref a[data-mw-group="upper-roman"]::after { + content: "[" counter(mw-Ref, upper-roman) "]"; +}
[MediaWiki-commits] [Gerrit] Upgrade Mailgun to 2.0 - change (mediawiki...Mailgun)
jenkins-bot has submitted this change and it was merged. Change subject: Upgrade Mailgun to 2.0 .. Upgrade Mailgun to 2.0 The composer.json file has been updated by version = 2.0. Bug:T132020 Change-Id: Ia6c384f6cc132b52430136f4efffebcc03b895ae --- M MailgunHooks.php M composer.json 2 files changed, 9 insertions(+), 3 deletions(-) Approvals: 01tonythomas: Looks good to me, approved jenkins-bot: Verified diff --git a/MailgunHooks.php b/MailgunHooks.php index 9df0774..61ba017 100644 --- a/MailgunHooks.php +++ b/MailgunHooks.php @@ -38,7 +38,8 @@ array $headers, array $to, MailAddress $from, $subject, $body ) { $conf = RequestContext::getMain()->getConfig(); - $mailgunTransport = new \Mailgun\Mailgun( $conf->get( 'MailgunAPIKey' ) ); + $client = new \Http\Adapter\Guzzle6\Client(); + $mailgunTransport = new \Mailgun\Mailgun( $conf->get( 'MailgunAPIKey' ), $client ); $message = $mailgunTransport->BatchMessage( $conf->get( 'MailgunDomain' ) ); $message->setFromAddress( $from ); diff --git a/composer.json b/composer.json index d4ec90e..1372cbf 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,15 @@ { "name": "mediawiki/mailgun", "require": { - "mailgun/mailgun-php": "1.7.2" + "mailgun/mailgun-php": "2.0", + "guzzlehttp/psr7": "~1.2", + "php-http/httplug": "^1.0", + "php-http/discovery": "^0.8" }, "require-dev": { - "jakub-onderka/php-parallel-lint": "0.9.2" + "jakub-onderka/php-parallel-lint": "0.9.2", + "phpunit/phpunit": "~4.6", + "php-http/guzzle6-adapter": "^1.0" }, "scripts": { "test": [ -- To view, visit https://gerrit.wikimedia.org/r/282162 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia6c384f6cc132b52430136f4efffebcc03b895ae Gerrit-PatchSet: 9 Gerrit-Project: mediawiki/extensions/Mailgun Gerrit-Branch: master Gerrit-Owner: Haritha28Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com> Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Modification of Rakefile - change (operations/puppet)
Nicko has uploaded a new change for review. https://gerrit.wikimedia.org/r/282484 Change subject: Modification of Rakefile .. Modification of Rakefile Changing rake task executed by default plus adding puppetlabs_spec_helper gem in the Gemfile, cleanup improvement in teardown task Bug:T78342 Change-Id: I7bf2fe24c063b686ad826082e735d09b0767670a --- M Gemfile M Gemfile.lock M Rakefile M modules/backup/Rakefile M modules/bacula/Rakefile M modules/base/Rakefile M modules/git/Rakefile M modules/install_server/Rakefile M modules/mirrors/Rakefile M modules/mysql/Rakefile M modules/nrpe/Rakefile M modules/osm/Rakefile M modules/postgresql/Rakefile M modules/rsync/Rakefile M modules/servermon/Rakefile M modules/service/Rakefile M modules/squid3/Rakefile M modules/stdlib/Rakefile M modules/strongswan/Rakefile M modules/wmflib/Rakefile 20 files changed, 43 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/84/282484/1 diff --git a/Gemfile b/Gemfile index 86513f6..a3bc8a8 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ gem 'puppet', '~> 3.4.3' gem 'rspec-puppet', '~> 2.3.2' +gem 'puppetlabs_spec_helper' gem 'rake', '~> 10.4', '>= 10.4.2' gem 'rubocop', '~> 0.35.1', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 36d1336..4bab863 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,6 +9,9 @@ hiera (1.3.4) json_pure json_pure (1.8.3) +metaclass (0.0.4) +mocha (1.1.0) + metaclass (~> 0.0.1) parser (2.2.3.0) ast (>= 1.1, < 3.0) powerpack (0.1.1) @@ -16,6 +19,15 @@ facter (~> 1.6) hiera (~> 1.0) rgen (~> 0.6.5) +puppet-lint (1.1.0) +puppet-syntax (2.1.0) + rake +puppetlabs_spec_helper (1.1.1) + mocha + puppet-lint + puppet-syntax + rake + rspec-puppet rainbow (2.0.0) rake (10.4.2) rgen (0.6.6) @@ -49,6 +61,7 @@ DEPENDENCIES puppet (~> 3.4.3) + puppetlabs_spec_helper rake (~> 10.4, >= 10.4.2) rspec-puppet (~> 2.3.2) rubocop (~> 0.35.1) diff --git a/Rakefile b/Rakefile index 79615e6..f224c55 100644 --- a/Rakefile +++ b/Rakefile @@ -201,7 +201,7 @@ system("touch #{site_file_name}") unless File.exists?(site_file_name) puts "Invoking tests on module #{module_name}" -system('rake spec_standalone') +system('rake spec') end end diff --git a/modules/backup/Rakefile b/modules/backup/Rakefile index d9226a8..e94f2c5 100644 --- a/modules/backup/Rakefile +++ b/modules/backup/Rakefile @@ -23,7 +23,7 @@ task :teardown do symlinks.each { |x| FileUtils.rm(x[0], :force => true) } FileUtils.rmdir('spec/fixtures/modules/%s' % modulename) - FileUtils.rmdir('spec/fixtures/modules') + FileUtils.rm('spec/fixtures/modules') end RSpec::Core::RakeTask.new(:realspec) do |t| diff --git a/modules/bacula/Rakefile b/modules/bacula/Rakefile index d9226a8..e94f2c5 100644 --- a/modules/bacula/Rakefile +++ b/modules/bacula/Rakefile @@ -23,7 +23,7 @@ task :teardown do symlinks.each { |x| FileUtils.rm(x[0], :force => true) } FileUtils.rmdir('spec/fixtures/modules/%s' % modulename) - FileUtils.rmdir('spec/fixtures/modules') + FileUtils.rm('spec/fixtures/modules') end RSpec::Core::RakeTask.new(:realspec) do |t| diff --git a/modules/base/Rakefile b/modules/base/Rakefile index 165b532..5f44960 100644 --- a/modules/base/Rakefile +++ b/modules/base/Rakefile @@ -33,7 +33,7 @@ extra_modules.each do |x| FileUtils.rm('spec/fixtures/modules/%s' % x, :force => true) end - FileUtils.rmdir('spec/fixtures/modules') + FileUtils.rm('spec/fixtures/modules') end RSpec::Core::RakeTask.new(:realspec) do |t| diff --git a/modules/git/Rakefile b/modules/git/Rakefile index cd3d379..221d85b 100644 --- a/modules/git/Rakefile +++ b/modules/git/Rakefile @@ -1 +1,4 @@ require 'puppetlabs_spec_helper/rake_tasks' + +task :spec => :spec_standalone do +end diff --git a/modules/install_server/Rakefile b/modules/install_server/Rakefile index 0542f30..1c930d9 100644 --- a/modules/install_server/Rakefile +++ b/modules/install_server/Rakefile @@ -33,7 +33,7 @@ extra_modules.each do |x| FileUtils.rm('spec/fixtures/modules/%s' % x, :force => true) end - FileUtils.rmdir('spec/fixtures/modules') + FileUtils.rm('spec/fixtures/modules') end RSpec::Core::RakeTask.new(:realspec) do |t| diff --git a/modules/mirrors/Rakefile b/modules/mirrors/Rakefile index 0542f30..1c930d9 100644 --- a/modules/mirrors/Rakefile +++ b/modules/mirrors/Rakefile @@ -33,7 +33,7 @@ extra_modules.each do |x| FileUtils.rm('spec/fixtures/modules/%s' % x, :force => true) end - FileUtils.rmdir('spec/fixtures/modules') + FileUtils.rm('spec/fixtures/modules') end RSpec::Core::RakeTask.new(:realspec) do |t| diff --git a/modules/mysql/Rakefile b/modules/mysql/Rakefile index cd3d379..221d85b 100644 ---
[MediaWiki-commits] [Gerrit] Replace erroneously removed cite styles - change (apps...wikipedia)
Mholloway has uploaded a new change for review. https://gerrit.wikimedia.org/r/282483 Change subject: Replace erroneously removed cite styles .. Replace erroneously removed cite styles Generating these requires the 'cite' role in mw-vagrant, which I didn't have before (leading to an error generating the CSS). Thus, I removed the reference from the CSS generation script. This puts back the needed styles. I'll update the mobileapp role in a follow-up patch to require the cite role. Bug: T132253 Change-Id: I7a9c8ef804301bc81932886a2aec74fe96ba3f84 --- M app/src/main/assets/preview.css M app/src/main/assets/styles.css M scripts/make-css-assets.bash 3 files changed, 296 insertions(+), 139 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/83/282483/1 diff --git a/app/src/main/assets/preview.css b/app/src/main/assets/preview.css index 8c85468..84e0395 100644 --- a/app/src/main/assets/preview.css +++ b/app/src/main/assets/preview.css @@ -467,6 +467,88 @@ display: block !important; width: auto !important; } +}/* CSS for Parsoid Cite extension */ + +/* Style for s */ +span.mw-ref { + vertical-align: super; + line-height: 1; + font-size: smaller; + /* Make sure the brackets and the numbers aren't jumbled after LTR words in RTL wikis */ + unicode-bidi: embed; +} + +/* With a group set */ +span.mw-ref a[data-mw-group]::after { + content: "[" attr(data-mw-group) " " counter(mw-Ref, decimal) "]"} + +/* Groups with special appearance */ +span.mw-ref a[data-mw-group="decimal"]::after { + content: "[" counter(mw-Ref, decimal) "]"; +} +span.mw-ref a[data-mw-group="lower-alpha"]::after { + content: "[" counter(mw-Ref, lower-alpha) "]"; +} +span.mw-ref a[data-mw-group="upper-alpha"]::after { + content: "[" counter(mw-Ref, upper-alpha) "]"; +} +span.mw-ref a[data-mw-group="lower-greek"]::after { + content: "[" counter(mw-Ref, lower-greek) "]"; +} +span.mw-ref a[data-mw-group="lower-roman"]::after { + content: "[" counter(mw-Ref, lower-roman) "]"; +} +span.mw-ref a[data-mw-group="upper-roman"]::after { + content: "[" counter(mw-Ref, upper-roman) "]"; +} +span.mw-ref a[data-mw-group="error-test"]::after { + content: "[" counter(mw-Ref, symbols(cyclic "first" "second" "last!")) "]"; +} + +/* Without a group */ +span.mw-ref a::after { + content: "[" counter(mw-Ref, decimal) "]"; +} + +/* Hide the default rendering in browsers that support content + * generation by selecting for ::after pseudo-element.*/ +x-thereisnoelementwiththisname::after, span.mw-reflink-text { + display: none; +} + +/* Style for linkbacks from to s */ +ol.mw-references { + counter-reset: mw-ref-linkback; +} + +ol.mw-references li { + counter-increment: mw-ref-linkback; +} + +[rel="mw:referencedBy"] { + counter-reset: mw-ref-linkback -1; +} + +[rel="mw:referencedBy"]::before { + content: "↑ "; +} + +span[rel="mw:referencedBy"] a::before { + counter-increment: mw-ref-linkback; + content: counters(mw-ref-linkback, ".", decimal); + vertical-align: super; + line-height: 1; + font-size: smaller; +} + +span[rel="mw:referencedBy"] a::after { + content: " "; +} + +/* Hide the default rendering in browsers that support content + * generation by selecting for ::after pseudo-element.*/ +x-thereisnoelementwiththisname[rel="mw:referencedBy"]::before, span.mw-linkback-text { + display: none; }/* Hide the stupid editlink */ .edit-page { display: none; diff --git a/app/src/main/assets/styles.css b/app/src/main/assets/styles.css index ad191a6..6264352 100644 --- a/app/src/main/assets/styles.css +++ b/app/src/main/assets/styles.css @@ -467,26 +467,98 @@ display: block !important; width: auto !important; } -}/* Loading animation in pure CSS - Thanks to http://dabblet.com/gist/7708654 */ -.loading { - border: 4px solid rgba(0, 0, 0, 0.1); - border-top: 4px solid rgba(0, 0, 0, 0.4); - border-radius: 100%; - -webkit-animation: rot .6s infinite linear; +}/* CSS for Parsoid Cite extension */ + +/* Style for s */ +span.mw-ref { + vertical-align: super; + line-height: 1; + font-size: smaller; + /* Make sure the brackets and the numbers aren't jumbled after LTR words in RTL wikis */ + unicode-bidi: embed; } -@-webkit-keyframes rot { - from { --webkit-transform: rotate(0deg); - } - to { --webkit-transform: rotate(359deg); - } + +/* With a group set */ +span.mw-ref a[data-mw-group]::after { + content: "[" attr(data-mw-group) " " counter(mw-Ref, decimal) "]"} + +/* Groups with special appearance */ +span.mw-ref a[data-mw-group="decimal"]::after { + content: "[" counter(mw-Ref, decimal) "]"; } -#loading_sections { - margin: 8px auto; - height: 24px; - width: 24px; +span.mw-ref a[data-mw-group="lower-alpha"]::after {
[MediaWiki-commits] [Gerrit] Remove stupid print height value - change (mediawiki...Screenplay)
Isarra has submitted this change and it was merged. Change subject: Remove stupid print height value .. Remove stupid print height value Change-Id: I3f75fcbb5cc199af15014183ed53e562c15056b0 --- M resources/ext.screenplay.print.css 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Isarra: Verified; Looks good to me, approved diff --git a/resources/ext.screenplay.print.css b/resources/ext.screenplay.print.css index 64ce3cd..f61f6e6 100644 --- a/resources/ext.screenplay.print.css +++ b/resources/ext.screenplay.print.css @@ -5,8 +5,7 @@ .screenplay { /* width: 8.5" - 2.5", height: 11" - 2" */ width: 6in; - height: 9in; - /* margin: 1in 1in 1in 1.5in; except this is nested in mw, which probably has a ~1" margin already*/ + /* margin: 1in 1in 1in 1.5in; except this is nested in mw, which probably prints with a ~1" margin already */ margin: 0 0 0 .5in; font-family: Courier, monospace; font-size: 12pt; -- To view, visit https://gerrit.wikimedia.org/r/282481 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f75fcbb5cc199af15014183ed53e562c15056b0 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Screenplay Gerrit-Branch: master Gerrit-Owner: IsarraGerrit-Reviewer: Isarra Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [tox] pep8/257 - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282482 Change subject: [tox] pep8/257 .. [tox] pep8/257 Change-Id: Ib3c245f7de4ad06591bd3afa34e02a0d690dcf61 --- M tox.ini 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/82/282482/1 diff --git a/tox.ini b/tox.ini index 6db3873..0231885 100644 --- a/tox.ini +++ b/tox.ini @@ -32,3 +32,11 @@ ignore = E115,E266,E402 exclude = .tox,.git,./*.egg,ez_setup.py,build max_line_length = 289 + +[pep8] +ignore = E402 +exclude = .tox,.git,./*.egg,ez_setup.py,build +max_line_length = 100 + +[pep257] +ignore = D105,D211 -- To view, visit https://gerrit.wikimedia.org/r/282482 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3c245f7de4ad06591bd3afa34e02a0d690dcf61 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: Xqt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add print styles, add 'mw' to page-header-links id - change (mediawiki...Timeless)
jenkins-bot has submitted this change and it was merged. Change subject: Add print styles, add 'mw' to page-header-links id .. Add print styles, add 'mw' to page-header-links id Bug: T131987 Change-Id: Ia14e7f26dd249e95d1bbe00437b8d1483be08fa5 --- M TimelessTemplate.php A resources/print.css M resources/screen-common.less M resources/screen-desktop.less M skin.json 5 files changed, 23 insertions(+), 4 deletions(-) Approvals: Isarra: Looks good to me, approved jenkins-bot: Verified diff --git a/TimelessTemplate.php b/TimelessTemplate.php index d628fbb..90ff543 100644 --- a/TimelessTemplate.php +++ b/TimelessTemplate.php @@ -107,7 +107,7 @@ html( 'title' ) ?> - + assemblePortlet( array( 'id' => 'p-namespaces', diff --git a/resources/print.css b/resources/print.css new file mode 100644 index 000..cc8f611 --- /dev/null +++ b/resources/print.css @@ -0,0 +1,16 @@ +/* Styles for print view and printing */ + +/* Hide some extra stuff from print view */ +.mw-indicators, +#mw-header, +#mw-site-navigation, +#mw-related-navigation, +#mw-page-header-links, +#mw-footer, +#catlinks { + display: none; +} + +#mw-content-text { + margin-bottom: 3em; +} diff --git a/resources/screen-common.less b/resources/screen-common.less index cc66e55..4ea5124 100644 --- a/resources/screen-common.less +++ b/resources/screen-common.less @@ -165,7 +165,7 @@ #mw-content-container { border-bottom: solid 4px @green; } -#page-header-links { +#mw-page-header-links { div, ul, li { diff --git a/resources/screen-desktop.less b/resources/screen-desktop.less index 8be7343..d9523ce 100644 --- a/resources/screen-desktop.less +++ b/resources/screen-desktop.less @@ -101,8 +101,8 @@ } } -#page-header-links #ca-more, -#page-header-links #ca-languages, +#mw-page-header-links #ca-more, +#mw-page-header-links #ca-languages, .sidebar-chunk h2 { display: none; } diff --git a/skin.json b/skin.json index 6b0e276..cf38d28 100644 --- a/skin.json +++ b/skin.json @@ -43,6 +43,9 @@ }, "resources/screen-mobile.less": { "media": "screen and (max-width: 850px)" + }, + "resources/print.css": { + "media": "print" } } }, -- To view, visit https://gerrit.wikimedia.org/r/282480 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia14e7f26dd249e95d1bbe00437b8d1483be08fa5 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/skins/Timeless Gerrit-Branch: master Gerrit-Owner: IsarraGerrit-Reviewer: Isarra Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove stupid print height value - change (mediawiki...Screenplay)
Isarra has uploaded a new change for review. https://gerrit.wikimedia.org/r/282481 Change subject: Remove stupid print height value .. Remove stupid print height value Change-Id: I3f75fcbb5cc199af15014183ed53e562c15056b0 --- M resources/ext.screenplay.print.css 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Screenplay refs/changes/81/282481/1 diff --git a/resources/ext.screenplay.print.css b/resources/ext.screenplay.print.css index 64ce3cd..f61f6e6 100644 --- a/resources/ext.screenplay.print.css +++ b/resources/ext.screenplay.print.css @@ -5,8 +5,7 @@ .screenplay { /* width: 8.5" - 2.5", height: 11" - 2" */ width: 6in; - height: 9in; - /* margin: 1in 1in 1in 1.5in; except this is nested in mw, which probably has a ~1" margin already*/ + /* margin: 1in 1in 1in 1.5in; except this is nested in mw, which probably prints with a ~1" margin already */ margin: 0 0 0 .5in; font-family: Courier, monospace; font-size: 12pt; -- To view, visit https://gerrit.wikimedia.org/r/282481 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f75fcbb5cc199af15014183ed53e562c15056b0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Screenplay Gerrit-Branch: master Gerrit-Owner: Isarra___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add possibility to filter for log_action in all core logs - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add possibility to filter for log_action in all core logs .. Add possibility to filter for log_action in all core logs Adds possibility to filter all core logs with multiple log_actions, Log actions newusers and create for the newusers log are treated as one, because newusers is the predecessor of create and they describe the same actions. Bug: T16334 Bug: T109267 Change-Id: I04a0ef1a6b4ea90c517a11045b6bd73c26b96863 --- M includes/DefaultSettings.php M languages/i18n/en.json M languages/i18n/qqq.json 3 files changed, 94 insertions(+), 0 deletions(-) Approvals: Florianschmidtwelzow: Looks good to me, approved Luke081515: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 65032ad..8fa7c55 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -7240,11 +7240,35 @@ 'reblock' => [ 'reblock' ], 'unblock' => [ 'unblock' ], ], + 'contentmodel' => [ + 'change' => [ 'change' ], + 'new' => [ 'new' ], + ], 'delete' => [ 'delete' => [ 'delete' ], 'restore' => [ 'restore' ], 'event' => [ 'event' ], 'revision' => [ 'revision' ], + ], + 'import' => [ + 'interwiki' => [ 'interwiki' ], + 'upload' => [ 'upload' ], + ], + 'managetags' => [ + 'create' => [ 'create' ], + 'delete' => [ 'delete' ], + 'activate' => [ 'activate' ], + 'deactivate' => [ 'deactivate' ], + ], + 'move' => [ + 'move' => [ 'move' ], + 'move_redir' => [ 'move_redir' ], + ], + 'newusers' => [ + 'create' => [ 'create', 'newusers' ], + 'create2' => ['create2' ], + 'autocreate' => [ 'autocreate' ], + 'byemail' => [ 'byemail' ], ], 'patrol' => [ 'patrol' => [ 'patrol' ], @@ -7254,6 +7278,18 @@ 'protect' => [ 'protect' ], 'modify' => [ 'modify' ], 'unprotect' => [ 'unprotect' ], + 'move_prot' => ['move_prot'], + ], + 'rights' => [ + 'rights' => [ 'rights' ], + 'autopromote' => [ 'autopromote' ], + ], + 'suppress' => [ + 'event' => [ 'event' ], + 'revision' => [ 'revision' ], + 'delete' => [ 'delete' ], + 'block' => [ 'block' ], + 'reblock' => [ 'reblock' ], ], 'upload' => [ 'upload' => [ 'upload' ], diff --git a/languages/i18n/en.json b/languages/i18n/en.json index fe307d4..f5900a58 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -4025,23 +4025,52 @@ "sessionprovider-nocookies": "Cookies may be disabled. Ensure you have cookies enabled and start again.", "randomrootpage": "Random root page", "log-action-filter-block": "Type of block:", + "log-action-filter-contentmodel": "Type of contentmodel modification:", "log-action-filter-delete": "Type of deletion:", + "log-action-filter-import": "Type of import:", + "log-action-filter-managetags": "Type of tag management action:", + "log-action-filter-move": "Type of move:", + "log-action-filter-newusers": "Type of account creation:", "log-action-filter-patrol": "Type of patrol:", "log-action-filter-protect": "Type of protection:", + "log-action-filter-rights": "Type of right change", + "log-action-filter-suppress": "Type of suppression", "log-action-filter-upload": "Type of upload:", "log-action-filter-all": "All", "log-action-filter-block-block": "Block", "log-action-filter-block-reblock": "Block modification", "log-action-filter-block-unblock": "Unblock", + "log-action-filter-contentmodel-change": "Change of Contentmodel", + "log-action-filter-contentmodel-new": "Creation of page with non-standard Contentmodel", "log-action-filter-delete-delete": "Page deletion", "log-action-filter-delete-restore": "Page undeletion", "log-action-filter-delete-event": "Log deletion", "log-action-filter-delete-revision": "Revision deletion", + "log-action-filter-import-interwiki": "Transwiki import", + "log-action-filter-import-upload": "Import by XML upload", + "log-action-filter-managetags-create": "Tag creation", + "log-action-filter-managetags-delete": "Tag deletion", + "log-action-filter-managetags-activate": "Tag activation", + "log-action-filter-managetags-deactivate": "Tag deactivation", +
[MediaWiki-commits] [Gerrit] Add print styles, add 'mw' to page-header-links id - change (mediawiki...Timeless)
Isarra has uploaded a new change for review. https://gerrit.wikimedia.org/r/282480 Change subject: Add print styles, add 'mw' to page-header-links id .. Add print styles, add 'mw' to page-header-links id Change-Id: Ia14e7f26dd249e95d1bbe00437b8d1483be08fa5 --- M TimelessTemplate.php A resources/print.css M resources/screen-common.less M resources/screen-desktop.less M skin.json 5 files changed, 23 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Timeless refs/changes/80/282480/1 diff --git a/TimelessTemplate.php b/TimelessTemplate.php index d628fbb..90ff543 100644 --- a/TimelessTemplate.php +++ b/TimelessTemplate.php @@ -107,7 +107,7 @@ html( 'title' ) ?> - + assemblePortlet( array( 'id' => 'p-namespaces', diff --git a/resources/print.css b/resources/print.css new file mode 100644 index 000..cc8f611 --- /dev/null +++ b/resources/print.css @@ -0,0 +1,16 @@ +/* Styles for print view and printing */ + +/* Hide some extra stuff from print view */ +.mw-indicators, +#mw-header, +#mw-site-navigation, +#mw-related-navigation, +#mw-page-header-links, +#mw-footer, +#catlinks { + display: none; +} + +#mw-content-text { + margin-bottom: 3em; +} diff --git a/resources/screen-common.less b/resources/screen-common.less index cc66e55..4ea5124 100644 --- a/resources/screen-common.less +++ b/resources/screen-common.less @@ -165,7 +165,7 @@ #mw-content-container { border-bottom: solid 4px @green; } -#page-header-links { +#mw-page-header-links { div, ul, li { diff --git a/resources/screen-desktop.less b/resources/screen-desktop.less index 8be7343..d9523ce 100644 --- a/resources/screen-desktop.less +++ b/resources/screen-desktop.less @@ -101,8 +101,8 @@ } } -#page-header-links #ca-more, -#page-header-links #ca-languages, +#mw-page-header-links #ca-more, +#mw-page-header-links #ca-languages, .sidebar-chunk h2 { display: none; } diff --git a/skin.json b/skin.json index 6b0e276..cf38d28 100644 --- a/skin.json +++ b/skin.json @@ -43,6 +43,9 @@ }, "resources/screen-mobile.less": { "media": "screen and (max-width: 850px)" + }, + "resources/print.css": { + "media": "print" } } }, -- To view, visit https://gerrit.wikimedia.org/r/282480 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia14e7f26dd249e95d1bbe00437b8d1483be08fa5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Timeless Gerrit-Branch: master Gerrit-Owner: Isarra___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [tests] Aditional unittests for build_table - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: [tests] Aditional unittests for build_table .. [tests] Aditional unittests for build_table - add py3 compatibility - add doc strings Change-Id: I0ca9f38314562b673bafa45087bf41df21c495be --- M imagereview.py M tests/imagereview_tests.py 2 files changed, 100 insertions(+), 9 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/imagereview.py b/imagereview.py index f51a2d9..38af78d 100644 --- a/imagereview.py +++ b/imagereview.py @@ -605,7 +605,7 @@ self.save(i, text, summary=summary) return True # returns klären!!! -def build_table(self, save=True): +def build_table(self, save=True, unittest=False): def f(k): r = 0 @@ -632,7 +632,7 @@ table[sortkey].append([image.title(asLink=True, textlink=True), uploader, image, u'']) pywikibot.output(u'\nBuilding wiki table...') -keys = table.keys() +keys = list(table.keys()) # py3 compatibility if self.getOption('list'): keys.sort() else: @@ -668,7 +668,7 @@ pywikibot.output(u'Max limit %d exceeded.' % self.total) break continue -if self.inform_user(key, table[key]): +if not unittest and self.inform_user(key, table[key]): pywikibot.output(u'%s done.' % key) informed.append(key) k += l @@ -684,7 +684,6 @@ # jetzt wieder sortieren und (leider) erneuten Druchlauf informed.sort() keys = informed - for key in keys: if self.getOption('check'): ##cattext += u'\n== [[Benutzer:%s|]] ==\n\n' % key @@ -700,7 +699,7 @@ if self.getOption('check'): self.save(cat, cattext, summary=u'Bot: Neue DÜP-Einträge') self.save(pywikibot.Page(self.site, self.dest), text) -return +return table def run_check(self): MAX = 500 diff --git a/tests/imagereview_tests.py b/tests/imagereview_tests.py index 3834117..014a276 100644 --- a/tests/imagereview_tests.py +++ b/tests/imagereview_tests.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -"""Test vandalism modules.""" +"""Test imagereview modules.""" # -# (C) xqt, 2015 +# (C) xqt, 2016 # # Distributed under the terms of the MIT license. # @@ -15,6 +15,8 @@ import unittest import pywikibot +from pywikibot import config, Timestamp +from pywikibot.tools import StringTypes currentdir = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe( @@ -27,8 +29,6 @@ class TestMessages(unittest.TestCase): """Test messages.""" - -net = False def test_message_keys(self): """Test message keys for mail and talk page.""" @@ -52,18 +52,25 @@ @classmethod def setUpClass(cls): +"""Setup class.""" +super(TestDUP_Image, cls).setUpClass() cls.site = pywikibot.Site('de', 'wikipedia') cls.review_tpl = pywikibot.Page(cls.site, 'düp', 10) @classmethod def tearDownClass(cls): +"""Cleanup Class.""" del cls.site del cls.review_tpl +super(TestDUP_Image, cls).tearDownClass() def tearDown(self): +"""Cleanup methods.""" del self.image +super(TestDUP_Image, self).tearDown() def init_content(self): +"""Instantiate DUP_Image.""" self.image = imagereview.DUP_Image(self.site, 'Sample.jpg', self.TMPL) self.image._templates.append(self.review_tpl) self.image.text += self.TMPL @@ -107,6 +114,91 @@ self.assertTrue(self.image.hasRefs) +class TestCheckImageBot(unittest.TestCase): + +"""Test CheckImageBot.""" + +@classmethod +def setUpClass(cls): +"""Setup Class.""" +config.family = 'wikipedia' +config.mylang = 'de' + +def test_invalid_option(self): +"""Test run method without options.""" +with self.assertRaises(NotImplementedError): +imagereview.CheckImageBot() + +def test_list_option(self): +"""Test run method with list options.""" +bot = imagereview.CheckImageBot(list=True, total=1) +self.assertEqual(bot.sort, 1) +self.assertTrue(bot.filter) +self.assertEqual(bot.total, 1) + +def test_check_option(self): +"""Test run method with check options.""" +bot = imagereview.CheckImageBot(check=True) +self.assertEqual(bot.sort, 0) +self.assertFalse(bot.filter) +self.assertIsNone(bot.total) + +def test_build_table_with_list(self): +"""Test buildt table with list option.""" +bot = imagereview.CheckImageBot(list=True) +table =
[MediaWiki-commits] [Gerrit] Make some TablePager methods actually protected - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Make some TablePager methods actually protected .. Make some TablePager methods actually protected * getTableClass * getNavClass * getSortHeaderClass Change-Id: I459ca456149635e3300c7ca7cfed4c1edc1c12b1 --- M includes/pager/TablePager.php M includes/specials/SpecialProtectedpages.php M includes/specials/pagers/BlockListPager.php M includes/specials/pagers/ImageListPager.php 4 files changed, 8 insertions(+), 11 deletions(-) Approvals: Florianschmidtwelzow: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/pager/TablePager.php b/includes/pager/TablePager.php index e22ceba..0a89e4e 100644 --- a/includes/pager/TablePager.php +++ b/includes/pager/TablePager.php @@ -264,26 +264,23 @@ } /** -* @protected * @return string */ - function getTableClass() { + protected function getTableClass() { return 'TablePager'; } /** -* @protected * @return string */ - function getNavClass() { + protected function getNavClass() { return 'TablePager_nav'; } /** -* @protected * @return string */ - function getSortHeaderClass() { + protected function getSortHeaderClass() { return 'TablePager_sort'; } diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 8e9636e..54b471e 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -549,7 +549,7 @@ ]; } - public function getTableClass() { + protected function getTableClass() { return parent::getTableClass() . ' mw-protectedpages'; } diff --git a/includes/specials/pagers/BlockListPager.php b/includes/specials/pagers/BlockListPager.php index cfaf5c5..d822976 100644 --- a/includes/specials/pagers/BlockListPager.php +++ b/includes/specials/pagers/BlockListPager.php @@ -241,7 +241,7 @@ return $info; } - public function getTableClass() { + protected function getTableClass() { return parent::getTableClass() . ' mw-blocklist'; } diff --git a/includes/specials/pagers/ImageListPager.php b/includes/specials/pagers/ImageListPager.php index 258ac83..45fe5c4 100644 --- a/includes/specials/pagers/ImageListPager.php +++ b/includes/specials/pagers/ImageListPager.php @@ -561,15 +561,15 @@ $form->displayForm( '' ); } - function getTableClass() { + protected function getTableClass() { return parent::getTableClass() . ' listfiles'; } - function getNavClass() { + protected function getNavClass() { return parent::getNavClass() . ' listfiles_nav'; } - function getSortHeaderClass() { + protected function getSortHeaderClass() { return parent::getSortHeaderClass() . ' listfiles_sort'; } -- To view, visit https://gerrit.wikimedia.org/r/282453 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I459ca456149635e3300c7ca7cfed4c1edc1c12b1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: RicordisamoaGerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace usage of wfSetupSession() - change (mediawiki...CentralNotice)
Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/282479 Change subject: Replace usage of wfSetupSession() .. Replace usage of wfSetupSession() Bug: T132251 Change-Id: Id750d2659b6231935fd13489563c1214a139924d --- M special/SpecialCentralNoticeBanners.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/79/282479/1 diff --git a/special/SpecialCentralNoticeBanners.php b/special/SpecialCentralNoticeBanners.php old mode 100644 new mode 100755 index 9b72f9d..6820a97 --- a/special/SpecialCentralNoticeBanners.php +++ b/special/SpecialCentralNoticeBanners.php @@ -23,7 +23,7 @@ SpecialPage::__construct( 'CentralNoticeBanners' ); // Make sure we have a session - wfSetupSession(); + \MediaWiki\Session\SessionManager::getGlobalSession()->persist(); // Load things that may have been serialized into the session $this->bannerLanguagePreview = $this->getCNSessionVar( -- To view, visit https://gerrit.wikimedia.org/r/282479 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id750d2659b6231935fd13489563c1214a139924d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix viewing raw php files in diffusion - change (operations/puppet)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/282478 Change subject: Fix viewing raw php files in diffusion .. Fix viewing raw php files in diffusion This fixes the problem whereby you go a view a raw php file but it asks you to download instead. Ive tested on my local machine and it works. Change-Id: I2766149bf74125942e1de2520f936da1e84a0ef3 --- M modules/phabricator/data/fixed_settings.yaml 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/78/282478/1 diff --git a/modules/phabricator/data/fixed_settings.yaml b/modules/phabricator/data/fixed_settings.yaml index a091cb4..6058853 100644 --- a/modules/phabricator/data/fixed_settings.yaml +++ b/modules/phabricator/data/fixed_settings.yaml @@ -29,7 +29,7 @@ 'audio/x-wav': 'audio/x-wav' 'application/ogg': 'application/ogg' 'audio/mpeg': 'audio/mpeg' - 'text/x-php': 'text/x-php; charset=utf-8' + 'text/x-php': 'text/plain; charset=utf-8' files.image-mime-types: 'image/jpeg': true -- To view, visit https://gerrit.wikimedia.org/r/282478 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2766149bf74125942e1de2520f936da1e84a0ef3 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Paladox___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve how the number of conditions is counted - change (mediawiki...AbuseFilter)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/282477 Change subject: Improve how the number of conditions is counted .. Improve how the number of conditions is counted With the new behavior, the number of conditions in incremented when: * Evaluating a function * Evaluating a comparison operator (== === != !== < > <= >= =) * Evaluating a keyword (in like matches contains rlike irlike regex) Previously, the number of conditions was incremented when: * Evaluating a function * Entering the comparison operator evaluation mode This resulted in a number of surprising behaviors. In particular: * '(((a == b)))' counted as 4 conditions, not 1 * 'contains_any(a, b, c)' counted as 5 conditions, not 1 * 'a == b == c' counted as 1 condition, not 2 * 'a in b + c in d + e in f' counted as 1 condition, not 3 * 'true' counted as 1 condition, not 0 It is still possible to easily cheat the count by rewriting comparisons as arithmetic operations. I believe this is meant to advise users of the complexity of their rules and not really enforce strict limits. Bug: T132190 Change-Id: I897769db4c2ceac802e3ae5d6fa8e9c9926ef246 --- M AbuseFilter.parser.php M tests/phpunit/parserTest.php 2 files changed, 33 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/77/282477/1 diff --git a/AbuseFilter.parser.php b/AbuseFilter.parser.php index 1ef3a1e..cc9d7a8 100644 --- a/AbuseFilter.parser.php +++ b/AbuseFilter.parser.php @@ -1016,7 +1016,6 @@ * @param $result */ protected function doLevelCompares( &$result ) { - AbuseFilter::triggerLimiter(); $this->doLevelSumRels( $result ); $ops = array( '==', '===', '!=', '!==', '<', '>', '<=', '>=', '=' ); while ( $this->mCur->type == AFPToken::TOP && in_array( $this->mCur->value, $ops ) ) { @@ -1024,6 +1023,7 @@ $this->move(); $r2 = new AFPData(); $this->doLevelSumRels( $r2 ); + AbuseFilter::triggerLimiter(); $result = AFPData::compareOp( $result, $r2, $op ); } } @@ -1114,6 +1114,7 @@ return; // The result doesn't matter. } + AbuseFilter::triggerLimiter(); wfProfileIn( __METHOD__ . "-$func" ); $result = AFPData::$func( $result, $r2, $this->mCur->pos ); wfProfileOut( __METHOD__ . "-$func" ); diff --git a/tests/phpunit/parserTest.php b/tests/phpunit/parserTest.php index 34c6c9c..0a114f1 100644 --- a/tests/phpunit/parserTest.php +++ b/tests/phpunit/parserTest.php @@ -77,7 +77,7 @@ } /** -* Ensure that AbsueFilterTokenizer::OPERATOR_RE matches the contents +* Ensure that AbuseFilterTokenizer::OPERATOR_RE matches the contents * and order of AbuseFilterTokenizer::$operators. */ public function testOperatorRe() { @@ -88,7 +88,7 @@ } /** -* Ensure that AbsueFilterTokenizer::RADIX_RE matches the contents +* Ensure that AbuseFilterTokenizer::RADIX_RE matches the contents * and order of AbuseFilterTokenizer::$bases. */ public function testRadixRe() { @@ -96,4 +96,33 @@ $radixRe = "/([0-9A-Fa-f]+(?:\.\d*)?|\.\d+)([$baseClass])?/Au"; $this->assertEquals( $radixRe, AbuseFilterTokenizer::RADIX_RE ); } + + /** +* Ensure the number of conditions counted for given expressions is right. +* +* @dataProvider condCountCases +*/ + public function testCondCount( $rule, $expected ) { + $parser = self::getParser(); + // Set some variables for convenience writing test cases + $parser->setVars( array_combine( range( 'a', 'f' ), range( 'a', 'f' ) ) ); + $countBefore = AbuseFilter::$condCount; + $parser->parse( $rule ); + $countAfter = AbuseFilter::$condCount; + $actual = $countAfter - $countBefore; + $this->assertEquals( $expected, $actual, 'Condition count for ' . $rule ); + } + + /** +* @return array +*/ + public function condCountCases() { + return array( + array( '(((a == b)))', 1 ), + array( 'contains_any(a, b, c)', 1 ), + array( 'a == b == c', 2 ), + array( 'a in b + c in d + e in f', 3 ), + array( 'true', 0 ), + ); + } } -- To view, visit https://gerrit.wikimedia.org/r/282477 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange
[MediaWiki-commits] [Gerrit] Fix broken confirmation link in mail when using protocol-rel... - change (mediawiki...ConfirmAccount)
jan has uploaded a new change for review. https://gerrit.wikimedia.org/r/282476 Change subject: Fix broken confirmation link in mail when using protocol-relative $wgServer .. Fix broken confirmation link in mail when using protocol-relative $wgServer If $wgServer has the protocol-relative form (e.g. "//mediawiki.org") the confirmation link is broken since not $wgCanonicalServer is used. The problem is fixed when the getCanonicalLink() method of Title is used. Change-Id: Ie87c1abebf0a4502a687eac76674b585b9b936a6 --- M backend/ConfirmAccount.class.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ConfirmAccount refs/changes/76/282476/1 diff --git a/backend/ConfirmAccount.class.php b/backend/ConfirmAccount.class.php index ba28531..d12db47 100644 --- a/backend/ConfirmAccount.class.php +++ b/backend/ConfirmAccount.class.php @@ -72,7 +72,7 @@ */ public static function confirmationTokenUrl( $token ) { $title = SpecialPage::getTitleFor( 'RequestAccount' ); - return $title->getFullUrl( array( + return $title->getCanonicalURL( array( 'action' => 'confirmemail', 'wpEmailToken' => $token ) ); -- To view, visit https://gerrit.wikimedia.org/r/282476 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie87c1abebf0a4502a687eac76674b585b9b936a6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ConfirmAccount Gerrit-Branch: master Gerrit-Owner: jan___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve ignoring short-circuited operations - change (mediawiki...AbuseFilter)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/282475 Change subject: Improve ignoring short-circuited operations .. Improve ignoring short-circuited operations (This is just a check to see if the tests fail when I break this, patch coming later...) Change-Id: Id1d5f577b14b6ae6d987ded12689788eb7922474 --- A tests/parserTests/shortcircuit.r A tests/parserTests/shortcircuit.t 2 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/75/282475/1 diff --git a/tests/parserTests/shortcircuit.r b/tests/parserTests/shortcircuit.r new file mode 100644 index 000..4736e08 --- /dev/null +++ b/tests/parserTests/shortcircuit.r @@ -0,0 +1 @@ +MATCH diff --git a/tests/parserTests/shortcircuit.t b/tests/parserTests/shortcircuit.t new file mode 100644 index 000..bec088f --- /dev/null +++ b/tests/parserTests/shortcircuit.t @@ -0,0 +1,2 @@ +/* The division by zero should not be executed and not crash the filter */ +true | 1/0 -- To view, visit https://gerrit.wikimedia.org/r/282475 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1d5f577b14b6ae6d987ded12689788eb7922474 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unnecessary phpcs overrides - change (mediawiki...AbuseFilter)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/282474 Change subject: Remove unnecessary phpcs overrides .. Remove unnecessary phpcs overrides Change-Id: Ic7648c14f2ac2a07878f69e102832215af6855c8 --- M AbuseFilter.parser.php M AbuseFilterTokenizer.php 2 files changed, 3 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/74/282474/1 diff --git a/AbuseFilter.parser.php b/AbuseFilter.parser.php index 1ef3a1e..05dcc7e 100644 --- a/AbuseFilter.parser.php +++ b/AbuseFilter.parser.php @@ -1305,9 +1305,7 @@ case AFPToken::TSQUAREBRACKET: if ( $this->mCur->value == '[' ) { $list = array(); - // @codingStandardsIgnoreStart Space beforsemi-colon ignored. - for ( ; ; ) { - // @codingStandardsIgnoreEnd + while ( true ) { $this->move(); if ( $this->mCur->type == AFPToken::TSQUAREBRACKET && $this->mCur->value == ']' ) { break; @@ -1662,9 +1660,7 @@ static $replacementArray = null; if ( is_null( $replacementArray ) ) { - // @codingStandardsIgnoreStart Ignore global without wg prefix. global $IP; - // @codingStandardsIgnoreEnd if ( is_readable( "$IP/extensions/AntiSpoof/equivset.php" ) ) { // Satisfy analyzer. diff --git a/AbuseFilterTokenizer.php b/AbuseFilterTokenizer.php index b76d7ec..1a6a2b6 100644 --- a/AbuseFilterTokenizer.php +++ b/AbuseFilterTokenizer.php @@ -7,9 +7,8 @@ const CACHE_VERSION = 1; const COMMENT_START_RE = '/\s*\/\*/A'; const ID_SYMBOL_RE = '/[0-9A-Za-z_]+/A'; - // @codingStandardsIgnoreStart Ignore long line. - const OPERATOR_RE = '/(\!\=\=|\!\=|\!|\*\*|\*|\/|\+|\-|%|&|\||\^|\:\=|\?|\:|\<\=|\<|\>\=|\>|\=\=\=|\=\=|\=)/A'; - // @codingStandardsIgnoreEnd + const OPERATOR_RE = + '/(\!\=\=|\!\=|\!|\*\*|\*|\/|\+|\-|%|&|\||\^|\:\=|\?|\:|\<\=|\<|\>\=|\>|\=\=\=|\=\=|\=)/A'; const RADIX_RE = '/([0-9A-Fa-f]+(?:\.\d*)?|\.\d+)([bxo])?/Au'; const WHITESPACE = "\011\012\013\014\015\040"; -- To view, visit https://gerrit.wikimedia.org/r/282474 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7648c14f2ac2a07878f69e102832215af6855c8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace explicit message with an {{int:}} reference - change (mediawiki...SemanticForms)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/282473 Change subject: Replace explicit message with an {{int:}} reference .. Replace explicit message with an {{int:}} reference Change-Id: I6d0c55b7d651241374c5c6fd9ba66bce80632474 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/73/282473/1 diff --git a/i18n/en.json b/i18n/en.json index a25d7dc..238305c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -261,5 +261,5 @@ "sf-regexp-baseprefix": "Prefix for the parameters of the base type.", "sf-regexp-orchar": "The OR-character to be used in the regular expression instead of |. Defaults to \"!\"", "sf-regexp-inverse": "If set, the input must NOT match the regular expression to be valid. I.e. the regular expression is inverted.", - "sf-regexp-message": "The error message to be displayed if the match fails. Defaults to \"Wrong format!\" (or equivalent in the current locale)" + "sf-regexp-message": "The error message to be displayed if the match fails. Defaults to {{int:sf-regexp-wrongformat}}" } -- To view, visit https://gerrit.wikimedia.org/r/282473 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d0c55b7d651241374c5c6fd9ba66bce80632474 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: Amire80___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve robustness of es-tool - change (operations/puppet)
Adedommelin has uploaded a new change for review. https://gerrit.wikimedia.org/r/282472 Change subject: Improve robustness of es-tool .. Improve robustness of es-tool Make set_allocation_state try REPLICATION_ENABLE_ATTEMPTS times before definitive failure. Bug: T128786 Change-Id: Ib5a6888a4b257be04ffc9a84b56477a88a22efd4 --- M modules/elasticsearch/files/es-tool 1 file changed, 15 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/72/282472/1 diff --git a/modules/elasticsearch/files/es-tool b/modules/elasticsearch/files/es-tool index 7138433..889ee18 100755 --- a/modules/elasticsearch/files/es-tool +++ b/modules/elasticsearch/files/es-tool @@ -64,7 +64,15 @@ def set_allocation_state(status): -return set_setting("cluster.routing.allocation.enable", status) +for attempt in range(REPLICATION_ENABLE_ATTEMPTS): +try: +if set_setting("cluster.routing.allocation.enable", status): +return True +except: +time.sleep(3) +print "failed! -- retrying (%d/%d)" % (attempt, + REPLICATION_ENABLE_ATTEMPTS) +return False def set_banned_nodes(nodelist, node_type): @@ -221,23 +229,13 @@ # Turn replication back on so things will recover fully printu("Enabling all replication...") -for attempt in range(REPLICATION_ENABLE_ATTEMPTS): -try: -if not set_allocation_state("all"): -print "failed! -- You will still need to enable replication", -print "again with `es-tool start-replication`" -return os.EX_UNAVAILABLE -else: -break -except ConnectionError: -print "failed! -- retrying (%d/%d)" % (attempt, - REPLICATION_ENABLE_ATTEMPTS) -time.sleep(3) -else: -print "failed! -- You will still need to enable replication again", -print "with `es-tool start-replication`" + +if not set_allocation_state("all"): +print "failed! -- You will still need to enable replication", +print "again with `es-tool start-replication`" return os.EX_UNAVAILABLE -printu("ok\n") +else: +printu("ok\n") # Wait a bit time.sleep(5) -- To view, visit https://gerrit.wikimedia.org/r/282472 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5a6888a4b257be04ffc9a84b56477a88a22efd4 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Adedommelin___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use markup for emphasis instead of all-caps - change (mediawiki...SemanticForms)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/282470 Change subject: Use markup for emphasis instead of all-caps .. Use markup for emphasis instead of all-caps All-caps must not be used in localization, because most alphabets don't have capital letters. Change-Id: I31857c6d84258b173bc8df88901c525fdf24e520 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/70/282470/1 diff --git a/i18n/en.json b/i18n/en.json index a25d7dc..1fd97ca 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -260,6 +260,6 @@ "sf-regexp-basetype": "The real input type to be used. Defaults to \"text\".", "sf-regexp-baseprefix": "Prefix for the parameters of the base type.", "sf-regexp-orchar": "The OR-character to be used in the regular expression instead of |. Defaults to \"!\"", - "sf-regexp-inverse": "If set, the input must NOT match the regular expression to be valid. I.e. the regular expression is inverted.", + "sf-regexp-inverse": "If set, the input must not match the regular expression to be valid. I.e. the regular expression is inverted.", "sf-regexp-message": "The error message to be displayed if the match fails. Defaults to \"Wrong format!\" (or equivalent in the current locale)" } -- To view, visit https://gerrit.wikimedia.org/r/282470 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31857c6d84258b173bc8df88901c525fdf24e520 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: Amire80___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set wgSemiprotectedRestrictionLevels for de.wikipedia - change (operations/mediawiki-config)
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/282471 Change subject: Set wgSemiprotectedRestrictionLevels for de.wikipedia .. Set wgSemiprotectedRestrictionLevels for de.wikipedia Bug: T132249 Change-Id: Ic86f2f1aaaed379e309b011e316dd49a903dc29c --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/71/282471/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4aab2dd..2142cee 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -4343,6 +4343,7 @@ 'wgSemiprotectedRestrictionLevels' => array( 'default' => array( 'autoconfirmed' ), + '+dewiki' => array( 'editeditorprotected' ), // T132249 '+enwiki' => array( 'extendedconfirmed' ), // T126607 '+frwiki' => array( 'editextendedsemiprotected' ), // T132248 ), -- To view, visit https://gerrit.wikimedia.org/r/282471 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic86f2f1aaaed379e309b011e316dd49a903dc29c Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set wgSemiprotectedRestrictionLevels for fr.wikipedia - change (operations/mediawiki-config)
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/282469 Change subject: Set wgSemiprotectedRestrictionLevels for fr.wikipedia .. Set wgSemiprotectedRestrictionLevels for fr.wikipedia Bug: T132248 Change-Id: Ic46b10aabbe566d669dceaee561ad73a9c40d77e --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/69/282469/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 2b64c42..4aab2dd 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -4344,6 +4344,7 @@ 'wgSemiprotectedRestrictionLevels' => array( 'default' => array( 'autoconfirmed' ), '+enwiki' => array( 'extendedconfirmed' ), // T126607 + '+frwiki' => array( 'editextendedsemiprotected' ), // T132248 ), 'wgSiteNotice' => array( -- To view, visit https://gerrit.wikimedia.org/r/282469 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic46b10aabbe566d669dceaee561ad73a9c40d77e Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add to a message that has sample code - change (mediawiki...SemanticForms)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/282468 Change subject: Add to a message that has sample code .. Add to a message that has sample code This should hint translators to apply correct markup, including direction. Change-Id: I28a818d00bc0ea9d06c53839855302f58e2672ce --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/68/282468/1 diff --git a/i18n/en.json b/i18n/en.json index a25d7dc..43bb073 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -256,7 +256,7 @@ "sf-datepicker-enableinputfield": "Should the user be able to fill the input field directly or only via the date picker?", "sf-datepicker-showresetbutton": "Should a reset button be shown? This is the only way for the user to erase the input field if it is disabled for direct input.", "sf-regexp-wrongformat": "Wrong format.", - "sf-regexp-regexp": "The regular expression the input has to match to be valid. This must be given including the slashes! Defaults to \"/.*/\", i.e. any value.", + "sf-regexp-regexp": "The regular expression the input has to match to be valid. This must be given including the slashes! Defaults to \"/.*/\", i.e. any value.", "sf-regexp-basetype": "The real input type to be used. Defaults to \"text\".", "sf-regexp-baseprefix": "Prefix for the parameters of the base type.", "sf-regexp-orchar": "The OR-character to be used in the regular expression instead of |. Defaults to \"!\"", -- To view, visit https://gerrit.wikimedia.org/r/282468 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I28a818d00bc0ea9d06c53839855302f58e2672ce Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: Amire80___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPR] fix username - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: [IMPR] fix username .. [IMPR] fix username Change-Id: Ib0ff1893ea2a3756be1bc9fd01c19526357d2107 --- M checkvotes.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/checkvotes.py b/checkvotes.py index 0c7ff9f..06ec3d7 100644 --- a/checkvotes.py +++ b/checkvotes.py @@ -280,7 +280,7 @@ if username in problems: target_username = problems[username] else: -target_username = username +target_username = username.replace('', ' ') # Scherzkekse if username in seen and last != username: pywikibot.output('%s already seen on this page' % username) continue -- To view, visit https://gerrit.wikimedia.org/r/282467 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib0ff1893ea2a3756be1bc9fd01c19526357d2107 Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPR] fix username - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282467 Change subject: [IMPR] fix username .. [IMPR] fix username Change-Id: Ib0ff1893ea2a3756be1bc9fd01c19526357d2107 --- M checkvotes.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/67/282467/1 diff --git a/checkvotes.py b/checkvotes.py index 0c7ff9f..93577eb 100644 --- a/checkvotes.py +++ b/checkvotes.py @@ -280,7 +280,7 @@ if username in problems: target_username = problems[username] else: -target_username = username +target_username = username.replace('', ' ') # Scherzkekse if username in seen and last != username: pywikibot.output('%s already seen on this page' % username) continue -- To view, visit https://gerrit.wikimedia.org/r/282467 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib0ff1893ea2a3756be1bc9fd01c19526357d2107 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: Xqt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Simplification of Cassandra Logstash filtering - change (operations/puppet)
Jstenval has uploaded a new change for review. https://gerrit.wikimedia.org/r/282466 Change subject: Simplification of Cassandra Logstash filtering .. Simplification of Cassandra Logstash filtering Implementing additivity in logback.xml configuration. and at the same time removing dependency jar files added in T128787. Bug:T130861 Change-Id: I5bc55904e707cc914106e56d0d4c3cbb80484e8f --- M modules/cassandra/manifests/logging.pp M modules/cassandra/templates/logback.xml.erb 2 files changed, 9 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/66/282466/1 diff --git a/modules/cassandra/manifests/logging.pp b/modules/cassandra/manifests/logging.pp index 574690b..d5c4925 100644 --- a/modules/cassandra/manifests/logging.pp +++ b/modules/cassandra/manifests/logging.pp @@ -39,15 +39,10 @@ require => Package['cassandra/logstash-logback-encoder'], } -file { '/usr/share/cassandra/lib/commons-compiler-2.7.8.jar': -ensure => 'link', -target => '/srv/deployment/cassandra/logstash-logback-encoder/lib/commons-compiler-2.7.8.jar', -require => Package['cassandra/logstash-logback-encoder'], -} - -file { '/usr/share/cassandra/lib/janino-2.7.8.jar': -ensure => 'link', -target => '/srv/deployment/cassandra/logstash-logback-encoder/lib/janino-2.7.8.jar', -require => Package['cassandra/logstash-logback-encoder'], +# removes unnecessary dependencies, deprecates T128787; the following code can be removed once it's run on each node +# note! the source dependency jar files needs to be removed from somewhere (maybe trebuchet?? I don't know where) +$useless = ['/usr/share/cassandra/lib/commons-compiler-2.7.8.jar', '/usr/share/cassandra/lib/janino-2.7.8.jar'] +file { $useless: +ensure => 'absent', } } diff --git a/modules/cassandra/templates/logback.xml.erb b/modules/cassandra/templates/logback.xml.erb index 7d89169..4862814 100644 --- a/modules/cassandra/templates/logback.xml.erb +++ b/modules/cassandra/templates/logback.xml.erb @@ -51,13 +51,6 @@ <%= @logstash_host %> <%= @logstash_port %> {"program":"cassandra", "cluster":"<%= @cluster_name %>"} - - -return logger.equals("org.apache.cassandra.utils.StatusLogger"); - - NEUTRAL - DENY - @@ -79,5 +72,9 @@ + + + + -- To view, visit https://gerrit.wikimedia.org/r/282466 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bc55904e707cc914106e56d0d4c3cbb80484e8f Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Jstenval___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [tests] Aditional unittests for build_table - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282465 Change subject: [tests] Aditional unittests for build_table .. [tests] Aditional unittests for build_table Change-Id: I0ca9f38314562b673bafa45087bf41df21c495be --- M imagereview.py M tests/imagereview_tests.py 2 files changed, 98 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/65/282465/1 diff --git a/imagereview.py b/imagereview.py index f51a2d9..9c59b31 100644 --- a/imagereview.py +++ b/imagereview.py @@ -605,7 +605,7 @@ self.save(i, text, summary=summary) return True # returns klären!!! -def build_table(self, save=True): +def build_table(self, save=True, unittest=False): def f(k): r = 0 @@ -668,7 +668,7 @@ pywikibot.output(u'Max limit %d exceeded.' % self.total) break continue -if self.inform_user(key, table[key]): +if not unittest and self.inform_user(key, table[key]): pywikibot.output(u'%s done.' % key) informed.append(key) k += l @@ -684,7 +684,6 @@ # jetzt wieder sortieren und (leider) erneuten Druchlauf informed.sort() keys = informed - for key in keys: if self.getOption('check'): ##cattext += u'\n== [[Benutzer:%s|]] ==\n\n' % key @@ -700,7 +699,7 @@ if self.getOption('check'): self.save(cat, cattext, summary=u'Bot: Neue DÜP-Einträge') self.save(pywikibot.Page(self.site, self.dest), text) -return +return table def run_check(self): MAX = 500 diff --git a/tests/imagereview_tests.py b/tests/imagereview_tests.py index 3834117..ca5f297 100644 --- a/tests/imagereview_tests.py +++ b/tests/imagereview_tests.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -"""Test vandalism modules.""" +"""Test imagereview modules.""" # -# (C) xqt, 2015 +# (C) xqt, 2016 # # Distributed under the terms of the MIT license. # @@ -15,6 +15,8 @@ import unittest import pywikibot +from pywikibot import Timestamp +from pywikibot.tools import StringTypes currentdir = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe( @@ -27,8 +29,6 @@ class TestMessages(unittest.TestCase): """Test messages.""" - -net = False def test_message_keys(self): """Test message keys for mail and talk page.""" @@ -52,18 +52,25 @@ @classmethod def setUpClass(cls): +"""Setup class.""" +super(TestDUP_Image, self).setUpClass() cls.site = pywikibot.Site('de', 'wikipedia') cls.review_tpl = pywikibot.Page(cls.site, 'düp', 10) @classmethod def tearDownClass(cls): +"""Cleanup Class.""" del cls.site del cls.review_tpl +super(TestDUP_Image, self).tearDownClass() def tearDown(self): +"""Cleanup methods.""" del self.image +super(TestDUP_Image, self).tearDown() def init_content(self): +"""Instantiate DUP_Image.""" self.image = imagereview.DUP_Image(self.site, 'Sample.jpg', self.TMPL) self.image._templates.append(self.review_tpl) self.image.text += self.TMPL @@ -107,6 +114,90 @@ self.assertTrue(self.image.hasRefs) +class TestCheckImageBot(unittest.TestCase): + +"""Test CheckImageBot.""" + +def test_invalid_option(self): +"""Test run method without options.""" +with self.assertRaises(NotImplementedError): +bot = imagereview.CheckImageBot() + +def test_invalid_option(self): +"""Test run method without options.""" +with self.assertRaises(NotImplementedError): +bot = imagereview.CheckImageBot() + +def test_list_option(self): +"""Test run method with list options.""" +bot = imagereview.CheckImageBot(list=True, total=1) +self.assertEqual(bot.sort, 1) +self.assertTrue(bot.filter) +self.assertEqual(bot.total, 1) + +def test_check_option(self): +"""Test run method with check options.""" +bot = imagereview.CheckImageBot(check=True) +self.assertEqual(bot.sort, 0) +self.assertFalse(bot.filter) +self.assertIsNone(bot.total) + +def test_build_table_with_list(self): +"""Test buildt table with list option.""" +bot = imagereview.CheckImageBot(list=True) +table = bot.build_table(False) +if not table: +self.assertSkip() +key = table.keys()[0] +data = table[key] +item = data[0] +self.assertIsInstance(key, StringTypes) +self.assertIsInstance(data, list) +self.assertIsInstance(item, list) +
[MediaWiki-commits] [Gerrit] Rename ve-ce-sectionNode-focused to active - change (VisualEditor/VisualEditor)
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/282462 Change subject: Rename ve-ce-sectionNode-focused to active .. Rename ve-ce-sectionNode-focused to active Change-Id: I6bf094be08f68263aa8e50b05e2fbb420003d3de --- M src/ce/nodes/ve.ce.SectionNode.js M src/ce/styles/nodes/ve.ce.SectionNode.css 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/62/282462/1 diff --git a/src/ce/nodes/ve.ce.SectionNode.js b/src/ce/nodes/ve.ce.SectionNode.js index 6508ecc..3238729 100644 --- a/src/ce/nodes/ve.ce.SectionNode.js +++ b/src/ce/nodes/ve.ce.SectionNode.js @@ -81,13 +81,13 @@ if ( !this.surface.getActiveNode() || !this.surface.getActiveNode().traverseUpstream( function ( node ) { return node !== sectionNode; } ) ) { this.surface.setActiveNode( this ); } - this.$element.addClass( 've-ce-sectionNode-focused' ); + this.$element.addClass( 've-ce-sectionNode-active' ); } else { if ( this.surface.getActiveNode() === this ) { this.surface.setActiveNode( null ); } if ( !selection.isNull() ) { - this.$element.removeClass( 've-ce-sectionNode-focused' ); + this.$element.removeClass( 've-ce-sectionNode-active' ); } } }; diff --git a/src/ce/styles/nodes/ve.ce.SectionNode.css b/src/ce/styles/nodes/ve.ce.SectionNode.css index b0662e2..718d3fe 100644 --- a/src/ce/styles/nodes/ve.ce.SectionNode.css +++ b/src/ce/styles/nodes/ve.ce.SectionNode.css @@ -18,6 +18,6 @@ transition: opacity 250ms ease; } -.ve-ce-documentNode .ve-ce-sectionNode-focused { +.ve-ce-documentNode .ve-ce-sectionNode-active { opacity: 1; } -- To view, visit https://gerrit.wikimedia.org/r/282462 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6bf094be08f68263aa8e50b05e2fbb420003d3de Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement ve.dm.Selection#getCoveringRange - change (VisualEditor/VisualEditor)
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/282463 Change subject: Implement ve.dm.Selection#getCoveringRange .. Implement ve.dm.Selection#getCoveringRange Change-Id: I8512e6f67ca7025f8890663c10b4d69cb8063dd0 --- M src/ce/nodes/ve.ce.SectionNode.js M src/ce/ve.ce.Surface.js M src/dm/selections/ve.dm.LinearSelection.js M src/dm/selections/ve.dm.NullSelection.js M src/dm/selections/ve.dm.TableSelection.js M src/dm/ve.dm.Selection.js M src/ui/dialogs/ve.ui.FindAndReplaceDialog.js 7 files changed, 42 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/63/282463/1 diff --git a/src/ce/nodes/ve.ce.SectionNode.js b/src/ce/nodes/ve.ce.SectionNode.js index 3238729..3618db4 100644 --- a/src/ce/nodes/ve.ce.SectionNode.js +++ b/src/ce/nodes/ve.ce.SectionNode.js @@ -72,10 +72,10 @@ * @param {ve.dm.Selection} selection Selection */ ve.ce.SectionNode.prototype.onSurfaceModelSelect = function ( selection ) { - var ranges = selection.getRanges(), + var coveringRange = selection.getCoveringRange(), sectionNode = this; - if ( ranges.length && this.model.getRange().containsRange( ranges[ 0 ] ) ) { + if ( coveringRange && this.model.getRange().containsRange( new ve.Range( coveringRange.start ) ) ) { // Only set this as the active node if active node is empty, or not a // descendent of this node. if ( !this.surface.getActiveNode() || !this.surface.getActiveNode().traverseUpstream( function ( node ) { return node !== sectionNode; } ) ) { diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js index 735806a..4283d8e 100644 --- a/src/ce/ve.ce.Surface.js +++ b/src/ce/ve.ce.Surface.js @@ -1696,9 +1696,9 @@ documentModel = surfaceModel.getDocument(); if ( selection instanceof ve.dm.LinearSelection ) { - range = selection.getRanges()[ 0 ]; + range = selection.getCoveringRange(); } else if ( selection instanceof ve.dm.TableSelection ) { - range = new ve.Range( selection.getRanges()[ 0 ].start ); + range = new ve.Range( selection.getCoveringRange().start ); } else { e.preventDefault(); return; @@ -1725,7 +1725,7 @@ tx = ve.dm.Transaction.newFromRemoval( documentModel, range ); selection = selection.translateByTransaction( tx ); surfaceModel.change( tx, selection ); - range = selection.getRanges()[ 0 ]; + range = selection.getCoveringRange(); } // Save scroll position before changing focus to "offscreen" paste target @@ -1940,7 +1940,7 @@ return; } - range = selection.getRanges()[ 0 ]; + range = selection.getCoveringRange(); if ( slice ) { // Pasting non-table content into table: just replace the the first cell with the pasted content @@ -2567,6 +2567,7 @@ ve.ce.Surface.prototype.handleObservedChanges = function ( oldState, newState ) { var newSelection, transaction, removedUnicorns, + activeNode, coveringRange, nodeRange, containsStart, containsEnd, surface = this, dmDoc = this.getModel().getDocument(), insertedText = false; @@ -2767,7 +2768,7 @@ return; } - sequences = this.getSurface().sequenceRegistry.findMatching( model.getDocument().data, selection.getModel().getRanges()[ 0 ].end ); + sequences = this.getSurface().sequenceRegistry.findMatching( model.getDocument().data, selection.getModel().getCoveringRange().end ); // sequences.length will likely be 0 or 1 so don't cache for ( i = 0; i < sequences.length; i++ ) { diff --git a/src/dm/selections/ve.dm.LinearSelection.js b/src/dm/selections/ve.dm.LinearSelection.js index 6f475d7..e97d81c 100644 --- a/src/dm/selections/ve.dm.LinearSelection.js +++ b/src/dm/selections/ve.dm.LinearSelection.js @@ -111,6 +111,13 @@ }; /** + * @inheritdoc + */ +ve.dm.LinearSelection.prototype.getCoveringRange = function () { + return this.range; +}; + +/** * Get the range for this selection * * @return {ve.Range} Range diff --git a/src/dm/selections/ve.dm.NullSelection.js b/src/dm/selections/ve.dm.NullSelection.js index d9023aa..7f0a370 100644 --- a/src/dm/selections/ve.dm.NullSelection.js +++ b/src/dm/selections/ve.dm.NullSelection.js @@ -83,6 +83,13 @@ /** * @inheritdoc */ +ve.dm.NullSelection.prototype.getCoveringRange = function () { + return null; +}; + +/** + * @inheritdoc + */ ve.dm.NullSelection.prototype.equals = function ( other ) { return other instanceof ve.dm.NullSelection && this.getDocument() === other.getDocument(); diff --git
[MediaWiki-commits] [Gerrit] Prevent selection from spanning an active node - change (VisualEditor/VisualEditor)
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/282464 Change subject: Prevent selection from spanning an active node .. Prevent selection from spanning an active node This can happen when double clicking between paragraphs. Change-Id: I6d9b5f4781d5189df156f926d3c20f098eaba912 --- M src/ce/ve.ce.Surface.js 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/64/282464/1 diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js index 4283d8e..207386b 100644 --- a/src/ce/ve.ce.Surface.js +++ b/src/ce/ve.ce.Surface.js @@ -2626,6 +2626,27 @@ this.surfaceObserver.pollOnceNoCallback(); } + // Ensure we don't observe a selection that spans an active node + activeNode = this.getActiveNode(); + coveringRange = newSelection.getCoveringRange(); + if ( activeNode && coveringRange ) { + nodeRange = activeNode.getRange(); + // TODO: ranges[0] should be getCoveringRange from the selection (which doesn't exist yet) + containsStart = nodeRange.containsRange( new ve.Range( coveringRange.start ) ); + containsEnd = nodeRange.containsRange( new ve.Range( coveringRange.end ) ); + // If the range starts xor ends in the active node, but not both, then it must + // span an active node boundary, so fixup. + if ( containsStart ^ containsEnd ) { + newSelection = oldState && oldState.veRange ? + new ve.dm.LinearSelection( dmDoc, oldState.veRange ) : + new ve.dm.NullSelection( dmDoc ); + setTimeout( function () { + surface.changeModel( null, newSelection ); + surface .showModelSelection(); + } ); + } + } + // Firefox lets you create multiple selections within a single paragraph // which our model doesn't support, so detect and prevent these. // This shouldn't create problems with IME candidates as only an explicit user -- To view, visit https://gerrit.wikimedia.org/r/282464 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d9b5f4781d5189df156f926d3c20f098eaba912 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] T78342 excluding spec folders in .gitignore file - change (operations/puppet)
Nicko has uploaded a new change for review. https://gerrit.wikimedia.org/r/282461 Change subject: T78342 excluding spec folders in .gitignore file .. T78342 excluding spec folders in .gitignore file Change-Id: I77858ee660772b92dfeef70f042975445b0d1bb9 --- M .gitignore 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/61/282461/1 diff --git a/.gitignore b/.gitignore index 99f1aa3..3c15ab5 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,7 @@ # Jetbrain's IDEA editor settings /.idea -/*.iml \ No newline at end of file +/*.iml + +# Rake generated folders +spec/ -- To view, visit https://gerrit.wikimedia.org/r/282461 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77858ee660772b92dfeef70f042975445b0d1bb9 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Nicko___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [tox] Shorten some lines - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: [tox] Shorten some lines .. [tox] Shorten some lines Change-Id: I514df5e5664faccdb7e2424d9f829aaa5c38e55d --- M checkvotes.py M tox.ini 2 files changed, 13 insertions(+), 9 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/checkvotes.py b/checkvotes.py index 7e61cc0..0c7ff9f 100644 --- a/checkvotes.py +++ b/checkvotes.py @@ -133,7 +133,6 @@ urlRegex = re.compile( r'\[(?:http:)?//tools.wmflabs.org/(%s)\?([^ ]*?) +.*?\]' % SB_TOOL) url = urlRegex.findall(text)[1] # zweites Auftreten nehmen -# R = re.compile(r'\* *\[\[Wikipedia:Schiedsgericht/Wahl/Mai 2010/(.+?)\|.+?\]\] \**') R = re.compile(r'[#\*] *\[\[/(.+?)/\]\]') for pagename in R.findall(text): if votepage == '' or votepage == pagename: @@ -161,7 +160,8 @@ d['stunde'] = d['stunde1'] if 'minute1' in d: d['minute'] = d['minute1'] -s = 'day=%(tag1)s=%(monat1)s=%(jahr1)s=%(stunde)s=%(minute)s' % d +s = ('day=%(tag1)s=%(monat1)s=%(jahr1)s' + '=%(stunde)s=%(minute)s' % d) return (SB_TOOL, s) return elif url: @@ -233,10 +233,12 @@ return # regex = re.compile(ur"^#[^#:]*?\[\[Benutzer:(?P[^/]+?)[\||\]]", re.MULTILINE) # regex = re.compile(ur"^#[^#:]*?\[\[(?:[b|B]enutzer|[u|U]ser):(?P[^/]+?)[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)", -##regex = re.compile(ur"^#[^#:]*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P[_ ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P[^/#]+?)(?:/[^\\\]])?[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)", -## re.MULTILINE|re.UNICODE) -regex = re.compile(r'^#(?!:).*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P[_ ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P[^/#]+?) *(?:/[^\\\]])?[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)', - re.MULTILINE | re.UNICODE) +##regex = re.compile( +## r"^#[^#:]*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P[_ ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P[^/#]+?)(?:/[^\\\]])?[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)", +##re.MULTILINE|re.UNICODE) +regex = re.compile( + r'^#(?!:).*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P[_ ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P[^/#]+?) *(?:/[^\\\]])?[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)', +re.MULTILINE | re.UNICODE) i = 0 pywikibot.output('\nCheck votings for %s' % page.title(asLink=True)) self.summary = pywikibot.translate(self.site, self.msg) @@ -291,9 +293,11 @@ target_user = user while not target_user.exists() or not target_user.editCount(): if target_user.getUserPage().isRedirectPage(): -target_username = user.getUserPage().getRedirectTarget().title(withNamespace=False) +target_username = user.getUserPage().getRedirectTarget().title( +withNamespace=False) if target_username in seen and last != target_username: -pywikibot.output('%s already seen on this page' % target_username) +pywikibot.output('%s already seen on this page' + % target_username) break seen.add(target_username) target_user = pywikibot.User(self.site, target_username) diff --git a/tox.ini b/tox.ini index 77eb0e0..6db3873 100644 --- a/tox.ini +++ b/tox.ini @@ -31,4 +31,4 @@ ; E402 module level import not at top of file (T87409) ignore = E115,E266,E402 exclude = .tox,.git,./*.egg,ez_setup.py,build -max_line_length = 304 +max_line_length = 289 -- To view, visit https://gerrit.wikimedia.org/r/282460 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I514df5e5664faccdb7e2424d9f829aaa5c38e55d Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [tox] Shorten some lines - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282460 Change subject: [tox] Shorten some lines .. [tox] Shorten some lines Change-Id: I514df5e5664faccdb7e2424d9f829aaa5c38e55d --- M checkvotes.py M tox.ini 2 files changed, 13 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/60/282460/1 diff --git a/checkvotes.py b/checkvotes.py index 7e61cc0..0c7ff9f 100644 --- a/checkvotes.py +++ b/checkvotes.py @@ -133,7 +133,6 @@ urlRegex = re.compile( r'\[(?:http:)?//tools.wmflabs.org/(%s)\?([^ ]*?) +.*?\]' % SB_TOOL) url = urlRegex.findall(text)[1] # zweites Auftreten nehmen -# R = re.compile(r'\* *\[\[Wikipedia:Schiedsgericht/Wahl/Mai 2010/(.+?)\|.+?\]\] \**') R = re.compile(r'[#\*] *\[\[/(.+?)/\]\]') for pagename in R.findall(text): if votepage == '' or votepage == pagename: @@ -161,7 +160,8 @@ d['stunde'] = d['stunde1'] if 'minute1' in d: d['minute'] = d['minute1'] -s = 'day=%(tag1)s=%(monat1)s=%(jahr1)s=%(stunde)s=%(minute)s' % d +s = ('day=%(tag1)s=%(monat1)s=%(jahr1)s' + '=%(stunde)s=%(minute)s' % d) return (SB_TOOL, s) return elif url: @@ -233,10 +233,12 @@ return # regex = re.compile(ur"^#[^#:]*?\[\[Benutzer:(?P[^/]+?)[\||\]]", re.MULTILINE) # regex = re.compile(ur"^#[^#:]*?\[\[(?:[b|B]enutzer|[u|U]ser):(?P[^/]+?)[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)", -##regex = re.compile(ur"^#[^#:]*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P[_ ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P[^/#]+?)(?:/[^\\\]])?[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)", -## re.MULTILINE|re.UNICODE) -regex = re.compile(r'^#(?!:).*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P[_ ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P[^/#]+?) *(?:/[^\\\]])?[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)', - re.MULTILINE | re.UNICODE) +##regex = re.compile( +## r"^#[^#:]*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P[_ ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P[^/#]+?)(?:/[^\\\]])?[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)", +##re.MULTILINE|re.UNICODE) +regex = re.compile( + r'^#(?!:).*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P[_ ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P[^/#]+?) *(?:/[^\\\]])?[\||\]].*?(?P\d\d):(?P\d\d), (?P\d\d?)\. (?P\w+)\.? (?P\d\d\d\d) \(CES?T\)', +re.MULTILINE | re.UNICODE) i = 0 pywikibot.output('\nCheck votings for %s' % page.title(asLink=True)) self.summary = pywikibot.translate(self.site, self.msg) @@ -291,9 +293,11 @@ target_user = user while not target_user.exists() or not target_user.editCount(): if target_user.getUserPage().isRedirectPage(): -target_username = user.getUserPage().getRedirectTarget().title(withNamespace=False) +target_username = user.getUserPage().getRedirectTarget().title( +withNamespace=False) if target_username in seen and last != target_username: -pywikibot.output('%s already seen on this page' % target_username) +pywikibot.output('%s already seen on this page' + % target_username) break seen.add(target_username) target_user = pywikibot.User(self.site, target_username) diff --git a/tox.ini b/tox.ini index 77eb0e0..6db3873 100644 --- a/tox.ini +++ b/tox.ini @@ -31,4 +31,4 @@ ; E402 module level import not at top of file (T87409) ignore = E115,E266,E402 exclude = .tox,.git,./*.egg,ez_setup.py,build -max_line_length = 304 +max_line_length = 289 -- To view, visit https://gerrit.wikimedia.org/r/282460 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I514df5e5664faccdb7e2424d9f829aaa5c38e55d Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: Xqt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updating Wiktionary and Wikiquote HTML portals - change (wikimedia/portals)
jenkins-bot has submitted this change and it was merged. Change subject: Updating Wiktionary and Wikiquote HTML portals .. Updating Wiktionary and Wikiquote HTML portals Change-Id: I3040b052be1c725db06f48e79c83a45c235b5d2b --- M prod/wikiquote.org/index.html M prod/wiktionary.org/index.html 2 files changed, 9 insertions(+), 9 deletions(-) Approvals: MarcoAurelio: Looks good to me, approved jenkins-bot: Verified diff --git a/prod/wikiquote.org/index.html b/prod/wikiquote.org/index.html index 8789abc..03eed73 100644 --- a/prod/wikiquote.org/index.html +++ b/prod/wikiquote.org/index.html @@ -1,7 +1,7 @@ - + Wikiquote @@ -42,7 +42,7 @@ Italiano Aforismi e citazioni -22 000+ voci +23 000+ voci @@ -77,7 +77,7 @@ Français Collection de citations -4 000+ articles +3 000+ articles diff --git a/prod/wiktionary.org/index.html b/prod/wiktionary.org/index.html index 42a73c8..b9181ed 100644 --- a/prod/wiktionary.org/index.html +++ b/prod/wiktionary.org/index.html @@ -1,7 +1,7 @@ - + Wiktionary @@ -30,28 +30,28 @@ English The free dictionary -4 671 000+ entries +4 681 000+ entries Français Le dictionnaire libre -2 907 000+ articles +2 915 000+ articles Русский Свободный словарь -714 000+ статей +715 000+ статей Deutsch Das freie Wörterbuch -490 000+ Einträge +491 000+ Einträge @@ -93,7 +93,7 @@ Svenska Den fria ordboken -510 000+ stavningar +511 000+ stavningar -- To view, visit https://gerrit.wikimedia.org/r/281320 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3040b052be1c725db06f48e79c83a45c235b5d2b Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/portals Gerrit-Branch: master Gerrit-Owner: MarcoAurelioGerrit-Reviewer: JGirault Gerrit-Reviewer: MarcoAurelio Gerrit-Reviewer: Mxn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPR] Some compat2core and other code cleanups - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: [IMPR] Some compat2core and other code cleanups .. [IMPR] Some compat2core and other code cleanups - Page.usingPages is not a generator but an api.PageGenerator. It must be iterated. - Don't use general exception; use StopIteration exception type - extract_templates_and_params already strips named parameters - don't check known templates for Information template - expectedFailer is solved with iterating usingPages() - uns next() for py3 compatibility Change-Id: Ie0d4ec9b980bbf2d773c6a8aa213c180e11db109 --- M imagereview.py M tests/imagereview_tests.py 2 files changed, 7 insertions(+), 10 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/imagereview.py b/imagereview.py index 1459112..f51a2d9 100644 --- a/imagereview.py +++ b/imagereview.py @@ -237,7 +237,7 @@ for r in param: if r.strip(): self.reasons.add(r.strip()) -if tpl.title(withNamespace=False) == 'Information': +elif tpl.title(withNamespace=False) == 'Information': self.info = True @property @@ -248,9 +248,8 @@ if r.startswith('Hinweis'): self.reasons.remove(r) self.reasons.add('Hinweis') -note = r.split('=', 1) -r = note[0].strip() -self.remark = note[1].strip() +# r is already stripped by extract_templates_and_params +r, sep, self.remark = r.partition('=') if r not in DUP_REASONS: valid = False pywikibot.output(u'\nIgnoriere %s: ' @@ -264,13 +263,12 @@ @property def hasRefs(self): -refs = self.usingPages() +refs = iter(self.usingPages()) try: -refs.next() -except: +next(refs) +except StopIteration: return False -else: -return True +return True class CheckImageBot(object): diff --git a/tests/imagereview_tests.py b/tests/imagereview_tests.py index b2710d3..3834117 100644 --- a/tests/imagereview_tests.py +++ b/tests/imagereview_tests.py @@ -101,7 +101,6 @@ self.assertEqual(self.image.remark, self.REMARK) self.assertLessEqual(self.image.reasons, set(imagereview.DUP_REASONS)) -@unittest.expectedFailure def test_hasRefs(self): """Test hasRefs method.""" self.init_content() -- To view, visit https://gerrit.wikimedia.org/r/282459 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie0d4ec9b980bbf2d773c6a8aa213c180e11db109 Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPR] Some compat2core and other code cleanups - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282459 Change subject: [IMPR] Some compat2core and other code cleanups .. [IMPR] Some compat2core and other code cleanups - Page.usingPages is not a generator but an api.PageGenerator. It must be iterated. - Don't use general exception; use StopIteration exception type - extract_templates_and_params already strips named parameters - don't check known templates for Information template - expectedFailer is solved with iterating usingPages() Change-Id: Ie0d4ec9b980bbf2d773c6a8aa213c180e11db109 --- M imagereview.py M tests/imagereview_tests.py 2 files changed, 6 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/59/282459/1 diff --git a/imagereview.py b/imagereview.py index 1459112..73a615c 100644 --- a/imagereview.py +++ b/imagereview.py @@ -237,7 +237,7 @@ for r in param: if r.strip(): self.reasons.add(r.strip()) -if tpl.title(withNamespace=False) == 'Information': +elif tpl.title(withNamespace=False) == 'Information': self.info = True @property @@ -248,9 +248,8 @@ if r.startswith('Hinweis'): self.reasons.remove(r) self.reasons.add('Hinweis') -note = r.split('=', 1) -r = note[0].strip() -self.remark = note[1].strip() +# r is already stripped by extract_templates_and_params +r, sep, self.remark = r.partition('=') if r not in DUP_REASONS: valid = False pywikibot.output(u'\nIgnoriere %s: ' @@ -264,13 +263,12 @@ @property def hasRefs(self): -refs = self.usingPages() +refs = iter(self.usingPages()) try: refs.next() -except: +except StopIteration: return False -else: -return True +return True class CheckImageBot(object): diff --git a/tests/imagereview_tests.py b/tests/imagereview_tests.py index b2710d3..3834117 100644 --- a/tests/imagereview_tests.py +++ b/tests/imagereview_tests.py @@ -101,7 +101,6 @@ self.assertEqual(self.image.remark, self.REMARK) self.assertLessEqual(self.image.reasons, set(imagereview.DUP_REASONS)) -@unittest.expectedFailure def test_hasRefs(self): """Test hasRefs method.""" self.init_content() -- To view, visit https://gerrit.wikimedia.org/r/282459 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0d4ec9b980bbf2d773c6a8aa213c180e11db109 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: Xqt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [test] Additional test for review FilePage - change (pywikibot...xqbot)
jenkins-bot has submitted this change and it was merged. Change subject: [test] Additional test for review FilePage .. [test] Additional test for review FilePage Change-Id: I298b2f1e07669909fd07411e4374386e575805de --- M tests/imagereview_tests.py 1 file changed, 67 insertions(+), 0 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/imagereview_tests.py b/tests/imagereview_tests.py index 9692f37..b2710d3 100644 --- a/tests/imagereview_tests.py +++ b/tests/imagereview_tests.py @@ -14,6 +14,8 @@ import sys import unittest +import pywikibot + currentdir = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe( parentdir = os.path.dirname(currentdir) @@ -41,6 +43,71 @@ self.assertTrue(hasattr(imagereview, 'mail_msg')) +class TestDUP_Image(unittest.TestCase): + +"""Test DUP_Image class.""" + +REMARK = 'Urheber und Uploader sind nicht identisch.' +TMPL = '{{düp|Lizenz|Freigabe | Quelle| Urheber | Hinweis = %s }}' % REMARK + +@classmethod +def setUpClass(cls): +cls.site = pywikibot.Site('de', 'wikipedia') +cls.review_tpl = pywikibot.Page(cls.site, 'düp', 10) + +@classmethod +def tearDownClass(cls): +del cls.site +del cls.review_tpl + +def tearDown(self): +del self.image + +def init_content(self): +self.image = imagereview.DUP_Image(self.site, 'Sample.jpg', self.TMPL) +self.image._templates.append(self.review_tpl) +self.image.text += self.TMPL +self.assertEqual(self.image.text, self.image._text) +self.image.__init__(self.image.site, self.image.title(), self.image.text) +self.assertEqual(self.image._contents, self.image.text) + +def test_empty_instance(self): +"""Test instance variables""" +self.image = imagereview.DUP_Image(self.site, 'Sample.jpg') +self.assertIsNone(self.image._contents) +self.assertIsNone(self.image._editTime) +self.assertEqual(self.image._file_revisions, dict()) +self.assertEqual(self.image._revisions, dict()) +self.assertIsNone(self.image.done) +self.assertFalse(self.image.info) +self.assertEqual(self.image.reasons, set([])) +self.assertIsNone(self.image.remark) +self.assertEqual(self.image.review_tpl, list()) + +def test_instance_with_content(self): +"""Test instance variables with content given.""" +self.init_content() +self.assertIsNone(self.image._editTime) +self.assertFalse(self.image.done) +self.assertTrue(self.image.info) +self.assertEqual(len(self.image.reasons), 5) +self.assertIsNone(self.image.remark) +self.assertEqual(self.image.review_tpl[0], self.review_tpl) + +def test_valid_reasons(self): +"""Test validReasons method.""" +self.init_content() +self.assertTrue(self.image.validReasons) +self.assertEqual(self.image.remark, self.REMARK) +self.assertLessEqual(self.image.reasons, set(imagereview.DUP_REASONS)) + +@unittest.expectedFailure +def test_hasRefs(self): +"""Test hasRefs method.""" +self.init_content() +self.assertTrue(self.image.hasRefs) + + if __name__ == '__main__': try: unittest.main() -- To view, visit https://gerrit.wikimedia.org/r/282457 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I298b2f1e07669909fd07411e4374386e575805de Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] New Wikidata Build - 2016-04-09T10:00:01+0000 - change (mediawiki...Wikidata)
WikidataBuilder has uploaded a new change for review. https://gerrit.wikimedia.org/r/282458 Change subject: New Wikidata Build - 2016-04-09T10:00:01+ .. New Wikidata Build - 2016-04-09T10:00:01+ Change-Id: I89621985844e79d3d26b8fd58ccf11514ea22d76 --- M composer.lock A extensions/Wikibase/docs/rdf-binding.txt M extensions/Wikibase/repo/includes/Rdf/RdfVocabulary.php M extensions/Wikibase/repo/includes/Rdf/Values/GlobeCoordinateRdfBuilder.php M extensions/Wikibase/repo/tests/phpunit/data/maintenance/dumpRdf-out.txt M extensions/Wikibase/repo/tests/phpunit/data/rdf/FullStatementRdfBuilder/Q4_all.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/FullStatementRdfBuilder/Q4_minimal.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/FullStatementRdfBuilder/Q4_statements.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/FullStatementRdfBuilder/Q4_values.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/FullStatementRdfBuilder/Q6_with_qualifiers.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/FullStatementRdfBuilder/Q7_refs.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q1_info.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q1_simple.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q2_labels.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q3_links.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q4_all_statements.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q4_claims.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q4_props.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q4_resolved.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q4_truthy_statements.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q4_values.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q5_badges.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q6_qualifiers.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q6_with_qualifiers.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q7_Q9_dedup.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q7_references.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q7_refs.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/Q8_baddates.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfBuilder/dumpheader.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfDumpGenerator/empty.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfDumpGenerator/entities.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfDumpGenerator/redirect.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/RdfDumpGenerator/refs.nt M extensions/Wikibase/repo/tests/phpunit/data/rdf/TruthyStatementRdfBuilder/Q4_statements.nt M extensions/Wikibase/repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php M extensions/Wikibase/repo/tests/phpunit/includes/Rdf/Values/GlobeCoordinateRdfBuilderTest.php M vendor/composer/installed.json 37 files changed, 61 insertions(+), 52 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/58/282458/1 diff --git a/composer.lock b/composer.lock index f5328d3..9d3fe90 100644 --- a/composer.lock +++ b/composer.lock @@ -1559,12 +1559,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git;, -"reference": "4e101c8ceedbcabae368e71ff7babea90225c17d" +"reference": "03a0a86d12206acf6369915890b7884acf99d520" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/4e101c8ceedbcabae368e71ff7babea90225c17d;, -"reference": "4e101c8ceedbcabae368e71ff7babea90225c17d", +"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/03a0a86d12206acf6369915890b7884acf99d520;, +"reference": "03a0a86d12206acf6369915890b7884acf99d520", "shasum": "" }, "require": { @@ -1636,7 +1636,7 @@ "wikibaserepo", "wikidata" ], -"time": "2016-04-07 21:05:43" +"time": "2016-04-08 17:18:26" }, { "name": "wikibase/wikimedia-badges", diff --git a/extensions/Wikibase/docs/rdf-binding.txt b/extensions/Wikibase/docs/rdf-binding.txt new file mode 100644 index 000..60e3d09 --- /dev/null +++ b/extensions/Wikibase/docs/rdf-binding.txt @@ -0,0 +1,9 @@ +Wikibase allows exporting data in RDF format. See details of the implementation in: +https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format + +Change log +-- +The following are the RDF format
[MediaWiki-commits] [Gerrit] [test] Additional test for review FilePage - change (pywikibot...xqbot)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/282457 Change subject: [test] Additional test for review FilePage .. [test] Additional test for review FilePage Change-Id: I298b2f1e07669909fd07411e4374386e575805de --- M tests/imagereview_tests.py 1 file changed, 67 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot refs/changes/57/282457/1 diff --git a/tests/imagereview_tests.py b/tests/imagereview_tests.py index 9692f37..bb23412 100644 --- a/tests/imagereview_tests.py +++ b/tests/imagereview_tests.py @@ -14,6 +14,8 @@ import sys import unittest +import pywikibot + currentdir = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe( parentdir = os.path.dirname(currentdir) @@ -41,6 +43,71 @@ self.assertTrue(hasattr(imagereview, 'mail_msg')) +class TestDUP_Image(unittest.TestCase): + +"""Test DUP_Image class.""" + +REMARK = 'Urheber und Uploader sind nicht identisch.' +TMPL = '{{düp|Lizenz|Freigabe | Quelle| Urheber | Hinweis = %s }}' % REMARK + +@classmethod +def setUpClass(cls): +cls.site = pywikibot.Site()#'de', 'wikipedia') +cls.review_tpl = pywikibot.Page(cls.site, 'düp', 10) + +@classmethod +def tearDownClass(cls): +del cls.site +del cls.review_tpl + +def tearDown(self): +del self.image + +def init_content(self): +self.image = imagereview.DUP_Image(self.site, 'Sample.jpg', self.TMPL) +self.image._templates.append(self.review_tpl) +self.image.text += self.TMPL +self.assertEqual(self.image.text, self.image._text) +self.image.__init__(self.image.site, self.image.title(), self.image.text) +self.assertEqual(self.image._contents, self.image.text) + +def test_empty_instance(self): +"""Test instance variables""" +self.image = imagereview.DUP_Image(self.site, 'Sample.jpg') +self.assertIsNone(self.image._contents) +self.assertIsNone(self.image._editTime) +self.assertEqual(self.image._file_revisions, dict()) +self.assertEqual(self.image._revisions, dict()) +self.assertIsNone(self.image.done) +self.assertFalse(self.image.info) +self.assertEqual(self.image.reasons, set([])) +self.assertIsNone(self.image.remark) +self.assertEqual(self.image.review_tpl, list()) + +def test_instance_with_content(self): +"""Test instance variables with content given.""" +self.init_content() +self.assertIsNone(self.image._editTime) +self.assertFalse(self.image.done) +self.assertTrue(self.image.info) +self.assertEqual(len(self.image.reasons), 5) +self.assertIsNone(self.image.remark) +self.assertEqual(self.image.review_tpl[0], self.review_tpl) + +def test_valid_reasons(self): +"""Test validReasons method.""" +self.init_content() +self.assertTrue(self.image.validReasons) +self.assertEqual(self.image.remark, self.REMARK) +self.assertLessEqual(self.image.reasons, set(imagereview.DUP_REASONS)) + +@unittest.expectedFailure +def test_hasRefs(self): +"""Test hasRefs method.""" +self.init_content() +self.assertTrue(self.image.hasRefs) + + if __name__ == '__main__': try: unittest.main() -- To view, visit https://gerrit.wikimedia.org/r/282457 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I298b2f1e07669909fd07411e4374386e575805de Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/xqbot Gerrit-Branch: master Gerrit-Owner: Xqt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add pageview definition special case for iOs App - change (analytics...source)
Joal has submitted this change and it was merged. Change subject: Add pageview definition special case for iOs App .. Add pageview definition special case for iOs App In release 5 of iOs App, iOs App user agent has changed to Wikipedia/5.0.X instead of WikipediaApp/5.0,.X. We update the pageview definition for this special case in order to have the most correct data as possible. Bug: T131824 Change-Id: Ic562a4c45f63b13565d83296c968e89a7241695a --- M refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Webrequest.java M refinery-core/src/test/resources/access_method_test_data.csv 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Joal: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Webrequest.java b/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Webrequest.java index 1c000f5..24153c1 100644 --- a/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Webrequest.java +++ b/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Webrequest.java @@ -86,7 +86,7 @@ * getAccessMethod. */ private static final Pattern appAgentPattern = Pattern.compile( -"WikipediaApp" +"Wikipedia(App|/5.0.)" ); /** diff --git a/refinery-core/src/test/resources/access_method_test_data.csv b/refinery-core/src/test/resources/access_method_test_data.csv index 37b108e..c991888 100644 --- a/refinery-core/src/test/resources/access_method_test_data.csv +++ b/refinery-core/src/test/resources/access_method_test_data.csv @@ -10,3 +10,4 @@ Mobile web request through zero,mobile web,zero.wikipedia.org,rutabaga Mobile apps request through mobile API,mobile app,en.m.wikipedia.org, WikipediaApp/1.2.3 Mobile apps request through desktop API,mobile app, en.wikipedia.org, WikipediaApp/1.2.3 +Mobile apps request through desktop API,mobile app, en.wikipedia.org, Wikipedia/5.0.2 -- To view, visit https://gerrit.wikimedia.org/r/282439 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic562a4c45f63b13565d83296c968e89a7241695a Gerrit-PatchSet: 1 Gerrit-Project: analytics/refinery/source Gerrit-Branch: master Gerrit-Owner: NuriaGerrit-Reviewer: Joal Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow tags in summary - change (mediawiki/core)
Eranroz has uploaded a new change for review. https://gerrit.wikimedia.org/r/282456 Change subject: Allow tags in summary .. Allow tags in summary This patch address T109032 by adding support for assigning tags to an edit from the summary using tags, that is #TAG_NAME will result in assigning tag to edit. This partially address T123529, but only for exlpicitly predefined tags (explicitly defined tags). Bug: T109032, T123529 Change-Id: If2dfc8e525d2710d122f40903d76e92c84beb1ab --- M includes/EditPage.php M includes/changetags/ChangeTags.php 2 files changed, 28 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/56/282456/1 diff --git a/includes/EditPage.php b/includes/EditPage.php index 3522531..10868ce 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -923,7 +923,11 @@ $changeTags = $request->getVal( 'wpChangeTags' ); if ( is_null( $changeTags ) || $changeTags === '' ) { - $this->changeTags = []; + // if tags aren't explicitly defined try to extract them from the summary + preg_match_all('/(?:^\#| \#)([^ ]+)/', $this->summary, $implicitTagMatches); + // TODO: ideally we should accept translated tags, that is wfMesssage(tag-$tag) => tag not only tag. + $existingTags = ChangeTags::allowedTagsAccompanyingChange( $implicitTagMatches[1] ); + $this->changeTags = $existingTags; } else { $this->changeTags = array_filter( array_map( 'trim', explode( ',', $changeTags ) ) ); diff --git a/includes/changetags/ChangeTags.php b/includes/changetags/ChangeTags.php index 9db1697..d4cff7d 100644 --- a/includes/changetags/ChangeTags.php +++ b/includes/changetags/ChangeTags.php @@ -398,6 +398,29 @@ return Status::newGood(); } + + /** +* List of tags user is allowed to add +* +* @param array $tags Tags that you are interested in applying +* @param User|null $user User whose permission you wish to check, or null if +* you don't care (e.g. maintenance scripts) +* @return Status +* @since 1.27 +*/ + public static function allowedTagsAccompanyingChange( array $tags, + User $user = null ) { + + if ( !is_null( $user ) ) { + if ( !$user->isAllowed( 'applychangetags' ) || $user->isBlocked() ) { + return []; + } + } + + $allowedTags = self::listExplicitlyDefinedTags(); + return array_intersect( $tags, $allowedTags ); + } + /** * Adds tags to a given change, checking whether it is allowed first, but * without adding a log entry. Useful for cases where the tag is being added -- To view, visit https://gerrit.wikimedia.org/r/282456 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2dfc8e525d2710d122f40903d76e92c84beb1ab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Eranroz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] WIP CategorySelector: use classes instead of switch for cate... - change (mediawiki/core)
Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/282455 Change subject: WIP CategorySelector: use classes instead of switch for category search types .. WIP CategorySelector: use classes instead of switch for category search types Change-Id: I1cecdad3049115852afdf9ae78dc894d28b0d1b4 --- M resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js 1 file changed, 150 insertions(+), 130 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/55/282455/1 diff --git a/resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js b/resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js index 5d7d115..14f0b31 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js +++ b/resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js @@ -9,6 +9,139 @@ NS_CATEGORY = mw.config.get( 'wgNamespaceIds' ).category; /** +* @class mw.widgets.CategorySelector.CategorySearchType +* @uses mw.Api +* +* @constructor +* @param {Object} config Configuration options +* @cfg {mw.Api} api Instance of mw.Api (or subclass thereof) to use for queries +*/ + function CategorySearchType( config ) { + this.api = config.api; + } + CategorySearchType.prototype.mustBeTheOnlySearchType = false; + + function OpenSearchCategorySearchType( config ) { + CategorySearchType.call( this, config ); + } + OO.inheritClass( OpenSearchCategorySearchType, CategorySearchType ); + OpenSearchCategorySearchType.prototype.searchCategories = function ( input, limit ) { + return this.api.get( { + formatversion: 2, + action: 'opensearch', + namespace: NS_CATEGORY, + limit: limit, + search: input + } ).then( function ( res ) { + return res[ 1 ]; + } ); + }; + + function InternalSearchCategorySearchType( config ) { + CategorySearchType.call( this, config ); + } + OO.inheritClass( InternalSearchCategorySearchType, CategorySearchType ); + InternalSearchCategorySearchType.prototype.searchCategories = function ( input, limit ) { + return this.api.get( { + formatversion: 2, + action: 'query', + list: 'allpages', + apnamespace: NS_CATEGORY, + aplimit: limit, + apfrom: input, + apprefix: input + } ).then( function ( res ) { + return res.query.allpages.map( function ( page ) { + return page.title; + } ); + } ); + }; + + function ExistsCategorySearchType( config ) { + CategorySearchType.call( this, config ); + } + OO.inheritClass( ExistsCategorySearchType, CategorySearchType ); + ExistsCategorySearchType.prototype.searchCategories = function ( input ) { + if ( input.indexOf( '|' ) > -1 ) { + return $.Deferred().resolve( [] ); + } + + return this.api.get( { + formatversion: 2, + action: 'query', + prop: 'info', + titles: 'Category:' + input + } ).then( function ( res ) { + var categories = []; + + $.each( res.query.pages, function ( index, page ) { + if ( !page.missing ) { + categories.push( page.title ); + } + } ); + + return categories; + } ); + }; + + function SubCategoriesCategorySearchType( config ) { + CategorySearchType.call( this, config ); + } + OO.inheritClass( SubCategoriesCategorySearchType, CategorySearchType ); + SubCategoriesCategorySearchType.prototype.mustBeTheOnlySearchType = true; + SubCategoriesCategorySearchType.prototype.searchCategories = function ( input, limit ) { + if ( input.indexOf( '|' ) > -1 ) { + return $.Deferred().resolve( [] ); + } + + return this.api.get( { + formatversion: 2, + action: 'query', + list: 'categorymembers', + cmtype: 'subcat', + cmlimit: limit, + cmtitle: 'Category:' + input + } ).then( function ( res ) { + return