[MediaWiki-commits] [Gerrit] Fix most annoying SVG bug, SVG path data number parsing issue - change (operations...librsvg)
Ebrahim has uploaded a new change for review. https://gerrit.wikimedia.org/r/173639 Change subject: Fix most annoying SVG bug, SVG path data number parsing issue .. Fix most annoying SVG bug, SVG path data number parsing issue Hopefully we will get this from upstream on next dist upgrade however this is most annoying issue of Wikimedia SVG parser, so lets fix it Cherrypicked from https://git.gnome.org/browse/librsvg/commit/?id=5ba4343bccc7e1765f38f87490b3d6a3a500fde1 Change-Id: I5f7cfec14ed4cb3d22197f377d9e26a0c0101c9b --- M rsvg-path.c 1 file changed, 113 insertions(+), 77 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/librsvg refs/changes/39/173639/1 diff --git a/rsvg-path.c b/rsvg-path.c index 604b64c..ce9be42 100644 --- a/rsvg-path.c +++ b/rsvg-path.c @@ -210,7 +210,7 @@ } /** - * rsvg_path_arc: Add an RSVG arc to the path context. + * rsvg_path_arc: * @ctx: Path context. * @rx: Radius in x direction (before rotation). * @ry: Radius in y direction (before rotation). @@ -220,6 +220,7 @@ * @x: New x coordinate. * @y: New y coordinate. * + * Add an RSVG arc to the path context. **/ static void rsvg_path_arc (RSVGParsePathCtx * ctx, @@ -567,100 +568,135 @@ rsvg_parse_path_do_cmd (ctx, FALSE); } +#define RSVGN_IN_PREINTEGER 0 +#define RSVGN_IN_INTEGER 1 +#define RSVGN_IN_FRACTION2 +#define RSVGN_IN_PREEXPONENT 3 +#define RSVGN_IN_EXPONENT4 + +#define RSVGN_GOT_SIGN 0x1 +#define RSVGN_GOT_EXPONENT_SIGN 0x2 + +/* Returns the length of the number parsed, so it can be skipped + * in rsvg_parse_path_data. Calls rsvg_path_end_number to have the number + * processed in its command. + */ +static int +rsvg_parse_number (RSVGParsePathCtx * ctx, const char *data) +{ +int length = 0; +int in = RSVGN_IN_PREINTEGER; /* Current location within the number */ +int got = 0x0; /* [bitfield] Having 2 of each of these is an error */ +gboolean end = FALSE; /* Set to true if the number should end after a char */ +gboolean error = FALSE; /* Set to true if the number ended due to an error */ + +double value = 0.0; +double fraction = 1.0; +int sign = +1; /* Presume the INTEGER is positive if it has no sign */ +int exponent = 0; +int exponent_sign = +1; /* Presume the EXPONENT is positive if it has no sign */ + +while (data[length] != '\0' !end !error) { +char c = data[length]; +switch (in) { +case RSVGN_IN_PREINTEGER: /* No numbers yet, we're just starting out */ +/* LEGAL: + - .-FRACTION DIGIT-INTEGER */ +if (c == '+' || c == '-') { +if (got RSVGN_GOT_SIGN) { +error = TRUE; /* Two signs: not allowed */ +} else { +sign = c == '+' ? +1 : -1; +got |= RSVGN_GOT_SIGN; +} +} else if (c == '.') { +in = RSVGN_IN_FRACTION; +} else if (c = '0' c = '9') { +value = c - '0'; +in = RSVGN_IN_INTEGER; +} +break; +case RSVGN_IN_INTEGER: /* Previous character(s) was/were digit(s) */ +/* LEGAL: DIGIT .-FRACTION E-PREEXPONENT */ +if (c = '0' c = '9') { +value = value * 10 + (c - '0'); +} +else if (c == '.') { +in = RSVGN_IN_FRACTION; +} +else if (c == 'e' || c == 'E') { +in = RSVGN_IN_PREEXPONENT; +} +else { +end = TRUE; +} +break; +case RSVGN_IN_FRACTION: /* Previously, digit(s) in the fractional part */ +/* LEGAL: DIGIT E-PREEXPONENT */ +if (c = '0' c = '9') { +fraction *= 0.1; +value += fraction * (c - '0'); +} +else if (c == 'e' || c == 'E') { +in = RSVGN_IN_PREEXPONENT; +} +else { +end = TRUE; +} +break; +case RSVGN_IN_PREEXPONENT: /* Right after E */ +/* LEGAL: + - DIGIT-EXPONENT */ +if (c == '+' || c == '-') { +if (got RSVGN_GOT_EXPONENT_SIGN) { +error = TRUE; /* Two signs: not allowed */ +} else { +exponent_sign = c == '+' ? +1 : -1; +got |= RSVGN_GOT_EXPONENT_SIGN; +} +} else if (c = '0' c = '9') { +exponent = c - '0'; +in = RSVGN_IN_EXPONENT; +} +break; +case RSVGN_IN_EXPONENT: /*
[MediaWiki-commits] [Gerrit] doc: raise doxygen lookup cache - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: doc: raise doxygen lookup cache .. doc: raise doxygen lookup cache The lookup cache size is exhausted again, bumping it from: 131072 entries - 2^(16+1) to 262144 entries - 2^(16+2) See previous bump for details: 432a0cb https://gerrit.wikimedia.org/r/69709 Change-Id: I9a15cce6f77745c4e913a562e8f1f43a4988c83d --- M maintenance/Doxyfile 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/Doxyfile b/maintenance/Doxyfile index ffc8c3b..f5141f6 100644 --- a/maintenance/Doxyfile +++ b/maintenance/Doxyfile @@ -82,7 +82,7 @@ INLINE_SIMPLE_STRUCTS = NO TYPEDEF_HIDES_STRUCT = NO SYMBOL_CACHE_SIZE = 0 -LOOKUP_CACHE_SIZE = 1 +LOOKUP_CACHE_SIZE = 2 #--- # Build related configuration options #--- -- To view, visit https://gerrit.wikimedia.org/r/172682 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9a15cce6f77745c4e913a562e8f1f43a4988c83d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Hashar has...@free.fr Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Hashar has...@free.fr Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Parent5446 tylerro...@gmail.com Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Track how long users are viewing images for - change (mediawiki...MultimediaViewer)
Gilles has uploaded a new change for review. https://gerrit.wikimedia.org/r/173640 Change subject: Track how long users are viewing images for .. Track how long users are viewing images for This is complete, but it would be better if the HEAD request was actually aborted by Varnish when the viewDuration parameter is present, or if the hit pointed to a script that does that. Change-Id: I66cafd97427756411e967de1901324af2215e3ae Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1001 --- M MultimediaViewer.php M MultimediaViewerHooks.php A resources/mmv/logging/mmv.logging.View.js M resources/mmv/mmv.js 4 files changed, 173 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/40/173640/1 diff --git a/MultimediaViewer.php b/MultimediaViewer.php index a9abc28..a7a0d9c 100644 --- a/MultimediaViewer.php +++ b/MultimediaViewer.php @@ -109,6 +109,14 @@ $wgMediaViewerEnableByDefaultForAnonymous = $wgMediaViewerEnableByDefault; } +if ( !isset( $wgMediaViewerRecordViewDuration ) ) { + /** +* If set, record the view duration via a HEAD request. +* @var bool +*/ + $wgMediaViewerRecordViewDuration = false; +} + $wgMessagesDirs['MultimediaViewer'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['MultimediaViewer'] = __DIR__ . '/MultimediaViewer.i18n.php'; @@ -889,6 +897,7 @@ 'mmv.routing', 'mmv.logging.DurationLogger', 'mmv.logging.DimensionLogger', + 'mmv.logging.View', 'jquery.fullscreen', 'jquery.hidpi', 'jquery.scrollTo', @@ -994,6 +1003,17 @@ ), ), + 'mmv.logging.View' = $wgMediaViewerResourceTemplate + array( + 'scripts' = array( + 'mmv/logging/mmv.logging.View.js', + ), + + 'dependencies' = array( + 'mmv.base', + 'mmv.logging.ActionLogger', + ), + ), + 'mmv.head' = $wgMediaViewerResourceTemplate + array( 'scripts' = array( 'mmv/mmv.head.js', diff --git a/MultimediaViewerHooks.php b/MultimediaViewerHooks.php index bf6d36f..a8d9c43 100644 --- a/MultimediaViewerHooks.php +++ b/MultimediaViewerHooks.php @@ -142,7 +142,7 @@ global $wgMediaViewerActionLoggingSamplingFactorMap, $wgNetworkPerformanceSamplingFactor, $wgMediaViewerDurationLoggingSamplingFactor, $wgMediaViewerDurationLoggingLoggedinSamplingFactor, $wgMediaViewerAttributionLoggingSamplingFactor, $wgMediaViewerDimensionLoggingSamplingFactor, - $wgMediaViewerIsInBeta, $wgMediaViewerUseThumbnailGuessing; + $wgMediaViewerIsInBeta, $wgMediaViewerUseThumbnailGuessing, $wgMediaViewerRecordViewDuration; $vars['wgMultimediaViewer'] = array( 'infoLink' = self::$infoLink, 'discussionLink' = self::$discussionLink, @@ -154,6 +154,7 @@ 'actionLoggingSamplingFactorMap' = $wgMediaViewerActionLoggingSamplingFactorMap, 'attributionSamplingFactor' = $wgMediaViewerAttributionLoggingSamplingFactor, 'dimensionSamplingFactor' = $wgMediaViewerDimensionLoggingSamplingFactor, + 'recordViewDuration' = $wgMediaViewerRecordViewDuration, 'tooltipDelay' = 1000, ); $vars['wgMediaViewer'] = true; diff --git a/resources/mmv/logging/mmv.logging.View.js b/resources/mmv/logging/mmv.logging.View.js new file mode 100644 index 000..d38ed94 --- /dev/null +++ b/resources/mmv/logging/mmv.logging.View.js @@ -0,0 +1,143 @@ +/* + * This file is part of the MediaWiki extension MultimediaViewer. + * + * MultimediaViewer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * MultimediaViewer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MultimediaViewer. If not, see http://www.gnu.org/licenses/. + */ + +( function ( mw, $ ) { + var V; + + /** +* Tracks how long users are viewing images for +* @class mw.mmv.logging.View +* @extends mw.Api +* @constructor +*/ + function
[MediaWiki-commits] [Gerrit] Add marker parameter to image requests coming from MediaViewer - change (mediawiki...MultimediaViewer)
Gilles has uploaded a new change for review. https://gerrit.wikimedia.org/r/173641 Change subject: Add marker parameter to image requests coming from MediaViewer .. Add marker parameter to image requests coming from MediaViewer This will be needed by Erik Zachte for compiling per-file image view data. Since Media Viewer does preloading, it skews the HTTP request-based statistics. By marking image requests coming from Media Viewer, it allows us to remove that bias. I haven't made this configurable, maybe it should be? Change-Id: Iac8e7770c1a379691547de4b6d47b7d54467f54d Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1002 --- M resources/mmv/provider/mmv.provider.Image.js M tests/qunit/mmv/provider/mmv.provider.Image.test.js 2 files changed, 67 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/41/173641/1 diff --git a/resources/mmv/provider/mmv.provider.Image.js b/resources/mmv/provider/mmv.provider.Image.js index e2e1b2b..cb5d187 100644 --- a/resources/mmv/provider/mmv.provider.Image.js +++ b/resources/mmv/provider/mmv.provider.Image.js @@ -50,6 +50,8 @@ start, rawGet; + url = this.addQueryParameterToURI( url, 'mediaviewer' ); + if ( !this.cache[cacheKey] ) { if ( this.imagePreloadingSupported() ) { rawGet = $.proxy( provider.rawGet, provider, url, true ); @@ -129,5 +131,36 @@ return window.MSInputMethodContext === undefined; }; + /** +* Adds a query parameter to a URI +* @param {string} uri URI to modify +* @param {string} parameter parameter string to add +*/ + Image.prototype.addQueryParameterToURI = function ( uri, parameter ) { + var modifiedUri, prefix, split; + + prefix = uri.indexOf( '?' ) -1 ? '' : '?'; + + hashPoint = uri.indexOf( '#' ); + + if ( hashPoint -1 ) { + split = uri.split( '#' ); + + if ( split[ 0 ][ split[ 0 ].length - 1 ] === '?' ) { + prefix = ''; + } + + modifiedUri = split[ 0 ] + prefix + parameter + '#' + split[ 1 ]; + } else { + if ( uri[ uri.length - 1 ] === '?' ) { + prefix = ''; + } + + modifiedUri = uri + prefix + parameter; + } + + return modifiedUri; + }; + mw.mmv.provider.Image = Image; }( mediaWiki, jQuery ) ); diff --git a/tests/qunit/mmv/provider/mmv.provider.Image.test.js b/tests/qunit/mmv/provider/mmv.provider.Image.test.js index 6879bf7..03a1ab8 100644 --- a/tests/qunit/mmv/provider/mmv.provider.Image.test.js +++ b/tests/qunit/mmv/provider/mmv.provider.Image.test.js @@ -200,4 +200,38 @@ QUnit.start(); } ); } ); + + QUnit.test( 'addQueryParameterToURI', 6, function ( assert ) { + var imageProvider = new mw.mmv.provider.Image(); + + assert.strictEqual( + imageProvider.addQueryParameterToURI( 'http://foo.com/bar#baz', 'param' ), + 'http://foo.com/bar?param#baz', + 'Extra parameter added before hash' ); + + assert.strictEqual( + imageProvider.addQueryParameterToURI( 'http://foo.com/bar?#baz', 'param' ), + 'http://foo.com/bar?param#baz', + 'Extra parameter added before hash' ); + + assert.strictEqual( + imageProvider.addQueryParameterToURI( 'http://foo.com/bar?boo#baz', 'param' ), + 'http://foo.com/bar?booparam#baz', + 'Extra parameter added before hash' ); + + assert.strictEqual( + imageProvider.addQueryParameterToURI( 'http://foo.com/bar?param2', 'param' ), + 'http://foo.com/bar?param2param', + 'Extra parameter added at the end' ); + + assert.strictEqual( + imageProvider.addQueryParameterToURI( 'http://foo.com/bar?', 'param' ), + 'http://foo.com/bar?param', + 'Extra parameter added at the end' ); + + assert.strictEqual( + imageProvider.addQueryParameterToURI( 'http://foo.com/bar', 'param' ), + 'http://foo.com/bar?param', + 'Extra parameter added at the end' ); + } ); }( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/173641 To unsubscribe, visit
[MediaWiki-commits] [Gerrit] Add missing visibility keywords everywhere - change (mediawiki...Scribunto)
jenkins-bot has submitted this change and it was merged. Change subject: Add missing visibility keywords everywhere .. Add missing visibility keywords everywhere Change-Id: I270d1dd9b6545e15398c2f8b8e9ae533844cc998 --- M common/Base.php M tests/engines/LuaCommon/CommonTest.php M tests/engines/LuaCommon/LanguageLibraryTest.php M tests/engines/LuaCommon/LuaEngineTestBase.php M tests/engines/LuaCommon/LuaEnvironmentComparisonTest.php M tests/engines/LuaCommon/LuaInterpreterTest.php M tests/engines/LuaCommon/MessageLibraryTest.php M tests/engines/LuaCommon/TitleLibraryTest.php M tests/engines/LuaCommon/UstringLibraryTest.php M tests/engines/LuaSandbox/LuaSandboxInterpreterTest.php M tests/engines/LuaSandbox/SandboxTest.php M tests/engines/LuaStandalone/LuaStandaloneInterpreterTest.php 12 files changed, 44 insertions(+), 49 deletions(-) Approvals: Addshore: Looks good to me, approved JanZerebecki: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/common/Base.php b/common/Base.php index 1fbf945..850cb44 100644 --- a/common/Base.php +++ b/common/Base.php @@ -91,7 +91,7 @@ } } - function __destruct() { + public function __destruct() { $this-destroy(); } diff --git a/tests/engines/LuaCommon/CommonTest.php b/tests/engines/LuaCommon/CommonTest.php index 19504f7..4afb6e8 100644 --- a/tests/engines/LuaCommon/CommonTest.php +++ b/tests/engines/LuaCommon/CommonTest.php @@ -71,7 +71,7 @@ ); } - function getTestModules() { + protected function getTestModules() { return parent::getTestModules() + array( 'CommonTests' = __DIR__ . '/CommonTests.lua', 'CommonTests-data' = __DIR__ . '/CommonTests-data.lua', @@ -83,7 +83,7 @@ ); } - function testNoLeakedGlobals() { + public function testNoLeakedGlobals() { $interpreter = $this-getEngine()-getInterpreter(); list( $actualGlobals ) = $interpreter-callFunction( @@ -99,7 +99,7 @@ ); } - function testPHPLibrary() { + public function testPHPLibrary() { $engine = $this-getEngine(); $frame = $engine-getParser()-getPreprocessor()-newFrame(); @@ -191,7 +191,7 @@ 'library is not recreated between invokes' ); } - function testModuleStringExtend() { + public function testModuleStringExtend() { $engine = $this-getEngine(); $interpreter = $engine-getInterpreter(); @@ -265,7 +265,7 @@ ); } - function testLoadDataLoadedOnce() { + public function testLoadDataLoadedOnce() { $engine = $this-getEngine(); $interpreter = $engine-getInterpreter(); $frame = $engine-getParser()-getPreprocessor()-newFrame(); @@ -311,7 +311,7 @@ ); } - function testFrames() { + public function testFrames() { $engine = $this-getEngine(); $ret = $engine-runConsole( array( @@ -342,7 +342,7 @@ $this-assertSame( ok\ttable, $ret['return'], 'child frames have correct parents' ); } - function testCallParserFunction() { + public function testCallParserFunction() { global $wgContLang; $engine = $this-getEngine(); @@ -471,7 +471,7 @@ } } - function testBug62291() { + public function testBug62291() { $engine = $this-getEngine(); $frame = $engine-getParser()-getPreprocessor()-newFrame(); @@ -514,7 +514,7 @@ $this-assertSame( $r1, $r2, 'Multiple invokes with recursive invoke returned different sets of random numbers' ); } - function testOsDateTimeTTLs() { + public function testOsDateTimeTTLs() { $engine = $this-getEngine(); $pp = $engine-getParser()-getPreprocessor(); @@ -587,7 +587,7 @@ /** * @dataProvider provideVolatileCaching */ - function testVolatileCaching( $func ) { + public function testVolatileCaching( $func ) { $engine = $this-getEngine(); $parser = $engine-getParser(); $pp = $parser-getPreprocessor(); @@ -626,7 +626,7 @@ $this-assertEquals( '1 2', $text, Volatile wikitext was not cached ); } - function provideVolatileCaching() { + public function provideVolatileCaching() { return array( array( 'preprocess' ), array( 'extensionTag' ), @@ -634,7 +634,7 @@ ); } - function testGetCurrentFrameAndMWLoadData() { + public function
[MediaWiki-commits] [Gerrit] [WIP] MWException: Log traces for php errors (not exceptions) - change (mediawiki/core)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/173642 Change subject: [WIP] MWException: Log traces for php errors (not exceptions) .. [WIP] MWException: Log traces for php errors (not exceptions) * Remove use of 'error' where it's redundant. * Remove call to logException from responsibility of MWException. Call from MWExceptionHandler::report instead, just like we do for non-MWException objects in the same function already. Change-Id: I8764cf5df87b226813c9b9cf99f9b4f3fa4b7c92 --- M includes/OutputPage.php M includes/exception/MWException.php M includes/exception/MWExceptionHandler.php 3 files changed, 55 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/42/173642/1 diff --git a/includes/OutputPage.php b/includes/OutputPage.php index a517788..08706b0 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2132,6 +2132,7 @@ $response = $this-getRequest()-response(); $config = $this-getConfig(); + strpos(); if ( $this-mRedirect != '' ) { # Standards require redirect URLs to be absolute diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 074128f..6fd6fb5 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -222,8 +222,6 @@ public function report() { global $wgMimeType; - MWExceptionHandler::logException( $this ); - if ( defined( 'MW_API' ) ) { // Unhandled API exception, we can't be sure that format printer is alive self::header( 'MediaWiki-API-Error: internal_api_error_' . get_class( $this ) ); diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 1f1ba9c..0877f74 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -23,11 +23,13 @@ * @ingroup Exception */ class MWExceptionHandler { + /** -* Install an exception handler for MediaWiki exception types. +* Install handlers with PHP. */ public static function installHandler() { - set_exception_handler( array( 'MWExceptionHandler', 'handle' ) ); + set_exception_handler( array( 'MWExceptionHandler', 'handleException' ) ); + set_error_handler( array( 'MWExceptionHandler', 'handleError' ) ); } /** @@ -40,12 +42,13 @@ $cmdLine = MWException::isCommandLine(); if ( $e instanceof MWException ) { + self::logException( $e ); try { // Try and show the exception prettily, with the normal skin infrastructure $e-report(); } catch ( Exception $e2 ) { // Exception occurred from within exception handler - // Show a simpler error message for the original exception, + // Show a simpler message for the original exception, // don't try to invoke report() $message = MediaWiki internal error.\n\n; @@ -135,7 +138,7 @@ * } * @param Exception $e */ - public static function handle( $e ) { + public static function handleException( $e ) { global $wgFullyInitialised; self::rollbackMasterChangesAndLog( $e ); @@ -156,6 +159,21 @@ } /** +* @param int $level Error level raised +* @param string $message +* @param string $file +* @param int $line +*/ + public static function handleError( $level, $message, $file = null, $line = null ) { + $e = new ErrorException( $message, 0, $level, $file, $line ); + self::logException( $e, 'error' ); + + // This handler is for logging only. Return false will instruct PHP + // to continue regular handling. + return false; + } + + /** * Generate a string representation of an exception's stack trace * * Like Exception::getTraceAsString, but replaces argument values with @@ -165,9 +183,13 @@ * @return string */ public static function getRedactedTraceAsString( Exception $e ) { + return self::formatTrace( self::getRedactedTrace( $e ) ); + } + + protected static function formatTrace( Array $trace ) { $text = ''; - foreach ( self::getRedactedTrace( $e ) as $level = $frame ) { + foreach ( $trace as $level = $frame ) { if (
[MediaWiki-commits] [Gerrit] Fix typo in exception - change (mediawiki...Translate)
jenkins-bot has submitted this change and it was merged. Change subject: Fix typo in exception .. Fix typo in exception Change-Id: Ic1170408bbef420ca9995e75b85c4d652ae39cc2 --- M tag/TranslatablePage.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: KartikMistry: Looks good to me, approved Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/tag/TranslatablePage.php b/tag/TranslatablePage.php index b76a495..97e1431 100644 --- a/tag/TranslatablePage.php +++ b/tag/TranslatablePage.php @@ -509,7 +509,7 @@ $aid = $this-getTitle()-getArticleID(); if ( is_object( $revision ) ) { - throw new MWException( 'Got object, excepted id' ); + throw new MWException( 'Got object, expected id' ); } $conds = array( -- To view, visit https://gerrit.wikimedia.org/r/173081 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1170408bbef420ca9995e75b85c4d652ae39cc2 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nemo bis federicol...@tiscali.it Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com Gerrit-Reviewer: Nemo bis federicol...@tiscali.it Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com 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 support for TSReports and Cvnoverlay - change (translatewiki)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/173643 Change subject: Add support for TSReports and Cvnoverlay .. Add support for TSReports and Cvnoverlay Change-Id: I06602b8771ac2602f8fe46923290c0a7b9f2fdfb --- M groups/Intuition/intuition-textdomains.txt 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/43/173643/1 diff --git a/groups/Intuition/intuition-textdomains.txt b/groups/Intuition/intuition-textdomains.txt index 05f6083..469c9aa 100644 --- a/groups/Intuition/intuition-textdomains.txt +++ b/groups/Intuition/intuition-textdomains.txt @@ -5,6 +5,8 @@ ignored = title, tusc optional = commonshelper2, standard_project, checkusage +Cvn Overlay + General optional = colon-separator, dateformat, parentheses, comma-separator, word-separator @@ -53,7 +55,9 @@ Templatecount optional = title -Toolserverstatus +Toolserver status + +Ts Reports Voiceintro ignored = voiceintro-title -- To view, visit https://gerrit.wikimedia.org/r/173643 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06602b8771ac2602f8fe46923290c0a7b9f2fdfb Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add support for TSReports and Cvnoverlay - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: Add support for TSReports and Cvnoverlay .. Add support for TSReports and Cvnoverlay Change-Id: I06602b8771ac2602f8fe46923290c0a7b9f2fdfb --- M groups/Intuition/intuition-textdomains.txt 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/groups/Intuition/intuition-textdomains.txt b/groups/Intuition/intuition-textdomains.txt index 05f6083..469c9aa 100644 --- a/groups/Intuition/intuition-textdomains.txt +++ b/groups/Intuition/intuition-textdomains.txt @@ -5,6 +5,8 @@ ignored = title, tusc optional = commonshelper2, standard_project, checkusage +Cvn Overlay + General optional = colon-separator, dateformat, parentheses, comma-separator, word-separator @@ -53,7 +55,9 @@ Templatecount optional = title -Toolserverstatus +Toolserver status + +Ts Reports Voiceintro ignored = voiceintro-title -- To view, visit https://gerrit.wikimedia.org/r/173643 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06602b8771ac2602f8fe46923290c0a7b9f2fdfb Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Scoping for h1 and h3 rules - change (mediawiki...FanBoxes)
Jack Phoenix has submitted this change and it was merged. Change subject: Scoping for h1 and h3 rules .. Scoping for h1 and h3 rules Essentially the first 187 lines should be decoupled from this file into a separate module which is only loaded on Special:UserBoxes, but even so, without this change there would be some skins where Special:UserBoxes would render improperly. SocialProfile's UserProfile (specifically UserProfilePage.php) loads this CSS file when FanBoxes is available and enabled, so we need to limit the scope of the h1 and h3 rules. I chose to use both .mw-body and .mw-body-primary because at least one of those two is present on all skins. Change-Id: Id770404ac629b5aa26bf56e5370a7301612acaae --- M FanBoxes.css 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jack Phoenix: Verified; Looks good to me, approved diff --git a/FanBoxes.css b/FanBoxes.css index 49a2ba6..e790caf 100644 --- a/FanBoxes.css +++ b/FanBoxes.css @@ -5,7 +5,7 @@ margin-bottom: 10px; } -h3 { +.mw-body h3, .mw-body-primary h3 { margin-top: 5px; margin-bottom: 5px; font-size: 14px; @@ -24,7 +24,7 @@ width: 550px; } -h1 { +.mw-body h1, .mw-body-primary h1 { font-size: 16px; margin: 10px 0px 10px 0px !important; border-bottom: none; -- To view, visit https://gerrit.wikimedia.org/r/173644 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id770404ac629b5aa26bf56e5370a7301612acaae Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FanBoxes Gerrit-Branch: master Gerrit-Owner: Jack Phoenix j...@countervandalism.net Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Scoping for h1 and h3 rules - change (mediawiki...FanBoxes)
Jack Phoenix has uploaded a new change for review. https://gerrit.wikimedia.org/r/173644 Change subject: Scoping for h1 and h3 rules .. Scoping for h1 and h3 rules Essentially the first 187 lines should be decoupled from this file into a separate module which is only loaded on Special:UserBoxes, but even so, without this change there would be some skins where Special:UserBoxes would render improperly. SocialProfile's UserProfile (specifically UserProfilePage.php) loads this CSS file when FanBoxes is available and enabled, so we need to limit the scope of the h1 and h3 rules. I chose to use both .mw-body and .mw-body-primary because at least one of those two is present on all skins. Change-Id: Id770404ac629b5aa26bf56e5370a7301612acaae --- M FanBoxes.css 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FanBoxes refs/changes/44/173644/1 diff --git a/FanBoxes.css b/FanBoxes.css index 49a2ba6..e790caf 100644 --- a/FanBoxes.css +++ b/FanBoxes.css @@ -5,7 +5,7 @@ margin-bottom: 10px; } -h3 { +.mw-body h3, .mw-body-primary h3 { margin-top: 5px; margin-bottom: 5px; font-size: 14px; @@ -24,7 +24,7 @@ width: 550px; } -h1 { +.mw-body h1, .mw-body-primary h1 { font-size: 16px; margin: 10px 0px 10px 0px !important; border-bottom: none; -- To view, visit https://gerrit.wikimedia.org/r/173644 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id770404ac629b5aa26bf56e5370a7301612acaae Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FanBoxes Gerrit-Branch: master Gerrit-Owner: Jack Phoenix j...@countervandalism.net ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] MWException: Log stack traces for php errors (not exceptions) - change (mediawiki/core)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/173645 Change subject: MWException: Log stack traces for php errors (not exceptions) .. MWException: Log stack traces for php errors (not exceptions) * Remove use of 'error' where it's redundant. * Remove call to logException from responsibility of MWException. Call from exception handler instead. Change-Id: I8764cf5df87b226813c9b9cf99f9b4f3fa4b7c92 --- M includes/MediaWiki.php M includes/exception/MWException.php M includes/exception/MWExceptionHandler.php 3 files changed, 51 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/45/173645/1 diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 9585c5f..7ce6d1b 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -446,7 +446,7 @@ $this-triggerJobs(); $this-restInPeace(); } catch ( Exception $e ) { - MWExceptionHandler::handle( $e ); + MWExceptionHandler::handleException( $e ); } } diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 074128f..6fd6fb5 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -222,8 +222,6 @@ public function report() { global $wgMimeType; - MWExceptionHandler::logException( $this ); - if ( defined( 'MW_API' ) ) { // Unhandled API exception, we can't be sure that format printer is alive self::header( 'MediaWiki-API-Error: internal_api_error_' . get_class( $this ) ); diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 1f1ba9c..0d90e66 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -23,11 +23,13 @@ * @ingroup Exception */ class MWExceptionHandler { + /** -* Install an exception handler for MediaWiki exception types. +* Install handlers with PHP. */ public static function installHandler() { - set_exception_handler( array( 'MWExceptionHandler', 'handle' ) ); + set_exception_handler( array( 'MWExceptionHandler', 'handleException' ) ); + set_error_handler( array( 'MWExceptionHandler', 'handleError' ) ); } /** @@ -45,7 +47,7 @@ $e-report(); } catch ( Exception $e2 ) { // Exception occurred from within exception handler - // Show a simpler error message for the original exception, + // Show a simpler message for the original exception, // don't try to invoke report() $message = MediaWiki internal error.\n\n; @@ -83,7 +85,6 @@ echo nl2br( htmlspecialchars( $message ) ) . \n; } - self::logException( $e ); } } @@ -108,6 +109,7 @@ * If there are any open database transactions, roll them back and log * the stack trace of the exception that should have been caught so the * transaction could be aborted properly. +* * @since 1.23 * @param Exception $e */ @@ -133,13 +135,15 @@ * } catch ( Exception $e ) { * echo $e-__toString(); * } +* +* @since 1.25 * @param Exception $e */ - public static function handle( $e ) { + public static function handleException( $e ) { global $wgFullyInitialised; self::rollbackMasterChangesAndLog( $e ); - + self::logException( $e ); self::report( $e ); // Final cleanup @@ -153,6 +157,22 @@ // Exit value should be nonzero for the benefit of shell jobs exit( 1 ); + } + + /** +* @since 1.25 +* @param int $level Error level raised +* @param string $message +* @param string $file +* @param int $line +*/ + public static function handleError( $level, $message, $file = null, $line = null ) { + $e = new ErrorException( $message, 0, $level, $file, $line ); + self::logError( $e ); + + // This handler is for logging only. Return false will instruct PHP + // to continue regular handling. + return false; } /** @@ -219,7 +239,7 @@ } /** -* Get the ID for this error. +* Get the ID for this exception. *
[MediaWiki-commits] [Gerrit] MWException: Log stack traces for php errors (not exceptions) - change (mediawiki/core)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/173646 Change subject: MWException: Log stack traces for php errors (not exceptions) .. MWException: Log stack traces for php errors (not exceptions) * Remove use of 'error' where it's redundant. * Remove call to logException from responsibility of MWException. Call from exception handler instead. Change-Id: I8764cf5df87b226813c9b9cf99f9b4f3fa4b7c92 --- M includes/MediaWiki.php M includes/exception/MWException.php M includes/exception/MWExceptionHandler.php 3 files changed, 51 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/46/173646/1 diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 9585c5f..7ce6d1b 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -446,7 +446,7 @@ $this-triggerJobs(); $this-restInPeace(); } catch ( Exception $e ) { - MWExceptionHandler::handle( $e ); + MWExceptionHandler::handleException( $e ); } } diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 074128f..6fd6fb5 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -222,8 +222,6 @@ public function report() { global $wgMimeType; - MWExceptionHandler::logException( $this ); - if ( defined( 'MW_API' ) ) { // Unhandled API exception, we can't be sure that format printer is alive self::header( 'MediaWiki-API-Error: internal_api_error_' . get_class( $this ) ); diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 1f1ba9c..0d90e66 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -23,11 +23,13 @@ * @ingroup Exception */ class MWExceptionHandler { + /** -* Install an exception handler for MediaWiki exception types. +* Install handlers with PHP. */ public static function installHandler() { - set_exception_handler( array( 'MWExceptionHandler', 'handle' ) ); + set_exception_handler( array( 'MWExceptionHandler', 'handleException' ) ); + set_error_handler( array( 'MWExceptionHandler', 'handleError' ) ); } /** @@ -45,7 +47,7 @@ $e-report(); } catch ( Exception $e2 ) { // Exception occurred from within exception handler - // Show a simpler error message for the original exception, + // Show a simpler message for the original exception, // don't try to invoke report() $message = MediaWiki internal error.\n\n; @@ -83,7 +85,6 @@ echo nl2br( htmlspecialchars( $message ) ) . \n; } - self::logException( $e ); } } @@ -108,6 +109,7 @@ * If there are any open database transactions, roll them back and log * the stack trace of the exception that should have been caught so the * transaction could be aborted properly. +* * @since 1.23 * @param Exception $e */ @@ -133,13 +135,15 @@ * } catch ( Exception $e ) { * echo $e-__toString(); * } +* +* @since 1.25 * @param Exception $e */ - public static function handle( $e ) { + public static function handleException( $e ) { global $wgFullyInitialised; self::rollbackMasterChangesAndLog( $e ); - + self::logException( $e ); self::report( $e ); // Final cleanup @@ -153,6 +157,22 @@ // Exit value should be nonzero for the benefit of shell jobs exit( 1 ); + } + + /** +* @since 1.25 +* @param int $level Error level raised +* @param string $message +* @param string $file +* @param int $line +*/ + public static function handleError( $level, $message, $file = null, $line = null ) { + $e = new ErrorException( $message, 0, $level, $file, $line ); + self::logError( $e ); + + // This handler is for logging only. Return false will instruct PHP + // to continue regular handling. + return false; } /** @@ -219,7 +239,7 @@ } /** -* Get the ID for this error. +* Get the ID for this exception. *
[MediaWiki-commits] [Gerrit] Update tags for Tsreports - change (translatewiki)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/173647 Change subject: Update tags for Tsreports .. Update tags for Tsreports Change-Id: I7f1c4ae2607157120ac177ecb4b2a8cc044813d1 --- M groups/Intuition/intuition-textdomains.txt 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/47/173647/1 diff --git a/groups/Intuition/intuition-textdomains.txt b/groups/Intuition/intuition-textdomains.txt index 469c9aa..1dc88db 100644 --- a/groups/Intuition/intuition-textdomains.txt +++ b/groups/Intuition/intuition-textdomains.txt @@ -58,6 +58,7 @@ Toolserver status Ts Reports +optional = tsreports-base_links, tsreports-report_variable, tsreports-report_changelinks Voiceintro ignored = voiceintro-title -- To view, visit https://gerrit.wikimedia.org/r/173647 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f1c4ae2607157120ac177ecb4b2a8cc044813d1 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update tags for Tsreports - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: Update tags for Tsreports .. Update tags for Tsreports Change-Id: I7f1c4ae2607157120ac177ecb4b2a8cc044813d1 --- M groups/Intuition/intuition-textdomains.txt 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/groups/Intuition/intuition-textdomains.txt b/groups/Intuition/intuition-textdomains.txt index 469c9aa..1dc88db 100644 --- a/groups/Intuition/intuition-textdomains.txt +++ b/groups/Intuition/intuition-textdomains.txt @@ -58,6 +58,7 @@ Toolserver status Ts Reports +optional = tsreports-base_links, tsreports-report_variable, tsreports-report_changelinks Voiceintro ignored = voiceintro-title -- To view, visit https://gerrit.wikimedia.org/r/173647 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f1c4ae2607157120ac177ecb4b2a8cc044813d1 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix tags - change (translatewiki)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/173648 Change subject: Fix tags .. Fix tags They didn't need the prefix. Change-Id: Id560328ec00f6e869991a1a325de0e65f563d6ab --- M groups/Intuition/intuition-textdomains.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/48/173648/1 diff --git a/groups/Intuition/intuition-textdomains.txt b/groups/Intuition/intuition-textdomains.txt index 1dc88db..c355118 100644 --- a/groups/Intuition/intuition-textdomains.txt +++ b/groups/Intuition/intuition-textdomains.txt @@ -58,7 +58,7 @@ Toolserver status Ts Reports -optional = tsreports-base_links, tsreports-report_variable, tsreports-report_changelinks +optional = base_links, report_variable, report_changelinks Voiceintro ignored = voiceintro-title -- To view, visit https://gerrit.wikimedia.org/r/173648 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id560328ec00f6e869991a1a325de0e65f563d6ab Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix tags - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: Fix tags .. Fix tags They didn't need the prefix. Change-Id: Id560328ec00f6e869991a1a325de0e65f563d6ab --- M groups/Intuition/intuition-textdomains.txt 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/groups/Intuition/intuition-textdomains.txt b/groups/Intuition/intuition-textdomains.txt index 1dc88db..c355118 100644 --- a/groups/Intuition/intuition-textdomains.txt +++ b/groups/Intuition/intuition-textdomains.txt @@ -58,7 +58,7 @@ Toolserver status Ts Reports -optional = tsreports-base_links, tsreports-report_variable, tsreports-report_changelinks +optional = base_links, report_variable, report_changelinks Voiceintro ignored = voiceintro-title -- To view, visit https://gerrit.wikimedia.org/r/173648 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id560328ec00f6e869991a1a325de0e65f563d6ab Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] MWException: Log stack traces for php errors (not exceptions) - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: MWException: Log stack traces for php errors (not exceptions) .. MWException: Log stack traces for php errors (not exceptions) * Remove use of 'error' where it's redundant. * Remove call to logException from responsibility of MWException. Call from exception handler instead. Change-Id: I8764cf5df87b226813c9b9cf99f9b4f3fa4b7c92 --- M includes/MediaWiki.php M includes/exception/MWException.php M includes/exception/MWExceptionHandler.php M tests/phpunit/phpunit.php 4 files changed, 57 insertions(+), 15 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 9585c5f..7ce6d1b 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -446,7 +446,7 @@ $this-triggerJobs(); $this-restInPeace(); } catch ( Exception $e ) { - MWExceptionHandler::handle( $e ); + MWExceptionHandler::handleException( $e ); } } diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 074128f..6fd6fb5 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -222,8 +222,6 @@ public function report() { global $wgMimeType; - MWExceptionHandler::logException( $this ); - if ( defined( 'MW_API' ) ) { // Unhandled API exception, we can't be sure that format printer is alive self::header( 'MediaWiki-API-Error: internal_api_error_' . get_class( $this ) ); diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 1f1ba9c..0d90e66 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -23,11 +23,13 @@ * @ingroup Exception */ class MWExceptionHandler { + /** -* Install an exception handler for MediaWiki exception types. +* Install handlers with PHP. */ public static function installHandler() { - set_exception_handler( array( 'MWExceptionHandler', 'handle' ) ); + set_exception_handler( array( 'MWExceptionHandler', 'handleException' ) ); + set_error_handler( array( 'MWExceptionHandler', 'handleError' ) ); } /** @@ -45,7 +47,7 @@ $e-report(); } catch ( Exception $e2 ) { // Exception occurred from within exception handler - // Show a simpler error message for the original exception, + // Show a simpler message for the original exception, // don't try to invoke report() $message = MediaWiki internal error.\n\n; @@ -83,7 +85,6 @@ echo nl2br( htmlspecialchars( $message ) ) . \n; } - self::logException( $e ); } } @@ -108,6 +109,7 @@ * If there are any open database transactions, roll them back and log * the stack trace of the exception that should have been caught so the * transaction could be aborted properly. +* * @since 1.23 * @param Exception $e */ @@ -133,13 +135,15 @@ * } catch ( Exception $e ) { * echo $e-__toString(); * } +* +* @since 1.25 * @param Exception $e */ - public static function handle( $e ) { + public static function handleException( $e ) { global $wgFullyInitialised; self::rollbackMasterChangesAndLog( $e ); - + self::logException( $e ); self::report( $e ); // Final cleanup @@ -153,6 +157,22 @@ // Exit value should be nonzero for the benefit of shell jobs exit( 1 ); + } + + /** +* @since 1.25 +* @param int $level Error level raised +* @param string $message +* @param string $file +* @param int $line +*/ + public static function handleError( $level, $message, $file = null, $line = null ) { + $e = new ErrorException( $message, 0, $level, $file, $line ); + self::logError( $e ); + + // This handler is for logging only. Return false will instruct PHP + // to continue regular handling. + return false; } /** @@ -219,7 +239,7 @@ } /** -* Get the ID for this error. +* Get the ID for this exception. * * The ID
[MediaWiki-commits] [Gerrit] Declare 'error' log group - change (operations/mediawiki-config)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/173649 Change subject: Declare 'error' log group .. Declare 'error' log group Follows-up 399ba2fecf in mediawiki-core. Change-Id: If9194b73c3256e0064ff724c1ff3fcc2f0930366 --- M wmf-config/CommonSettings.php M wmf-config/InitialiseSettings.php 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/49/173649/1 diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index aa31fef..a37e619 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -18,7 +18,7 @@ # # More modern PHP versions will send a 500 result code on fatal error, # at least sometimes, but what we're running will send a 200. -if( PHP_SAPI != 'cli' ) { +if ( PHP_SAPI != 'cli' ) { header( Cache-control: no-cache ); } diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4fc8274..0dedae7 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -4139,6 +4139,7 @@ 'thumbnail' = udp://$wmfUdp2logDest/thumbnail, 'jobqueue' = udp://$wmfUdp2logDest/jobqueue/web, 'slow-parse' = udp://$wmfUdp2logDest/slow-parse, + 'error' = udp://$wmfUdp2logDest/error, 'exception' = udp://$wmfUdp2logDest/exception, 'exception-json' = udp://$wmfUdp2logDest/exception-json, 'session' = udp://$wmfUdp2logDest/session, -- To view, visit https://gerrit.wikimedia.org/r/173649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9194b73c3256e0064ff724c1ff3fcc2f0930366 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Safer ctrl-c handling - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/173650 Change subject: Safer ctrl-c handling .. Safer ctrl-c handling Change-Id: Iac27f7f7ddc7578368fa149e4be136bb0f9b12ef --- M scripts/harvest_template.py 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/50/173650/1 diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py index 102931d..a811d8c 100755 --- a/scripts/harvest_template.py +++ b/scripts/harvest_template.py @@ -33,6 +33,19 @@ # import re +import signal + +willstop = False +def signal_handler(signal, frame): +global willstop +if not willstop: +willstop = True +print Received ctrl-c. Finishing current item; press ctrl-c again to abort. +else: +raise KeyboardInterrupt + +signal.signal(signal.SIGINT, signal_handler) + import pywikibot from pywikibot import pagegenerators as pg, textlib, WikidataBot @@ -107,6 +120,8 @@ def treat(self, page, item): Process a single page/item. +if willstop: +raise KeyboardInterrupt self.current_page = page item.get() if set(self.fields.values()) = set(item.claims.keys()): -- To view, visit https://gerrit.wikimedia.org/r/173650 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac27f7f7ddc7578368fa149e4be136bb0f9b12ef Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add qualifier support - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/173651 Change subject: Add qualifier support .. Add qualifier support Change-Id: Icfd121d017fdf4fe6f8a65c5ce17e768d3a5469f --- M scripts/harvest_template.py 1 file changed, 65 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/51/173651/1 diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py index a811d8c..db401a7 100755 --- a/scripts/harvest_template.py +++ b/scripts/harvest_template.py @@ -5,7 +5,7 @@ Usage: -python harvest_template.py -transcludes:... template_parameter PID [template_parameter PID] +python harvest_template.py -transcludes:... template_parameter PID [template_parameter PID [-qualifier:Q:val -qualifier:Q:val ...]] or @@ -51,6 +51,8 @@ docuReplacements = {'params;': pywikibot.pagegenerators.parameterHelp} +class SetClaimException(Exception): +pass class HarvestRobot(WikidataBot): @@ -124,7 +126,7 @@ raise KeyboardInterrupt self.current_page = page item.get() -if set(self.fields.values()) = set(item.claims.keys()): +if set(x['P'] for x in self.fields.values()) = set(item.claims.keys()): pywikibot.output(u'%s item %s has claims for all properties. Skipping' % (page, item.title())) return @@ -149,7 +151,7 @@ # This field contains something useful for us if field in self.fields: # Check if the property isn't already set -claim = pywikibot.Claim(self.repo, self.fields[field]) +claim = pywikibot.Claim(self.repo, self.fields[field][P]) if claim.getID() in item.get().get('claims'): pywikibot.output( u'A claim for %s already exists. Skipping' @@ -158,42 +160,62 @@ # harvested values with existing claims esp. # without overwriting humans unintentionally. else: -if claim.type == 'wikibase-item': -# Try to extract a valid page -match = re.search(pywikibot.link_regex, value) -if not match: -pywikibot.output(u'%s field %s value %s isnt a wikilink. Skipping' % (claim.getID(), field, value)) -continue - -link_text = match.group(1) -linked_item = self._template_link_target(item, link_text) -if not linked_item: -continue - -claim.setTarget(linked_item) -elif claim.type == 'string': -claim.setTarget(value.strip()) -elif claim.type == 'commonsMedia': -commonssite = pywikibot.Site(commons, commons) -imagelink = pywikibot.Link(value, source=commonssite, defaultNamespace=6) -image = pywikibot.FilePage(imagelink) -if image.isRedirectPage(): -image = pywikibot.FilePage(image.getRedirectTarget()) -if not image.exists(): -pywikibot.output('[[%s]] doesn\'t exist so I can\'t link to it' % (image.title(),)) -continue -claim.setTarget(image) -else: -pywikibot.output(%s is not a supported datatype. % claim.type) +try: +self.setClaimValue(field, claim, value) +except SetClaimException as e: +pywikibot.output(e) continue - -pywikibot.output('Adding %s -- %s' % (claim.getID(), claim.getTarget())) +pywikibot.output('%s: Adding %s -- %s' % (item.getID(), claim.getID(), claim.getTarget())) item.addClaim(claim) + # A generator might yield pages from multiple sites source = self.getSource(page.site) +for P, value in self.fields[field]['qualifiers'].items(): +qualifier = pywikibot.Claim(self.repo, P, isQualifier=True) +try: +self.setClaimValue(field + qualifier + P, qualifier, value) +
[MediaWiki-commits] [Gerrit] Declare 'error' log group - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Declare 'error' log group .. Declare 'error' log group Follows-up 399ba2fecf in mediawiki-core. Change-Id: If9194b73c3256e0064ff724c1ff3fcc2f0930366 --- M wmf-config/CommonSettings.php M wmf-config/InitialiseSettings.php 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index aa31fef..a37e619 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -18,7 +18,7 @@ # # More modern PHP versions will send a 500 result code on fatal error, # at least sometimes, but what we're running will send a 200. -if( PHP_SAPI != 'cli' ) { +if ( PHP_SAPI != 'cli' ) { header( Cache-control: no-cache ); } diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4fc8274..0dedae7 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -4139,6 +4139,7 @@ 'thumbnail' = udp://$wmfUdp2logDest/thumbnail, 'jobqueue' = udp://$wmfUdp2logDest/jobqueue/web, 'slow-parse' = udp://$wmfUdp2logDest/slow-parse, + 'error' = udp://$wmfUdp2logDest/error, 'exception' = udp://$wmfUdp2logDest/exception, 'exception-json' = udp://$wmfUdp2logDest/exception-json, 'session' = udp://$wmfUdp2logDest/session, -- To view, visit https://gerrit.wikimedia.org/r/173649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If9194b73c3256e0064ff724c1ff3fcc2f0930366 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] MWException: Log stack traces for php errors (not exceptions) - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: MWException: Log stack traces for php errors (not exceptions) .. MWException: Log stack traces for php errors (not exceptions) * Remove use of 'error' where it's redundant. * Remove call to logException from responsibility of MWException. Call from exception handler instead. Change-Id: I8764cf5df87b226813c9b9cf99f9b4f3fa4b7c92 (cherry picked from commit 399ba2fecfe098b45b2064380eadcac0b24b9a4a) --- M includes/MediaWiki.php M includes/exception/MWException.php M includes/exception/MWExceptionHandler.php M tests/phpunit/phpunit.php 4 files changed, 57 insertions(+), 15 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 9585c5f..7ce6d1b 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -446,7 +446,7 @@ $this-triggerJobs(); $this-restInPeace(); } catch ( Exception $e ) { - MWExceptionHandler::handle( $e ); + MWExceptionHandler::handleException( $e ); } } diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 074128f..6fd6fb5 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -222,8 +222,6 @@ public function report() { global $wgMimeType; - MWExceptionHandler::logException( $this ); - if ( defined( 'MW_API' ) ) { // Unhandled API exception, we can't be sure that format printer is alive self::header( 'MediaWiki-API-Error: internal_api_error_' . get_class( $this ) ); diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 1f1ba9c..0d90e66 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -23,11 +23,13 @@ * @ingroup Exception */ class MWExceptionHandler { + /** -* Install an exception handler for MediaWiki exception types. +* Install handlers with PHP. */ public static function installHandler() { - set_exception_handler( array( 'MWExceptionHandler', 'handle' ) ); + set_exception_handler( array( 'MWExceptionHandler', 'handleException' ) ); + set_error_handler( array( 'MWExceptionHandler', 'handleError' ) ); } /** @@ -45,7 +47,7 @@ $e-report(); } catch ( Exception $e2 ) { // Exception occurred from within exception handler - // Show a simpler error message for the original exception, + // Show a simpler message for the original exception, // don't try to invoke report() $message = MediaWiki internal error.\n\n; @@ -83,7 +85,6 @@ echo nl2br( htmlspecialchars( $message ) ) . \n; } - self::logException( $e ); } } @@ -108,6 +109,7 @@ * If there are any open database transactions, roll them back and log * the stack trace of the exception that should have been caught so the * transaction could be aborted properly. +* * @since 1.23 * @param Exception $e */ @@ -133,13 +135,15 @@ * } catch ( Exception $e ) { * echo $e-__toString(); * } +* +* @since 1.25 * @param Exception $e */ - public static function handle( $e ) { + public static function handleException( $e ) { global $wgFullyInitialised; self::rollbackMasterChangesAndLog( $e ); - + self::logException( $e ); self::report( $e ); // Final cleanup @@ -153,6 +157,22 @@ // Exit value should be nonzero for the benefit of shell jobs exit( 1 ); + } + + /** +* @since 1.25 +* @param int $level Error level raised +* @param string $message +* @param string $file +* @param int $line +*/ + public static function handleError( $level, $message, $file = null, $line = null ) { + $e = new ErrorException( $message, 0, $level, $file, $line ); + self::logError( $e ); + + // This handler is for logging only. Return false will instruct PHP + // to continue regular handling. + return false; } /** @@ -219,7 +239,7 @@ } /** -* Get the ID for this error. +
[MediaWiki-commits] [Gerrit] MWException: Log stack traces for php errors (not exceptions) - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: MWException: Log stack traces for php errors (not exceptions) .. MWException: Log stack traces for php errors (not exceptions) * Remove use of 'error' where it's redundant. * Remove call to logException from responsibility of MWException. Call from exception handler instead. Change-Id: I8764cf5df87b226813c9b9cf99f9b4f3fa4b7c92 (cherry picked from commit 399ba2fecfe098b45b2064380eadcac0b24b9a4a) --- M includes/MediaWiki.php M includes/exception/MWException.php M includes/exception/MWExceptionHandler.php M tests/phpunit/phpunit.php 4 files changed, 57 insertions(+), 15 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 9585c5f..7ce6d1b 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -446,7 +446,7 @@ $this-triggerJobs(); $this-restInPeace(); } catch ( Exception $e ) { - MWExceptionHandler::handle( $e ); + MWExceptionHandler::handleException( $e ); } } diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 074128f..6fd6fb5 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -222,8 +222,6 @@ public function report() { global $wgMimeType; - MWExceptionHandler::logException( $this ); - if ( defined( 'MW_API' ) ) { // Unhandled API exception, we can't be sure that format printer is alive self::header( 'MediaWiki-API-Error: internal_api_error_' . get_class( $this ) ); diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 1f1ba9c..0d90e66 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -23,11 +23,13 @@ * @ingroup Exception */ class MWExceptionHandler { + /** -* Install an exception handler for MediaWiki exception types. +* Install handlers with PHP. */ public static function installHandler() { - set_exception_handler( array( 'MWExceptionHandler', 'handle' ) ); + set_exception_handler( array( 'MWExceptionHandler', 'handleException' ) ); + set_error_handler( array( 'MWExceptionHandler', 'handleError' ) ); } /** @@ -45,7 +47,7 @@ $e-report(); } catch ( Exception $e2 ) { // Exception occurred from within exception handler - // Show a simpler error message for the original exception, + // Show a simpler message for the original exception, // don't try to invoke report() $message = MediaWiki internal error.\n\n; @@ -83,7 +85,6 @@ echo nl2br( htmlspecialchars( $message ) ) . \n; } - self::logException( $e ); } } @@ -108,6 +109,7 @@ * If there are any open database transactions, roll them back and log * the stack trace of the exception that should have been caught so the * transaction could be aborted properly. +* * @since 1.23 * @param Exception $e */ @@ -133,13 +135,15 @@ * } catch ( Exception $e ) { * echo $e-__toString(); * } +* +* @since 1.25 * @param Exception $e */ - public static function handle( $e ) { + public static function handleException( $e ) { global $wgFullyInitialised; self::rollbackMasterChangesAndLog( $e ); - + self::logException( $e ); self::report( $e ); // Final cleanup @@ -153,6 +157,22 @@ // Exit value should be nonzero for the benefit of shell jobs exit( 1 ); + } + + /** +* @since 1.25 +* @param int $level Error level raised +* @param string $message +* @param string $file +* @param int $line +*/ + public static function handleError( $level, $message, $file = null, $line = null ) { + $e = new ErrorException( $message, 0, $level, $file, $line ); + self::logError( $e ); + + // This handler is for logging only. Return false will instruct PHP + // to continue regular handling. + return false; } /** @@ -219,7 +239,7 @@ } /** -* Get the ID for this error. +
[MediaWiki-commits] [Gerrit] Add support for Dotyali (dty) - change (translatewiki)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/173652 Change subject: Add support for Dotyali (dty) .. Add support for Dotyali (dty) Change-Id: Ia68ff98cce12ec4fed395267c49115c70df5850f --- M FallbackSettings.php M LanguageSettings.php 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/52/173652/1 diff --git a/FallbackSettings.php b/FallbackSettings.php index 1924d21..b95371d 100644 --- a/FallbackSettings.php +++ b/FallbackSettings.php @@ -20,6 +20,7 @@ $wgTranslateLanguageFallbacks['cps'] = array( 'tl' ); $wgTranslateLanguageFallbacks['cs'] = array( 'sk', 'de', 'fr', 'ru', 'pl' ); $wgTranslateLanguageFallbacks['da'] = array( 'nn', 'nb', 'sv' ); # Siebrand 2008-03-23 +$wgTranslateLanguageFallbacks['dty'] = array( 'ne' ); $wgTranslateLanguageFallbacks['egl'] = array( 'it', 'rgn' ); $wgTranslateLanguageFallbacks['es-formal'] = 'es'; $wgTranslateLanguageFallbacks['et'] = 'fi'; diff --git a/LanguageSettings.php b/LanguageSettings.php index 4a2e41c..a99303b 100644 --- a/LanguageSettings.php +++ b/LanguageSettings.php @@ -84,6 +84,7 @@ $wgExtraLanguageNames['cnh'] = 'Lai holh'; # Haka Chin / Siebrand 2014-08-06 $wgExtraLanguageNames['smn'] = 'Anarâškielâ'; # Inari Saami / Siebrand 2014-10-06 $wgExtraLanguageNames['bgn'] = 'بلوچی رخشانی'; # Western Balochi / Siebrand 2014-11-15 +$wgExtraLanguageNames['dty'] = 'डोटेली'; # Dotyali / Siebrand 2014-11-16 $wgExtraLanguageNames['nl-be'] = 'nl-be'; # Nikerabbit 2008-xx-xx - For FreeCol $wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic content. Used for documenting messages -- To view, visit https://gerrit.wikimedia.org/r/173652 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia68ff98cce12ec4fed395267c49115c70df5850f Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add support for Dotyali (dty) - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: Add support for Dotyali (dty) .. Add support for Dotyali (dty) Change-Id: Ia68ff98cce12ec4fed395267c49115c70df5850f --- M FallbackSettings.php M LanguageSettings.php 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/FallbackSettings.php b/FallbackSettings.php index 1924d21..b95371d 100644 --- a/FallbackSettings.php +++ b/FallbackSettings.php @@ -20,6 +20,7 @@ $wgTranslateLanguageFallbacks['cps'] = array( 'tl' ); $wgTranslateLanguageFallbacks['cs'] = array( 'sk', 'de', 'fr', 'ru', 'pl' ); $wgTranslateLanguageFallbacks['da'] = array( 'nn', 'nb', 'sv' ); # Siebrand 2008-03-23 +$wgTranslateLanguageFallbacks['dty'] = array( 'ne' ); $wgTranslateLanguageFallbacks['egl'] = array( 'it', 'rgn' ); $wgTranslateLanguageFallbacks['es-formal'] = 'es'; $wgTranslateLanguageFallbacks['et'] = 'fi'; diff --git a/LanguageSettings.php b/LanguageSettings.php index 4a2e41c..a99303b 100644 --- a/LanguageSettings.php +++ b/LanguageSettings.php @@ -84,6 +84,7 @@ $wgExtraLanguageNames['cnh'] = 'Lai holh'; # Haka Chin / Siebrand 2014-08-06 $wgExtraLanguageNames['smn'] = 'Anarâškielâ'; # Inari Saami / Siebrand 2014-10-06 $wgExtraLanguageNames['bgn'] = 'بلوچی رخشانی'; # Western Balochi / Siebrand 2014-11-15 +$wgExtraLanguageNames['dty'] = 'डोटेली'; # Dotyali / Siebrand 2014-11-16 $wgExtraLanguageNames['nl-be'] = 'nl-be'; # Nikerabbit 2008-xx-xx - For FreeCol $wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic content. Used for documenting messages -- To view, visit https://gerrit.wikimedia.org/r/173652 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia68ff98cce12ec4fed395267c49115c70df5850f Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] MWExceptionHandler::handle - MWExceptionHandler::handleExce... - change (operations/mediawiki-config)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/173653 Change subject: MWExceptionHandler::handle - MWExceptionHandler::handleException .. MWExceptionHandler::handle - MWExceptionHandler::handleException Follows up I8764cf5df87b226813c9b9cf99f9b4f3fa4b7c92 from core Change-Id: Ied5906c928b1596db2afc17b9018d8d0c0a60f7a --- M rpc/RunJobs.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/53/173653/1 diff --git a/rpc/RunJobs.php b/rpc/RunJobs.php index 7ec198f..edd9b94 100644 --- a/rpc/RunJobs.php +++ b/rpc/RunJobs.php @@ -45,5 +45,5 @@ $mediawiki-restInPeace(); } catch ( Exception $e ) { - MWExceptionHandler::handle( $e ); + MWExceptionHandler::handleException( $e ); } -- To view, visit https://gerrit.wikimedia.org/r/173653 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied5906c928b1596db2afc17b9018d8d0c0a60f7a Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] MWExceptionHandler::handle - MWExceptionHandler::handleExce... - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: MWExceptionHandler::handle - MWExceptionHandler::handleException .. MWExceptionHandler::handle - MWExceptionHandler::handleException Follows up I8764cf5df87b226813c9b9cf99f9b4f3fa4b7c92 from core Change-Id: Ied5906c928b1596db2afc17b9018d8d0c0a60f7a --- M rpc/RunJobs.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/rpc/RunJobs.php b/rpc/RunJobs.php index 7ec198f..edd9b94 100644 --- a/rpc/RunJobs.php +++ b/rpc/RunJobs.php @@ -45,5 +45,5 @@ $mediawiki-restInPeace(); } catch ( Exception $e ) { - MWExceptionHandler::handle( $e ); + MWExceptionHandler::handleException( $e ); } -- To view, visit https://gerrit.wikimedia.org/r/173653 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied5906c928b1596db2afc17b9018d8d0c0a60f7a Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Undefined index: HTTPS - change (operations/mediawiki-config)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/173654 Change subject: Fix Undefined index: HTTPS .. Fix Undefined index: HTTPS 2014-11-16 14:15:47 mw1116 itwikinews: [4706de18] /w/api.php ErrorException from line 981 of /srv/mediawiki/wmf-config/CommonSettings.php: Undefined index: HTTPS Change-Id: I2103329803081a5ca5033b8612c86db544b88b58 --- M wmf-config/CommonSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/54/173654/1 diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index a37e619..a9a4736 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -978,7 +978,7 @@ $wgExtensionFunctions[] = function() { global $wmfUdp2logDest, $wgRequest; if ( isset( $_SERVER['REQUEST_METHOD'] ) $_SERVER['REQUEST_METHOD'] === 'POST' ) { - $uri = ( $_SERVER['HTTPS'] ? 'https://' : 'http://' ) . + $uri = ( ( isset( $_SERVER['HTTPS'] ) $_SERVER['HTTPS'] ) ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $xff = isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : ''; wfErrorLog( -- To view, visit https://gerrit.wikimedia.org/r/173654 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2103329803081a5ca5033b8612c86db544b88b58 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Undefined index: HTTPS - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Fix Undefined index: HTTPS .. Fix Undefined index: HTTPS 2014-11-16 14:15:47 mw1116 itwikinews: [4706de18] /w/api.php ErrorException from line 981 of /srv/mediawiki/wmf-config/CommonSettings.php: Undefined index: HTTPS Change-Id: I2103329803081a5ca5033b8612c86db544b88b58 --- M wmf-config/CommonSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index a37e619..a9a4736 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -978,7 +978,7 @@ $wgExtensionFunctions[] = function() { global $wmfUdp2logDest, $wgRequest; if ( isset( $_SERVER['REQUEST_METHOD'] ) $_SERVER['REQUEST_METHOD'] === 'POST' ) { - $uri = ( $_SERVER['HTTPS'] ? 'https://' : 'http://' ) . + $uri = ( ( isset( $_SERVER['HTTPS'] ) $_SERVER['HTTPS'] ) ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $xff = isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : ''; wfErrorLog( -- To view, visit https://gerrit.wikimedia.org/r/173654 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2103329803081a5ca5033b8612c86db544b88b58 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Disable 'error' ErrorLogGroup - change (operations/mediawiki-config)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/173655 Change subject: Disable 'error' ErrorLogGroup .. Disable 'error' ErrorLogGroup Change-Id: Ic0a50a2bcbffa9c52a388259efb661ab3b830d13 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/55/173655/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 0dedae7..d9dd4ac 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -4139,7 +4139,7 @@ 'thumbnail' = udp://$wmfUdp2logDest/thumbnail, 'jobqueue' = udp://$wmfUdp2logDest/jobqueue/web, 'slow-parse' = udp://$wmfUdp2logDest/slow-parse, - 'error' = udp://$wmfUdp2logDest/error, + // 'error' = udp://$wmfUdp2logDest/error, // Logs warnings, notices and such 'exception' = udp://$wmfUdp2logDest/exception, 'exception-json' = udp://$wmfUdp2logDest/exception-json, 'session' = udp://$wmfUdp2logDest/session, -- To view, visit https://gerrit.wikimedia.org/r/173655 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0a50a2bcbffa9c52a388259efb661ab3b830d13 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Disable 'error' ErrorLogGroup - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Disable 'error' ErrorLogGroup .. Disable 'error' ErrorLogGroup Change-Id: Ic0a50a2bcbffa9c52a388259efb661ab3b830d13 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 0dedae7..d9dd4ac 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -4139,7 +4139,7 @@ 'thumbnail' = udp://$wmfUdp2logDest/thumbnail, 'jobqueue' = udp://$wmfUdp2logDest/jobqueue/web, 'slow-parse' = udp://$wmfUdp2logDest/slow-parse, - 'error' = udp://$wmfUdp2logDest/error, + // 'error' = udp://$wmfUdp2logDest/error, // Logs warnings, notices and such 'exception' = udp://$wmfUdp2logDest/exception, 'exception-json' = udp://$wmfUdp2logDest/exception-json, 'session' = udp://$wmfUdp2logDest/session, -- To view, visit https://gerrit.wikimedia.org/r/173655 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic0a50a2bcbffa9c52a388259efb661ab3b830d13 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] A tweak and comment on language settings - change (translatewiki)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/173656 Change subject: A tweak and comment on language settings .. A tweak and comment on language settings Change-Id: Ie56ddb47b849a90161c62046e88bf547fe449f38 --- M LanguageSettings.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/56/173656/1 diff --git a/LanguageSettings.php b/LanguageSettings.php index a99303b..68691d2 100644 --- a/LanguageSettings.php +++ b/LanguageSettings.php @@ -63,8 +63,8 @@ $wgExtraLanguageNames['mic'] = 'Mi\'kmaq'; # Micmac / Nikerabbit 2012-02-27 $wgExtraLanguageNames['mnw'] = 'ဘာသာ မန်'; # Mon / Amir 2012-05-31 $wgExtraLanguageNames['rut'] = 'мыхӀабишды'; # Rutul / Robin 2012-07-24 -$wgExtraLanguageNames['acf'] = 'Saint Lucian Creole French'; # Saint Lucian Creole French / Siebrand 2012-08-05 -$wgExtraLanguageNames['izh'] = 'ižoran keel'; # Ingrian / Robin 2012-11-17 +$wgExtraLanguageNames['acf'] = 'kwéyòl'; # Saint Lucian Creole French / Siebrand 2012-08-05 +$wgExtraLanguageNames['izh'] = 'ižoran keel'; # Ingrian / Robin 2012-11-17 / Language classified as not written in Ethnologue. Should be removed. $wgExtraLanguageNames['ban'] = 'ᬩᬲᬩᬮᬶ'; # Balinese / Siebrand 2012-11-25 $wgExtraLanguageNames['miq'] = 'Mískitu'; # Miskito / Siebrand 2013-07-02 $wgExtraLanguageNames['abs'] = 'Bahasa Ambon'; # Ambonese Malay / Siebrand 2013-07-05 -- To view, visit https://gerrit.wikimedia.org/r/173656 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie56ddb47b849a90161c62046e88bf547fe449f38 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] A tweak and comment on language settings - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: A tweak and comment on language settings .. A tweak and comment on language settings Change-Id: Ie56ddb47b849a90161c62046e88bf547fe449f38 --- M LanguageSettings.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/LanguageSettings.php b/LanguageSettings.php index a99303b..68691d2 100644 --- a/LanguageSettings.php +++ b/LanguageSettings.php @@ -63,8 +63,8 @@ $wgExtraLanguageNames['mic'] = 'Mi\'kmaq'; # Micmac / Nikerabbit 2012-02-27 $wgExtraLanguageNames['mnw'] = 'ဘာသာ မန်'; # Mon / Amir 2012-05-31 $wgExtraLanguageNames['rut'] = 'мыхӀабишды'; # Rutul / Robin 2012-07-24 -$wgExtraLanguageNames['acf'] = 'Saint Lucian Creole French'; # Saint Lucian Creole French / Siebrand 2012-08-05 -$wgExtraLanguageNames['izh'] = 'ižoran keel'; # Ingrian / Robin 2012-11-17 +$wgExtraLanguageNames['acf'] = 'kwéyòl'; # Saint Lucian Creole French / Siebrand 2012-08-05 +$wgExtraLanguageNames['izh'] = 'ižoran keel'; # Ingrian / Robin 2012-11-17 / Language classified as not written in Ethnologue. Should be removed. $wgExtraLanguageNames['ban'] = 'ᬩᬲᬩᬮᬶ'; # Balinese / Siebrand 2012-11-25 $wgExtraLanguageNames['miq'] = 'Mískitu'; # Miskito / Siebrand 2013-07-02 $wgExtraLanguageNames['abs'] = 'Bahasa Ambon'; # Ambonese Malay / Siebrand 2013-07-05 -- To view, visit https://gerrit.wikimedia.org/r/173656 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie56ddb47b849a90161c62046e88bf547fe449f38 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update tags - change (translatewiki)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/173657 Change subject: Update tags .. Update tags Change-Id: I18279a5dc947739385acf28624d06c84709062f5 --- M groups/FreeCol/FreeCol.yaml 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/57/173657/1 diff --git a/groups/FreeCol/FreeCol.yaml b/groups/FreeCol/FreeCol.yaml index 0d5d6cd..7752f4a 100644 --- a/groups/FreeCol/FreeCol.yaml +++ b/groups/FreeCol/FreeCol.yaml @@ -37,6 +37,7 @@ TAGS: optional: - *.accelerator +- UnitFormat.null.null.null.null - colopedia.abilityGrantedBy - indianCapitalOwner - indianSettlementOwner @@ -45,6 +46,7 @@ - model.foundingFather.*.birthAndDeath - model.foundingFather.*.name - model.goods.goodsAmount +- model.modifier.unknown - model.nation.*.europe - model.nation.*.region.land.* - model.nation.*.region.mountain.* @@ -64,14 +66,22 @@ - selectDestination.destinationTurns - shipName.3.0 - transaction.tax +- unitFormat.name.nation.null.equip - unitFormat.name.nation.null.null +- unitFormat.name.nation.role.equip - unitFormat.name.nation.role.null +- unitFormat.name.null.null.equip +- unitFormat.name.null.null.null +- unitFormat.name.null.role.equip +- unitFormat.name.null.role.null +- unitFormat.null.nation.null.equip - unitFormat.null.nation.null.null - unitFormat.null.nation.role.equip - unitFormat.null.nation.role.null +- unitFormat.null.null.null.equip +- unitFormat.null.null.role.equip - unitFormat.null.null.role.null - year.YEAR - ignored: - font.* - cli.arg.font -- To view, visit https://gerrit.wikimedia.org/r/173657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18279a5dc947739385acf28624d06c84709062f5 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update tags - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: Update tags .. Update tags Change-Id: I18279a5dc947739385acf28624d06c84709062f5 --- M groups/FreeCol/FreeCol.yaml 1 file changed, 11 insertions(+), 1 deletion(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/groups/FreeCol/FreeCol.yaml b/groups/FreeCol/FreeCol.yaml index 0d5d6cd..7752f4a 100644 --- a/groups/FreeCol/FreeCol.yaml +++ b/groups/FreeCol/FreeCol.yaml @@ -37,6 +37,7 @@ TAGS: optional: - *.accelerator +- UnitFormat.null.null.null.null - colopedia.abilityGrantedBy - indianCapitalOwner - indianSettlementOwner @@ -45,6 +46,7 @@ - model.foundingFather.*.birthAndDeath - model.foundingFather.*.name - model.goods.goodsAmount +- model.modifier.unknown - model.nation.*.europe - model.nation.*.region.land.* - model.nation.*.region.mountain.* @@ -64,14 +66,22 @@ - selectDestination.destinationTurns - shipName.3.0 - transaction.tax +- unitFormat.name.nation.null.equip - unitFormat.name.nation.null.null +- unitFormat.name.nation.role.equip - unitFormat.name.nation.role.null +- unitFormat.name.null.null.equip +- unitFormat.name.null.null.null +- unitFormat.name.null.role.equip +- unitFormat.name.null.role.null +- unitFormat.null.nation.null.equip - unitFormat.null.nation.null.null - unitFormat.null.nation.role.equip - unitFormat.null.nation.role.null +- unitFormat.null.null.null.equip +- unitFormat.null.null.role.equip - unitFormat.null.null.role.null - year.YEAR - ignored: - font.* - cli.arg.font -- To view, visit https://gerrit.wikimedia.org/r/173657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I18279a5dc947739385acf28624d06c84709062f5 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@kitano.nl Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] logstash: Update regex in 'exception' grokker - change (operations/puppet)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/173658 Change subject: logstash: Update regex in 'exception' grokker .. logstash: Update regex in 'exception' grokker Follows-up 399ba2fecf in mediawiki-core which changes the message from Exception from line ... to {ClassName} from line Change-Id: I895e8dba1d532a55c0730598c13d8e9c2048ced9 --- M files/logstash/filter-mw-via-udp2log.conf 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/58/173658/1 diff --git a/files/logstash/filter-mw-via-udp2log.conf b/files/logstash/filter-mw-via-udp2log.conf index a7cb6f0..ee902d8 100644 --- a/files/logstash/filter-mw-via-udp2log.conf +++ b/files/logstash/filter-mw-via-udp2log.conf @@ -254,7 +254,7 @@ grok { match = [ message, - ^(?m)\[(?exception_id\w+)\] %{NOTSPACE:url}\s+Exception from line %{NUMBER:line} of %{NOTSPACE:file}: %{GREEDYDATA:message}\n%{GREEDYDATA:backtrace}$ + ^(?m)\[(?exception_id\w+)\] %{NOTSPACE:url}\s+\w+ from line %{NUMBER:line} of %{NOTSPACE:file}: %{GREEDYDATA:message}\n%{GREEDYDATA:backtrace}$ ] overwrite = [ message ] } -- To view, visit https://gerrit.wikimedia.org/r/173658 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I895e8dba1d532a55c0730598c13d8e9c2048ced9 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [FEAT] Improved Site.sametitle - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [FEAT] Improved Site.sametitle .. [FEAT] Improved Site.sametitle This improves the Site.sametitle comparision by the following features: - It uses (if available) the case-sensitivity option defined by the namespace - It replaces underscores and spaces by only one space. So 'Fo__ar', 'Fo_ar' and 'Fo ar' are all the same. - It works with servers which don't have a namespace which is empty. Bug: 69118 Change-Id: I0b57ea6d7014b4ddfd8ceafbd859594b021e92b4 --- M pywikibot/site.py M tests/site_tests.py 2 files changed, 83 insertions(+), 44 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/site.py b/pywikibot/site.py index 799d99c..4a139fa 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -376,9 +376,9 @@ # Discard leading colon if count = 2 and parts[0] == '' and parts[1]: -return parts[1] +return parts[1].strip() elif parts[0]: -return parts[0] +return parts[0].strip() return False @staticmethod @@ -806,55 +806,42 @@ re.IGNORECASE | re.UNICODE | re.DOTALL) def sametitle(self, title1, title2): -Return True if title1 and title2 identify the same wiki page. -# title1 and title2 may be unequal but still identify the same page, -# if they use different aliases for the same namespace + +Return True if title1 and title2 identify the same wiki page. -def valid_namespace(alias, ns): -Determine if a string is a valid alias for a namespace. - -@param alias: namespace alias -@type alias: unicode -@param ns: namespace -@type ns: int - -@return: bool - -for text in self.namespace(ns, all=True): -if text.lower() == alias.lower(): -return True -return False +title1 and title2 may be unequal but still identify the same page, +if they use different aliases for the same namespace. + +def ns_split(title): +Separate the namespace from the name. +if ':' not in title: +title = ':' + title +ns, _, name = title.partition(':') +ns = Namespace.lookup_name(ns, self.namespaces) or default_ns +return ns, name if title1 == title2: return True +# Replace underscores with spaces and multiple combinations of them +# with only one space +title1 = re.sub(r'[_ ]+', ' ', title1) +title2 = re.sub(r'[_ ]+', ' ', title2) +if title1 == title2: +return True +default_ns = self.namespaces[0] # determine whether titles contain namespace prefixes -if : in title1: -ns1, name1 = title1.split(:, 1) -else: -ns1, name1 = 0, title1 -if : in title2: -ns2, name2 = title2.split(:, 1) -else: -ns2, name2 = 0, title2 -for space in self.namespaces(): # iterate over all valid namespaces -if not isinstance(ns1, int) and valid_namespace(ns1, space): -ns1 = space -if not isinstance(ns2, int) and valid_namespace(ns2, space): -ns2 = space -if not isinstance(ns1, int): -# no valid namespace prefix found, so the string followed by : -# must be part of the title -name1 = ns1 + : + name1 -ns1 = 0 -if not isinstance(ns2, int): -name2 = ns2 + : + name2 -ns2 = 0 -if ns1 != ns2: +ns1_obj, name1 = ns_split(title1) +ns2_obj, name2 = ns_split(title2) +if ns1_obj != ns2_obj: # pages in different namespaces return False -if self.case() == first-letter: -name1 = name1[:1].upper() + name1[1:] -name2 = name2[:1].upper() + name2[1:] +name1 = name1.strip() +name2 = name2.strip() +# If the namespace has a case definition it's overriding the site's +# case definition +if (ns1_obj.case if hasattr(ns1_obj, 'case') else self.case()) == 'first-letter': +name1 = name1[0].upper() + name1[1:] +name2 = name2[0].upper() + name2[1:] return name1 == name2 # namespace shortcuts for backwards-compatibility diff --git a/tests/site_tests.py b/tests/site_tests.py index 408c60b..c2b3140 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -144,6 +144,17 @@ self.assertFalse(mysite.isInterwikiLink(foo)) self.assertIsInstance(mysite.redirectRegex().pattern, basestring) self.assertIsInstance(mysite.category_on_one_line(), bool) +
[MediaWiki-commits] [Gerrit] [FIX] Don't use deprecated parameter of redirect() - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/173659 Change subject: [FIX] Don't use deprecated parameter of redirect() .. [FIX] Don't use deprecated parameter of redirect() With 7aa43ba4a0c8e12bda4a62e32e062672ec8851fa the default parameter from compat was deprecated. Because the decorator only supports deprecating keyword arguments, all calls which add the default parameter via a positional argument will fail. This removes all usages of the default parameter in the code base. Because only redirect() was used, only those method calls were fixed. Bug: 73489 Change-Id: Ie91063b48a599b737d67a624d79532daecd23dc6 --- M scripts/redirect.py M scripts/solve_disambiguation.py 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/59/173659/1 diff --git a/scripts/redirect.py b/scripts/redirect.py index 5524483..c39a931 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -662,7 +662,7 @@ targetlink = targetPage.title(asLink=True, textlink=True) text = self.site.redirectRegex().sub( -'#%s %s' % (self.site.redirect(True), +'#%s %s' % (self.site.redirect(), targetlink), oldText, 1) if redir.title() == targetPage.title() or text == oldText: diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index b32e0ef..e29b618 100644 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -574,7 +574,7 @@ 'to %s?' % (refPage.title(), target), default=False, automatic_quit=False): redir_text = '#%s [[%s]]' \ - % (self.mysite.redirect(default=True), target) + % (self.mysite.redirect(), target) try: refPage.put_async(redir_text, comment=self.comment) except pywikibot.PageNotSaved as error: -- To view, visit https://gerrit.wikimedia.org/r/173659 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie91063b48a599b737d67a624d79532daecd23dc6 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] exception: Prefix error type in front of error message - change (mediawiki/core)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/173660 Change subject: exception: Prefix error type in front of error message .. exception: Prefix error type in front of error message Follows-up 399ba2fecf which didn't include any translation of the error type in the logged message (e.g. PHP Notice or PHP Warning). Before Error from line 2130 of mediawiki/includes/OutputPage.php: Undefined variable: bar Error from line 2130 of mediawiki/includes/OutputPage.php: strpos() expects at le.. After Error from line 2130 of mediawiki/includes/OutputPage.php: PHP Notice: Undefined variable: bar Error from line 2130 of mediawiki/includes/OutputPage.php: PHP Warning: strpos() expects at le.. Based on the log formatter in php https://github.com/php/php-src/blob/0f5858e3a328/main/main.c#L1086-L1119 Change-Id: I52f98e52caa64955050ed73e1acbc78b1116a9fd --- M includes/exception/MWExceptionHandler.php 1 file changed, 33 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/60/173660/1 diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 0d90e66..5975d40 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -167,7 +167,39 @@ * @param int $line */ public static function handleError( $level, $message, $file = null, $line = null ) { - $e = new ErrorException( $message, 0, $level, $file, $line ); + // Map error constant to error name (reverse-engineer PHP error reporting) + switch ( $level ) { + case E_ERROR: + case E_CORE_ERROR: + case E_COMPILE_ERROR: + case E_USER_ERROR: + case E_RECOVERABLE_ERROR: + case E_PARSE: + $type_str = 'Error'; + break; + case E_WARNING: + case E_CORE_WARNING: + case E_COMPILE_WARNING: + case E_USER_WARNING: + $type_str = 'Warning'; + break; + case E_NOTICE: + case E_USER_NOTICE: + $type_str = 'Notice'; + break; + case E_STRICT: + $type_str = 'Strict Standards'; + break; + case E_DEPRECATED: + case E_USER_DEPRECATED: + $type_str = 'Deprecated'; + break; + default: + $type_str = 'Unknown error'; + break; + } + + $e = new ErrorException( PHP $type_str: $message, 0, $level, $file, $line ); self::logError( $e ); // This handler is for logging only. Return false will instruct PHP -- To view, visit https://gerrit.wikimedia.org/r/173660 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52f98e52caa64955050ed73e1acbc78b1116a9fd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [FIX] Don't use deprecated parameter of redirect() - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [FIX] Don't use deprecated parameter of redirect() .. [FIX] Don't use deprecated parameter of redirect() With 7aa43ba4a0c8e12bda4a62e32e062672ec8851fa the default parameter from compat was deprecated. Because the decorator only supports deprecating keyword arguments, all calls which add the default parameter via a positional argument will fail. This removes all usages of the default parameter in the code base. Because only redirect() was used, only those method calls were fixed. Bug: 73489 Change-Id: Ie91063b48a599b737d67a624d79532daecd23dc6 --- M scripts/redirect.py M scripts/solve_disambiguation.py 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/redirect.py b/scripts/redirect.py index 5524483..c39a931 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -662,7 +662,7 @@ targetlink = targetPage.title(asLink=True, textlink=True) text = self.site.redirectRegex().sub( -'#%s %s' % (self.site.redirect(True), +'#%s %s' % (self.site.redirect(), targetlink), oldText, 1) if redir.title() == targetPage.title() or text == oldText: diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index b32e0ef..e29b618 100644 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -574,7 +574,7 @@ 'to %s?' % (refPage.title(), target), default=False, automatic_quit=False): redir_text = '#%s [[%s]]' \ - % (self.mysite.redirect(default=True), target) + % (self.mysite.redirect(), target) try: refPage.put_async(redir_text, comment=self.comment) except pywikibot.PageNotSaved as error: -- To view, visit https://gerrit.wikimedia.org/r/173659 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie91063b48a599b737d67a624d79532daecd23dc6 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Confirmed no more usage of toggleBanner - change (mediawiki...CentralNotice)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/173661 Change subject: Confirmed no more usage of toggleBanner .. Confirmed no more usage of toggleBanner See http://meta.wikimedia.org/w/index.php?title=Special%3ASearchprofile=advancedsearch=toggleBannerfulltext=Searchns8=1ns200=1ns202=1ns866=1profile=advanced Change-Id: Ic3e600a4b9d28dd7228f368dddacf5a4939b1089 --- M modules/ext.centralNotice.bannerController/bannerController.js 1 file changed, 0 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/61/173661/1 diff --git a/modules/ext.centralNotice.bannerController/bannerController.js b/modules/ext.centralNotice.bannerController/bannerController.js index 8aca1f2..f94f773 100644 --- a/modules/ext.centralNotice.bannerController/bannerController.js +++ b/modules/ext.centralNotice.bannerController/bannerController.js @@ -436,11 +436,6 @@ }; - // This function is deprecated - window.toggleNotice = function () { - window.hideBanner(); - }; - // Initialize CentralNotice $( function() { mw.centralNotice.initialize(); -- To view, visit https://gerrit.wikimedia.org/r/173661 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3e600a4b9d28dd7228f368dddacf5a4939b1089 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Awight awi...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Email and IRC build notifications - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Email and IRC build notifications .. Email and IRC build notifications Always send build notifications to pywikibot-comm...@lists.wikimedia.org as even successes may have slightly different output, and the build email signals that the build is completed. Only notify IRC on changes, and reduce the IRC build notice to one message which will wrap onto two lines. Change-Id: I5cc6e11e6bf5ecb2da83f9b1c4d5c40ea9caa694 --- M .travis.yml 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: John Vandenberg: Looks good to me, but someone else must approve Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/.travis.yml b/.travis.yml index 4759d96..7bac86e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,8 +46,15 @@ - LANGUAGE=fr FAMILY=wiktionary notifications: + email: +recipients: + - pywikibot-comm...@lists.wikimedia.org +on_success: always +on_failure: always irc: channels: - chat.freenode.net#pywikibot on_success: change -on_failure: always +on_failure: change +template: + - %{repository_slug}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} %{build_url} -- To view, visit https://gerrit.wikimedia.org/r/152834 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5cc6e11e6bf5ecb2da83f9b1c4d5c40ea9caa694 Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: John Vandenberg jay...@gmail.com Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement banner= override test - change (mediawiki...CentralNotice)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/173662 Change subject: Implement banner= override test .. Implement banner= override test Change-Id: Ic03cb6d6df5939033c6fdfcbb13c3f79efef433a --- M tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js 1 file changed, 33 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/62/173662/1 diff --git a/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js b/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js index 4f619e4..3b8d562 100644 --- a/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js +++ b/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js @@ -1,7 +1,8 @@ ( function ( mw, $ ) { 'use strict'; - var bannerJson = { + var realAjax = $.ajax, + bannerData = { bannerName: 'test_banner', campaign: 'test_campaign', category: 'test', @@ -12,9 +13,6 @@ setup: function () { var realLoadBanner = mw.centralNotice.loadBanner; - // Remove any existing div#siteNotice, so we are not testing the skin. - $( '#siteNotice' ).remove(); - // Reset in case the testing page itself ran CentralNotice. mw.centralNotice.alreadyRan = false; @@ -24,8 +22,21 @@ // Prevent banner load during initialize(). mw.centralNotice.loadBanner = function () {}; - // Suppress GeoIP call - mw.centralNotice.data.getVars.country = 'US'; + $.extend( mw.centralNotice.data.getVars.extend, { + // Suppress GeoIP call + country: 'US', + + // Boring defaults, assumed by test fixtures + // FIXME: move to tests that actually assume this. Move the + // initialize() call as well. + uselang: 'en', + project: 'wikipedia', + anonymous: true + } ); + + // Remove any existing div#siteNotice, so we are not testing the skin. + // Do it before initialize, so nothing + $( '#siteNotice' ).remove(); mw.centralNotice.initialize(); @@ -35,6 +46,9 @@ $( #qunit-fixture ).append( 'div id=siteNoticediv id=centralNotice/div/div' ); + }, + teardown: function () { + $.ajax = realAjax; } } ) ); @@ -43,7 +57,7 @@ } ); QUnit.test( 'canInsertBanner', 1, function( assert ) { - mw.centralNotice.insertBanner( bannerJson ); + mw.centralNotice.insertBanner( bannerData ); assert.equal( $( 'div#test_banner' ).length, 1 ); } ); @@ -52,7 +66,7 @@ return false; }; - mw.centralNotice.insertBanner( bannerJson ); + mw.centralNotice.insertBanner( bannerData ); assert.equal( $( 'div#test_banner' ).length, 0 ); } ); @@ -61,8 +75,18 @@ return true; }; - mw.centralNotice.insertBanner( bannerJson ); + mw.centralNotice.insertBanner( bannerData ); assert.equal( $( 'div#test_banner' ).length, 1 ); } ); + QUnit.test( 'banner= override param', 2, function( assert ) { + mw.centralNotice.data.getVars.banner = 'test_banner'; + $.ajax = function( params ) { + assert.ok( params.url.match( /Special(?:[:]|%3A)BannerLoader.*[?]banner=test_banner/ ) ); + }; + mw.centralNotice.loadBanner(); + + assert.ok( mw.centralNotice.data.testing ); + } ); + }( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/173662 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic03cb6d6df5939033c6fdfcbb13c3f79efef433a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Awight awi...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement random= override test - change (mediawiki...CentralNotice)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/173663 Change subject: Implement random= override test .. Implement random= override test TODO: * This is ahead of feature implementation. Change-Id: I0870b6c3a6fe31ce619bef20491d0c88b13c2626 --- M tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js 1 file changed, 44 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/63/173663/1 diff --git a/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js b/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js index 3b8d562..6ddb438 100644 --- a/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js +++ b/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js @@ -7,6 +7,33 @@ campaign: 'test_campaign', category: 'test', bannerHtml: 'div id=test_banner/div' + }, + skewedChoices = { + preferred: 1, + throttle: 50, + bucket_count: 1, + geotargetted: true, + countries: [ + FR, + GR, + US + ], + banners: [ + { + name: likely_banner, + weight: 99, + bucket: 0, + category: fundraising, + devices: [ desktop ] + }, + { + name: unlikely_banner, + weight: 1, + bucket: 0, + category: fundraising, + devices: [ desktop ] + } + ] }; QUnit.module( 'ext.centralNotice.bannerController', QUnit.newMwEnvironment( { @@ -89,4 +116,21 @@ assert.ok( mw.centralNotice.data.testing ); } ); + QUnit.test( 'random= override param', 2, function( assert ) { + // Slightly less than a millionth of the time, to hit below + // skewedFixture's first threshold in a remarkable way. + mw.centralNotice.data.getVars.random = (.99 / 100); + mw.cnBannerControllerLib.setChoiceData( skewedChoices ); + + // TODO: also verify something intermediate about the random override + + // Will we request the unlikely banner? + $.ajax = function( params ) { + assert.ok( params.url.match( /Special(?:[:]|%3A)BannerLoader.*[?]banner=unlikely_banner/ ) ); + }; + mw.centralNotice.loadBanner(); + + assert.ok( mw.centralNotice.data.testing ); + } ); + }( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/173663 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0870b6c3a6fe31ce619bef20491d0c88b13c2626 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Awight awi...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't include redirects in json dumps - change (mediawiki...Wikibase)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/173664 Change subject: Don't include redirects in json dumps .. Don't include redirects in json dumps Bug: 72678 Change-Id: I3c85ddcaf7b8947d08811135e9e56287f59aad3f --- M repo/includes/Dumpers/JsonDumpGenerator.php M repo/maintenance/dumpJson.php M repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php 3 files changed, 51 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/64/173664/1 diff --git a/repo/includes/Dumpers/JsonDumpGenerator.php b/repo/includes/Dumpers/JsonDumpGenerator.php index d443213..2148591 100644 --- a/repo/includes/Dumpers/JsonDumpGenerator.php +++ b/repo/includes/Dumpers/JsonDumpGenerator.php @@ -13,10 +13,13 @@ use Wikibase\Lib\Serializers\Serializer; use Wikibase\Lib\Store\EntityLookup; use Wikibase\Lib\Store\StorageException; +use Wikibase\Lib\Store\RedirectResolvingEntityLookup; +use Wikibase\Lib\Store\UnresolvedRedirectException; use Wikibase\Repo\Store\EntityIdPager; /** - * JsonDumpGenerator generates an JSON dump of a given set of entities. + * JsonDumpGenerator generates an JSON dump of a given set of entities, excluding + * redirects. * * @since 0.5 * @@ -83,7 +86,7 @@ /** * @param resource $out -* @param EntityLookup $lookup +* @param EntityLookup $lookup Must not resolve redirects * @param Serializer $entitySerializer * * @throws InvalidArgumentException @@ -91,6 +94,9 @@ public function __construct( $out, EntityLookup $lookup, Serializer $entitySerializer ) { if ( !is_resource( $out ) ) { throw new InvalidArgumentException( '$out must be a file handle!' ); + } + if ( $lookup instanceof RedirectResolvingEntityLookup ) { + throw new InvalidArgumentException( '$lookup must not resolve redirects!' ); } $this-out = $out; @@ -237,6 +243,9 @@ try { $json = $this-generateJsonForEntityId( $entityId ); + if ( $json === null ) { + continue; + } if ( $dumpCount 0 ) { $this-writeToDump( ,\n ); @@ -250,6 +259,13 @@ } } + /** +* @param EntityId $entityId +* +* @throws StorageException +* +* @return string|null +*/ private function generateJsonForEntityId( EntityId $entityId ) { try { $entity = $this-entityLookup-getEntity( $entityId ); @@ -260,6 +276,8 @@ } catch( MWContentSerializationException $ex ) { throw new StorageException( 'Deserialization error for ' . $entityId-getSerialization() ); + } catch( UnresolvedRedirectException $e ) { + return null; } $data = $this-entitySerializer-getSerialized( $entity ); diff --git a/repo/maintenance/dumpJson.php b/repo/maintenance/dumpJson.php index 3e00b25..9f1ae51 100644 --- a/repo/maintenance/dumpJson.php +++ b/repo/maintenance/dumpJson.php @@ -19,6 +19,7 @@ use Wikibase\Repo\IO\EntityIdReader; use Wikibase\Repo\IO\LineReader; use Wikibase\Repo\Store\EntityIdPager; +use Wikibase\Lib\Store\RevisionBasedEntityLookup; use Wikibase\Repo\WikibaseRepo; $basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) : __DIR__ . '/../../../..'; @@ -86,8 +87,10 @@ //TODO: allow injection for unit tests $this-entityPerPage = WikibaseRepo::getDefaultInstance()-getStore()-newEntityPerPage(); - // Use an uncached EntityRevisionLookup here to avoid memory leaks - $this-entityLookup = WikibaseRepo::getDefaultInstance()-getEntityLookup( 'uncached' ); + // Use an uncached EntityRevisionLookup here to avoid leaking memory (we only need every entity once) + $revisionLookup = WikibaseRepo::getDefaultInstance()-getStore()-getEntityRevisionLookup( 'uncached' ); + // This is not purposefully not resolving redirects, as we don't want them in the dump + $this-entityLookup = new RevisionBasedEntityLookup( $revisionLookup ); } /** diff --git a/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php b/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php index b680cd1..5b7443f 100644 --- a/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php +++ b/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php @@ -16,6 +16,7 @@ use
[MediaWiki-commits] [Gerrit] CSSMin: Rewrite encodeImageAsDataURI() - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: CSSMin: Rewrite encodeImageAsDataURI() .. CSSMin: Rewrite encodeImageAsDataURI() * Make it actually check against the URI length, not file size. Previous code could produce URIs that edged just over the limit. * Replace $sizeLimit parameter with $ie8Compat, because that's the only use case and the file size limit approach was flawed per above, anyway. * Remove CSSMin::EMBED_SIZE_LIMIT constant, which is not used anymore. CSSMin::DATA_URI_SIZE_LIMIT still exists. * Change code flow to avoid repetition. * Split off new method, encodeStringAsDataURI(), that does actual encoding rather than file handling. Change-Id: I3704404ce831d7e0f6e3a65f23c76f313ad13238 --- M includes/libs/CSSMin.php 1 file changed, 37 insertions(+), 22 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 6eb5258..bea6ced 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -32,12 +32,8 @@ /* Constants */ /** -* Maximum file size to still qualify for in-line embedding as a data-URI -* -* 24,576 is used because Internet Explorer has a 32,768 byte limit for data URIs, -* which when base64 encoded will result in a 1/3 increase in size. +* Internet Explorer data URI length limit. See encodeImageAsDataURI(). */ - const EMBED_SIZE_LIMIT = 24576; const DATA_URI_SIZE_LIMIT = 32768; const URL_REGEX = 'url\(\s*[\']?(?Pfile[^\?\)\']*?)(?Pquery\?[^\)\']*?|)[\']?\s*\)'; const EMBED_REGEX = '\/\*\s*\@embed\s*\*\/'; @@ -110,17 +106,17 @@ * @param string $file Image file to encode. * @param string|null $type File's MIME type or null. If null, CSSMin will * try to autodetect the type. -* @param int|bool $sizeLimit If the size of the target file is greater than -* this value, decline to encode the image file and return false -* instead. If $sizeLimit is false, no limit is enforced. +* @param bool $ie8Compat By default, a data URI will only be produced if it can be made short +* enough to fit in Internet Explorer 8 (and earlier) URI length limit (32,768 bytes). Pass +* `false` to remove this limitation. * @return string|bool Image contents encoded as a data URI or false. */ - public static function encodeImageAsDataURI( $file, $type = null, - $sizeLimit = self::EMBED_SIZE_LIMIT - ) { - if ( $sizeLimit !== false filesize( $file ) = $sizeLimit ) { + public static function encodeImageAsDataURI( $file, $type = null, $ie8Compat = true ) { + // Fast-fail for files that definitely exceed the maximum data URI length + if ( $ie8Compat filesize( $file ) = self::DATA_URI_SIZE_LIMIT ) { return false; } + if ( $type === null ) { $type = self::getMimeType( $file ); } @@ -128,22 +124,41 @@ return false; } - $contents = file_get_contents( $file ); - // Only whitespace and printable ASCII characters - $isText = (bool)preg_match( '/^[\r\n\t\x20-\x7e]+$/', $contents ); + return self::encodeStringAsDataURI( file_get_contents( $file ), $type, $ie8Compat ); + } - if ( $isText ) { - // Do not base64-encode non-binary files (sane SVGs), unless that'd exceed URI length limit. + /** +* Encode file contents as a data URI with chosen MIME type. +* +* The URI will be base64-encoded for binary files or just percent-encoded otherwise. +* +* @since 1.25 +* +* @param string $contents File contents to encode. +* @param string $type File's MIME type. +* @param bool $ie8Compat See encodeImageAsDataURI(). +* @return string|bool Image contents encoded as a data URI or false. +*/ + public static function encodeStringAsDataURI( $contents, $type, $ie8Compat = true ) { + // Try #1: Non-encoded data URI + // The regular expression matches ASCII whitespace and printable characters. + if ( preg_match( '/^[\r\n\t\x20-\x7e]+$/', $contents ) ) { + // Do not base64-encode non-binary files (sane SVGs). // (This often produces longer URLs, but they compress better, yielding a net smaller size.) $uri = 'data:' . $type . ',' . rawurlencode( $contents ); - if ( strlen( $uri ) = self::DATA_URI_SIZE_LIMIT ) { - $uri = 'data:' . $type .
[MediaWiki-commits] [Gerrit] [FEAT] Process a single page with redirect.py - change (pywikibot/core)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/173665 Change subject: [FEAT] Process a single page with redirect.py .. [FEAT] Process a single page with redirect.py Additional -page option enables to work on a single page to solve it's problems. Change-Id: I6e7da9ba91c7eb820b10b07a77076a093a2c2b2a --- M scripts/redirect.py 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/65/173665/1 diff --git a/scripts/redirect.py b/scripts/redirect.py index c39a931..87cd3d0 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -82,7 +82,7 @@ def __init__(self, xmlFilename=None, namespaces=[], offset=-1, use_move_log=False, use_api=False, start=None, until=None, - number=None, step=None): + number=None, step=None, page=None): self.site = pywikibot.Site() self.xmlFilename = xmlFilename self.namespaces = namespaces @@ -95,6 +95,7 @@ self.api_until = until self.api_number = number self.api_step = step +self.page = page def get_redirects_from_dump(self, alsoGetPageTitles=False): @@ -267,6 +268,8 @@ count += 1 if count = self.api_number: break +elif self.page: +yield self.page elif not self.xmlFilename: # retrieve information from broken redirect special page pywikibot.output(u'Retrieving special page...') @@ -326,6 +329,8 @@ yield key pywikibot.output(u'\nChecking redirect %i of %i...' % (num + 1, len(redict))) +elif self.page: +yield self.page else: # retrieve information from double redirect special page pywikibot.output(u'Retrieving special page...') @@ -753,6 +758,8 @@ until = '' number = None step = None +pagename = None + for arg in pywikibot.handle_args(args): if arg == 'double' or arg == 'do': action = 'double' @@ -796,6 +803,8 @@ number = int(arg[7:]) elif arg.startswith('-step:'): step = int(arg[6:]) +elif arg.startswith('-page:'): +pagename = arg[6:] elif arg == '-always': options['always'] = True elif arg == '-delete': @@ -812,7 +821,7 @@ else: pywikibot.Site().login() gen = RedirectGenerator(xmlFilename, namespaces, offset, moved_pages, -fullscan, start, until, number, step) +fullscan, start, until, number, step, pagename) bot = RedirectRobot(action, gen, number=number, **options) bot.run() -- To view, visit https://gerrit.wikimedia.org/r/173665 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e7da9ba91c7eb820b10b07a77076a093a2c2b2a Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Minor spring cleaning - change (operations...pybal)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/173666 Change subject: Minor spring cleaning .. Minor spring cleaning * Update copyright years for 2014. * Update version in setup.py to 1.06 (from debian/changelog). * Add trove classifiers and license information to setup.py. Change-Id: I6b615ee194f5496333595be469f1908a25cb7445 --- M .gitignore M pybal/ipvs.py M pybal/monitor.py M pybal/monitors/__init__.py M pybal/monitors/__skeleton__.py M pybal/monitors/dnsquery.py M pybal/pybal.py M setup.py 8 files changed, 48 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal refs/changes/66/173666/1 diff --git a/.gitignore b/.gitignore index fd7f02e..f322c84 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ .tox /.coverage _trial_temp +build +dist diff --git a/pybal/ipvs.py b/pybal/ipvs.py index 3ad8cf9..6d4aa76 100644 --- a/pybal/ipvs.py +++ b/pybal/ipvs.py @@ -1,6 +1,6 @@ ipvsadm.py -Copyright (C) 2006-2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org LVS state/configuration classes for PyBal @@ -263,4 +263,4 @@ def getDepoolThreshold(self): Returns the threshold below which no more down servers will be depooled -return self.configuration.getfloat('depool-threshold', .5) \ No newline at end of file +return self.configuration.getfloat('depool-threshold', .5) diff --git a/pybal/monitor.py b/pybal/monitor.py index 024fc94..6b42521 100644 --- a/pybal/monitor.py +++ b/pybal/monitor.py @@ -1,6 +1,6 @@ monitor.py -Copyright (C) 2006-2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org Monitor class implementations for PyBal diff --git a/pybal/monitors/__init__.py b/pybal/monitors/__init__.py index 524db70..d0743a7 100644 --- a/pybal/monitors/__init__.py +++ b/pybal/monitors/__init__.py @@ -1,6 +1,6 @@ monitors.__init__.py -Copyright (C) 2006-2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org The monitors package contains all (complete) monitoring implementations of PyBal diff --git a/pybal/monitors/__skeleton__.py b/pybal/monitors/__skeleton__.py index 14daacf..5592b4b 100644 --- a/pybal/monitors/__skeleton__.py +++ b/pybal/monitors/__skeleton__.py @@ -1,6 +1,6 @@ __skeleton__.py -Copyright (C) 2006-2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org Copy and modify this file to write a new PyBal monitor. It contains the minimum imports and base methods that need diff --git a/pybal/monitors/dnsquery.py b/pybal/monitors/dnsquery.py index 3a65718..37e1cf5 100644 --- a/pybal/monitors/dnsquery.py +++ b/pybal/monitors/dnsquery.py @@ -1,6 +1,6 @@ dns.py -Copyright (C) 2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2012-2014 by Mark Bergsma m...@nedworks.org DNS Monitor class implementation for PyBal diff --git a/pybal/pybal.py b/pybal/pybal.py index 43ad576..6dae0d3 100644 --- a/pybal/pybal.py +++ b/pybal/pybal.py @@ -2,7 +2,7 @@ PyBal -Copyright (C) 2006-20012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org LVS Squid balancer/monitor for managing the Wikimedia Squid servers using LVS diff --git a/setup.py b/setup.py index 436443d..19fea7e 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,12 @@ -#!/usr/bin/env python + +PyBal +~ + +PyBal is a cluster monitoring daemon. It executes health checks against +servers and updates LVS connection tables accordingly. PyBal is used in +production at Wikimedia. + + try: from setuptools import setup except ImportError: @@ -6,13 +14,35 @@ setup( -name=pybal, -version=0.1, -description=PyBal LVS monitor, -author=Mark Bergsma, -author_email=m...@wikimedia.org, -url=http://wikitech.wikimedia.org/view/Pybal;, -packages=['pybal', 'pybal.monitors'], -requires=['twisted'], +name='PyBal', +version='1.06', +license='GPLv2+', +author='Mark Bergsma', +author_email='m...@wikimedia.org', +url='https://wikitech.wikimedia.org/wiki/PyBal', +description='PyBal LVS monitor', +long_description=__doc__, +classifiers=( +'Development Status :: 5 - Production/Stable', +'Framework :: Twisted', +'Intended Audience :: System Administrators', +'License :: OSI Approved :: ' +'GNU General Public License v2 or later (GPLv2+)', +'Operating System :: POSIX :: Linux', +'Programming Language :: Python :: 2.7', +'Topic :: Internet :: Proxy Servers', +'Topic :: System :: Networking :: Monitoring', +), +packages=( +'pybal', +'pybal.monitors', +), +scripts=( +'scripts/pybal', +), +zip_safe=False, +requires=( +'twisted', +),
[MediaWiki-commits] [Gerrit] Minor spring cleaning - change (operations...pybal)
jenkins-bot has submitted this change and it was merged. Change subject: Minor spring cleaning .. Minor spring cleaning * Update copyright years for 2014. * Update version in setup.py to 1.06 (from debian/changelog). * Add trove classifiers and license information to setup.py. Change-Id: I6b615ee194f5496333595be469f1908a25cb7445 --- M .gitignore M pybal/ipvs.py M pybal/monitor.py M pybal/monitors/__init__.py M pybal/monitors/__skeleton__.py M pybal/monitors/dnsquery.py M pybal/pybal.py M setup.py 8 files changed, 48 insertions(+), 16 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/.gitignore b/.gitignore index fd7f02e..f322c84 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ .tox /.coverage _trial_temp +build +dist diff --git a/pybal/ipvs.py b/pybal/ipvs.py index 3ad8cf9..6d4aa76 100644 --- a/pybal/ipvs.py +++ b/pybal/ipvs.py @@ -1,6 +1,6 @@ ipvsadm.py -Copyright (C) 2006-2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org LVS state/configuration classes for PyBal @@ -263,4 +263,4 @@ def getDepoolThreshold(self): Returns the threshold below which no more down servers will be depooled -return self.configuration.getfloat('depool-threshold', .5) \ No newline at end of file +return self.configuration.getfloat('depool-threshold', .5) diff --git a/pybal/monitor.py b/pybal/monitor.py index 024fc94..6b42521 100644 --- a/pybal/monitor.py +++ b/pybal/monitor.py @@ -1,6 +1,6 @@ monitor.py -Copyright (C) 2006-2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org Monitor class implementations for PyBal diff --git a/pybal/monitors/__init__.py b/pybal/monitors/__init__.py index 524db70..d0743a7 100644 --- a/pybal/monitors/__init__.py +++ b/pybal/monitors/__init__.py @@ -1,6 +1,6 @@ monitors.__init__.py -Copyright (C) 2006-2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org The monitors package contains all (complete) monitoring implementations of PyBal diff --git a/pybal/monitors/__skeleton__.py b/pybal/monitors/__skeleton__.py index 14daacf..5592b4b 100644 --- a/pybal/monitors/__skeleton__.py +++ b/pybal/monitors/__skeleton__.py @@ -1,6 +1,6 @@ __skeleton__.py -Copyright (C) 2006-2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org Copy and modify this file to write a new PyBal monitor. It contains the minimum imports and base methods that need diff --git a/pybal/monitors/dnsquery.py b/pybal/monitors/dnsquery.py index 3a65718..37e1cf5 100644 --- a/pybal/monitors/dnsquery.py +++ b/pybal/monitors/dnsquery.py @@ -1,6 +1,6 @@ dns.py -Copyright (C) 2012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2012-2014 by Mark Bergsma m...@nedworks.org DNS Monitor class implementation for PyBal diff --git a/pybal/pybal.py b/pybal/pybal.py index 43ad576..6dae0d3 100644 --- a/pybal/pybal.py +++ b/pybal/pybal.py @@ -2,7 +2,7 @@ PyBal -Copyright (C) 2006-20012 by Mark Bergsma m...@nedworks.org +Copyright (C) 2006-2014 by Mark Bergsma m...@nedworks.org LVS Squid balancer/monitor for managing the Wikimedia Squid servers using LVS diff --git a/setup.py b/setup.py index 436443d..19fea7e 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,12 @@ -#!/usr/bin/env python + +PyBal +~ + +PyBal is a cluster monitoring daemon. It executes health checks against +servers and updates LVS connection tables accordingly. PyBal is used in +production at Wikimedia. + + try: from setuptools import setup except ImportError: @@ -6,13 +14,35 @@ setup( -name=pybal, -version=0.1, -description=PyBal LVS monitor, -author=Mark Bergsma, -author_email=m...@wikimedia.org, -url=http://wikitech.wikimedia.org/view/Pybal;, -packages=['pybal', 'pybal.monitors'], -requires=['twisted'], +name='PyBal', +version='1.06', +license='GPLv2+', +author='Mark Bergsma', +author_email='m...@wikimedia.org', +url='https://wikitech.wikimedia.org/wiki/PyBal', +description='PyBal LVS monitor', +long_description=__doc__, +classifiers=( +'Development Status :: 5 - Production/Stable', +'Framework :: Twisted', +'Intended Audience :: System Administrators', +'License :: OSI Approved :: ' +'GNU General Public License v2 or later (GPLv2+)', +'Operating System :: POSIX :: Linux', +'Programming Language :: Python :: 2.7', +'Topic :: Internet :: Proxy Servers', +'Topic :: System :: Networking :: Monitoring', +), +packages=( +'pybal', +'pybal.monitors', +), +scripts=( +'scripts/pybal', +), +zip_safe=False, +requires=( +'twisted', +), test_suite='pybal.test', ) -- To view,
[MediaWiki-commits] [Gerrit] Pass $wgDebugTimestamp info to debug console - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/173667 Change subject: Pass $wgDebugTimestamp info to debug console .. Pass $wgDebugTimestamp info to debug console Bug: 73492 Change-Id: I2557601e85d1f4837c67621f2db27dae70b09880 --- M autoload.php M includes/GlobalFunctions.php M includes/debug/MWDebug.php M includes/debug/logger/legacy/Logger.php M resources/src/mediawiki/mediawiki.debug.js 5 files changed, 40 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/67/173667/1 diff --git a/autoload.php b/autoload.php index c5fc22c..24ed452 100644 --- a/autoload.php +++ b/autoload.php @@ -676,6 +676,7 @@ 'MWCryptHKDF' = __DIR__ . '/includes/utils/MWCryptHKDF.php', 'MWCryptRand' = __DIR__ . '/includes/utils/MWCryptRand.php', 'MWDebug' = __DIR__ . '/includes/debug/MWDebug.php', + 'MWDebugEntry' = __DIR__ . '/includes/debug/MWDebug.php', 'MWDocGen' = __DIR__ . '/maintenance/mwdocgen.php', 'MWException' = __DIR__ . '/includes/exception/MWException.php', 'MWExceptionHandler' = __DIR__ . '/includes/exception/MWExceptionHandler.php', diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 81f767d..d48367f 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -973,19 +973,16 @@ } $timer = wfDebugTimer(); - if ( $timer !== '' ) { - // Prepend elapsed request time and real memory usage to each line - $text = preg_replace( '/[^\n]/', $timer . '\0', $text, 1 ); - } if ( $dest === 'all' ) { - MWDebug::debugMsg( $text ); + MWDebug::debugMsg( $text, $timer ); } $ctx = array(); if ( $wgDebugLogPrefix !== '' ) { $ctx['prefix'] = $wgDebugLogPrefix; } + $ctx['debugtimestamps'] = $timer; $logger = MWLogger::getInstance( 'wfDebug' ); $logger-debug( rtrim( $text, \n ), $ctx ); @@ -1076,13 +1073,16 @@ $text = trim( $text ); + $timer = wfDebugTimer(); + if ( $dest === 'all' ) { - MWDebug::debugMsg( [{$logGroup}] {$text}\n ); + MWDebug::debugMsg( [{$logGroup}] {$text}\n, $timer ); } $logger = MWLogger::getInstance( $logGroup ); $logger-debug( $text, array( 'private' = ( $dest === 'private' ), + 'debugtimestamps' = $timer ) ); } diff --git a/includes/debug/MWDebug.php b/includes/debug/MWDebug.php index ffc6b3b..1b05670 100644 --- a/includes/debug/MWDebug.php +++ b/includes/debug/MWDebug.php @@ -312,11 +312,11 @@ * @since 1.19 * @param string $str */ - public static function debugMsg( $str ) { + public static function debugMsg( $str, $debugtimestamp = '' ) { global $wgDebugComments, $wgShowDebug; if ( self::$enabled || $wgDebugComments || $wgShowDebug ) { - self::$debug[] = rtrim( UtfNormal::cleanUp( $str ) ); + self::$debug[] = new MWDebugEntry( rtrim( UtfNormal::cleanUp( $str ) ), $debugtimestamp ); } } @@ -582,3 +582,24 @@ ); } } + +/* + * Single debugger log entry + * + * @since 1.25 + */ +class MWDebugEntry { + + function __construct( $text, $timer = '' ) { + $this-text = $text; + $this-timer = $timer; + } + + function __toString() { + if ( $this-timer) { + return {$this-timer} {$this-text}; + } else { + return $this-text; + } + } +} diff --git a/includes/debug/logger/legacy/Logger.php b/includes/debug/logger/legacy/Logger.php index daf3f51..6e93e59 100644 --- a/includes/debug/logger/legacy/Logger.php +++ b/includes/debug/logger/legacy/Logger.php @@ -166,6 +166,7 @@ $log = sprintf( %s\t%04.3f\t%s%s\n, gmdate( 'YmdHis' ), $context['elapsed'], $context['url'], $forward ); + unset( $context['debugtimestamps'] ); // redundant with profiling $text = self::formatAsWfDebugLog( $channel, $log . $context['output'], $context ); @@ -194,6 +195,9 @@ $text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1f]!', ' ', $message ); if ( isset( $context['prefix'] ) ) { $text = {$context['prefix']}{$text}; + } + if ( $context['debugtimestamps'] ) { + $text = {$context['debugtimestamps']} {$text}; } return {$text}\n; } @@ -241,6 +245,9 @@ */ protected static function formatAsWfDebugLog( $channel, $message, $context
[MediaWiki-commits] [Gerrit] Move UpdateRepo hook handlers into a dedicated class - change (mediawiki...Wikibase)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/173668 Change subject: Move UpdateRepo hook handlers into a dedicated class .. Move UpdateRepo hook handlers into a dedicated class Change-Id: I60ab88d3d43d9981ee71412a569bb21bfc2bbd30 --- M client/WikibaseClient.hooks.php M client/WikibaseClient.php 2 files changed, 2 insertions(+), 168 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/68/173668/1 diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index aa63bc9..1cb216a 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -7,10 +7,8 @@ use ChangesList; use FormOptions; use IContextSource; -use JobQueueGroup; use Message; use MovePageForm; -use MWException; use OutputPage; use Parser; use QuickTemplate; @@ -25,9 +23,6 @@ use UnexpectedValueException; use User; use Wikibase\Client\Changes\ChangeHandler; -use WikiPage; -use Content; -use ManualLogEntry; use Wikibase\Client\Hooks\BaseTemplateAfterPortletHandler; use Wikibase\Client\Hooks\BeforePageDisplayHandler; use Wikibase\Client\Hooks\ChangesPageWikibaseFilterHandler; @@ -39,8 +34,6 @@ use Wikibase\Client\RecentChanges\ExternalChangeFactory; use Wikibase\Client\RecentChanges\RecentChangesFilterOptions; use Wikibase\Client\RepoItemLinkGenerator; -use Wikibase\Client\UpdateRepo\UpdateRepoOnMove; -use Wikibase\Client\UpdateRepo\UpdateRepoOnDelete; use Wikibase\Client\WikibaseClient; use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\SiteLink; @@ -689,165 +682,6 @@ $pageInfo = $infoActionHookHandler-handle( $context, $pageInfo ); - return true; - } - - /** -* After a page has been moved also update the item on the repo -* This only works with CentralAuth -* -* @see https://www.mediawiki.org/wiki/Manual:Hooks/TitleMoveComplete -* -* @param Title $oldTitle -* @param Title $newTitle -* @param User $user -* @param integer $pageId database ID of the page that's been moved -* @param integer $redirectId database ID of the created redirect -* @param string $reason -* -* @return bool -*/ - public static function onTitleMoveComplete( - Title $oldTitle, - Title $newTitle, - User $user, - $pageId, - $redirectId, - $reason - ) { - - if ( !self::isWikibaseEnabled( $oldTitle-getNamespace() ) -!self::isWikibaseEnabled( $newTitle-getNamespace() ) ) { - // shorten out - return true; - } - - wfProfileIn( __METHOD__ ); - - $wikibaseClient = WikibaseClient::getDefaultInstance(); - $settings = $wikibaseClient-getSettings(); - - if ( $settings-getSetting( 'propagateChangesToRepo' ) !== true ) { - wfProfileOut( __METHOD__ ); - return true; - } - - $repoDB = $settings-getSetting( 'repoDatabase' ); - $siteLinkLookup = $wikibaseClient-getStore()-getSiteLinkTable(); - $jobQueueGroup = JobQueueGroup::singleton( $repoDB ); - - if ( !$jobQueueGroup ) { - wfLogWarning( Failed to acquire a JobQueueGroup for $repoDB ); - wfProfileOut( __METHOD__ ); - return true; - } - - $updateRepo = new UpdateRepoOnMove( - $repoDB, - $siteLinkLookup, - $user, - $settings-getSetting( 'siteGlobalID' ), - $oldTitle, - $newTitle - ); - - if ( !$updateRepo || !$updateRepo-getEntityId() || !$updateRepo-userIsValidOnRepo() ) { - wfProfileOut( __METHOD__ ); - return true; - } - - try { - $updateRepo-injectJob( $jobQueueGroup ); - - // To be able to find out about this in the SpecialMovepageAfterMove hook - $newTitle-wikibasePushedMoveToRepo = true; - } catch( MWException $e ) { - // This is not a reason to let an exception bubble up, we just - // show a message to the user that the Wikibase item needs to be - // manually updated. - wfLogWarning( $e-getMessage() ); - } - - wfProfileOut( __METHOD__ ); - return true; - } - - /** -* After a page has been deleted also update the item on the repo -* This
[MediaWiki-commits] [Gerrit] Fixed apparent redundancy in handling 'mapping template', ad... - change (mediawiki...SemanticForms)
Yaron Koren has uploaded a new change for review. https://gerrit.wikimedia.org/r/173670 Change subject: Fixed apparent redundancy in handling 'mapping template', added trim() calls .. Fixed apparent redundancy in handling 'mapping template', added trim() calls Change-Id: I04b46be355c692c5e3115ebfb0fea059e2adfe3f --- M includes/SF_FormPrinter.php 1 file changed, 13 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/70/173670/1 diff --git a/includes/SF_FormPrinter.php b/includes/SF_FormPrinter.php index 8e5bfb4..2c14f5a 100644 --- a/includes/SF_FormPrinter.php +++ b/includes/SF_FormPrinter.php @@ -1039,22 +1039,24 @@ } if ( is_array( $field_query_val ) ) { $cur_values = array(); - foreach ( $field_query_val as $key = $value ) { - if ( !is_null( $mapping_template ) !is_null( $possible_values ) ) { - $cur_values = array(); - foreach ( $field_query_val as $key = $val ) { - if ( $key === 'is_list' ) { - $cur_values[$key] = $val; - } else { - $cur_values[] = SFUtils::labelToValue( $val, $possible_values, $mapping_template ); - } + if ( !is_null( $mapping_template ) !is_null( $possible_values ) ) { + $cur_values = array(); + foreach ( $field_query_val as $key = $val ) { + $val = trim( $val ); + if ( $key === 'is_list' ) { + $cur_values[$key] = $val; + } else { + $cur_values[] = SFUtils::labelToValue( $val, $possible_values, $mapping_template ); } - } else { - $cur_values[$key] = $value; + } + } else { + foreach ( $field_query_val as $key = $val ) { + $cur_values[$key] = $val; } } $cur_value = $this-getStringFromPassedInArray( $cur_values, $delimiter ); } else { + $field_query_val = trim( $field_query_val ); if ( !is_null( $mapping_template ) !is_null( $possible_values ) ) { $cur_value = SFUtils::labelToValue( $field_query_val, $possible_values, $mapping_template ); } else { -- To view, visit https://gerrit.wikimedia.org/r/173670 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04b46be355c692c5e3115ebfb0fea059e2adfe3f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: Yaron Koren yaro...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] Hygiene: Update mixin file to use single line comments - change (mediawiki/core)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/173669 Change subject: Hygiene: Update mixin file to use single line comments .. Hygiene: Update mixin file to use single line comments Since these are not valid CSS they do not turn up in the output. This makes debugging a lot easier as mixin files typically get included multiple times across less files. Change-Id: I5adacb277f18f782a8293285fd8f98e825f39734 --- M resources/src/mediawiki.less/mediawiki.mixins.less 1 file changed, 18 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/69/173669/1 diff --git a/resources/src/mediawiki.less/mediawiki.mixins.less b/resources/src/mediawiki.less/mediawiki.mixins.less index 4a87b74..ea5f6a8 100644 --- a/resources/src/mediawiki.less/mediawiki.mixins.less +++ b/resources/src/mediawiki.less/mediawiki.mixins.less @@ -1,17 +1,15 @@ -/** - * Common LESS mixin library for MediaWiki - * - * By default the folder containing this file is included in $wgResourceLoaderLESSImportPaths, - * which makes this file importable by all less files via '@import mediawiki.mixins;'. - * - * The mixins included below are considered a public interface for MediaWiki extensions. - * The signatures of parametrized mixins should be kept as stable as possible. - * - * See http://lesscss.org/#-mixins for more information about how to write mixins. - */ +// Common LESS mixin library for MediaWiki +// +// By default the folder containing this file is included in $wgResourceLoaderLESSImportPaths, +// which makes this file importable by all less files via '@import mediawiki.mixins;'. +// +// The mixins included below are considered a public interface for MediaWiki extensions. +// The signatures of parametrized mixins should be kept as stable as possible. +// +// See http://lesscss.org/#-mixins for more information about how to write mixins. .background-image(@url) { - background-image: e('/* @embed */') url(@url); + background-image: e('/* @embed///') url(@url); } .background-size(@width, @height) { @@ -31,16 +29,14 @@ background-image: linear-gradient( @startColor @startPos, @endColor @endPos ); // Standard } -/* - * SVG support using a transparent gradient to guarantee cross-browser - * compatibility (browsers able to understand gradient syntax support also SVG). - * http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique - * - * We use gzip compression, which means that it is okay to embed twice. - * - * We do not embed the fallback image on the assumption that the gain for old browsers - * is not worth the harm done to modern ones. - */ +// SVG support using a transparent gradient to guarantee cross-browser +// compatibility (browsers able to understand gradient syntax support also SVG). +// http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique +// +// We use gzip compression, which means that it is okay to embed twice. +// +// We do not embed the fallback image on the assumption that the gain for old browsers +// is not worth the harm done to modern ones. .background-image-svg(@svg, @fallback) { background-image: url(@fallback); background-image: -webkit-linear-gradient(transparent, transparent), e('/* @embed */') url(@svg); -- To view, visit https://gerrit.wikimedia.org/r/173669 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5adacb277f18f782a8293285fd8f98e825f39734 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Jdlrobson jrob...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Standardize indentation of multiline 'if'/'elseif' conditions - change (mediawiki/core)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/173671 Change subject: Standardize indentation of multiline 'if'/'elseif' conditions .. Standardize indentation of multiline 'if'/'elseif' conditions Always indent the continuation one level deeper, and always place the closing parenthesis on the next line, per coding conventions. https://www.mediawiki.org/wiki/Manual:Coding_conventions#Indenting_and_alignment https://www.mediawiki.org/wiki/Manual:Coding_conventions#Line_continuation Regexp used: (\t+)(if|while|\} elseif|foreach).+(?![;}])\n\1\S Also: * Change to just one line if line length stays under 100 characters. * Add // Do nothing comment in empty 'if' bodies. * Change '#' comments to '//' comments near affected code. Change-Id: I4f62658fddb5a0ed18bbf9b2231cd794683d6402 --- M includes/GlobalFunctions.php M includes/Html.php M includes/Linker.php M includes/Sanitizer.php M includes/User.php M includes/htmlform/HTMLIntField.php M includes/htmlform/HTMLSelectAndOtherField.php M includes/installer/WebInstallerPage.php 8 files changed, 39 insertions(+), 43 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/71/173671/1 diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 11388e8..031ac5e 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1710,15 +1710,15 @@ array_shift( $args ); array_shift( $args ); $options = (array)$options; + $validOptions = array( 'parse', 'parseinline', 'escape', 'escapenoentities', 'replaceafter', + 'parsemag', 'content' ); foreach ( $options as $arrayKey = $option ) { if ( !preg_match( '/^[0-9]+|language$/', $arrayKey ) ) { - # An unknown index, neither numeric nor language + // An unknown index, neither numeric nor language wfWarn( wfMsgExt called with incorrect parameter key $arrayKey, 1, E_USER_WARNING ); - } elseif ( preg_match( '/^[0-9]+$/', $arrayKey ) !in_array( $option, - array( 'parse', 'parseinline', 'escape', 'escapenoentities', - 'replaceafter', 'parsemag', 'content' ) ) ) { - # A numeric index with unknown value + } elseif ( preg_match( '/^[0-9]+$/', $arrayKey ) !in_array( $option, $validOptions ) ) { + // A numeric index with unknown value wfWarn( wfMsgExt called with incorrect parameter $option, 1, E_USER_WARNING ); } } diff --git a/includes/Html.php b/includes/Html.php index fa868e3..b3437d3 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -267,8 +267,7 @@ // In text/html, initial html and head tags can be omitted under // pretty much any sane circumstances, if they have no attributes. See: // http://www.whatwg.org/html/syntax.html#optional-tags - if ( !$wgWellFormedXml !$attribs -in_array( $element, array( 'html', 'head' ) ) ) { + if ( !$wgWellFormedXml !$attribs in_array( $element, array( 'html', 'head' ) ) ) { return ''; } @@ -301,8 +300,7 @@ 'tel', 'color', ); - if ( isset( $attribs['type'] ) -!in_array( $attribs['type'], $validTypes ) ) { + if ( isset( $attribs['type'] ) !in_array( $attribs['type'], $validTypes ) ) { unset( $attribs['type'] ); } } @@ -396,8 +394,9 @@ } // Simple checks using $attribDefaults - if ( isset( $attribDefaults[$element][$lcattrib] ) - $attribDefaults[$element][$lcattrib] == $value ) { + if ( isset( $attribDefaults[$element][$lcattrib] ) +$attribDefaults[$element][$lcattrib] == $value + ) { unset( $attribs[$attrib] ); } @@ -407,8 +406,9 @@ } // More subtle checks - if ( $element === 'link' isset( $attribs['type'] ) -strval( $attribs['type'] ) == 'text/css' ) { + if ( $element === 'link' +isset( $attribs['type'] ) strval( $attribs['type'] ) == 'text/css' + ) { unset( $attribs['type'] ); } if ( $element === 'input' ) { @@ -507,8 +507,7 @@ // For boolean attributes, support array( 'foo' ) instead of // requiring array( 'foo'
[MediaWiki-commits] [Gerrit] [FEAT] Page: Use APISite.interwiki_prefix for title - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/173672 Change subject: [FEAT] Page: Use APISite.interwiki_prefix for title .. [FEAT] Page: Use APISite.interwiki_prefix for title The title with asLink used just the site's code and family which is not always correct. This uses the interwiki_prefix function to get the actual prefix from the actual site. It introduces as_link as additional parameter because it redefines 'insite': Instead of the configured it uses the page's site by default (which would use a self referencing interwiki prefix if forced). It's still possible to get the configured site by using 'True'. Because this now could raises exceptions, only asLink usages are replaced which don't force an interwiki link (or if it's known in the tests that it'll work). It supports two level deep interwiki links, if the first interwiki prefix goes into the family of the page. For example if the page is in the German Wiktionary and insite is set to the English Wikipedia it'll first search for an interwiki prefix to the Wiktionary, if the site also supports an interwiki prefix on it's own to the German Wiktionary. In theory it could do a search of all prefixes, but which would cause many requests, especially if there is no path. It's also at least as good as the asLink functionality. Change-Id: Idde31761411cd4a1ac0d0e5b5b10c5b02a17f965 --- M README-conversion.txt M pywikibot/bot.py M pywikibot/exceptions.py M pywikibot/page.py M pywikibot/pagegenerators.py M pywikibot/site.py M scripts/basic.py M scripts/blockpageschecker.py M scripts/blockreview.py M scripts/capitalize_redirects.py M scripts/casechecker.py M scripts/category.py M scripts/category_redirect.py M scripts/clean_sandbox.py M scripts/commonscat.py M scripts/imagetransfer.py M scripts/isbn.py M scripts/maintenance/compat2core.py M scripts/movepages.py M scripts/newitem.py M scripts/noreferences.py M scripts/redirect.py M scripts/reflinks.py M scripts/replace.py M scripts/selflink.py M scripts/template.py M scripts/touch.py M scripts/transferbot.py M scripts/unlink.py M scripts/unusedfiles.py M scripts/weblinkchecker.py M tests/page_tests.py 32 files changed, 216 insertions(+), 172 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/72/173672/1 diff --git a/README-conversion.txt b/README-conversion.txt index dd6c1c7..e30c0a5 100644 --- a/README-conversion.txt +++ b/README-conversion.txt @@ -93,7 +93,7 @@ - urlname(): replaced by Page.title(asUrl=True) - titleWithoutNamespace(): replaced by Page.title(withNamespace=False) - sectionFreeTitle(): replaced by Page.title(withSection=False) -- aslink(): replaced by Page.title(asLink=True) +- aslink(): replaced by Page.title(as_link=True) - encoding(): replaced by Page.site.encoding() The following methods of the Page object have been obsoleted and no longer diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 1b5bfec..5c84027 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -995,7 +995,7 @@ if oldtext == newtext: pywikibot.output(u'No changes were needed on %s' - % page.title(asLink=True)) + % page.title(as_link=True)) return self.current_page = page diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py index b5013df..53f8eef 100644 --- a/pywikibot/exceptions.py +++ b/pywikibot/exceptions.py @@ -96,7 +96,7 @@ raise Error(PageRelatedError is abstract. Can't instantiate it!) self.page = page -self.title = page.title(asLink=True) +self.title = page.title(as_link=True) self.site = page.site if '%(' in self.message and ')s' in self.message: diff --git a/pywikibot/page.py b/pywikibot/page.py index 68bfd5c..2315028 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -165,7 +165,7 @@ def title(self, underscore=False, withNamespace=True, withSection=True, asUrl=False, asLink=False, allowInterwiki=True, forceInterwiki=False, textlink=False, - as_filename=False, insite=None): + as_filename=False, insite=None, as_link=False): Return the title of this Page, as a Unicode string. @param underscore: (not used with asLink) if true, replace all ' ' @@ -188,34 +188,78 @@ @param insite: (only used if asLink is true) a site object where the title is to be shown. default is the current family/lang given by -family and -lang option i.e. config.family and config.mylang - +@param as_link: The same as asLink, but uses the dynamic interwiki +map. The insite parameter is the configured Family if set to True, +otherwise it is set to the site of the page. +assert(not asLink or not as_link) title = self._link.canonical_title()
[MediaWiki-commits] [Gerrit] make monitor constructor accept a custom reactor object - change (operations...pybal)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/173673 Change subject: make monitor constructor accept a custom reactor object .. make monitor constructor accept a custom reactor object Instead of using the global reactor object, have MonitoringProtocol.__init__ accept an optional reactor parameter. If not specified, it will default to the global reactor object, as before. This makes unit testing easier. Per Twisted docs: New application code should prefer to pass and accept the reactor as a parameter where it is needed, rather than relying on being able to import this module to get a reference. This simplifies unit testing and may make it easier to one day support multiple reactors (as a performance enhancement), though this is not currently possible. (http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.reactor.html) Change-Id: I282892a519fa73e47788c393c3dcf4079f0889d4 --- M pybal/monitor.py M pybal/monitors/idleconnection.py 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal refs/changes/73/173673/1 diff --git a/pybal/monitor.py b/pybal/monitor.py index 6b42521..623f899 100644 --- a/pybal/monitor.py +++ b/pybal/monitor.py @@ -13,19 +13,20 @@ abstract methods, and some commonly useful functions -def __init__(self, coordinator, server, configuration={}): +def __init__(self, coordinator, server, configuration={}, reactor=reactor): Constructor self.coordinator = coordinator self.server = server self.configuration = configuration self.up = None# None, False (Down) or True (Up) +self.reactor = reactor self.active = False self.firstCheck = True # Install cleanup handler -reactor.addSystemEventTrigger('before', 'shutdown', self.stop) +self.reactor.addSystemEventTrigger('before', 'shutdown', self.stop) def run(self): Start the monitoring diff --git a/pybal/monitors/idleconnection.py b/pybal/monitors/idleconnection.py index 3268408..cc34585 100644 --- a/pybal/monitors/idleconnection.py +++ b/pybal/monitors/idleconnection.py @@ -113,4 +113,4 @@ except (TypeError, IndexError): host = self.server.host -reactor.connectTCP(host, self.server.port, self, *args, **kwargs) +self.reactor.connectTCP(host, self.server.port, self, *args, **kwargs) -- To view, visit https://gerrit.wikimedia.org/r/173673 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I282892a519fa73e47788c393c3dcf4079f0889d4 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/pybal Gerrit-Branch: master Gerrit-Owner: Ori.livneh o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed apparent redundancy in handling 'mapping template', ad... - change (mediawiki...SemanticForms)
Yaron Koren has submitted this change and it was merged. Change subject: Fixed apparent redundancy in handling 'mapping template', added trim() calls .. Fixed apparent redundancy in handling 'mapping template', added trim() calls Change-Id: I04b46be355c692c5e3115ebfb0fea059e2adfe3f --- M includes/SF_FormPrinter.php 1 file changed, 13 insertions(+), 11 deletions(-) Approvals: Yaron Koren: Checked; Looks good to me, approved diff --git a/includes/SF_FormPrinter.php b/includes/SF_FormPrinter.php index 8e5bfb4..2c14f5a 100644 --- a/includes/SF_FormPrinter.php +++ b/includes/SF_FormPrinter.php @@ -1039,22 +1039,24 @@ } if ( is_array( $field_query_val ) ) { $cur_values = array(); - foreach ( $field_query_val as $key = $value ) { - if ( !is_null( $mapping_template ) !is_null( $possible_values ) ) { - $cur_values = array(); - foreach ( $field_query_val as $key = $val ) { - if ( $key === 'is_list' ) { - $cur_values[$key] = $val; - } else { - $cur_values[] = SFUtils::labelToValue( $val, $possible_values, $mapping_template ); - } + if ( !is_null( $mapping_template ) !is_null( $possible_values ) ) { + $cur_values = array(); + foreach ( $field_query_val as $key = $val ) { + $val = trim( $val ); + if ( $key === 'is_list' ) { + $cur_values[$key] = $val; + } else { + $cur_values[] = SFUtils::labelToValue( $val, $possible_values, $mapping_template ); } - } else { - $cur_values[$key] = $value; + } + } else { + foreach ( $field_query_val as $key = $val ) { + $cur_values[$key] = $val; } } $cur_value = $this-getStringFromPassedInArray( $cur_values, $delimiter ); } else { + $field_query_val = trim( $field_query_val ); if ( !is_null( $mapping_template ) !is_null( $possible_values ) ) { $cur_value = SFUtils::labelToValue( $field_query_val, $possible_values, $mapping_template ); } else { -- To view, visit https://gerrit.wikimedia.org/r/173670 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04b46be355c692c5e3115ebfb0fea059e2adfe3f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: Yaron Koren yaro...@gmail.com Gerrit-Reviewer: Yaron Koren yaro...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] Add superclass initialisation for the Bot scripts - change (pywikibot/core)
John Vandenberg has uploaded a new change for review. https://gerrit.wikimedia.org/r/173674 Change subject: Add superclass initialisation for the Bot scripts .. Add superclass initialisation for the Bot scripts Three scripts didnt call their superclass Bot's __init__. Logic was recently added to the Bot class which depended on the object being initialised properly. Added a plain super call to replace.py and solve_disambiguation.py and revise states_redirect.py soas it uses the new Bot 'site' property manager. Change-Id: I8dc7f2c4e45b020376060c0806acd02e987bf04a --- M scripts/replace.py M scripts/solve_disambiguation.py M scripts/states_redirect.py 3 files changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/74/173674/1 diff --git a/scripts/replace.py b/scripts/replace.py index c40ca69..4a79ddc 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -280,6 +280,7 @@ exceptionRegexes dictionary in textlib.replaceExcept(). +super(ReplaceRobot, self).__init__() self.generator = generator self.replacements = replacements self.exceptions = exceptions diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index e29b618..9f26db8 100644 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -470,6 +470,7 @@ def __init__(self, always, alternatives, getAlternatives, dnSkip, generator, primary, main_only, minimum=0): +super(DisambiguationRobot, self).__init__() self.always = always self.alternatives = alternatives self.getAlternatives = getAlternatives diff --git a/scripts/states_redirect.py b/scripts/states_redirect.py index 6f3bbd1..2f25802 100644 --- a/scripts/states_redirect.py +++ b/scripts/states_redirect.py @@ -57,16 +57,18 @@ @param force: Don't ask whether to create pages, just create them. -self.start = start +site = pywikibot.Site() +generator = self.site.allpages(start=start) +super(StatesRedirectBot, self).__init__(generator=generator) + self.force = force -self.site = pywikibot.Site() + # Created abbrev from pycountry data base self.abbrev = {} for subd in pycountry.subdivisions: # Used subd.code[3:] to extract the exact code for # subdivisional states(ignoring the country code). self.abbrev[subd.name] = subd.code[3:] -self.generator = self.site.allpages(start=self.start) def treat(self, page): Re-directing process. -- To view, visit https://gerrit.wikimedia.org/r/173674 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8dc7f2c4e45b020376060c0806acd02e987bf04a Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: John Vandenberg jay...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add superclass initialisation for three Bot scripts - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add superclass initialisation for three Bot scripts .. Add superclass initialisation for three Bot scripts Three scripts didnt call their superclass Bot's __init__. Logic was recently added to the Bot class which depended on the object being initialised properly. Added a plain super call to replace.py and solve_disambiguation.py and revise states_redirect.py soas it uses the new Bot 'site' property manager. Bug: 73494 Change-Id: I8dc7f2c4e45b020376060c0806acd02e987bf04a --- M scripts/replace.py M scripts/solve_disambiguation.py M scripts/states_redirect.py 3 files changed, 7 insertions(+), 3 deletions(-) Approvals: XZise: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/replace.py b/scripts/replace.py index c40ca69..4a79ddc 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -280,6 +280,7 @@ exceptionRegexes dictionary in textlib.replaceExcept(). +super(ReplaceRobot, self).__init__() self.generator = generator self.replacements = replacements self.exceptions = exceptions diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index e29b618..9f26db8 100644 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -470,6 +470,7 @@ def __init__(self, always, alternatives, getAlternatives, dnSkip, generator, primary, main_only, minimum=0): +super(DisambiguationRobot, self).__init__() self.always = always self.alternatives = alternatives self.getAlternatives = getAlternatives diff --git a/scripts/states_redirect.py b/scripts/states_redirect.py index 6f3bbd1..1bf5d5c 100644 --- a/scripts/states_redirect.py +++ b/scripts/states_redirect.py @@ -57,16 +57,18 @@ @param force: Don't ask whether to create pages, just create them. -self.start = start +site = pywikibot.Site() +generator = site.allpages(start=start) +super(StatesRedirectBot, self).__init__(generator=generator) + self.force = force -self.site = pywikibot.Site() + # Created abbrev from pycountry data base self.abbrev = {} for subd in pycountry.subdivisions: # Used subd.code[3:] to extract the exact code for # subdivisional states(ignoring the country code). self.abbrev[subd.name] = subd.code[3:] -self.generator = self.site.allpages(start=self.start) def treat(self, page): Re-directing process. -- To view, visit https://gerrit.wikimedia.org/r/173674 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8dc7f2c4e45b020376060c0806acd02e987bf04a Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: XZise commodorefabia...@gmx.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Do not pass whole Entity when not needed - change (mediawiki...Wikibase)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/173676 Change subject: Do not pass whole Entity when not needed .. Do not pass whole Entity when not needed Change-Id: I5f3b993ec7bd4839028519f66e583e286c50510a --- M repo/includes/View/EntityViewPlaceholderExpander.php M repo/includes/View/TermBoxView.php M repo/tests/phpunit/includes/View/TermBoxViewTest.php 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/76/173676/1 diff --git a/repo/includes/View/EntityViewPlaceholderExpander.php b/repo/includes/View/EntityViewPlaceholderExpander.php index dea5f86..3f3f225 100644 --- a/repo/includes/View/EntityViewPlaceholderExpander.php +++ b/repo/includes/View/EntityViewPlaceholderExpander.php @@ -241,7 +241,7 @@ } $termBoxView = new TermBoxView( $this-uiLanguage ); - $html = $termBoxView-renderTermBox( $this-targetPage, $entity, $languages ); + $html = $termBoxView-renderTermBox( $this-targetPage, $entity-getFingerprint(), $languages ); return $html; } diff --git a/repo/includes/View/TermBoxView.php b/repo/includes/View/TermBoxView.php index 15b35d0..62d39c9 100644 --- a/repo/includes/View/TermBoxView.php +++ b/repo/includes/View/TermBoxView.php @@ -7,6 +7,7 @@ use Title; use Wikibase\DataModel\Entity\Entity; use Wikibase\DataModel\Term\AliasGroupList; +use Wikibase\DataModel\Term\Fingerprint; use Wikibase\Utils; /** @@ -51,20 +52,19 @@ * @since 0.4 * * @param Title $title The title of the page the term box is to be shown on -* @param Entity $entity the entity to render +* @param Fingerprint $fingerprint the Fingerprint to render * @param string[] $languageCodes list of language codes to show terms for * @param bool $editable whether editing is allowed (enabled edit links) * * @return string */ - public function renderTermBox( Title $title, Entity $entity, array $languageCodes, $editable = true ) { + public function renderTermBox( Title $title, Fingerprint $fingerprint, array $languageCodes, $editable = true ) { if ( empty( $languageCodes ) ) { return ''; } wfProfileIn( __METHOD__ ); - $fingerprint = $entity-getFingerprint(); $labels = $fingerprint-getLabels(); $descriptions = $fingerprint-getDescriptions(); $aliasGroups = $fingerprint-getAliasGroups(); diff --git a/repo/tests/phpunit/includes/View/TermBoxViewTest.php b/repo/tests/phpunit/includes/View/TermBoxViewTest.php index f460bdc..c92a4b2 100644 --- a/repo/tests/phpunit/includes/View/TermBoxViewTest.php +++ b/repo/tests/phpunit/includes/View/TermBoxViewTest.php @@ -39,7 +39,7 @@ $languages = array( 'de', 'ru' ); - $html = $view-renderTermBox( $title, $entity, $languages ); + $html = $view-renderTermBox( $title, $entity-getFingerprint(), $languages ); $this-assertNotRegExp( '/Moskow/', $html, 'unexpected English label, should not be there' ); -- To view, visit https://gerrit.wikimedia.org/r/173676 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f3b993ec7bd4839028519f66e583e286c50510a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bot.site property fails when set to None - change (pywikibot/core)
John Vandenberg has uploaded a new change for review. https://gerrit.wikimedia.org/r/173675 Change subject: Bot.site property fails when set to None .. Bot.site property fails when set to None - Allow None value to be given to Bot.site property setter. - Fix ReplaceBot.__init__ to not set it to None. - Provide an explicit site when running ReplaceBot from replace.main. Any other caller of ReplaceBot will now receive a warning from Bot.site getter if they have not specified a site for the bot to use. Bug: 73494 Change-Id: Ib98334d820ec2e8ea14d17cb1346ac287ba19a59 --- M pywikibot/bot.py M scripts/replace.py 2 files changed, 22 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/75/173675/1 diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 1b5bfec..9fb6254 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1070,6 +1070,10 @@ When Bot.run() is managing the generator and site property, this is set each time a page is on a site different from the previous page. +if not site: +self._site = None +return + if site not in self._sites: log(u'LOADING SITE %s VERSION: %s' % (site, unicode(site.version( diff --git a/scripts/replace.py b/scripts/replace.py index 4a79ddc..cd9fcfb 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -164,7 +164,7 @@ constructor below. -def __init__(self, xmlFilename, xmlStart, replacements, exceptions): +def __init__(self, xmlFilename, xmlStart, replacements, exceptions, site): Constructor. self.xmlFilename = xmlFilename self.replacements = replacements @@ -178,7 +178,10 @@ if inside in self.exceptions: self.excsInside += self.exceptions['inside'] from pywikibot import xmlreader -self.site = pywikibot.Site() +if site: +self.site = site +else: +self.site = pywikibot.Site() dump = xmlreader.XmlDump(self.xmlFilename) self.parser = dump.parse() @@ -287,9 +290,8 @@ self.acceptall = acceptall self.allowoverlap = allowoverlap self.recursive = recursive -self.site = site -if self.site is None: -self.site = pywikibot.Site() +if site: +self.site = site if addedCat: cat_ns = site.category_namespaces()[0] self.addedCat = pywikibot.Page(self.site, @@ -576,6 +578,8 @@ else: commandline_replacements.append(arg) +site = pywikibot.Site() + if (len(commandline_replacements) % 2): raise pywikibot.Error('require even number of replacements.') elif (len(commandline_replacements) == 2 and fix is None): @@ -583,7 +587,7 @@ commandline_replacements[1])) if not summary_commandline: edit_summary = i18n.twtranslate( -pywikibot.Site(), 'replace-replacing', +site, 'replace-replacing', {'description': ' (-%s +%s)' % (commandline_replacements[0], commandline_replacements[1])} ) @@ -598,7 +602,7 @@ for i in range(0, len(commandline_replacements), 2)] replacementsDescription = '(%s)' % ', '.join( [('-' + pair[0] + ' +' + pair[1]) for pair in pairs]) -edit_summary = i18n.twtranslate(pywikibot.Site(), +edit_summary = i18n.twtranslate(site, 'replace-replacing', {'description': replacementsDescription}) @@ -621,7 +625,7 @@ change += ' -' + old + ' +' + new replacements.append((old, new)) if not summary_commandline: -default_summary_message = i18n.twtranslate(pywikibot.Site(), +default_summary_message = i18n.twtranslate(site, 'replace-replacing', {'description': change}) pywikibot.output(u'The summary message will default to: %s' @@ -645,10 +649,10 @@ regex = fix['regex'] if msg in fix: if isinstance(fix['msg'], basestring): -edit_summary = i18n.twtranslate(pywikibot.Site(), +edit_summary = i18n.twtranslate(site, str(fix['msg'])) else: -edit_summary = i18n.translate(pywikibot.Site(), +edit_summary = i18n.translate(site, fix['msg'], fallback=True) if exceptions in
[MediaWiki-commits] [Gerrit] Bot.site property fails when set to None - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Bot.site property fails when set to None .. Bot.site property fails when set to None - Allow None value to be given to Bot.site property setter. - Fix ReplaceBot.__init__ to not set it to None. - Provide an explicit site when running ReplaceBot from replace.main. Any other caller of ReplaceBot will now receive a warning from Bot.site getter if they have not specified a site for the bot to use. Bug: 73494 Change-Id: Ib98334d820ec2e8ea14d17cb1346ac287ba19a59 --- M pywikibot/bot.py M scripts/replace.py 2 files changed, 22 insertions(+), 13 deletions(-) Approvals: XZise: Looks good to me, approved Martineznovo: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 1b5bfec..9fb6254 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1070,6 +1070,10 @@ When Bot.run() is managing the generator and site property, this is set each time a page is on a site different from the previous page. +if not site: +self._site = None +return + if site not in self._sites: log(u'LOADING SITE %s VERSION: %s' % (site, unicode(site.version( diff --git a/scripts/replace.py b/scripts/replace.py index 4a79ddc..cd9fcfb 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -164,7 +164,7 @@ constructor below. -def __init__(self, xmlFilename, xmlStart, replacements, exceptions): +def __init__(self, xmlFilename, xmlStart, replacements, exceptions, site): Constructor. self.xmlFilename = xmlFilename self.replacements = replacements @@ -178,7 +178,10 @@ if inside in self.exceptions: self.excsInside += self.exceptions['inside'] from pywikibot import xmlreader -self.site = pywikibot.Site() +if site: +self.site = site +else: +self.site = pywikibot.Site() dump = xmlreader.XmlDump(self.xmlFilename) self.parser = dump.parse() @@ -287,9 +290,8 @@ self.acceptall = acceptall self.allowoverlap = allowoverlap self.recursive = recursive -self.site = site -if self.site is None: -self.site = pywikibot.Site() +if site: +self.site = site if addedCat: cat_ns = site.category_namespaces()[0] self.addedCat = pywikibot.Page(self.site, @@ -576,6 +578,8 @@ else: commandline_replacements.append(arg) +site = pywikibot.Site() + if (len(commandline_replacements) % 2): raise pywikibot.Error('require even number of replacements.') elif (len(commandline_replacements) == 2 and fix is None): @@ -583,7 +587,7 @@ commandline_replacements[1])) if not summary_commandline: edit_summary = i18n.twtranslate( -pywikibot.Site(), 'replace-replacing', +site, 'replace-replacing', {'description': ' (-%s +%s)' % (commandline_replacements[0], commandline_replacements[1])} ) @@ -598,7 +602,7 @@ for i in range(0, len(commandline_replacements), 2)] replacementsDescription = '(%s)' % ', '.join( [('-' + pair[0] + ' +' + pair[1]) for pair in pairs]) -edit_summary = i18n.twtranslate(pywikibot.Site(), +edit_summary = i18n.twtranslate(site, 'replace-replacing', {'description': replacementsDescription}) @@ -621,7 +625,7 @@ change += ' -' + old + ' +' + new replacements.append((old, new)) if not summary_commandline: -default_summary_message = i18n.twtranslate(pywikibot.Site(), +default_summary_message = i18n.twtranslate(site, 'replace-replacing', {'description': change}) pywikibot.output(u'The summary message will default to: %s' @@ -645,10 +649,10 @@ regex = fix['regex'] if msg in fix: if isinstance(fix['msg'], basestring): -edit_summary = i18n.twtranslate(pywikibot.Site(), +edit_summary = i18n.twtranslate(site, str(fix['msg'])) else: -edit_summary = i18n.translate(pywikibot.Site(), +edit_summary = i18n.translate(site, fix['msg'], fallback=True) if
[MediaWiki-commits] [Gerrit] Update type hints to not use Entity - change (mediawiki...Wikibase)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/173701 Change subject: Update type hints to not use Entity .. Update type hints to not use Entity Change-Id: Id4b202f1fc86e383d0c4240cd1649240b7de118b --- M repo/includes/Interactors/ItemMergeInteractor.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/01/173701/1 diff --git a/repo/includes/Interactors/ItemMergeInteractor.php b/repo/includes/Interactors/ItemMergeInteractor.php index d194695..519432c 100644 --- a/repo/includes/Interactors/ItemMergeInteractor.php +++ b/repo/includes/Interactors/ItemMergeInteractor.php @@ -7,6 +7,7 @@ use Wikibase\ChangeOp\ChangeOpsMerge; use Wikibase\ChangeOp\MergeChangeOpsFactory; use Wikibase\DataModel\Entity\Entity; +use Wikibase\DataModel\Entity\EntityDocument; use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; @@ -178,7 +179,7 @@ } } - private function validateEntities( Entity $fromEntity, Entity $toEntity ) { + private function validateEntities( EntityDocument $fromEntity, EntityDocument $toEntity ) { if ( !( $fromEntity instanceof Item $toEntity instanceof Item ) ) { throw new ItemMergeException( 'One or more of the entities are not items', 'not-item' ); } -- To view, visit https://gerrit.wikimedia.org/r/173701 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id4b202f1fc86e383d0c4240cd1649240b7de118b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] py3 pwb - change (pywikibot/core)
John Vandenberg has uploaded a new change for review. https://gerrit.wikimedia.org/r/173713 Change subject: py3 pwb .. py3 pwb Fix Python3 support for pwb, so that it sets __builtins__ and __package__, and its test now works. c5d5b01 removed Site interaction from the library bootstrap logic. The pwb tests can now be flagged as 'net' only, and not 'site', tests. Move the pwb running functionality out of script_tests into utils. Change-Id: Ic2443c17c9ad3976d654b2dd29201cfc12134322 --- M pwb.py M scripts/commonscat.py M scripts/cosmetic_changes.py M tests/__init__.py M tests/aspects.py M tests/pwb/print_locals.py M tests/pwb_tests.py M tests/script_tests.py M tests/utils.py 9 files changed, 199 insertions(+), 137 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/13/173713/1 diff --git a/pwb.py b/pwb.py index 29ddc24..6bfdf47 100644 --- a/pwb.py +++ b/pwb.py @@ -42,7 +42,7 @@ pwb.argvu = [] -def run_python_file(filename, argv, argvu): +def run_python_file(filename, argv, argvu, package=None): Run a python file as if it were the main program on the command line. `filename` is the path to the file to execute, it need not be a .py file. @@ -57,9 +57,11 @@ sys.modules['__main__'] = main_mod main_mod.__file__ = filename if sys.version_info[0] 2: -main_mod.builtins = sys.modules['builtins'] +main_mod.__builtins__ = sys.modules['builtins'] else: main_mod.__builtins__ = sys.modules['__builtin__'] +if package: +main_mod.__package__ = package # Set sys.argv and the first path element properly. old_argv = sys.argv @@ -95,9 +97,13 @@ raise RuntimeError(ERROR: Pywikibot only runs under Python 3.3 or higher) -rewrite_path = os.path.dirname(sys.argv[0]) -if not os.path.isabs(rewrite_path): -rewrite_path = os.path.abspath(os.path.join(os.curdir, rewrite_path)) +# Establish a normalised path for the directory containing pwb.py. +# Either it is '.' if the user's current working directory is the same, +# or it is the absolute path for the directory of pwb.py +absolute_path = os.path.dirname(sys.argv[0]) +if not os.path.isabs(absolute_path): +absolute_path = os.path.abspath(os.path.join(os.curdir, absolute_path)) +rewrite_path = absolute_path sys.path = [sys.path[0], rewrite_path, os.path.join(rewrite_path, 'pywikibot', 'compat'), @@ -166,18 +172,38 @@ sys.exit(1) if len(sys.argv) 1: +file_package = None tryimport_pwb() -fn = sys.argv[1] +filename = sys.argv[1] argv = sys.argv[1:] argvu = pwb.argvu[1:] -if not fn.endswith('.py'): -fn += '.py' -if not os.path.exists(fn): -testpath = os.path.join(os.path.split(__file__)[0], 'scripts', fn) +if not filename.endswith('.py'): +filename += '.py' +if not os.path.exists(filename): +testpath = os.path.join(os.path.split(__file__)[0], +'scripts', +filename) +file_package = 'scripts' if os.path.exists(testpath): -fn = testpath +filename = testpath else: -raise OSError(%s not found! % fn) -run_python_file(fn, argv, argvu) +raise OSError(%s not found! % filename) + +# when both pwb.py and the filename to run are in the current working +# directory, use relative paths and set the package name as if called +# using python -m scripts.blah.foo +cwd = os.path.abspath(os.getcwd()) +if absolute_path == cwd: +absolute_filename = os.path.abspath(filename) +if absolute_filename.startswith(rewrite_path): +relative_filename = os.path.relpath(filename) +# strip '.py' from the end and use '.' instead of path sep. +file_package = os.path.dirname(relative_filename).replace(os.sep, '.') +filename = os.path.join(os.curdir, relative_filename) + +if file_package and file_package not in sys.modules: +__import__(file_package) + +run_python_file(filename, argv, argvu, file_package) elif __name__ == __main__: print(__doc__) diff --git a/scripts/commonscat.py b/scripts/commonscat.py index ad004f6..91551a7 100755 --- a/scripts/commonscat.py +++ b/scripts/commonscat.py @@ -66,10 +66,11 @@ import re -from add_text import add_text import pywikibot from pywikibot import i18n, pagegenerators, Bot +from scripts.add_text import add_text + docuReplacements = { 'params;': pagegenerators.parameterHelp } diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py index 5776a6e..5a09bc7 100755 --- a/scripts/cosmetic_changes.py +++ b/scripts/cosmetic_changes.py @@ -74,12 +74,14 @@ # import re -from pywikibot.tools import MediaWikiVersion as LV + import pywikibot -import isbn + from pywikibot import config,
[MediaWiki-commits] [Gerrit] Update comment - change (mediawiki...Wikibase)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/173724 Change subject: Update comment .. Update comment Change-Id: I290c90a07645dc49db58c5e894eb83eba86c73d3 --- M lib/includes/store/sql/TermSqlIndex.php 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/24/173724/1 diff --git a/lib/includes/store/sql/TermSqlIndex.php b/lib/includes/store/sql/TermSqlIndex.php index ec9e931..d804971 100644 --- a/lib/includes/store/sql/TermSqlIndex.php +++ b/lib/includes/store/sql/TermSqlIndex.php @@ -180,8 +180,9 @@ } /** -* TODO: this method belongs in Entity itself. This change can only be made once -* there is a sane Term object in DataModel itself though. +* FIXME: this code assumes all entities have descriptions labels and aliases +* FIXME: this code uses deprecated Entity +* FIXME: OCP violation. No support for new types of entities can be registered * * @param Entity $entity * -- To view, visit https://gerrit.wikimedia.org/r/173724 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I290c90a07645dc49db58c5e894eb83eba86c73d3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 9b3b81c..fce0ed5 - change (mediawiki/extensions)
Jenkins-mwext-sync has uploaded a new change for review. https://gerrit.wikimedia.org/r/173743 Change subject: Syncronize VisualEditor: 9b3b81c..fce0ed5 .. Syncronize VisualEditor: 9b3b81c..fce0ed5 Change-Id: I0600061576a267118e215a48c6a3e9650c1a8333 --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions refs/changes/43/173743/1 diff --git a/VisualEditor b/VisualEditor index 9b3b81c..fce0ed5 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit 9b3b81c234341c8048f3dd61eea787f3d8c3374c +Subproject commit fce0ed5d6cb717da6d7731c91cb61f93e84d04dc -- To view, visit https://gerrit.wikimedia.org/r/173743 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0600061576a267118e215a48c6a3e9650c1a8333 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 9b3b81c..fce0ed5 - change (mediawiki/extensions)
Jenkins-mwext-sync has submitted this change and it was merged. Change subject: Syncronize VisualEditor: 9b3b81c..fce0ed5 .. Syncronize VisualEditor: 9b3b81c..fce0ed5 Change-Id: I0600061576a267118e215a48c6a3e9650c1a8333 --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Jenkins-mwext-sync: Verified; Looks good to me, approved diff --git a/VisualEditor b/VisualEditor index 9b3b81c..fce0ed5 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit 9b3b81c234341c8048f3dd61eea787f3d8c3374c +Subproject commit fce0ed5d6cb717da6d7731c91cb61f93e84d04dc -- To view, visit https://gerrit.wikimedia.org/r/173743 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0600061576a267118e215a48c6a3e9650c1a8333 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org Gerrit-Reviewer: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix PHP Notice: Undefined offset: 1 bug - change (mediawiki...ZeroBanner)
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/173744 Change subject: Fix PHP Notice: Undefined offset: 1 bug .. Fix PHP Notice: Undefined offset: 1 bug bug 73486 Change-Id: I25d13d1d20db8234f79e2cc7d9baa2bdde55fd73 --- M includes/PageRendering.php 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroBanner refs/changes/44/173744/1 diff --git a/includes/PageRendering.php b/includes/PageRendering.php index 3cb7456..d2e8ed3 100644 --- a/includes/PageRendering.php +++ b/includes/PageRendering.php @@ -584,16 +584,17 @@ if ( $this-config === false || ( $this-config $this-config-contextMode() !== $mode ) ) { wfProfileIn( __METHOD__ ); + $ipset = ''; $xcs = $this-getConfigId(); // Unified is treated as if there is no config - we don't know the actual ID if ( $xcs !== null !$this-isUnifiedZero() ) { - @list( $id, $ipset ) = explode( '|', $xcs, 2 ); - if ( $ipset === null ) { - $ipset = ''; + $xcsParts = explode( '|', $xcs, 2 ); + $id = $xcsParts[0]; + if ( count( $xcsParts ) 1 ) { + $ipset = $xcsParts[1]; } } else { $id = null; - $ipset = ''; } if ( $id !== null $this-config === false ) { -- To view, visit https://gerrit.wikimedia.org/r/173744 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25d13d1d20db8234f79e2cc7d9baa2bdde55fd73 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ZeroBanner Gerrit-Branch: master Gerrit-Owner: Yurik yu...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add ability to move and scale main 'Play' button - change (mediawiki...TimedMediaHandler)
Reticulated Spline has uploaded a new change for review. https://gerrit.wikimedia.org/r/173745 Change subject: Add ability to move and scale main 'Play' button .. Add ability to move and scale main 'Play' button Allows the main overlaid 'Play' button to be relocated to any of the four corners of the player. New config var 'EmbedPlayer.PlayButtonLocation' controls which. Control bar can now be hidden before playback to prevent conflict with button in bottom corners. Toggled with new config var 'EmbedPlayer.ShowControlBarBeforePlayback'. Also gives the option to scale-down the button should the player dimensions be less than 480 * 360. Toggled with new config var 'EmbedPlayer.ScalePlayButton'. Default settings ensure transparent backwards-compatibility, existing players will look exactly the same unless changes made to config vars listed above. Intended to address an issue on enwiki regarding 'Play' button obscuring video thumbnails leading to an inelegant appearance in articles. Bug: 73438 Change-Id: I1a8acfe6e6a14f738877cf915bad4820a922fa7f --- M MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php M MwEmbedModules/EmbedPlayer/resources/skins/kskin/PlayerSkinKskin.css M MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js 3 files changed, 114 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/45/173745/1 diff --git a/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php b/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php index 8ea95b9..5086516 100644 --- a/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php +++ b/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php @@ -192,6 +192,21 @@ // When there is no in-browser playback mechanism provide a download link for the play button 'EmbedPlayer.NotPlayableDownloadLink' = true, + + // The location of the large 'Play' button. + // Expected to be an integer value between 0 and 4, + // 0 being the center, and 1-4 the corners clockwise from top left. + // Defaults to the center if an invalid value is supplied. + + 'EmbedPlayer.PlayButtonLocation' = 0, + + // If the timeline/volume control bar should be shown on hover before the video has been started + // If the play button is moved to the bottom of the video, you might want to set this to FALSE for a cleaner UI. + 'EmbedPlayer.ShowControlBarBeforePlayback' = true, + + // If the large 'Play' button should be scaled down when the player is smaller than 480 * 360. + // Can prevent the button obscuring the thumbnail, allowing videos to be used like static images in articles. + 'EmbedPlayer.ScalePlayButton' = false, // A black pixel for source switching 'EmbedPlayer.BlackPixel' = data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%01%00%00%00%01%08%02%00%00%00%90wS%DE%00%00%00%01sRGB%00%AE%CE%1C%E9%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%07tIME%07%DB%0B%0A%17%041%80%9B%E7%F2%00%00%00%19tEXtComment%00Created%20with%20GIMPW%81%0E%17%00%00%00%0CIDAT%08%D7c%60%60%60%00%00%00%04%00%01'4'%0A%00%00%00%00IEND%AEB%60%82 diff --git a/MwEmbedModules/EmbedPlayer/resources/skins/kskin/PlayerSkinKskin.css b/MwEmbedModules/EmbedPlayer/resources/skins/kskin/PlayerSkinKskin.css index 8649a6f..f4bd50d 100644 --- a/MwEmbedModules/EmbedPlayer/resources/skins/kskin/PlayerSkinKskin.css +++ b/MwEmbedModules/EmbedPlayer/resources/skins/kskin/PlayerSkinKskin.css @@ -21,7 +21,7 @@ /* large play button */ .k-player .play-btn-large { width: 70px; - height: 55px; + height: 54px; background: url(images/ksprite.png) no-repeat 0px -433px; position: absolute; cursor: pointer; @@ -479,4 +479,4 @@ width : 51px; height : 12px; cursor: pointer; -} +} \ No newline at end of file diff --git a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js index 98602da..1e16894 100644 --- a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js +++ b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js @@ -28,7 +28,60 @@ // Default control bar height height: mw.config.get( 'EmbedPlayer.ControlsHeight' ), - + + playButtonPositionCases : { + // Center of player + 0 : { + 'top': '50%', + 'left' : '50%' + },
[MediaWiki-commits] [Gerrit] Allow maxlength attribute on HTMLSelectAndOtherField - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Allow maxlength attribute on HTMLSelectAndOtherField .. Allow maxlength attribute on HTMLSelectAndOtherField A reason on a SelectAndOtherField can have two parts, one of the scroll down box and a free text field. The free text field is actually unlimited. This patch allows the maxlength on that field. To respect the concat of the two parts, also javascript code is added, which adds a dynamic maxlength to respect also the text from the scroll down box. The HTMLSelectAndOtherField is only used on Special:Block, where the maxlength attribute is now set to 255 (length of the database field ipb_reason). Change-Id: I5c164b41ab047e7ecf9d92db6eddcc980e2db048 --- M includes/htmlform/HTMLSelectAndOtherField.php M includes/specials/SpecialBlock.php M resources/Resources.php M resources/src/mediawiki/mediawiki.htmlform.js 4 files changed, 46 insertions(+), 4 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/htmlform/HTMLSelectAndOtherField.php b/includes/htmlform/HTMLSelectAndOtherField.php index 65176dd..1175bd3 100644 --- a/includes/htmlform/HTMLSelectAndOtherField.php +++ b/includes/htmlform/HTMLSelectAndOtherField.php @@ -39,10 +39,12 @@ $textAttribs = array( 'id' = $this-mID . '-other', 'size' = $this-getSize(), + 'class' = array( 'mw-htmlform-select-and-other-field' ), + 'data-id-select' = $this-mID, ); if ( $this-mClass !== '' ) { - $textAttribs['class'] = $this-mClass; + $textAttribs['class'][] = $this-mClass; } $allowedParams = array( @@ -50,7 +52,8 @@ 'autofocus', 'multiple', 'disabled', - 'tabindex' + 'tabindex', + 'maxlength', // gets dynamic with javascript, see mediawiki.htmlform.js ); $textAttribs += $this-getAttributes( $allowedParams ); @@ -71,6 +74,7 @@ $list = $request-getText( $this-mName ); $text = $request-getText( $this-mName . '-other' ); + // Should be built the same as in mediawiki.htmlform.js if ( $list == 'other' ) { $final = $text; } elseif ( !in_array( $list, $this-mFlatOptions, true ) ) { diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index cf82b86..084336d 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -147,6 +147,7 @@ ), 'Reason' = array( 'type' = 'selectandother', + 'maxlength' = 255, 'label-message' = 'ipbreason', 'options-message' = 'ipbreason-dropdown', ), diff --git a/resources/Resources.php b/resources/Resources.php index ca90efa..dc7b6f4 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -894,8 +894,13 @@ 'scripts' = 'resources/src/mediawiki/mediawiki.htmlform.js', 'dependencies' = array( 'jquery.mwExtension', + 'jquery.byteLimit', ), - 'messages' = array( 'htmlform-chosen-placeholder' ), + 'messages' = array( + 'htmlform-chosen-placeholder', + // @todo Load this message in content language + 'colon-separator', + ), ), 'mediawiki.icon' = array( 'styles' = 'resources/src/mediawiki/mediawiki.icon.less', diff --git a/resources/src/mediawiki/mediawiki.htmlform.js b/resources/src/mediawiki/mediawiki.htmlform.js index 594800e..db8d8b1 100644 --- a/resources/src/mediawiki/mediawiki.htmlform.js +++ b/resources/src/mediawiki/mediawiki.htmlform.js @@ -237,7 +237,9 @@ } ); function enhance( $root ) { - var $matrixTooltips, $autocomplete; + var $matrixTooltips, $autocomplete, + // cache the separator to avoid object creation on each keypress + colonSeparator = mw.message( 'colon-separator' ).text(); /** * @ignore @@ -261,6 +263,36 @@ handleSelectOrOther.call( this, true ); } ); + // Add a dynamic max length to the reason field of SelectAndOther + // This checks the length together with the value from
[MediaWiki-commits] [Gerrit] Reuse $wgCentralDBname for the Choice infrastructure - change (mediawiki...CentralNotice)
jenkins-bot has submitted this change and it was merged. Change subject: Reuse $wgCentralDBname for the Choice infrastructure .. Reuse $wgCentralDBname for the Choice infrastructure I don't think we need to make this independently conditional of the main infrastructure config. Change-Id: If967c4a6b65773b0ba3b8235b1b07498747c1863 --- M CentralNotice.php M includes/BannerChoiceDataProvider.php M includes/CNBannerChoiceDataResourceLoaderModule.php 3 files changed, 8 insertions(+), 12 deletions(-) Approvals: AndyRussG: Looks good to me, approved jenkins-bot: Verified diff --git a/CentralNotice.php b/CentralNotice.php index e659a3b..fb177e7 100644 --- a/CentralNotice.php +++ b/CentralNotice.php @@ -85,15 +85,11 @@ // For example 'http://meta.wikimedia.org/w/index.php' $wgCentralPagePath = false; -// The wiki ID for direct database queries on the infrastructure wiki database. -// Leave this set to false to use the Web API instead. -$wgCentralNoticeInfrastructureId = false; - // The API path on the wiki that hosts the CentralNotice infrastructure // For example 'http://meta.wikimedia.org/api.php' // This must be set if you enable the selection of banners on the client and // you don't have direct access to the infrastructure database (see -// $wgCentralNoticeInfrastructureId). +// $wgCentralDBname). $wgCentralNoticeApiUrl = false; // How long to cache the banner choice data in memcached, in seconds diff --git a/includes/BannerChoiceDataProvider.php b/includes/BannerChoiceDataProvider.php index 210d81b..6827b6d 100644 --- a/includes/BannerChoiceDataProvider.php +++ b/includes/BannerChoiceDataProvider.php @@ -13,7 +13,7 @@ /** * Query the infrastructure DB using the wiki ID in -* $wgCentralNoticeInfrastructureId +* $wgCentralDBname */ const USE_INFRASTRUCTURE_DB = 1; @@ -51,7 +51,7 @@ * are provided. */ public function getChoices() { - global $wgCentralNoticeInfrastructureId; + global $wgCentralDBname; // For speed, we'll do our own queries instead of using methods in // Campaign and Banner. @@ -62,7 +62,7 @@ break; case self::USE_INFRASTRUCTURE_DB: - $wikiId = $wgCentralNoticeInfrastructureId; + $wikiId = $wgCentralDBname; break; default: diff --git a/includes/CNBannerChoiceDataResourceLoaderModule.php b/includes/CNBannerChoiceDataResourceLoaderModule.php index 908d0d3..3e7837f 100644 --- a/includes/CNBannerChoiceDataResourceLoaderModule.php +++ b/includes/CNBannerChoiceDataResourceLoaderModule.php @@ -28,9 +28,9 @@ protected function getChoices( ResourceLoaderContext $context ) { global $wgNoticeProject, $wgUser, - $wgCentralNoticeInfrastructureId, $wgCentralNoticeApiUrl, - $wgCentralNoticeBannerChoiceDataCacheExpiry; + $wgCentralNoticeBannerChoiceDataCacheExpiry, + $wgCentralDBname; $project = $wgNoticeProject; $language = $context-getLanguage(); @@ -64,7 +64,7 @@ // If something's amiss, we warn and return an empty array, but don't // bring everything to a standstill. - if ( $wgCentralNoticeInfrastructureId ) { + if ( $wgCentralDBname ) { $choices = $this-getFromDb( $project, $language, $status ); } else if ( $wgCentralNoticeApiUrl ) { @@ -95,7 +95,7 @@ /** * Get the banner choices data via a direct DB call using -* $wgCentralNoticeInfrastructureId. +* $wgCentralDBname. * * @param string $project * @param string $language -- To view, visit https://gerrit.wikimedia.org/r/173218 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If967c4a6b65773b0ba3b8235b1b07498747c1863 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Awight awi...@wikimedia.org Gerrit-Reviewer: AndyRussG andrew.green...@gmail.com Gerrit-Reviewer: Awight awi...@wikimedia.org Gerrit-Reviewer: Ejegg eeggles...@wikimedia.org Gerrit-Reviewer: Katie Horn kh...@wikimedia.org Gerrit-Reviewer: Mwalker mwal...@khaosdev.com Gerrit-Reviewer: Ssmith ssm...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] api: Produce 'parsedsummary' in action=parse even when onlyp... - change (mediawiki/core)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/173746 Change subject: api: Produce 'parsedsummary' in action=parse even when onlypst=1 .. api: Produce 'parsedsummary' in action=parse even when onlypst=1 There's no reason not to, and it'll let us save a request in Ia339f431. Also produce some other reasonable props, which were previously omitted. Change-Id: Iacb62f86e2e7335f7435805425d92acfa4badca2 --- M includes/api/ApiParse.php 1 file changed, 21 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/46/173746/1 diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 2bf1677..d18d6a2 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -209,19 +209,6 @@ if ( $params['pst'] || $params['onlypst'] ) { $this-pstContent = $this-content-preSaveTransform( $titleObj, $this-getUser(), $popts ); } - if ( $params['onlypst'] ) { - // Build a result and bail out - $result_array = array(); - $result_array['text'] = array(); - ApiResult::setContent( $result_array['text'], $this-pstContent-serialize( $format ) ); - if ( isset( $prop['wikitext'] ) ) { - $result_array['wikitext'] = array(); - ApiResult::setContent( $result_array['wikitext'], $this-content-serialize( $format ) ); - } - $result-addValue( null, $this-getModuleName(), $result_array ); - - return; - } // Not cached (save or load) if ( $params['pst'] ) { @@ -235,12 +222,33 @@ $result_array['title'] = $titleObj-getPrefixedText(); + if ( !is_null( $params['summary'] ) ) { + $result_array['parsedsummary'] = array(); + ApiResult::setContent( + $result_array['parsedsummary'], + Linker::formatComment( $params['summary'], $titleObj ) + ); + } + if ( !is_null( $oldid ) ) { $result_array['revid'] = intval( $oldid ); } if ( $params['redirects'] !is_null( $redirValues ) ) { $result_array['redirects'] = $redirValues; + } + + if ( $params['onlypst'] ) { + // Build a result and bail out. + $result_array['text'] = array(); + ApiResult::setContent( $result_array['text'], $this-pstContent-serialize( $format ) ); + if ( isset( $prop['wikitext'] ) ) { + $result_array['wikitext'] = array(); + ApiResult::setContent( $result_array['wikitext'], $this-content-serialize( $format ) ); + } + $result-addValue( null, $this-getModuleName(), $result_array ); + + return; } if ( $params['disabletoc'] ) { @@ -250,14 +258,6 @@ if ( isset( $prop['text'] ) ) { $result_array['text'] = array(); ApiResult::setContent( $result_array['text'], $p_result-getText() ); - } - - if ( !is_null( $params['summary'] ) ) { - $result_array['parsedsummary'] = array(); - ApiResult::setContent( - $result_array['parsedsummary'], - Linker::formatComment( $params['summary'], $titleObj ) - ); } if ( isset( $prop['langlinks'] ) ) { -- To view, visit https://gerrit.wikimedia.org/r/173746 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iacb62f86e2e7335f7435805425d92acfa4badca2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński matma@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't try to get newtimestamp from edit if no change was made - change (mediawiki...VisualEditor)
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/173747 Change subject: Don't try to get newtimestamp from edit if no change was made .. Don't try to get newtimestamp from edit if no change was made ApiEditPage can give us 'nochange' instead of the 'oldrevid'/'newrevid'/'newtimestamp' keys if we gave it a null edit. Bug: 73463 Change-Id: Ic22597dfed11de3823471673404090a9bce12928 --- M ApiVisualEditorEdit.php M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 2 files changed, 19 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/47/173747/1 diff --git a/ApiVisualEditorEdit.php b/ApiVisualEditorEdit.php index e21e134..7cd6e73 100644 --- a/ApiVisualEditorEdit.php +++ b/ApiVisualEditorEdit.php @@ -153,12 +153,15 @@ } $lang = $this-getLanguage(); - $ts = $saveresult['edit']['newtimestamp']; - $result['lastModified'] = array( - 'date' = $lang-userDate( $ts, $user ), - 'time' = $lang-userTime( $ts, $user ) - ); + if ( isset( $saveresult['edit']['newtimestamp'] ) ) { + $ts = $saveresult['edit']['newtimestamp']; + + $result['lastModified'] = array( + 'date' = $lang-userDate( $ts, $user ), + 'time' = $lang-userTime( $ts, $user ) + ); + } if ( isset( $saveresult['edit']['newrevid'] ) ) { $result['newrevid'] = intval( $saveresult['edit']['newrevid'] ); diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index 1386282..3562504 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -436,7 +436,8 @@ * @param {number} newid New revision id, undefined if unchanged * @param {boolean} isRedirect Whether this page is a redirect or not * @param {string} displayTitle What HTML to show as the page title - * @param {Object} lastModified Object containing user-formatted date and time strings + * @param {Object} lastModified Object containing user-formatted date +and time strings, or undefined if we made no change. */ ve.init.mw.ViewPageTarget.prototype.onSave = function ( html, categoriesHtml, newid, isRedirect, displayTitle, lastModified, contentSub @@ -1528,7 +1529,8 @@ * @param {string} html Rendered HTML from server * @param {string} categoriesHtml Rendered categories HTML from server * @param {string} displayTitle What HTML to show as the page title - * @param {Object} lastModified Object containing user-formatted date and time strings + * @param {Object} lastModified Object containing user-formatted date +and time strings, or undefined if we made no change. * @param {string} contentSub What HTML to show as the content subtitle */ ve.init.mw.ViewPageTarget.prototype.replacePageContent = function ( @@ -1536,11 +1538,13 @@ ) { var $content = $( $.parseHTML( html ) ), $editableContent; - $( '#footer-info-lastmod' ).text( ' ' + mw.msg( - 'lastmodifiedat', - lastModified.date, - lastModified.time - ) ); + if ( lastModified ) { + $( '#footer-info-lastmod' ).text( ' ' + mw.msg( + 'lastmodifiedat', + lastModified.date, + lastModified.time + ) ); + } if ( $( '#mw-imagepage-content' ).length ) { // On file pages, we only want to replace the (local) description. -- To view, visit https://gerrit.wikimedia.org/r/173747 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic22597dfed11de3823471673404090a9bce12928 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Alex Monk kren...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] On save, if there was no 'last modified' text at the bottom ... - change (mediawiki...VisualEditor)
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/173748 Change subject: On save, if there was no 'last modified' text at the bottom of the page, add it .. On save, if there was no 'last modified' text at the bottom of the page, add it Just hope that wgMaxCredits is 0. Change-Id: Idf4a7cceb0650eaec4442244066d875a3ff38e06 --- M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/48/173748/1 diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index 3562504..ea28a58 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -1539,6 +1539,14 @@ var $content = $( $.parseHTML( html ) ), $editableContent; if ( lastModified ) { + // If we were not viewing the most recent revision before (a requirement + // for lastmod to have been added by MediaWiki), we will be now. + if ( !$( '#footer-info-lastmod' ).length ) { + $( '#footer-info' ).prepend( + $( 'li' ).attr( 'id', 'footer-info-lastmod' ) + ); + } + $( '#footer-info-lastmod' ).text( ' ' + mw.msg( 'lastmodifiedat', lastModified.date, -- To view, visit https://gerrit.wikimedia.org/r/173748 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf4a7cceb0650eaec4442244066d875a3ff38e06 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Alex Monk kren...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Stop warnings about calling FlaggablePageView::setPageConten... - change (mediawiki...VisualEditor)
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/173749 Change subject: Stop warnings about calling FlaggablePageView::setPageContent with no parameters .. Stop warnings about calling FlaggablePageView::setPageContent with no parameters We don't care. Bug: 73469 Change-Id: I2ff0ec2fd1b0d34c1168f83d808c1cb498b17511 --- M ApiVisualEditorEdit.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/49/173749/1 diff --git a/ApiVisualEditorEdit.php b/ApiVisualEditorEdit.php index e21e134..1d71aef 100644 --- a/ApiVisualEditorEdit.php +++ b/ApiVisualEditorEdit.php @@ -139,7 +139,11 @@ ) + $this-getRequest()-getValues() ) ); - $view-setPageContent(); + // The two parameters here are references but we don't care + // about what FlaggedRevs does with them. + $outputDone = null; + $useParserCache = null; + $view-setPageContent( $outputDone, $useParserCache ); $view-displayTag(); } $result['contentSub'] = $this-getOutput()-getSubtitle(); -- To view, visit https://gerrit.wikimedia.org/r/173749 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2ff0ec2fd1b0d34c1168f83d808c1cb498b17511 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Alex Monk kren...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Preview: Add content clears after side-by-side preview - change (mediawiki...WikiEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Preview: Add content clears after side-by-side preview .. Preview: Add content clears after side-by-side preview Change-Id: Ib6147e38aa98a5498300513da3557ce74af1252d --- M modules/jquery.wikiEditor.preview.js 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: GOIII: Looks good to me, but someone else must approve Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/jquery.wikiEditor.preview.js b/modules/jquery.wikiEditor.preview.js index f066522..04a3831 100644 --- a/modules/jquery.wikiEditor.preview.js +++ b/modules/jquery.wikiEditor.preview.js @@ -74,6 +74,7 @@ context.modules.preview.$preview.find( '.wikiEditor-preview-loading' ).hide(); context.modules.preview.$preview.find( '.wikiEditor-preview-contents' ) .html( data.parse.text['*'] ) + .append( 'div class=visualClear/div' ) .find( 'a:not([href^=#])' ) .click( false ); @@ -140,7 +141,9 @@ var diff = data.query.pages[data.query.pageids[0]] .revisions[0].diff['*']; - context.$changesTab.find( 'table.diff tbody' ).html( diff ); + context.$changesTab.find( 'table.diff tbody' ) + .html( diff ) + .append( 'div class=visualClear/div' ); context.modules.preview.changesText = wikitext; } catch ( e ) { // data.blah is undefined error, ignore -- To view, visit https://gerrit.wikimedia.org/r/172318 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6147e38aa98a5498300513da3557ce74af1252d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: GOIII george.orwell@outlook.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Test CNBannerChoicesResourceLoaderModule - change (mediawiki...CentralNotice)
jenkins-bot has submitted this change and it was merged. Change subject: Test CNBannerChoicesResourceLoaderModule .. Test CNBannerChoicesResourceLoaderModule Change-Id: I66fb71d395fec137c6670b2bc7fecf87ca7481f6 --- M CentralNotice.hooks.php A tests/CNBannerChoicesResourceLoaderModuleTest.php 2 files changed, 82 insertions(+), 0 deletions(-) Approvals: AndyRussG: Looks good to me, approved jenkins-bot: Verified diff --git a/CentralNotice.hooks.php b/CentralNotice.hooks.php index f4c3dd3..8e578e7 100644 --- a/CentralNotice.hooks.php +++ b/CentralNotice.hooks.php @@ -369,6 +369,7 @@ $files[ ] = __DIR__ . '/tests/BannerAllocationCalculatorTest.php'; $files[ ] = __DIR__ . '/tests/BannerChoiceDataProviderTest.php'; $files[ ] = __DIR__ . '/tests/BannerTest.php'; + $files[ ] = __DIR__ . '/tests/CNBannerChoicesResourceLoaderModuleTest.php'; return true; } diff --git a/tests/CNBannerChoicesResourceLoaderModuleTest.php b/tests/CNBannerChoicesResourceLoaderModuleTest.php new file mode 100644 index 000..d65a393 --- /dev/null +++ b/tests/CNBannerChoicesResourceLoaderModuleTest.php @@ -0,0 +1,81 @@ +?php + +/** + * @group CentralNotice + * @group medium + * @group Database + */ +class CNBannerChoicesResourceLoaderModuleTest extends MediaWikiTestCase { + /** @var CentralNoticeTestFixtures */ + protected $cnFixtures; + + protected function setUp() { + parent::setUp(); + + $this-setMwGlobals( array( + 'wgCentralNoticeChooseBannerOnClient' = true, + 'wgCentralNoticeBannerChoiceDataCacheExpiry' = 0, + 'wgNoticeProject' = 'wikipedia', + ) ); + $this-cnFixtures = new CentralNoticeTestFixtures(); + + $fauxRequest = new FauxRequest( array( + 'modules' = 'ext.centralNotice.bannerChoiceData', + 'skin' = 'fallback', + 'user' = false, + 'uselang' = CentralNoticeTestFixtures::$defaultCampaign['project_languages'][0], + ) ); + $this-rlContext = new ResourceLoaderContext( new ResourceLoader(), $fauxRequest ); + } + + protected function tearDown() { + if ( $this-cnFixtures ) { + $this-cnFixtures-removeFixtures(); + } + parent::tearDown(); + } + + protected function getProvider() { + return new TestingCNBannerChoiceDataResourceLoaderModule(); + } + + protected function addSomeBanners() { + $scenarios = CentralNoticeTestFixtures::allocationsData(); + $a_scenario = $scenarios[0][0]; + $this-cnFixtures-addFixtures( $a_scenario['fixture'] ); + } + + public function testDisabledByConfig() { + $this-setMwGlobals( 'wgCentralNoticeChooseBannerOnClient', false ); + + $this-addSomeBanners(); + $script = $this-getProvider()-getScript( $this-rlContext ); + + $this-assertEmpty( $script ); + } + + /** +* @dataProvider CentralNoticeTestFixtures::allocationsData +*/ + public function testChoicesFromDb( $data ) { + $this-setMwGlobals( 'wgCentralDBname', wfWikiID() ); + + $this-cnFixtures-addFixtures( $data['fixture'] ); + + $choices = $this-getProvider()-getChoicesForTesting( $this-rlContext ); + $this-assertTrue( ComparisonUtil::assertSuperset( $choices, $data['choices'] ) ); + + if ( empty( $data['choices'] ) ) { + $this-assertEmpty( $choices ); + } + } +} + +/** + * Wrapper to circumvent access control + */ +class TestingCNBannerChoiceDataResourceLoaderModule extends CNBannerChoiceDataResourceLoaderModule { + public function getChoicesForTesting( $rlContext ) { + return $this-getChoices( $rlContext ); + } +} -- To view, visit https://gerrit.wikimedia.org/r/172882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I66fb71d395fec137c6670b2bc7fecf87ca7481f6 Gerrit-PatchSet: 11 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Awight awi...@wikimedia.org Gerrit-Reviewer: AndyRussG andrew.green...@gmail.com Gerrit-Reviewer: Awight awi...@wikimedia.org Gerrit-Reviewer: Ejegg eeggles...@wikimedia.org Gerrit-Reviewer: Katie Horn kh...@wikimedia.org Gerrit-Reviewer: Mwalker mwal...@khaosdev.com Gerrit-Reviewer: Ssmith ssm...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] UI strings consistency: page instead of article - change (mediawiki...ContentTranslation)
jenkins-bot has submitted this change and it was merged. Change subject: UI strings consistency: page instead of article .. UI strings consistency: page instead of article And make cx-sourceselector-dialog-error-page-and-title-exist clearer and less repetitive. Change-Id: Id84faf60d553e4cc7b7721fa23f2dfc13cd14242 --- M i18n/en.json 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Santhosh: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index 7d0e982..6508032 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -22,7 +22,7 @@ cx-publish-button: Publish translation, cx-publish-button-publishing: Publishing..., cx-publish-summary: Created by translating the page \$1\, - cx-publish-gt-no-permission-to-move-description: Please ask an experienced user of this site to help you review your translation and publish it in the article space., + cx-publish-gt-no-permission-to-move-description: Please ask an experienced user of this site to help you review your translation and publish it in the main space., cx-publish-gt-first-step-title: The translation has been published as a draft under your user page for review, cx-publish-gt-first-step-description: Click on the \{{int:vector-action-move}}\ action under this menu to make the content available to all users as a regular page., cx-publish-gt-move-page-title: Move the page, @@ -81,9 +81,9 @@ cx-sourceselector-dialog-button-start-translation: Start translation, cx-sourceselector-dialog-source-language-label: From:, cx-sourceselector-dialog-target-language-label: To:, - cx-sourceselector-dialog-source-title-placeholder: Search for source article, + cx-sourceselector-dialog-source-title-placeholder: Search for source page, cx-sourceselector-dialog-target-title-placeholder: Translation title (if different from source), - cx-sourceselector-dialog-error-page-and-title-exist: The page already exists in [$1 $2] and the title is used by [$3 a different article], + cx-sourceselector-dialog-error-page-and-title-exist: This title is already used in [$1 $2] for [$3 a different page], cx-sourceselector-dialog-error-page-exists: The page [$1 already exists] in $2, cx-sourceselector-dialog-error-title-in-use: The title for the new page is [$1 already in use], cx-sourceselector-dialog-error-no-source-article: The page to translate does not exist in $1, -- To view, visit https://gerrit.wikimedia.org/r/173328 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id84faf60d553e4cc7b7721fa23f2dfc13cd14242 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il Gerrit-Reviewer: Santhosh santhosh.thottin...@gmail.com Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] v1.11.3.1 - change (xowa)
Gnosygnu has uploaded a new change for review. https://gerrit.wikimedia.org/r/173750 Change subject: v1.11.3.1 .. v1.11.3.1 Change-Id: I75914d5fc0edf615dc922fa1aedd0e1313f3a7fb --- M 100_core/src_110_primitive/gplx/Bry_finder.java M 400_xowa/src/gplx/xowa/Xoa_app_.java M 400_xowa/src/gplx/xowa/gui/views/Xog_tab_itm_edit_mgr.java M 400_xowa/src/gplx/xowa/hdumps/Xodb_hdump_mgr__write_tst.java M 400_xowa/src/gplx/xowa/hdumps/saves/Hdump_stats_tbl.java M 400_xowa/src/gplx/xowa/html/hzips/Xow_hzip_itm__anchor.java M 400_xowa/src/gplx/xowa/html/hzips/Xow_hzip_itm__file_tst.java M 400_xowa/src/gplx/xowa/html/hzips/Xow_hzip_itm__header.java M 400_xowa/src/gplx/xowa/html/hzips/Xow_hzip_stats.java M 400_xowa/src/gplx/xowa/html/lnkis/Xoh_file_html_fmtr__hdump.java M 400_xowa/src/gplx/xowa/pages/Xopg_html_data.java M 400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr.java M 400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr_tst.java M 400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde.java M 400_xowa/src/gplx/xowa/xtns/poems/Poem_nde_tst.java M 400_xowa/src/gplx/xowa/xtns/scribunto/lib/Scrib_lib_wikibase_srl.java M 400_xowa/src/gplx/xowa/xtns/scribunto/lib/Scrib_lib_wikibase_srl_tst.java M 400_xowa/src/gplx/xowa/xtns/wdatas/Wdata_wiki_mgr_fxt.java M 400_xowa/src/gplx/xowa/xtns/wdatas/Wdata_xwiki_link_wtr_tst.java M 400_xowa/src_120_wiki/gplx/xowa/Xow_lang_mgr.java M 400_xowa/src_400_parser/gplx/xowa/Xop_parser_.java M 400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_tkn.java M tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.002.sqlite3 23 files changed, 149 insertions(+), 56 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/xowa refs/changes/50/173750/1 diff --git a/100_core/src_110_primitive/gplx/Bry_finder.java b/100_core/src_110_primitive/gplx/Bry_finder.java index bc92371..cfd29e5 100644 --- a/100_core/src_110_primitive/gplx/Bry_finder.java +++ b/100_core/src_110_primitive/gplx/Bry_finder.java @@ -34,6 +34,10 @@ if (src[i] == lkp) return i; return Bry_finder.Not_found; } + public static int Move_fwd(byte[] src, byte[] lkp, int cur, int end) { + int rv = Find_fwd(src, lkp, 0, src.length); + return rv == Bry_finder.Not_found ? rv : rv + lkp.length; + } public static int Find_fwd(byte[] src, byte[] lkp) {return Find(src, lkp, 0, src.length, true);} public static int Find_fwd(byte[] src, byte[] lkp, int cur) {return Find(src, lkp, cur , src.length, true);} public static int Find_fwd(byte[] src, byte[] lkp, int cur, int end) {return Find(src, lkp, cur ,end, true);} diff --git a/400_xowa/src/gplx/xowa/Xoa_app_.java b/400_xowa/src/gplx/xowa/Xoa_app_.java index 929b223..73761c1 100644 --- a/400_xowa/src/gplx/xowa/Xoa_app_.java +++ b/400_xowa/src/gplx/xowa/Xoa_app_.java @@ -24,7 +24,7 @@ boot_mgr.Run(args); } public static final String Name = xowa; - public static final String Version = 1.11.2.1; + public static final String Version = 1.11.3.1; public static String Build_date = 2012-12-30 00:00:00; public static String Op_sys; public static String User_agent = ; diff --git a/400_xowa/src/gplx/xowa/gui/views/Xog_tab_itm_edit_mgr.java b/400_xowa/src/gplx/xowa/gui/views/Xog_tab_itm_edit_mgr.java index 7dfcab2..5b10fe4 100644 --- a/400_xowa/src/gplx/xowa/gui/views/Xog_tab_itm_edit_mgr.java +++ b/400_xowa/src/gplx/xowa/gui/views/Xog_tab_itm_edit_mgr.java @@ -65,12 +65,6 @@ win_itm.Page__mode_(Xopg_view_mode.Tid_edit); html_itm.Scroll_page_by_id_gui(Xog_html_itm.Elem_id__first_heading);// NOTE: was originally directly; changed to call on thread; DATE:2014-05-03 win_itm.Page__async__bgn(tab); // NOTE: needed to show images during preview; DATE:2014-06-21 - try { - tab.Async(); - } - catch (Exception e) { - tab.Tab_mgr().Win().App().Usr_dlg().Warn_many(error while running file wkr; page=~{0} err=~{1}, tab.Page().Url().Xto_full_str(), Err_.Message_gplx_brief(e)); - } } public static void Rename(Xog_tab_itm tab) { if (tab.View_mode() != Xopg_view_mode.Tid_edit) return; // exit if not edit; handles ctrl+r being pressed diff --git a/400_xowa/src/gplx/xowa/hdumps/Xodb_hdump_mgr__write_tst.java b/400_xowa/src/gplx/xowa/hdumps/Xodb_hdump_mgr__write_tst.java index a1c13e9..2ac0466 100644 --- a/400_xowa/src/gplx/xowa/hdumps/Xodb_hdump_mgr__write_tst.java +++ b/400_xowa/src/gplx/xowa/hdumps/Xodb_hdump_mgr__write_tst.java @@ -24,7 +24,7 @@ fxt.Expd_itms_xfers(fxt.Make_xfer(A.png, 0, 0, 0, Bool_.Y,
[MediaWiki-commits] [Gerrit] Basic QUnit tests - change (mediawiki...CentralNotice)
Ejegg has submitted this change and it was merged. Change subject: Basic QUnit tests .. Basic QUnit tests Covers a tiny bit of bannerController. Change-Id: I281f576b4a75458b15071167220c1c404e7bec6d --- M CentralNotice.hooks.php A tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js 2 files changed, 118 insertions(+), 1 deletion(-) Approvals: Ejegg: Looks good to me, approved diff --git a/CentralNotice.hooks.php b/CentralNotice.hooks.php index f4c3dd3..f7f8898 100644 --- a/CentralNotice.hooks.php +++ b/CentralNotice.hooks.php @@ -111,7 +111,9 @@ $wgAPIListModules[ 'centralnoticelogs' ] = 'ApiCentralNoticeLogs'; // Register hooks - $wgHooks[ 'UnitTestsList' ][ ] = 'efCentralNoticeUnitTests'; + // TODO: replace ef- global functions with static methods in CentralNoticeHooks + $wgHooks['ResourceLoaderTestModules'][] = 'efCentralNoticeResourceLoaderTestModules'; + $wgHooks['UnitTestsList'][] = 'efCentralNoticeUnitTests'; // If CentralNotice banners should be shown on this wiki, load the components we need for // showing banners. For discussion of banner loading strategies, see @@ -374,6 +376,53 @@ /** * Place CentralNotice ResourceLoader modules onto mobile pages. + * ResourceLoaderTestModules hook handler + * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules + * + * @param array $testModules + * @param ResourceLoader $resourceLoader + * @return bool + */ +function efCentralNoticeResourceLoaderTestModules( array $testModules, + ResourceLoader $resourceLoader +) { + global $wgResourceModules; + + $testModuleBoilerplate = array( + 'localBasePath' = __DIR__, + 'remoteExtPath' = 'CentralNotice', + ); + + // TODO: Something similar should be provided by core. + // find test files for every RL module + $prefix = 'ext.centralNotice'; + foreach ( $wgResourceModules as $key = $module ) { + if ( substr( $key, 0, strlen( $prefix ) ) === $prefix isset( $module['scripts'] ) ) { + $testFiles = array(); + foreach ( ((array) $module['scripts'] ) as $script ) { + $testFile = 'tests/qunit/' . $key . '/' . basename( $script ); + $testFile = preg_replace( '/.js$/', '.tests.js', $testFile ); + // if a test file exists for a given JS file, add it + if ( file_exists( __DIR__ . '/' . $testFile ) ) { + $testFiles[] = $testFile; + } + } + // if test files exist for given module, create a corresponding test module + if ( count( $testFiles ) 0 ) { + $testModules['qunit'][$key.tests] = $testModuleBoilerplate + array( + 'dependencies' = array( $key ), + 'scripts' = $testFiles, + ); + } + } + } + + return true; +} + +/** + * EnableMobileModules callback for placing the CN resourceloader + * modules onto mobile pages. * * @param Skin $skin * @param array $modules diff --git a/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js b/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js new file mode 100644 index 000..4f619e4 --- /dev/null +++ b/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js @@ -0,0 +1,68 @@ +( function ( mw, $ ) { + 'use strict'; + + var bannerJson = { + bannerName: 'test_banner', + campaign: 'test_campaign', + category: 'test', + bannerHtml: 'div id=test_banner/div' + }; + + QUnit.module( 'ext.centralNotice.bannerController', QUnit.newMwEnvironment( { + setup: function () { + var realLoadBanner = mw.centralNotice.loadBanner; + + // Remove any existing div#siteNotice, so we are not testing the skin. + $( '#siteNotice' ).remove(); + + // Reset in case the testing page itself ran CentralNotice. + mw.centralNotice.alreadyRan = false; + + // Fool code that prevents CentralNotice from running on Special pages. + mw.config.set( 'wgNamespaceNumber', 0 ); + + // Prevent banner load during initialize(). + mw.centralNotice.loadBanner = function () {}; + + // Suppress GeoIP call + mw.centralNotice.data.getVars.country = 'US'; + +
[MediaWiki-commits] [Gerrit] Add normalized filename for LoremIpsum.djvu to mockAPI.js - change (mediawiki...parsoid)
Subramanya Sastry has uploaded a new change for review. https://gerrit.wikimedia.org/r/173751 Change subject: Add normalized filename for LoremIpsum.djvu to mockAPI.js .. Add normalized filename for LoremIpsum.djvu to mockAPI.js * Fixes incorrect API response of missing file for that parser test * Updated the relevant parser test with new wt2html output. * That test fails wt2wt mode because serializer doesn't yet handle the page parameter. * Selser failures are false negatives. Change-Id: Iaca49583994cc27803887e081740f231299f99a9 --- M tests/mockAPI.js M tests/parserTests-blacklist.js M tests/parserTests.txt 3 files changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/51/173751/1 diff --git a/tests/mockAPI.js b/tests/mockAPI.js index f405063..5bc6a06 100644 --- a/tests/mockAPI.js +++ b/tests/mockAPI.js @@ -45,7 +45,8 @@ 'Image:Foobar.svg': 'Foobar.svg', 'File:Foobar.svg': 'Foobar.svg', 'Image:Thumb.png': 'Thumb.png', - 'File:Thumb.png': 'Thumb.png' + 'File:Thumb.png': 'Thumb.png', + 'File:LoremIpsum.djvu': 'LoremIpsum.djvu' }, pnames = { diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js index 484b6cf..754daac 100644 --- a/tests/parserTests-blacklist.js +++ b/tests/parserTests-blacklist.js @@ -307,7 +307,6 @@ add(wt2html, Width-sized image (using px, no following whitespace), p data-parsoid='{\dsr\:[0,26,0,0]}'span typeof=\mw:Image\ data-parsoid='{\optList\:[{\ck\:\width\,\ak\:\640px\}],\dsr\:[0,26,null,null]}'a href=\./File:Foobar.jpg\ data-parsoid='{\a\:{\href\:\./File:Foobar.jpg\},\sa\:{}}'img resource=\./File:Foobar.jpg\ src=\//example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg\ height=\73\ width=\640\ data-parsoid='{\a\:{\resource\:\./File:Foobar.jpg\,\height\:\73\,\width\:\640\},\sa\:{\resource\:\Image:foobar.jpg\}}'//a/span/p); add(wt2html, Width-sized image (using px, with following whitespace - test regression from r39467), p data-parsoid='{\dsr\:[0,27,0,0]}'span typeof=\mw:Image\ data-parsoid='{\optList\:[{\ck\:\width\,\ak\:\640px \}],\dsr\:[0,27,null,null]}'a href=\./File:Foobar.jpg\ data-parsoid='{\a\:{\href\:\./File:Foobar.jpg\},\sa\:{}}'img resource=\./File:Foobar.jpg\ src=\//example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg\ height=\73\ width=\640\ data-parsoid='{\a\:{\resource\:\./File:Foobar.jpg\,\height\:\73\,\width\:\640\},\sa\:{\resource\:\Image:foobar.jpg\}}'//a/span/p); add(wt2html, Width-sized image (using px, with preceding whitespace - test regression from r39467), p data-parsoid='{\dsr\:[0,27,0,0]}'span typeof=\mw:Image\ data-parsoid='{\optList\:[{\ck\:\width\,\ak\:\ 640px\}],\dsr\:[0,27,null,null]}'a href=\./File:Foobar.jpg\ data-parsoid='{\a\:{\href\:\./File:Foobar.jpg\},\sa\:{}}'img resource=\./File:Foobar.jpg\ src=\//example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg\ height=\73\ width=\640\ data-parsoid='{\a\:{\resource\:\./File:Foobar.jpg\,\height\:\73\,\width\:\640\},\sa\:{\resource\:\Image:foobar.jpg\}}'//a/span/p); -add(wt2html, Image with page parameter, meta typeof=\mw:Placeholder\ data-parsoid='{\src\:\[[File:LoremIpsum.djvu|page=2]]\,\optList\:[{\ck\:\page\,\ak\:\page=2\}],\dsr\:[0,31,null,null]}'/); add(wt2html, HTML with raw HTML ($wgRawHtml==true), p data-parsoid='{\dsr\:[0,39,0,0]}'lt;htmllt;scriptalert(1);lt;/scriptlt;/html/p); add(wt2html, Parents of subpages, one level up, not named, p data-parsoid='{\dsr\:[0,7,0,0]}'a rel=\mw:WikiLink\ href=\./Subpage_test/L1/L2\ title=\Subpage test/L1/L2\ data-parsoid='{\stx\:\simple\,\a\:{\href\:\./Subpage_test/L1/L2\},\sa\:{\href\:\../\},\dsr\:[0,7,2,2]}'Subpage_test/L1/L2/a/p); add(wt2html, Parents of subpages, two levels up, without trailing slash or name., p data-parsoid='{\dsr\:[0,9,0,0]}'a rel=\mw:WikiLink\ href=\./Subpage_test/L1/L2/..\ title=\Subpage test/L1/L2/..\ data-parsoid='{\stx\:\simple\,\a\:{\href\:\./Subpage_test/L1/L2/..\},\sa\:{\href\:\../..\},\dsr\:[0,9,2,2]}'Subpage_test/L1/L2/../a/p); @@ -525,6 +524,7 @@ add(wt2wt, Mixing markup for italics and bold, '''nowikibold'/nowiki'bold''bolditalics'\n); add(wt2wt, ISBN code coverage, ISBN 978-0-1234-56#x20;789\n); add(wt2wt, RFC code coverage, RFC 983#x20;987\n); +add(wt2wt, Image with page parameter, [[File:LoremIpsum.djvu]]\n); add(wt2wt, Don't fall for the self-closing div, divhello world/div); add(wt2wt, Parsing of overlapping (improperly nested) inline html tags, spansx/span\n); add(wt2wt, Don't break table handling if language converter markup is in the cell., {|\n|-\n| -{R |B}-\n|}); @@ -838,7 +838,6 @@ add(html2html, Width-sized image (using px, no following whitespace), p data-parsoid='{\dsr\:[0,64,0,0]}'img src=\http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg\;
[MediaWiki-commits] [Gerrit] Remove coloured gdb prompt - change (operations/puppet)
Tim Starling has uploaded a new change for review. https://gerrit.wikimedia.org/r/173752 Change subject: Remove coloured gdb prompt .. Remove coloured gdb prompt It breaks readline editing of previous lines in the history, the cursor does not line up with the text being edited. Change-Id: I03015fd4edf6a30f9678390f4caddbb95e6c9e83 --- M modules/hhvm/files/debug/gdbinit 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/52/173752/1 diff --git a/modules/hhvm/files/debug/gdbinit b/modules/hhvm/files/debug/gdbinit index a8ff43c..7c80d1c 100644 --- a/modules/hhvm/files/debug/gdbinit +++ b/modules/hhvm/files/debug/gdbinit @@ -2,7 +2,6 @@ # This file was provisioned by Puppet. set verbose off set print pretty on -set prompt (\001\033[32m\002gdb\001\033[0m\002)\040 set substitute-path /home/joe/HHVM/hhvm /usr/local/src/hhvm set substitute-path /usr/src/hhvm /usr/local/src/hhvm -- To view, visit https://gerrit.wikimedia.org/r/173752 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03015fd4edf6a30f9678390f4caddbb95e6c9e83 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Tim Starling tstarl...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement banner= override test - change (mediawiki...CentralNotice)
Ejegg has submitted this change and it was merged. Change subject: Implement banner= override test .. Implement banner= override test Change-Id: Ic03cb6d6df5939033c6fdfcbb13c3f79efef433a --- M tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js 1 file changed, 33 insertions(+), 9 deletions(-) Approvals: Ejegg: Looks good to me, approved diff --git a/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js b/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js index 4f619e4..6273eef 100644 --- a/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js +++ b/tests/qunit/ext.centralNotice.bannerController/bannerController.tests.js @@ -1,7 +1,8 @@ ( function ( mw, $ ) { 'use strict'; - var bannerJson = { + var realAjax = $.ajax, + bannerData = { bannerName: 'test_banner', campaign: 'test_campaign', category: 'test', @@ -12,9 +13,6 @@ setup: function () { var realLoadBanner = mw.centralNotice.loadBanner; - // Remove any existing div#siteNotice, so we are not testing the skin. - $( '#siteNotice' ).remove(); - // Reset in case the testing page itself ran CentralNotice. mw.centralNotice.alreadyRan = false; @@ -24,8 +22,21 @@ // Prevent banner load during initialize(). mw.centralNotice.loadBanner = function () {}; - // Suppress GeoIP call - mw.centralNotice.data.getVars.country = 'US'; + $.extend( mw.centralNotice.data.getVars, { + // Suppress GeoIP call + country: 'US', + + // Boring defaults, assumed by test fixtures + // FIXME: move to tests that actually assume this. Move the + // initialize() call as well. + uselang: 'en', + project: 'wikipedia', + anonymous: true + } ); + + // Remove any existing div#siteNotice, so we are not testing the skin. + // Do it before initialize, so nothing + $( '#siteNotice' ).remove(); mw.centralNotice.initialize(); @@ -35,6 +46,9 @@ $( #qunit-fixture ).append( 'div id=siteNoticediv id=centralNotice/div/div' ); + }, + teardown: function () { + $.ajax = realAjax; } } ) ); @@ -43,7 +57,7 @@ } ); QUnit.test( 'canInsertBanner', 1, function( assert ) { - mw.centralNotice.insertBanner( bannerJson ); + mw.centralNotice.insertBanner( bannerData ); assert.equal( $( 'div#test_banner' ).length, 1 ); } ); @@ -52,7 +66,7 @@ return false; }; - mw.centralNotice.insertBanner( bannerJson ); + mw.centralNotice.insertBanner( bannerData ); assert.equal( $( 'div#test_banner' ).length, 0 ); } ); @@ -61,8 +75,18 @@ return true; }; - mw.centralNotice.insertBanner( bannerJson ); + mw.centralNotice.insertBanner( bannerData ); assert.equal( $( 'div#test_banner' ).length, 1 ); } ); + QUnit.test( 'banner= override param', 2, function( assert ) { + mw.centralNotice.data.getVars.banner = 'test_banner'; + $.ajax = function( params ) { + assert.ok( params.url.match( /Special(?:[:]|%3A)BannerLoader.*[?]banner=test_banner/ ) ); + }; + mw.centralNotice.loadBanner(); + + assert.ok( mw.centralNotice.data.testing ); + } ); + }( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/173662 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic03cb6d6df5939033c6fdfcbb13c3f79efef433a Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Awight awi...@wikimedia.org Gerrit-Reviewer: AndyRussG andrew.green...@gmail.com Gerrit-Reviewer: Awight awi...@wikimedia.org Gerrit-Reviewer: Ejegg eeggles...@wikimedia.org Gerrit-Reviewer: Katie Horn kh...@wikimedia.org Gerrit-Reviewer: Mwalker mwal...@khaosdev.com Gerrit-Reviewer: Ssmith ssm...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___
[MediaWiki-commits] [Gerrit] Turn random into a feed of random articles. - change (apps...wikipedia)
Deskana has uploaded a new change for review. https://gerrit.wikimedia.org/r/173753 Change subject: Turn random into a feed of random articles. .. Turn random into a feed of random articles. This patch changes the Random entry in the left nav to instead contain a feed of random articles. Ten articles are fetched at once, and if you scroll down to the bottom of the list then more are fetched. Thanks to Adam Baso for the idea! Change-Id: Ie056267b66b7eb307f68d254f4b77200c49a11b3 --- M wikipedia/res/layout/fragment_navdrawer.xml A wikipedia/res/layout/fragment_random.xml A wikipedia/res/layout/item_random_entry.xml M wikipedia/res/values-qq/strings.xml M wikipedia/res/values/strings.xml M wikipedia/src/main/java/org/wikipedia/NavDrawerFragment.java A wikipedia/src/main/java/org/wikipedia/random/RandomFetchException.java A wikipedia/src/main/java/org/wikipedia/random/RandomFetchTask.java A wikipedia/src/main/java/org/wikipedia/random/RandomFragment.java D wikipedia/src/main/java/org/wikipedia/random/RandomHandler.java 10 files changed, 400 insertions(+), 119 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/53/173753/1 diff --git a/wikipedia/res/layout/fragment_navdrawer.xml b/wikipedia/res/layout/fragment_navdrawer.xml index 6b56ff0..3d6cc25 100644 --- a/wikipedia/res/layout/fragment_navdrawer.xml +++ b/wikipedia/res/layout/fragment_navdrawer.xml @@ -184,9 +184,6 @@ android:src=@drawable/dice_white android:id=@+id/nav_item_random_icon android:contentDescription=@null / -ProgressBar android:layout_width=match_parent android:layout_height=match_parent - android:id=@+id/nav_item_random_progressbar -/ /FrameLayout TextView android:layout_width=match_parent diff --git a/wikipedia/res/layout/fragment_random.xml b/wikipedia/res/layout/fragment_random.xml new file mode 100644 index 000..9edf4be --- /dev/null +++ b/wikipedia/res/layout/fragment_random.xml @@ -0,0 +1,23 @@ +?xml version=1.0 encoding=utf-8? + +FrameLayout xmlns:android=http://schemas.android.com/apk/res/android; + android:layout_width=match_parent + android:layout_height=match_parent + android:background=?attr/window_background_color + android:paddingTop=?attr/actionBarSize + +LinearLayout +android:id=@+id/random_container +android:layout_width=match_parent +android:layout_height=match_parent +android:layout_gravity=center +android:gravity=center +android:orientation=vertical + +ListView +android:id=@+id/random_list +android:layout_width=match_parent +android:layout_height=match_parent +/ +/LinearLayout +/FrameLayout diff --git a/wikipedia/res/layout/item_random_entry.xml b/wikipedia/res/layout/item_random_entry.xml new file mode 100644 index 000..73075c4 --- /dev/null +++ b/wikipedia/res/layout/item_random_entry.xml @@ -0,0 +1,47 @@ +?xml version=1.0 encoding=utf-8? + +LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; + android:orientation=vertical + android:layout_width=match_parent + android:layout_height=match_parent + android:background=@drawable/selectable_item_background +LinearLayout +android:layout_width=match_parent +android:layout_height=wrap_content +android:orientation=horizontal + +ImageView +android:id=@+id/random_thumbnail +android:layout_height=64dp +android:layout_width=64dp +android:layout_margin=8dp +android:layout_gravity=center_vertical +android:background=@android:color/transparent +/ +LinearLayout +android:layout_width=match_parent +android:layout_height=wrap_content +android:layout_gravity=top +android:layout_marginBottom=6dp +android:layout_marginLeft=8dp +android:layout_marginRight=8dp +android:layout_marginTop=6dp +android:orientation=vertical +TextView +android:id=@+id/random_entry_title +android:layout_height=wrap_content +android:layout_width=wrap_content +android:layout_gravity=center_vertical +style=?android:textAppearanceMedium +/ +TextView +android:id=@+id/random_entry_description +style=?android:textAppearanceSmall +android:layout_width=match_parent +android:layout_height=wrap_content +
[MediaWiki-commits] [Gerrit] [FEAT] Process a single page with redirect.py - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [FEAT] Process a single page with redirect.py .. [FEAT] Process a single page with redirect.py - Additional -page option enables to work on a single page to solve it's problems. - Re-enable XML file for broken redirect - Remove old screen scraping code for broken redirect special page Change-Id: I6e7da9ba91c7eb820b10b07a77076a093a2c2b2a --- M scripts/redirect.py 1 file changed, 25 insertions(+), 32 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/redirect.py b/scripts/redirect.py index c39a931..0fde4ab 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -36,6 +36,8 @@ If neither of -xml -fullscan -moves is given, info will be loaded from a special page of the live wiki. +-page:titleWork on a single page + -namespace:n Namespace to process. Can be given multiple times, for several namespaces. If omitted, only the main (article) namespace is treated. @@ -82,7 +84,7 @@ def __init__(self, xmlFilename=None, namespaces=[], offset=-1, use_move_log=False, use_api=False, start=None, until=None, - number=None, step=None): + number=None, step=None, page_title=None): self.site = pywikibot.Site() self.xmlFilename = xmlFilename self.namespaces = namespaces @@ -95,6 +97,7 @@ self.api_until = until self.api_number = number self.api_step = step +self.page_title = page_title def get_redirects_from_dump(self, alsoGetPageTitles=False): @@ -267,38 +270,22 @@ count += 1 if count = self.api_number: break -elif not self.xmlFilename: +elif self.xmlFilename: +# retrieve information from XML dump +pywikibot.output( +u'Getting a list of all redirects and of all page titles...') +redirs, pageTitles = self.get_redirects_from_dump( +alsoGetPageTitles=True) +for (key, value) in redirs.items(): +if value not in pageTitles: +yield key +elif self.page_title: +yield self.page_title +else: # retrieve information from broken redirect special page pywikibot.output(u'Retrieving special page...') for redir_name in self.site.broken_redirects(): yield redir_name.title() - -# TODO: add XML dump support -##elif self.xmlFilename == None: -### retrieve information from the live wiki's maintenance page -### broken redirect maintenance page's URL -##path = self.site.broken_redirects_address(default_limit=False) -##pywikibot.output(u'Retrieving special page...') -##maintenance_txt = self.site.getUrl(path) -## -### regular expression which finds redirects which point to a -### non-existing page inside the HTML -##Rredir = re.compile('\li\\a href=.+? title=(.*?)') -## -##redir_names = Rredir.findall(maintenance_txt) -##pywikibot.output(u'Retrieved %d redirects from special page.\n' -## % len(redir_names)) -##for redir_name in redir_names: -##yield redir_name -##else: -### retrieve information from XML dump -##pywikibot.output( -##u'Getting a list of all redirects and of all page titles...') -##redirs, pageTitles = self.get_redirects_from_dump( -##alsoGetPageTitles=True) -##for (key, value) in redirs.items(): -##if value not in pageTitles: -##yield key def retrieve_double_redirects(self): if self.use_move_log: @@ -326,6 +313,8 @@ yield key pywikibot.output(u'\nChecking redirect %i of %i...' % (num + 1, len(redict))) +elif self.page_title: +yield self.page_title else: # retrieve information from double redirect special page pywikibot.output(u'Retrieving special page...') @@ -516,8 +505,8 @@ uWon't delete anything. % targetPage.title(asLink=True)) else: -#we successfully get the target page, meaning that -#it exists and is not a redirect: no reason to touch it. +# we successfully get the target page, meaning that +# it exists and is not a redirect: no reason to touch it. pywikibot.output(
[MediaWiki-commits] [Gerrit] Fix: preg_replace /e modifier deprecation error - change (mediawiki...BlueSpiceFoundation)
Robert Vogel has uploaded a new change for review. https://gerrit.wikimedia.org/r/173754 Change subject: Fix: preg_replace /e modifier deprecation error .. Fix: preg_replace /e modifier deprecation error There was a very old code path that uses /e modifier in preg_replace statement. On PHP5 this causes issues. The replacement actually never gets executed, but the pattern gets still compiled and causes error_log output. I moved it to preg_replace_callback and adjusted the callbacks argument processing. Change-Id: Ic31f4fe2384bf46a88d4ca67e8f8ca19148203da --- M includes/outputhandler/views/view.BaseElement.php 1 file changed, 15 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/54/173754/1 diff --git a/includes/outputhandler/views/view.BaseElement.php b/includes/outputhandler/views/view.BaseElement.php index 701cbd3..ea29513 100644 --- a/includes/outputhandler/views/view.BaseElement.php +++ b/includes/outputhandler/views/view.BaseElement.php @@ -231,7 +231,11 @@ elseif ( count( $this-_mItems ) ) { if ( $this-_mTemplate != '' ) { $output = $this-_mTemplate; - $output = preg_replace( '/###([-_|A-Za-z0-9]*?)###/e', \$this-processItem('\\1'), $output ); + $output = preg_replace_callback( + '/###([-_|A-Za-z0-9]*?)###/', + array( $this, 'processItem' ), + $output + ); } else { $output .= $this-getAutoElementOpener(); @@ -257,7 +261,12 @@ $this-_mPresentDataset = $dataSet; if($this-_mTemplate != '') { $output = $this-_mTemplate; - $output = preg_replace( '/###([-_|A-Za-z0-9]*?)###/e', \$this-processItem('\\1'), $output ); // TODO RBV (12.10.10 16:37): Könnte man das nicht etwas ansehnlicher mit preg_replace_callback gestalten? + $output = preg_replace_callback( + '/###([-_|A-Za-z0-9]*?)###/', + array( $this, 'processItem' ), + $output + ); + foreach( $dataSet as $key = $value ) { $output = str_replace('{'.$key.'}', $value, $output); } @@ -275,7 +284,9 @@ return $output; } - protected function processItem( $request ) { + public function processItem( $matches ) { + $request = $matches[1]; + // TODO MRG20100816: Ist diese Token-Syntax irgendwo beschrieben? Ausserdem müssen wir sicherstellen, dass // | nicht anderweitig verwendet wird. $tokens = explode( '|', $request ); @@ -286,7 +297,7 @@ if ( count( $tokens ) ) { $params = array(); foreach ( $tokens as $token ) { - if ( isset( $this-_mPresentDataset[$token] ) + if ( isset( $this-_mPresentDataset[$token] ) ) { $params[$token] = $this-_mPresentDataset[$token]; } -- To view, visit https://gerrit.wikimedia.org/r/173754 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic31f4fe2384bf46a88d4ca67e8f8ca19148203da Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: REL1_22 Gerrit-Owner: Robert Vogel vo...@hallowelt.biz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki: simplify apache config - change (operations/puppet)
Giuseppe Lavagetto has submitted this change and it was merged. Change subject: mediawiki: simplify apache config .. mediawiki: simplify apache config - use includes wherever possible - add a public rewrites include - add the configurable apple touch icon using this include. - make the math redirect now respects RW_PROTO if present - added retry=0 to all the proxypass directives This change supersedes Ieb55283f7b33c589bec71e9e17f170948a57d3b8 and I515deb3ae5e8a30435360fcace587ac298d0e73a . Change-Id: I440f2e37a437c96af4c7be7d1ca5255a16eecaa0 Signed-off-by: Giuseppe Lavagetto glavage...@wikimedia.org --- M modules/mediawiki/files/apache/sites/foundation.conf A modules/mediawiki/files/apache/sites/public-wiki-rewrites.incl M modules/mediawiki/files/apache/sites/remnant.conf M modules/mediawiki/files/apache/sites/wikimania.conf M modules/mediawiki/files/apache/sites/wikimedia-common.incl M modules/mediawiki/files/apache/sites/wikimedia.conf M modules/mediawiki/manifests/web/sites.pp 7 files changed, 37 insertions(+), 233 deletions(-) Approvals: Reedy: Looks good to me, but someone else must approve Giuseppe Lavagetto: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/mediawiki/files/apache/sites/foundation.conf b/modules/mediawiki/files/apache/sites/foundation.conf index e533a69..2b5c96d 100644 --- a/modules/mediawiki/files/apache/sites/foundation.conf +++ b/modules/mediawiki/files/apache/sites/foundation.conf @@ -20,19 +20,12 @@ # Primary wiki redirector: Alias /wiki /srv/mediawiki/docroot/foundation/w/index.php -RewriteRule ^/$ /w/index.php - -# UseMod compatibility URLs -RewriteCond %{QUERY_STRING} ([^;]+) -RewriteRule ^/wiki\.cgi$ %{ENV:RW_PROTO}://%{SERVER_NAME}/w/index.php?title=%1 [R=301,L] -RewriteRule ^/wiki\.cgi$ %{ENV:RW_PROTO}://%{SERVER_NAME}/w/index.php [R=301,L] +Include sites-enabled/public-wiki-rewrites.incl +Include sites-enabled/wikimedia-legacy.incl RewriteRule ^/math/(.*) %{ENV:RW_PROTO}://upload.wikimedia.org/math/$1 [R=301] RewriteRule ^/wiki/Donate$ https://donate.wikimedia.org/ [R=301,L] - -# Configurable favicon -RewriteRule ^/favicon\.ico$ /w/favicon.php [L] Directory /srv/mediawiki/docroot/foundation/w IfModule mod_php5.c diff --git a/modules/mediawiki/files/apache/sites/public-wiki-rewrites.incl b/modules/mediawiki/files/apache/sites/public-wiki-rewrites.incl new file mode 100644 index 000..f4ff058 --- /dev/null +++ b/modules/mediawiki/files/apache/sites/public-wiki-rewrites.incl @@ -0,0 +1,10 @@ +# Common include for all public wikis + +# Make robots.txt editable via Mediawiki:robots.txt +RewriteRule ^/robots\.txt$ /w/robots.php [L] +# Primary wiki redirector: +RewriteRule ^/$ /w/index.php +# Configurable favicon +RewriteRule ^/favicon\.ico$ /w/favicon.php [L] +# Configurable apple-touch-icon.png +RewriteRule ^/apple-touch-icon\.png$ /w/touch.php [L] diff --git a/modules/mediawiki/files/apache/sites/remnant.conf b/modules/mediawiki/files/apache/sites/remnant.conf index 0cb2f9b..0899cf5 100644 --- a/modules/mediawiki/files/apache/sites/remnant.conf +++ b/modules/mediawiki/files/apache/sites/remnant.conf @@ -30,20 +30,13 @@ # Primary wiki redirector: Alias /wiki /srv/mediawiki/docroot/wikisource.org/w/index.php -RewriteRule ^/$ /w/index.php - -# UseMod compatibility URLs -RewriteCond %{QUERY_STRING} ([^;]+) -RewriteRule ^/wiki\.cgi$ %{ENV:RW_PROTO}://%{SERVER_NAME}/w/index.php?title=%1 [R=301,L] -RewriteRule ^/wiki\.cgi$ %{ENV:RW_PROTO}://%{SERVER_NAME}/w/index.php [R=301,L] +Include sites-enabled/public-wiki-rewrites.incl +Include sites-enabled/wikimedia-legacy.incl RewriteRule ^/math/(.*) %{ENV:RW_PROTO}://upload.wikimedia.org/math/$1 [R=301] # Uploads are offsite RewriteRule ^/upload/(.*)$ %{ENV:RW_PROTO}://upload.wikimedia.org/wikipedia/sources/$1 [R=302] - -# Configurable favicon -RewriteRule ^/favicon\.ico$ /w/favicon.php [L] Directory /srv/mediawiki/docroot/wikisource.org/w IfModule mod_php5.c @@ -74,20 +67,13 @@ # Primary wiki redirector: Alias /wiki /srv/mediawiki/docroot/commons/w/index.php -RewriteRule ^/$ /w/index.php - -# UseMod compatibility URLs -RewriteCond %{QUERY_STRING} ([^;]+) -RewriteRule ^/wiki\.cgi$ %{ENV:RW_PROTO}://%{SERVER_NAME}/w/index.php?title=%1 [R=301,L] -RewriteRule ^/wiki\.cgi$ %{ENV:RW_PROTO}://%{SERVER_NAME}/w/index.php [R=301,L] +Include sites-enabled/public-wiki-rewrites.incl +Include sites-enabled/wikimedia-legacy.incl RewriteRule ^/math/(.*) %{ENV:RW_PROTO}://upload.wikimedia.org/math/$1 [R=301] # Uploads are offsite RewriteRule ^/upload/(.*)$ %{ENV:RW_PROTO}://upload.wikimedia.org/wikipedia/commons/$1 [R=302] - -# Configurable favicon -RewriteRule ^/favicon\.ico$