[MediaWiki-commits] [Gerrit] register with data types and use value formatters for claim ... - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/80868 Change subject: register with data types and use value formatters for claim autosummaries .. register with data types and use value formatters for claim autosummaries Change-Id: I60de6baddfe0e76815176e4bdf5832f2bf7ed3e8 --- M lib/includes/WikibaseDataTypeBuilders.php M repo/includes/ClaimSummaryBuilder.php M repo/tests/phpunit/includes/ClaimSummaryBuilderTest.php 3 files changed, 181 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/68/80868/2 diff --git a/lib/includes/WikibaseDataTypeBuilders.php b/lib/includes/WikibaseDataTypeBuilders.php index 3e2e746..ac0e140 100644 --- a/lib/includes/WikibaseDataTypeBuilders.php +++ b/lib/includes/WikibaseDataTypeBuilders.php @@ -1,14 +1,19 @@ entityLookup ); - return new DataType( $id, 'wikibase-entityid', array(), array(), $validators ); + $formatters = $this->getItemFormatters(); + + return new DataType( $id, 'wikibase-entityid', array(), $formatters, $validators ); } public function buildMediaType( $id ) { @@ -122,7 +129,11 @@ new CompositeValidator( $validators, true ) //Note: each validator is fatal ); - return new DataType( $id, 'string', array(), array(), array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) ); + $formatters = array( + 'default' => new StringFormatter( new FormatterOptions() ) + ); + + return new DataType( $id, 'string', array(), $formatters, array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) ); } public function buildStringType( $id ) { @@ -136,7 +147,11 @@ new CompositeValidator( $validators, true ) //Note: each validator is fatal ); - return new DataType( $id, 'string', array(), array(), array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) ); + $formatters = array( + 'default' => new StringFormatter( new FormatterOptions() ) + ); + + return new DataType( $id, 'string', array(), $formatters, array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) ); } public function buildTimeType( $id ) { @@ -171,7 +186,12 @@ new CompositeValidator( $validators, true ) //Note: each validator is fatal ); - return new DataType( $id, 'time', array(), array(), array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) ); + $formatters = array( + 'default' => new TimeFormatter( new FormatterOptions() ) + ); + + return new DataType( $id, 'time', array(), $formatters, + array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) ); } public function buildCoordinateType( $id ) { @@ -195,7 +215,17 @@ new CompositeValidator( $validators, true ) //Note: each validator is fatal ); - return new DataType( $id, 'globecoordinate', array(), array(), array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) ); + $formatters = array( + 'default' => new GlobeCoordinateFormatter( new FormatterOptions() ) + ); + + return new DataType( + $id, + 'globecoordinate', + array(), + $formatters, + array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) + ); } public function buildUrlType( $id ) { @@ -215,7 +245,54 @@ new CompositeValidator( $validators, true ) //Note: each validator is fatal ); - return new DataType( $id, 'string', array(), array(), array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) ); + $formatters = array( + 'default' => new StringFormatter( new FormatterOptions() ) + ); + + return new DataType( $id, 'string', array(), $formatters, + array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) ); + } + + /** +* @since 0.4 +* +* @return ValueFormatter[] +*/ + protected function getItemFormatters() { + $idFormatter = $this->getEntityIdFormatter(); + + $labelFormatter = new EntityIdLabelFormatter( + new FormatterOptions(), + $this->entityLookup + ); + $labelFormatter->setId
[MediaWiki-commits] [Gerrit] Add 'RedisPubSubFeedEngine' feed engine - change (mediawiki/core)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/80958 Change subject: Add 'RedisPubSubFeedEngine' feed engine .. Add 'RedisPubSubFeedEngine' feed engine This patch adds a class which implements the RCFeedEngine interface by publishing recent change notifications to Redis. The class handles the 'redis://' URI scheme. Recent changes are PUBLISHed to the channel 'rc'; a different channel name may be specified as a path component. Change-Id: I846036c091c45059a8947245a1efe92c9800dcf4 --- M includes/AutoLoader.php M includes/DefaultSettings.php A includes/rcfeed/RedisPubSubFeedEngine.php 3 files changed, 43 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/58/80958/1 diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index b830b16..364fe80 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -837,6 +837,7 @@ # includes/rcfeed 'RCFeedEngine' => 'includes/rcfeed/RCFeedEngine.php', + 'RedisPubSubFeedEngine' => 'includes/rcfeed/RedisPubSubFeedEngine.php', 'UDPRCFeedEngine' => 'includes/rcfeed/UDPRCFeedEngine.php', 'RCFeedFormatter' => 'includes/rcfeed/RCFeedFormatter.php', 'IRCColourfulRCFeedFormatter' => 'includes/rcfeed/IRCColourfulRCFeedFormatter.php', diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 20c72ee..6c8739b 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5474,6 +5474,7 @@ * Keys are scheme names, values are names of engine classes. */ $wgStreamLoggers = array( + 'redis' => 'RedisPubSubFeedEngine', 'udp' => 'UDPRCFeedEngine', ); diff --git a/includes/rcfeed/RedisPubSubFeedEngine.php b/includes/rcfeed/RedisPubSubFeedEngine.php new file mode 100644 index 000..cfa1bf7 --- /dev/null +++ b/includes/rcfeed/RedisPubSubFeedEngine.php @@ -0,0 +1,41 @@ + 'JSONRCFeedFormatter', +* 'uri' => "redis://127.0.0.1:6379/rc.$wgDBname", +* ); +* +* @since 1.22 +*/ + public function send( array $feed, $line ) { + $parsed = parse_url( $feed['uri'] ); + $server = $parsed['host']; + $options = array( 'serializer' => 'none' ); // serialization is the purview of the formatter. + $channel = 'rc'; + + if ( isset( $parsed['port'] ) ) { + $server .= ":{$parsed['port']}"; + } + if ( isset( $parsed['query'] ) ) { + parse_str( $parsed['query'], $options ); + } + if ( isset( $parsed['pass'] ) ) { + $options['password'] = $parsed['pass']; + } + if ( isset( $parsed['path'] ) ) { + $channel = str_replace( '/', '.', ltrim( $parsed['path'], '/' ) ); + } + $pool = RedisConnectionPool::singleton( $options ); + $conn = $pool->getConnection( $server ); + $conn->publish( $channel, $line ); + } +} -- To view, visit https://gerrit.wikimedia.org/r/80958 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I846036c091c45059a8947245a1efe92c9800dcf4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ori.livneh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update jquery.webfonts from upstream - change (mediawiki...UniversalLanguageSelector)
jenkins-bot has submitted this change and it was merged. Change subject: Update jquery.webfonts from upstream .. Update jquery.webfonts from upstream Bug: 49151 Change-Id: I9dd87f44c0465801ac225a1bdc6268e85f89911e --- M lib/jquery.webfonts.js 1 file changed, 14 insertions(+), 2 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/jquery.webfonts.js b/lib/jquery.webfonts.js index 72b41b6..b4c0b5e 100644 --- a/lib/jquery.webfonts.js +++ b/lib/jquery.webfonts.js @@ -103,10 +103,13 @@ // jQuery.css(). if ( fontFamily ) { this.load( fontFamily ); - fontStack.unshift( fontFamily ); + // Avoid duplicates + if ( $.inArray( fontFamily, fontStack ) < 0 ) { + fontStack.unshift( fontFamily ); + } } - if ( !fontFamily || fontFamily === this.originalFontFamily ) { + if ( !fontFamily ) { // We are resetting the font to original font. fontStack = []; // This will cause removing inline fontFamily style. @@ -204,7 +207,16 @@ // Load and apply fonts for other language tagged elements (batched) if ( element.lang && element.lang !== webfonts.language ) { + // Child element's language differs from parent. fontFamily = webfonts.getFont( element.lang ); + + if ( !fontFamily ) { + // If there is no explicit font for this language, it will + // inherit the webfont for the parent. But that is undesirable here + // since language is different. So inherit the original font of the + // element. Define it explicitly so that inheritance is broken. + fontFamily = webfonts.originalFontFamily; + } // We do not have fonts for all languages if ( fontFamily !== null ) { append( fontQueue, fontFamily ); -- To view, visit https://gerrit.wikimedia.org/r/80554 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9dd87f44c0465801ac225a1bdc6268e85f89911e Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Santhosh Gerrit-Reviewer: Amire80 Gerrit-Reviewer: KartikMistry Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add - Aggregator class. - change (analytics/user-metrics)
Rfaulk has submitted this change and it was merged. Change subject: add - Aggregator class. .. add - Aggregator class. Change-Id: Id050b7ccf6ac19449f3dff8e0cb7f4398547ba17 --- M user_metrics/etl/aggregator.py 1 file changed, 42 insertions(+), 1 deletion(-) Approvals: Rfaulk: Verified; Looks good to me, approved diff --git a/user_metrics/etl/aggregator.py b/user_metrics/etl/aggregator.py index 6d165b7..9a8c175 100644 --- a/user_metrics/etl/aggregator.py +++ b/user_metrics/etl/aggregator.py @@ -69,7 +69,6 @@ # 2. header attribute for a type of metric aggregation methods # 3. name attribute for a type of metric aggregation methods # 4. keyword arg attribute for a type of metric aggregation methods -# TODO - move these to the module dedicated for aggregation processing METRIC_AGG_METHOD_FLAG = 'metric_agg_flag' METRIC_AGG_METHOD_HEAD = 'metric_agg_head' METRIC_AGG_METHOD_NAME = 'metric_agg_name' @@ -330,3 +329,45 @@ """ Basic exception class for aggregators """ def __init__(self, message="Aggregation error."): Exception.__init__(self, message) + + +class Aggregator(object): +""" +Base class for aggregators. Standard method for applying aggregators. +This class family maintains internal state of the result. + +Each subclass will implement the data_etl & post_process methods. + +The method header returns the object properties that store the aggregated +results. +""" + +def __init__(self, method=None): +""" +Initialize the aggregator method +""" +self._method = method + +def data_etl(self, data): +""" +Handle +""" +return data + +def post_process(self, data): +""" +Define +""" +self._result = data + +def run(self, data): +""" +Pass data through aggregate method +""" +self.post_process( +self._method( +self.data_etl(data))) +return self + +def header(self): +return ['result'] -- To view, visit https://gerrit.wikimedia.org/r/80955 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id050b7ccf6ac19449f3dff8e0cb7f4398547ba17 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk Gerrit-Reviewer: Rfaulk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add - regex filtering in all_requests view. - change (analytics/user-metrics)
Rfaulk has submitted this change and it was merged. Change subject: add - regex filtering in all_requests view. .. add - regex filtering in all_requests view. Change-Id: Ia5bca30cf8c455ded37ea5c384ceae2773e9ef35 --- M user_metrics/api/views.py 1 file changed, 11 insertions(+), 4 deletions(-) Approvals: Rfaulk: Verified; Looks good to me, approved diff --git a/user_metrics/api/views.py b/user_metrics/api/views.py index 9b30545..03fbad0 100644 --- a/user_metrics/api/views.py +++ b/user_metrics/api/views.py @@ -479,6 +479,9 @@ all_data = read_pickle_data() key_sigs = list() +# Get a filter on the results +pattern = request.args.get('filter', '') + for key, val in all_data.iteritems(): if hasattr(val, '__iter__'): try: @@ -492,10 +495,14 @@ for key_sig in key_sigs: url = get_url_from_keys(key_sig, 'cohorts/') -url_list.append("".join(['', - url, - ''])) + +# Only filter pattern matches +if re.search(pattern, url): +url_list.append("".join(['', + url, + ''])) + return render_template('all_urls.html', urls=url_list) -- To view, visit https://gerrit.wikimedia.org/r/80957 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia5bca30cf8c455ded37ea5c384ceae2773e9ef35 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk Gerrit-Reviewer: Rfaulk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] rm - thin_client view method. - change (analytics/user-metrics)
Rfaulk has submitted this change and it was merged. Change subject: rm - thin_client view method. .. rm - thin_client view method. Change-Id: I36b9eec3ff6647dd9e90d22683db89167e203854 --- M user_metrics/api/views.py 1 file changed, 0 insertions(+), 23 deletions(-) Approvals: Rfaulk: Verified; Looks good to me, approved diff --git a/user_metrics/api/views.py b/user_metrics/api/views.py index 32b581b..9b30545 100644 --- a/user_metrics/api/views.py +++ b/user_metrics/api/views.py @@ -499,26 +499,6 @@ return render_template('all_urls.html', urls=url_list) -def thin_client_view(): -""" -View for handling requests outside sessions. Useful for processing -jobs from https://github.com/rfaulkner/umapi_client. - -Returns: - -1) JSON response if the request is complete -2) Validation response (minimal size) -""" - -# Validate key -# Construct request meta -# Check for job cached -# If YES return -# If NO queue job, return verify - -return None - - # Add View Decorators # ## @@ -534,7 +514,6 @@ all_metrics.__name__: all_metrics, about.__name__: about, contact.__name__: contact, -thin_client_view.__name__: thin_client_view, upload_csv_cohort.__name__: upload_csv_cohort, upload_csv_cohort_finish.__name__: upload_csv_cohort_finish, validate_cohort_name_allowed.__name__: validate_cohort_name_allowed, @@ -562,7 +541,6 @@ all_metrics.__name__: app.route('/metrics/', methods=['POST', 'GET']), about.__name__: app.route('/about/'), contact.__name__: app.route('/contact/'), -thin_client_view.__name__: app.route('/thin//'), upload_csv_cohort_finish.__name__: app.route('/uploads/cohort/finish', methods=['POST']), upload_csv_cohort.__name__: app.route('/uploads/cohort', methods=['POST', 'GET']), validate_cohort_name_allowed.__name__: app.route('/validate/cohort/allowed', methods=['GET']), @@ -575,7 +553,6 @@ all_metrics.__name__, about.__name__, contact.__name__, -thin_client_view.__name__ ] # Apply decorators to views -- To view, visit https://gerrit.wikimedia.org/r/80956 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I36b9eec3ff6647dd9e90d22683db89167e203854 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk Gerrit-Reviewer: Rfaulk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] rm - thin_client view method. - change (analytics/user-metrics)
Rfaulk has uploaded a new change for review. https://gerrit.wikimedia.org/r/80956 Change subject: rm - thin_client view method. .. rm - thin_client view method. Change-Id: I36b9eec3ff6647dd9e90d22683db89167e203854 --- M user_metrics/api/views.py 1 file changed, 0 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/user-metrics refs/changes/56/80956/1 diff --git a/user_metrics/api/views.py b/user_metrics/api/views.py index 32b581b..9b30545 100644 --- a/user_metrics/api/views.py +++ b/user_metrics/api/views.py @@ -499,26 +499,6 @@ return render_template('all_urls.html', urls=url_list) -def thin_client_view(): -""" -View for handling requests outside sessions. Useful for processing -jobs from https://github.com/rfaulkner/umapi_client. - -Returns: - -1) JSON response if the request is complete -2) Validation response (minimal size) -""" - -# Validate key -# Construct request meta -# Check for job cached -# If YES return -# If NO queue job, return verify - -return None - - # Add View Decorators # ## @@ -534,7 +514,6 @@ all_metrics.__name__: all_metrics, about.__name__: about, contact.__name__: contact, -thin_client_view.__name__: thin_client_view, upload_csv_cohort.__name__: upload_csv_cohort, upload_csv_cohort_finish.__name__: upload_csv_cohort_finish, validate_cohort_name_allowed.__name__: validate_cohort_name_allowed, @@ -562,7 +541,6 @@ all_metrics.__name__: app.route('/metrics/', methods=['POST', 'GET']), about.__name__: app.route('/about/'), contact.__name__: app.route('/contact/'), -thin_client_view.__name__: app.route('/thin//'), upload_csv_cohort_finish.__name__: app.route('/uploads/cohort/finish', methods=['POST']), upload_csv_cohort.__name__: app.route('/uploads/cohort', methods=['POST', 'GET']), validate_cohort_name_allowed.__name__: app.route('/validate/cohort/allowed', methods=['GET']), @@ -575,7 +553,6 @@ all_metrics.__name__, about.__name__, contact.__name__, -thin_client_view.__name__ ] # Apply decorators to views -- To view, visit https://gerrit.wikimedia.org/r/80956 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I36b9eec3ff6647dd9e90d22683db89167e203854 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add - Aggregator class. - change (analytics/user-metrics)
Rfaulk has uploaded a new change for review. https://gerrit.wikimedia.org/r/80955 Change subject: add - Aggregator class. .. add - Aggregator class. Change-Id: Id050b7ccf6ac19449f3dff8e0cb7f4398547ba17 --- M user_metrics/etl/aggregator.py 1 file changed, 42 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/user-metrics refs/changes/55/80955/1 diff --git a/user_metrics/etl/aggregator.py b/user_metrics/etl/aggregator.py index 6d165b7..9a8c175 100644 --- a/user_metrics/etl/aggregator.py +++ b/user_metrics/etl/aggregator.py @@ -69,7 +69,6 @@ # 2. header attribute for a type of metric aggregation methods # 3. name attribute for a type of metric aggregation methods # 4. keyword arg attribute for a type of metric aggregation methods -# TODO - move these to the module dedicated for aggregation processing METRIC_AGG_METHOD_FLAG = 'metric_agg_flag' METRIC_AGG_METHOD_HEAD = 'metric_agg_head' METRIC_AGG_METHOD_NAME = 'metric_agg_name' @@ -330,3 +329,45 @@ """ Basic exception class for aggregators """ def __init__(self, message="Aggregation error."): Exception.__init__(self, message) + + +class Aggregator(object): +""" +Base class for aggregators. Standard method for applying aggregators. +This class family maintains internal state of the result. + +Each subclass will implement the data_etl & post_process methods. + +The method header returns the object properties that store the aggregated +results. +""" + +def __init__(self, method=None): +""" +Initialize the aggregator method +""" +self._method = method + +def data_etl(self, data): +""" +Handle +""" +return data + +def post_process(self, data): +""" +Define +""" +self._result = data + +def run(self, data): +""" +Pass data through aggregate method +""" +self.post_process( +self._method( +self.data_etl(data))) +return self + +def header(self): +return ['result'] -- To view, visit https://gerrit.wikimedia.org/r/80955 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id050b7ccf6ac19449f3dff8e0cb7f4398547ba17 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add - regex filtering in all_requests view. - change (analytics/user-metrics)
Rfaulk has uploaded a new change for review. https://gerrit.wikimedia.org/r/80957 Change subject: add - regex filtering in all_requests view. .. add - regex filtering in all_requests view. Change-Id: Ia5bca30cf8c455ded37ea5c384ceae2773e9ef35 --- M user_metrics/api/views.py 1 file changed, 11 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/user-metrics refs/changes/57/80957/1 diff --git a/user_metrics/api/views.py b/user_metrics/api/views.py index 9b30545..03fbad0 100644 --- a/user_metrics/api/views.py +++ b/user_metrics/api/views.py @@ -479,6 +479,9 @@ all_data = read_pickle_data() key_sigs = list() +# Get a filter on the results +pattern = request.args.get('filter', '') + for key, val in all_data.iteritems(): if hasattr(val, '__iter__'): try: @@ -492,10 +495,14 @@ for key_sig in key_sigs: url = get_url_from_keys(key_sig, 'cohorts/') -url_list.append("".join(['', - url, - ''])) + +# Only filter pattern matches +if re.search(pattern, url): +url_list.append("".join(['', + url, + ''])) + return render_template('all_urls.html', urls=url_list) -- To view, visit https://gerrit.wikimedia.org/r/80957 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia5bca30cf8c455ded37ea5c384ceae2773e9ef35 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make Phetsarath font default for Lao - change (mediawiki...UniversalLanguageSelector)
jenkins-bot has submitted this change and it was merged. Change subject: Make Phetsarath font default for Lao .. Make Phetsarath font default for Lao Bug: 52962 Change-Id: I5da0d2d3ca08f3eb3a09800e03e9d25ecdba0286 --- M data/fontrepo/fonts/Phetsarath/font.ini M resources/js/ext.uls.webfonts.repository.js 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Amire80: Looks good to me, approved jenkins-bot: Verified diff --git a/data/fontrepo/fonts/Phetsarath/font.ini b/data/fontrepo/fonts/Phetsarath/font.ini index f745bd3..910797c 100644 --- a/data/fontrepo/fonts/Phetsarath/font.ini +++ b/data/fontrepo/fonts/Phetsarath/font.ini @@ -1,5 +1,5 @@ [Phetsarath] -languages=lo +languages=lo* version=1.01 license=OFL licensefile=OFL.txt diff --git a/resources/js/ext.uls.webfonts.repository.js b/resources/js/ext.uls.webfonts.repository.js index 771ba8d..2925b8b 100644 --- a/resources/js/ext.uls.webfonts.repository.js +++ b/resources/js/ext.uls.webfonts.repository.js @@ -1,5 +1,5 @@ // Do not edit! This file is generated from data/fontrepo by data/fontrepo/scripts/compile.php ( function ( $ ) { $.webfonts = $.webfonts || {}; - $.webfonts.repository = {"base":"..\/data\/fontrepo\/fonts\/","languages":{"af":["system","OpenDyslexic"],"ahr":["Lohit Marathi"],"akk":["Akkadian"],"am":["AbyssinicaSIL"],"ang":["system","Junicode"],"ar":["Amiri"],"arb":["Amiri"],"arc":["Estarngelo Edessa","East Syriac Adiabene","SertoUrhoy"],"as":["system","Lohit Assamese"],"bh":["Lohit Devanagari"],"bho":["Lohit Devanagari"],"bk":["system","OpenDyslexic"],"bn":["Siyam Rupali","Lohit Bengali"],"bo":["Jomolhari"],"bpy":["Siyam Rupali","Lohit Bengali"],"bug":["Saweri"],"ca":["system","OpenDyslexic"],"cdo":["CharisSIL"],"cr":["OskiEast"],"cy":["system","OpenDyslexic"],"da":["system","OpenDyslexic"],"de":["system","OpenDyslexic"],"dv":["FreeFont-Thaana"],"dz":["Jomolhari"],"en":["system","OpenDyslexic"],"es":["system","OpenDyslexic"],"et":["system","OpenDyslexic"],"fa":["system","Iranian Sans","Nazli","Amiri"],"fi":["system","OpenDyslexic"],"fo":["system","OpenDyslexic"],"fr":["system","OpenDyslexic"],"fy":["system","OpenDyslexic"],"ga":["system","OpenDyslexic"],"gd":["system","OpenDyslexic"],"gl":["system","OpenDyslexic"],"gom":["Lohit Devanagari"],"grc":["system","GentiumPlus"],"gu":["Lohit Gujarati"],"hbo":["Taamey Frank CLM","Alef"],"he":["system","Alef","Miriam CLM","Taamey Frank CLM"],"hi":["Lohit Devanagari"],"hu":["system","OpenDyslexic"],"id":["system","OpenDyslexic"],"ii":["Nuosu SIL"],"is":["system","OpenDyslexic"],"it":["system","OpenDyslexic"],"iu":["system","OskiEast"],"jv":["system","Tuladha Jejeg"],"jv-java":["Tuladha Jejeg"],"km":["KhmerOSbattambang","KhmerOS","KhmerOSbokor","KhmerOSfasthand","KhmerOSfreehand","KhmerOSmuol","KhmerOSmuollight","KhmerOSmuolpali","KhmerOSsiemreap"],"kn":["Lohit Kannada","Gubbi"],"kok":["Lohit Devanagari"],"lb":["system","OpenDyslexic"],"li":["system","OpenDyslexic"],"lo":["system","Phetsarath"],"mai":["Lohit Devanagari"],"mak":["Saweri"],"mi":["system","OpenDyslexic"],"ml":["system","AnjaliOldLipi","Meera"],"mr":["Lohit Marathi"],"ms":["system","OpenDyslexic"],"my":["TharLon","Myanmar3","Padauk"],"nan":["Doulos SIL","CharisSIL"],"nb":["system","OpenDyslexic"],"ne":["Lohit Nepali","Madan"],"nl":["system","OpenDyslexic"],"oc":["system","OpenDyslexic"],"or":["Lohit Oriya","Utkal"],"pa":["Lohit Punjabi","Saab"],"pal":["Shapour"],"peo":["Xerxes"],"pt":["system","OpenDyslexic"],"sa":["Lohit Devanagari"],"saz":["Pagul"],"si":["system","lklug"],"sq":["system","OpenDyslexic"],"sux":["Akkadian"],"sv":["system","OpenDyslexic"],"sw":["system","OpenDyslexic"],"syc":["Estarngelo Edessa","East Syriac Adiabene","SertoUrhoy"],"ta":["system","Lohit Tamil","Lohit Tamil Classical","Thendral","Thenee"],"tcy":["Lohit Kannada","Gubbi"],"te":["Lohit Telugu"],"ti":["AbyssinicaSIL"],"tl":["system","OpenDyslexic"],"tr":["system","OpenDyslexic"],"ur":["system","NafeesWeb"],"wa":["system","OpenDyslexic"],"yi":["system","Alef"]},"fonts":{"AbyssinicaSIL":{"version":"1.200","license":"OFL 1.1","eot":"AbyssinicaSIL\/AbyssinicaSIL-R.eot","ttf":"AbyssinicaSIL\/AbyssinicaSIL-R.ttf","woff":"AbyssinicaSIL\/AbyssinicaSIL-R.woff"},"Akkadian":{"version":"2.56","license":"George-Douros","eot":"Akkadian\/Akkadian.eot","ttf":"Akkadian\/Akkadian.ttf","woff":"Akkadian\/Akkadian.woff"},"Alef":{"version":"1.0","license":"OFL 1.1","ttf":"Alef\/Alef-Regular.ttf","eot":"Alef\/Alef-Regular.eot","woff":"Alef\/Alef-Regular.woff","variants":{"bold":"Alef Bold"}},"Alef Bold":{"version":"1.0","license":"OFL 1.1","fontweight":"bold","ttf":"Alef\/Alef-Bold.ttf","eot":"Alef\/Alef-Bold.eot","woff":"Alef\/Alef-Bold.woff"},"Amiri":{"version":"1.0.2","license":"OFL 1.1","ttf":"amiri\/amiri-regular.ttf","eot":"amiri\/amiri-regular.eot","woff":"amiri\/amiri-regular.woff","variants":{"bold":"Amiri Bold","bolditalic
[MediaWiki-commits] [Gerrit] Pass an actual array to fontStack option to webfonts - change (mediawiki...UniversalLanguageSelector)
jenkins-bot has submitted this change and it was merged. Change subject: Pass an actual array to fontStack option to webfonts .. Pass an actual array to fontStack option to webfonts Change-Id: Id836d7ce82e22e7d0679a5c615be014b1fce08b3 --- M resources/js/ext.uls.webfonts.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/js/ext.uls.webfonts.js b/resources/js/ext.uls.webfonts.js index 0c524a7..c0922bc 100644 --- a/resources/js/ext.uls.webfonts.js +++ b/resources/js/ext.uls.webfonts.js @@ -87,7 +87,7 @@ // MediaWiki specific overrides for jquery.webfonts $.extend( $.fn.webfonts.defaults, { repository: mediawikiFontRepository, - fontStack: new Array( $( 'body' ).css( 'font-family' ) ) + fontStack: $( 'body' ).css( 'font-family' ).split( /, /g ) } ); mw.webfonts.preferences.load(); -- To view, visit https://gerrit.wikimedia.org/r/80555 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id836d7ce82e22e7d0679a5c615be014b1fce08b3 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Santhosh Gerrit-Reviewer: Amire80 Gerrit-Reviewer: KartikMistry Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: Santhosh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make OskiEast font default for Canadian Syllabic - change (mediawiki...UniversalLanguageSelector)
jenkins-bot has submitted this change and it was merged. Change subject: Make OskiEast font default for Canadian Syllabic .. Make OskiEast font default for Canadian Syllabic Change-Id: Ie928de294ec0dee5482fb93d4333ab5df9d1c843 --- M data/fontrepo/fonts/OskiEast/font.ini M resources/js/ext.uls.webfonts.repository.js 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Santhosh: Looks good to me, approved jenkins-bot: Verified diff --git a/data/fontrepo/fonts/OskiEast/font.ini b/data/fontrepo/fonts/OskiEast/font.ini index b7bc375..36b7f06 100644 --- a/data/fontrepo/fonts/OskiEast/font.ini +++ b/data/fontrepo/fonts/OskiEast/font.ini @@ -1,5 +1,5 @@ [OskiEast] -languages=cr, iu +languages=cr*, iu version=2.200 license=GPL-3 licensefile=gpl-3.0.txt diff --git a/resources/js/ext.uls.webfonts.repository.js b/resources/js/ext.uls.webfonts.repository.js index 0957004..771ba8d 100644 --- a/resources/js/ext.uls.webfonts.repository.js +++ b/resources/js/ext.uls.webfonts.repository.js @@ -1,5 +1,5 @@ // Do not edit! This file is generated from data/fontrepo by data/fontrepo/scripts/compile.php ( function ( $ ) { $.webfonts = $.webfonts || {}; - $.webfonts.repository = {"base":"..\/data\/fontrepo\/fonts\/","languages":{"af":["system","OpenDyslexic"],"ahr":["Lohit Marathi"],"akk":["Akkadian"],"am":["AbyssinicaSIL"],"ang":["system","Junicode"],"ar":["Amiri"],"arb":["Amiri"],"arc":["Estarngelo Edessa","East Syriac Adiabene","SertoUrhoy"],"as":["system","Lohit Assamese"],"bh":["Lohit Devanagari"],"bho":["Lohit Devanagari"],"bk":["system","OpenDyslexic"],"bn":["Siyam Rupali","Lohit Bengali"],"bo":["Jomolhari"],"bpy":["Siyam Rupali","Lohit Bengali"],"bug":["Saweri"],"ca":["system","OpenDyslexic"],"cdo":["CharisSIL"],"cr":["system","OskiEast"],"cy":["system","OpenDyslexic"],"da":["system","OpenDyslexic"],"de":["system","OpenDyslexic"],"dv":["FreeFont-Thaana"],"dz":["Jomolhari"],"en":["system","OpenDyslexic"],"es":["system","OpenDyslexic"],"et":["system","OpenDyslexic"],"fa":["system","Iranian Sans","Nazli","Amiri"],"fi":["system","OpenDyslexic"],"fo":["system","OpenDyslexic"],"fr":["system","OpenDyslexic"],"fy":["system","OpenDyslexic"],"ga":["system","OpenDyslexic"],"gd":["system","OpenDyslexic"],"gl":["system","OpenDyslexic"],"gom":["Lohit Devanagari"],"grc":["system","GentiumPlus"],"gu":["Lohit Gujarati"],"hbo":["Taamey Frank CLM","Alef"],"he":["system","Alef","Miriam CLM","Taamey Frank CLM"],"hi":["Lohit Devanagari"],"hu":["system","OpenDyslexic"],"id":["system","OpenDyslexic"],"ii":["Nuosu SIL"],"is":["system","OpenDyslexic"],"it":["system","OpenDyslexic"],"iu":["system","OskiEast"],"jv":["system","Tuladha Jejeg"],"jv-java":["Tuladha Jejeg"],"km":["KhmerOSbattambang","KhmerOS","KhmerOSbokor","KhmerOSfasthand","KhmerOSfreehand","KhmerOSmuol","KhmerOSmuollight","KhmerOSmuolpali","KhmerOSsiemreap"],"kn":["Lohit Kannada","Gubbi"],"kok":["Lohit Devanagari"],"lb":["system","OpenDyslexic"],"li":["system","OpenDyslexic"],"lo":["system","Phetsarath"],"mai":["Lohit Devanagari"],"mak":["Saweri"],"mi":["system","OpenDyslexic"],"ml":["system","AnjaliOldLipi","Meera"],"mr":["Lohit Marathi"],"ms":["system","OpenDyslexic"],"my":["TharLon","Myanmar3","Padauk"],"nan":["Doulos SIL","CharisSIL"],"nb":["system","OpenDyslexic"],"ne":["Lohit Nepali","Madan"],"nl":["system","OpenDyslexic"],"oc":["system","OpenDyslexic"],"or":["Lohit Oriya","Utkal"],"pa":["Lohit Punjabi","Saab"],"pal":["Shapour"],"peo":["Xerxes"],"pt":["system","OpenDyslexic"],"sa":["Lohit Devanagari"],"saz":["Pagul"],"si":["system","lklug"],"sq":["system","OpenDyslexic"],"sux":["Akkadian"],"sv":["system","OpenDyslexic"],"sw":["system","OpenDyslexic"],"syc":["Estarngelo Edessa","East Syriac Adiabene","SertoUrhoy"],"ta":["system","Lohit Tamil","Lohit Tamil Classical","Thendral","Thenee"],"tcy":["Lohit Kannada","Gubbi"],"te":["Lohit Telugu"],"ti":["AbyssinicaSIL"],"tl":["system","OpenDyslexic"],"tr":["system","OpenDyslexic"],"ur":["system","NafeesWeb"],"wa":["system","OpenDyslexic"],"yi":["system","Alef"]},"fonts":{"AbyssinicaSIL":{"version":"1.200","license":"OFL 1.1","eot":"AbyssinicaSIL\/AbyssinicaSIL-R.eot","ttf":"AbyssinicaSIL\/AbyssinicaSIL-R.ttf","woff":"AbyssinicaSIL\/AbyssinicaSIL-R.woff"},"Akkadian":{"version":"2.56","license":"George-Douros","eot":"Akkadian\/Akkadian.eot","ttf":"Akkadian\/Akkadian.ttf","woff":"Akkadian\/Akkadian.woff"},"Alef":{"version":"1.0","license":"OFL 1.1","ttf":"Alef\/Alef-Regular.ttf","eot":"Alef\/Alef-Regular.eot","woff":"Alef\/Alef-Regular.woff","variants":{"bold":"Alef Bold"}},"Alef Bold":{"version":"1.0","license":"OFL 1.1","fontweight":"bold","ttf":"Alef\/Alef-Bold.ttf","eot":"Alef\/Alef-Bold.eot","woff":"Alef\/Alef-Bold.woff"},"Amiri":{"version":"1.0.2","license":"OFL 1.1","ttf":"amiri\/amiri-regular.ttf","eot":"amiri\/amiri-regular.eot","woff":"amiri\/amiri-regular.woff","variants":{"bold":
[MediaWiki-commits] [Gerrit] Last few files in resources/ jshint fixes - change (mediawiki...UploadWizard)
MarkTraceur has uploaded a new change for review. https://gerrit.wikimedia.org/r/80954 Change subject: Last few files in resources/ jshint fixes .. Last few files in resources/ jshint fixes Change-Id: I0710fd5fb9ce8ad21b7d3a45834fa8955944e433 --- M resources/mw.UploadWizardUploadInterface.js M resources/mw.UploadWizardUtil.js M resources/mw.UtilitiesTime.js M resources/mw.fileApi.js 4 files changed, 155 insertions(+), 149 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/54/80954/1 diff --git a/resources/mw.UploadWizardUploadInterface.js b/resources/mw.UploadWizardUploadInterface.js index f494098..58bb1f2 100644 --- a/resources/mw.UploadWizardUploadInterface.js +++ b/resources/mw.UploadWizardUploadInterface.js @@ -7,32 +7,33 @@ ( function( mw, $ ) { mw.UploadWizardUploadInterface = function( upload, filesDiv, providedFile ) { - var _this = this; + var $preview, + ui = this; - _this.upload = upload; + this.upload = upload; - _this.providedFile = providedFile; + this.providedFile = providedFile; // may need to collaborate with the particular upload type sometimes // for the interface, as well as the uploadwizard. OY. - _this.div = $('').get(0); - _this.isFilled = false; + this.div = $('').get(0); + this.isFilled = false; - _this.previewLoaded = false; + this.previewLoaded = false; - _this.$fileInputCtrl = $( '' ); + this.$fileInputCtrl = $( '' ); if (mw.UploadWizard.config.enableFormData && mw.fileApi.isFormDataAvailable() && mw.UploadWizard.config.enableMultiFileSelect && mw.UploadWizard.config.enableMultipleFiles ) { // Multiple uploads requires the FormData transport - _this.$fileInputCtrl.attr( 'multiple', '1' ); + this.$fileInputCtrl.attr( 'multiple', '1' ); } - _this.initFileInputCtrl(); + this.initFileInputCtrl(); - _this.$indicator = $( '' ); + this.$indicator = $( '' ); - _this.visibleFilenameDiv = $('') - .append( _this.$indicator ) + this.visibleFilenameDiv = $('') + .append( this.$indicator ) .append( '' + '' + @@ -45,31 +46,31 @@ '' ); - _this.$removeCtrl = $.fn.removeCtrl( + this.$removeCtrl = $.fn.removeCtrl( 'mwe-upwiz-remove', 'mwe-upwiz-remove-upload', function() { - _this.upload.remove(); - _this.cancelPositionTracking(); + ui.upload.remove(); + ui.cancelPositionTracking(); } - ).addClass( "mwe-upwiz-file-status-line-item" ); + ).addClass( 'mwe-upwiz-file-status-line-item' ); - _this.visibleFilenameDiv.find( '.mwe-upwiz-file-status-line' ) - .append( _this.$removeCtrl ); + this.visibleFilenameDiv.find( '.mwe-upwiz-file-status-line' ) + .append( this.$removeCtrl ); // Add show thumbnail control - //_this.errorDiv = $('').get(0); + //this.errorDiv = $('').get(0); - _this.filenameCtrl = $('').get(0); + this.filenameCtrl = $('').get(0); // this file Ctrl container is placed over other interface elements, intercepts clicks and gives them to the file input control. // however, we want to pass hover events to interface elements that we are over, hence the bindings. // n.b. not using toggleClass because it often gets this event wrong -- relies on previous state to know what to do - _this.fileCtrlContainer = $(''); + this.fileCtrlContainer = $(''); /* - .bind( 'mouseenter', function(e) { _this.addFileCtrlHover(e); } ) - .bind( 'mouseleave', function(e) { _this.removeFileCtrlHover(e); } ); + .bind( 'mouseenter', function(e) { this.addFileCtrlHover(e); } ) + .bind( 'mouseleave', function(e) { this.removeFileCtrlHover(e); } ); */ @@ -79,11 +80,11 @@ // which works as a file input. It will be set to opacity:0 and then we can do whatever we want with // interface "below". // XXX caution -- if the add file input changes size we won't match, unless we add some sort of event to catch this. - _this.form = $( '' ) - .attr( { action: _this.upload.api.defaults.url } ) - .append( _this.visibleFilenameDiv ) - .append( _this.fileCtrlContainer ) - .append( _this.filenameCtrl ) + this.form = $( '' ) +
[MediaWiki-commits] [Gerrit] I2443700370c3679e6db3aab3845efd7d00bca7d1 - change (xowa)
Gnosygnu has uploaded a new change for review. https://gerrit.wikimedia.org/r/80952 Change subject: I2443700370c3679e6db3aab3845efd7d00bca7d1 .. I2443700370c3679e6db3aab3845efd7d00bca7d1 Change-Id: Idccf1e5aa6a38c9413c997d89cb650d386729283 --- M .metadata/.log M .metadata/.plugins/org.eclipse.core.resources/.projects/100_core/.markers M .metadata/.plugins/org.eclipse.core.resources/.projects/100_core/org.eclipse.jdt.core/state.dat M .metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/.markers M .metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/org.eclipse.jdt.core/state.dat M .metadata/.plugins/org.eclipse.core.resources/.projects/140_dbs/.markers M .metadata/.plugins/org.eclipse.core.resources/.projects/140_dbs/org.eclipse.jdt.core/state.dat M .metadata/.plugins/org.eclipse.core.resources/.projects/150_gfui/.markers M .metadata/.plugins/org.eclipse.core.resources/.projects/150_gfui/org.eclipse.jdt.core/state.dat M .metadata/.plugins/org.eclipse.core.resources/.projects/400_xowa/.markers M .metadata/.plugins/org.eclipse.core.resources/.projects/400_xowa/org.eclipse.jdt.core/state.dat M .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index M .metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources M .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs M .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs M .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs M .metadata/.plugins/org.eclipse.jdt.launching/.install.xml M .metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml M .metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml M .metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml M .metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml M .metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties M .metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml M .metadata/.plugins/org.eclipse.ui.workbench/workbench.xml 24 files changed, 25 insertions(+), 25 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/xowa refs/changes/52/80952/1 diff --git a/.metadata/.log b/.metadata/.log index 8c1f80a..6522cfd 100644 --- a/.metadata/.log +++ b/.metadata/.log @@ -481,7 +481,7 @@ !ENTRY org.eclipse.jdt.core 4 0 2013-03-06 20:41:57.796 !MESSAGE Invalid ZIP archive: lib/swt.jar [in 150_gfui] -<<< HEAD (d75126 initial commit:2013-08-26) +<<< HEAD === !SESSION 2013-08-25 22:58:47.491 --- eclipse.buildId=M20120208-0800 @@ -909,4 +909,4 @@ !MESSAGE Could not find view: com.android.ide.eclipse.ddms.views.LogCatView !SUBENTRY 1 unknown 0 0 2013-08-25 22:59:03.162 !MESSAGE OK ->>> BRANCH (084463 initial commit:2013-08-26) +>>> 08446399ad3aacf564be7bf1246f5461be88f3a1 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/100_core/.markers b/.metadata/.plugins/org.eclipse.core.resources/.projects/100_core/.markers index 41dcf37..720e247 100644 --- a/.metadata/.plugins/org.eclipse.core.resources/.projects/100_core/.markers +++ b/.metadata/.plugins/org.eclipse.core.resources/.projects/100_core/.markers Binary files differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/100_core/org.eclipse.jdt.core/state.dat b/.metadata/.plugins/org.eclipse.core.resources/.projects/100_core/org.eclipse.jdt.core/state.dat index 97d7e1f..336c566 100644 --- a/.metadata/.plugins/org.eclipse.core.resources/.projects/100_core/org.eclipse.jdt.core/state.dat +++ b/.metadata/.plugins/org.eclipse.core.resources/.projects/100_core/org.eclipse.jdt.core/state.dat Binary files differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/.markers b/.metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/.markers index 2d5f865..cb1190c 100644 --- a/.metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/.markers +++ b/.metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/.markers Binary files differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/org.eclipse.jdt.core/state.dat b/.metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/org.eclipse.jdt.core/state.dat index cdebb73..fc03cca 100644 --- a/.metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/org.eclipse.jdt.core/state.dat +++ b/.metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/org.eclipse.jdt.core/state.dat Binary files differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/140_dbs/.markers b/.metadata/.plugins/org.eclipse.core.resources/.projects/140_dbs/.markers index a18c08b..69502a1 100644 --- a/.metadata/.plugins/org.eclipse.core.resources/.projects/140_dbs/.markers +++ b/.metadata/.plugins/org.eclipse.core.resources/.projects/140_dbs/.marker
[MediaWiki-commits] [Gerrit] Provide a JSON recent changes feed. - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Provide a JSON recent changes feed. .. Provide a JSON recent changes feed. This introduces a new configuration variable, $wgRCFeeds, which allows the user to configure multiple destinations for RC notifications. It also allows the notification format to be customized. Two formats are included by default: the older IRC format and a new JSON format. Change-Id: I270bde418a82985c94372ac4579100435b6ee026 --- M RELEASE-NOTES-1.22 M includes/AutoLoader.php M includes/DefaultSettings.php M includes/RecentChange.php M includes/Setup.php M includes/logging/LogEntry.php A includes/rcfeed/IRCColourfulRCFeedFormatter.php A includes/rcfeed/JSONRCFeedFormatter.php A includes/rcfeed/RCFeedEngine.php A includes/rcfeed/RCFeedFormatter.php A includes/rcfeed/UDPRCFeedEngine.php M tests/phpunit/includes/RecentChangeTest.php 12 files changed, 380 insertions(+), 123 deletions(-) Approvals: Parent5446: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 239d997..50e2732 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -49,6 +49,11 @@ * The checkbox for staying in HTTPS displayed on the login form when $wgSecureLogin is enabled has been removed. Instead, whether the user stays in HTTPS will be determined based on the user's preferences, and whether they came from HTTPS or not. +* $wgRC2UDPAddress, $wgRC2UDPInterwikiPrefix, $wgRC2UDPOmitBots, $wgRC2UDPPort, + and $wgRC2UDPPrefix configuration options have been deprecated in favor of a + $wgRCFeeds configuration array. $wgRCFeeds makes both the format and + destination of recent change notifications customizable, and allows for + multiple destinations to be specified. === New features in 1.22 === * (bug 44525) mediawiki.jqueryMsg can now parse (whitelisted) HTML elements and attributes. @@ -403,6 +408,11 @@ have been deprecated in favour of using mw.hook. * The 'showjumplinks' user preference has been removed, jump links are now always included. +* Methods RecentChange::notifyRC2UDP, RecentChange::sendToUDP, and + RecentChange::cleanupForIRC have been deprecated, as it is now the + responsibility of classes implementing the RCFeedFormatter and RCFeedEngine + interfaces to implement the formatting and delivery for recent change + notifications. == Compatibility == diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 2f92ab0..b830b16 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -835,6 +835,13 @@ 'ProfilerStub' => 'includes/profiler/ProfilerStub.php', 'ProfileSection' => 'includes/profiler/Profiler.php', + # includes/rcfeed + 'RCFeedEngine' => 'includes/rcfeed/RCFeedEngine.php', + 'UDPRCFeedEngine' => 'includes/rcfeed/UDPRCFeedEngine.php', + 'RCFeedFormatter' => 'includes/rcfeed/RCFeedFormatter.php', + 'IRCColourfulRCFeedFormatter' => 'includes/rcfeed/IRCColourfulRCFeedFormatter.php', + 'JSONRCFeedFormatter' => 'includes/rcfeed/JSONRCFeedFormatter.php', + # includes/resourceloader 'ResourceLoader' => 'includes/resourceloader/ResourceLoader.php', 'ResourceLoaderContext' => 'includes/resourceloader/ResourceLoaderContext.php', diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 92cbab3..20c72ee 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5394,11 +5394,15 @@ /** * Send recent changes updates via UDP. The updates will be formatted for IRC. * Set this to the IP address of the receiver. + * + * @deprecated since 1.22, use $wgRCFeeds */ $wgRC2UDPAddress = false; /** * Port number for RC updates + * + * @deprecated since 1.22, use $wgRCFeeds */ $wgRC2UDPPort = false; @@ -5407,22 +5411,73 @@ * This can be used to identify the wiki. A script is available called * mxircecho.py which listens on a UDP port, and uses a prefix ending in a * tab to identify the IRC channel to send the log line to. + * + * @deprecated since 1.22, use $wgRCFeeds */ $wgRC2UDPPrefix = ''; /** * If this is set to true, $wgLocalInterwiki will be prepended to links in the * IRC feed. If this is set to a string, that string will be used as the prefix. + * + * @deprecated since 1.22, use $wgRCFeeds */ $wgRC2UDPInterwikiPrefix = false; /** * Set to true to omit "bot" edits (by users with the bot permission) from the * UDP feed. + * + * @deprecated since 1.22, use $wgRCFeeds */ $wgRC2UDPOmitBots = false; /** + * Destinations to which notifications about recent changes + * should be sent. + * + * As of MediaWiki 1.22, the only supported 'engine' parameter option in core + * is 'UDPRCFeedEngine', which is used to send recent changes over UDP to the + * specified server. + * The common options are: + * * 'uri' -- the address to which the notices are
[MediaWiki-commits] [Gerrit] initial commit:2013-08-26 - change (xowa)
Gnosygnu has uploaded a new change for review. https://gerrit.wikimedia.org/r/80950 Change subject: initial commit:2013-08-26 .. initial commit:2013-08-26 Change-Id: I541c44dddca6d5640d7a79226791f89d52f4e1f6 --- A .metadata/.lock A .metadata/.log A .metadata/.mylyn/repositories.xml.zip A .metadata/.plugins/org.eclipse.cdt.make.core/specs.c A .metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp A .metadata/.plugins/org.eclipse.core.resources/.projects/100_core/.markers A .metadata/.plugins/org.eclipse.core.resources/.projects/100_core/org.eclipse.jdt.core/state.dat A .metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/.location A .metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/.markers A .metadata/.plugins/org.eclipse.core.resources/.projects/110_gfml/org.eclipse.jdt.core/state.dat A .metadata/.plugins/org.eclipse.core.resources/.projects/140_dbs/.location A .metadata/.plugins/org.eclipse.core.resources/.projects/140_dbs/.markers A .metadata/.plugins/org.eclipse.core.resources/.projects/140_dbs/org.eclipse.jdt.core/state.dat A .metadata/.plugins/org.eclipse.core.resources/.projects/150_gfui/.location A .metadata/.plugins/org.eclipse.core.resources/.projects/150_gfui/.markers A .metadata/.plugins/org.eclipse.core.resources/.projects/150_gfui/org.eclipse.jdt.core/state.dat A .metadata/.plugins/org.eclipse.core.resources/.projects/400_xowa/.location A .metadata/.plugins/org.eclipse.core.resources/.projects/400_xowa/.markers A .metadata/.plugins/org.eclipse.core.resources/.projects/400_xowa/org.eclipse.jdt.core/state.dat A .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version A .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index A .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version A .metadata/.plugins/org.eclipse.core.resources/.root/26.tree A .metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources A .metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.adt.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.debug.core.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.usagedata.gathering.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.usagedata.recording.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.jsp.core.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.php.server.core.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.jsdt.ui.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.sse.core.prefs A .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.ws.service.policy.prefs A .metadata/.plugins/org.eclipse.debug.core/.launches/100_core.launch A .metadata/.plugins/org.eclipse.debug.core/.launches/110_gfml.launch A .metadata/.plugins/org.eclipse.debug.core/.launches/150_gfui.launch A .metadata/.plugins/org.eclipse.debug.core/.launches/400_xowa.launch A .metadata/.plugins/org.eclipse.debug.core/.launches/Xowa_main.launch A .metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml A .metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml A .metadata/.plugins/org.eclipse.dltk.core/Containers.dat A .metadata/.plugins/org.eclipse.epp.usagedata.recording/usagedata.csv A .metadata/.plugins/org.eclipse.jdt.core/1022868447.ind
[MediaWiki-commits] [Gerrit] Update README - change (mediawiki...WikibaseQueryEngine)
jenkins-bot has submitted this change and it was merged. Change subject: Update README .. Update README Change-Id: I9a221b6fb37cb4bd5a4c5492b2ecbf4997c561b1 --- M README.md 1 file changed, 12 insertions(+), 3 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index 7ad7f62..c8ce477 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # Wikibase QueryEngine -[![Latest Stable Version](https://poser.pugx.org/wikibase/query-engine/version.png)](https://packagist.org/packages/wikibase/query-engine) -[![Latest Stable Version](https://poser.pugx.org/wikibase/query-engine/d/total.png)](https://packagist.org/packages/wikibase/query-engine) [![Build Status](https://secure.travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQueryEngine.png?branch=master)](http://travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQueryEngine) [![Coverage Status](https://coveralls.io/repos/wikimedia/mediawiki-extensions-WikibaseQueryEngine/badge.png?branch=master)](https://coveralls.io/r/wikimedia/mediawiki-extensions-WikibaseQueryEngine?branch=master) +[![Dependency Status](https://www.versioneye.com/package/php--wikibase--query-engine/badge.png)](https://www.versioneye.com/package/php--wikibase--query-engine) + +On [Packagist](https://packagist.org/packages/wikibase/query-engine): +[![Latest Stable Version](https://poser.pugx.org/wikibase/query-engine/version.png)](https://packagist.org/packages/wikibase/query-engine) +[![Download count](https://poser.pugx.org/wikibase/query-engine/d/total.png)](https://packagist.org/packages/wikibase/query-engine) Component containing query answering code for [Ask](https://www.mediawiki.org/wiki/Extension:Ask) @@ -86,4 +89,10 @@ * [Wikibase QueryEngine on Ohloh](https://www.ohloh.net/p/wikibasequeryengine/) * [Wikibase QueryEngine on MediaWiki.org](https://www.mediawiki.org/wiki/Extension:Wikibase_QueryEngine) * [TravisCI build status](https://travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQueryEngine) -* [Latest version of the readme file](https://github.com/wikimedia/mediawiki-extensions-WikibaseQueryEngine/blob/master/README.md) \ No newline at end of file +* [Latest version of the readme file](https://github.com/wikimedia/mediawiki-extensions-WikibaseQueryEngine/blob/master/README.md) + +## Related projects + +* [Ask JavaScript implementation](https://github.com/JeroenDeDauw/AskJS) +* [Wikibase](https://www.mediawiki.org/wiki/Wikibase) +* [Semantic MediaWiki](https://semantic-mediawiki.org/) \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/80949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9a221b6fb37cb4bd5a4c5492b2ecbf4997c561b1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw Gerrit-Reviewer: Jeroen De Dauw 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 README - change (mediawiki...WikibaseQueryEngine)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/80949 Change subject: Update README .. Update README Change-Id: I9a221b6fb37cb4bd5a4c5492b2ecbf4997c561b1 --- M README.md 1 file changed, 12 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQueryEngine refs/changes/49/80949/1 diff --git a/README.md b/README.md index 7ad7f62..c8ce477 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # Wikibase QueryEngine -[![Latest Stable Version](https://poser.pugx.org/wikibase/query-engine/version.png)](https://packagist.org/packages/wikibase/query-engine) -[![Latest Stable Version](https://poser.pugx.org/wikibase/query-engine/d/total.png)](https://packagist.org/packages/wikibase/query-engine) [![Build Status](https://secure.travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQueryEngine.png?branch=master)](http://travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQueryEngine) [![Coverage Status](https://coveralls.io/repos/wikimedia/mediawiki-extensions-WikibaseQueryEngine/badge.png?branch=master)](https://coveralls.io/r/wikimedia/mediawiki-extensions-WikibaseQueryEngine?branch=master) +[![Dependency Status](https://www.versioneye.com/package/php--wikibase--query-engine/badge.png)](https://www.versioneye.com/package/php--wikibase--query-engine) + +On [Packagist](https://packagist.org/packages/wikibase/query-engine): +[![Latest Stable Version](https://poser.pugx.org/wikibase/query-engine/version.png)](https://packagist.org/packages/wikibase/query-engine) +[![Download count](https://poser.pugx.org/wikibase/query-engine/d/total.png)](https://packagist.org/packages/wikibase/query-engine) Component containing query answering code for [Ask](https://www.mediawiki.org/wiki/Extension:Ask) @@ -86,4 +89,10 @@ * [Wikibase QueryEngine on Ohloh](https://www.ohloh.net/p/wikibasequeryengine/) * [Wikibase QueryEngine on MediaWiki.org](https://www.mediawiki.org/wiki/Extension:Wikibase_QueryEngine) * [TravisCI build status](https://travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQueryEngine) -* [Latest version of the readme file](https://github.com/wikimedia/mediawiki-extensions-WikibaseQueryEngine/blob/master/README.md) \ No newline at end of file +* [Latest version of the readme file](https://github.com/wikimedia/mediawiki-extensions-WikibaseQueryEngine/blob/master/README.md) + +## Related projects + +* [Ask JavaScript implementation](https://github.com/JeroenDeDauw/AskJS) +* [Wikibase](https://www.mediawiki.org/wiki/Wikibase) +* [Semantic MediaWiki](https://semantic-mediawiki.org/) \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/80949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9a221b6fb37cb4bd5a4c5492b2ecbf4997c561b1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enclose every JS file in per-file closures - change (mediawiki...UploadWizard)
jenkins-bot has submitted this change and it was merged. Change subject: Enclose every JS file in per-file closures .. Enclose every JS file in per-file closures Per https://www.mediawiki.org/wiki/CC/JS#Closure Also made sure the style was pretty consistent. Bug: 53067 Change-Id: I0db18f24af2dc145f517e9844ef29ac5ad01b687 --- M UploadWizardPage.js M resources/mw.ApiUploadFormDataHandler.js M resources/mw.ApiUploadHandler.js M resources/mw.ConfirmCloseWindow.js M resources/mw.DestinationChecker.js M resources/mw.ErrorDialog.js M resources/mw.Firefogg.js M resources/mw.FirefoggHandler.js M resources/mw.FirefoggTransport.js M resources/mw.FlickrChecker.js M resources/mw.FormDataTransport.js M resources/mw.GroupProgressBar.js M resources/mw.IframeTransport.js M resources/mw.LanguageUpWiz.js M resources/mw.MockUploadHandler.js M resources/mw.UploadWizard.js M resources/mw.UploadWizardDeed.js M resources/mw.UploadWizardDescription.js M resources/mw.UploadWizardDetails.js M resources/mw.UploadWizardLicenseInput.js M resources/mw.UploadWizardUpload.js M resources/mw.UploadWizardUploadInterface.js M resources/mw.UploadWizardUtil.js M resources/mw.UtilitiesTime.js M resources/mw.fileApi.js 25 files changed, 56 insertions(+), 47 deletions(-) Approvals: Yuvipanda: Looks good to me, approved jenkins-bot: Verified diff --git a/UploadWizardPage.js b/UploadWizardPage.js index 85d51a1..21f9c8d 100644 --- a/UploadWizardPage.js +++ b/UploadWizardPage.js @@ -7,7 +7,7 @@ */ // Create UploadWizard -( function ( $, mw, undefined ) { +( function ( mw, $ ) { mw.UploadWizardPage = function () { @@ -26,4 +26,4 @@ mw.UploadWizardPage(); } ); -} )( jQuery, mediaWiki ); +} )( mediaWiki, jQuery ); diff --git a/resources/mw.ApiUploadFormDataHandler.js b/resources/mw.ApiUploadFormDataHandler.js index 59102db..c15644c 100644 --- a/resources/mw.ApiUploadFormDataHandler.js +++ b/resources/mw.ApiUploadFormDataHandler.js @@ -1,3 +1,4 @@ +( function ( mw, $ ) { /** * Represents an object which configures an html5 FormData object to upload. * Large files are uploaded in chunks. @@ -64,6 +65,4 @@ this.configureEditToken( ok, err ); } }; - - - +}( mediaWiki, jQuery ) ); diff --git a/resources/mw.ApiUploadHandler.js b/resources/mw.ApiUploadHandler.js index da79e06..2ef34c0 100644 --- a/resources/mw.ApiUploadHandler.js +++ b/resources/mw.ApiUploadHandler.js @@ -6,6 +6,8 @@ // n.b. if there are message strings, or any assumption about HTML structure of the form. // then we probably did it wrong +( function ( mw, $ ) { + /** * Represents an object which configures a form to upload its files via an iframe talking to the MediaWiki API. * @param an UploadInterface object, which contains a .form property which points to a real HTML form in the DOM @@ -104,3 +106,4 @@ this.configureEditToken( ok, err ); } }; +}( mediaWiki, jQuery ) ); diff --git a/resources/mw.ConfirmCloseWindow.js b/resources/mw.ConfirmCloseWindow.js index 57a87a5..99f487b 100644 --- a/resources/mw.ConfirmCloseWindow.js +++ b/resources/mw.ConfirmCloseWindow.js @@ -1,4 +1,4 @@ -( function( mw, $, undefined ) { +( function( mw, $ ) { /** * @method confirmCloseWindow * @member mw @@ -55,4 +55,4 @@ }; -} )( window.mediaWiki, jQuery ); +} )( mediaWiki, jQuery ); diff --git a/resources/mw.DestinationChecker.js b/resources/mw.DestinationChecker.js index b91529a..9d3c508 100644 --- a/resources/mw.DestinationChecker.js +++ b/resources/mw.DestinationChecker.js @@ -1,3 +1,4 @@ +( function ( mw, $ ) { /** * Object to attach to a file name input, to be run on its change() event * Largely derived from wgUploadWarningObj in old upload.js @@ -306,13 +307,12 @@ /** * jQuery extension to make a field upload-checkable */ -( function ( $ ) { - $.fn.destinationChecked = function( options ) { - var _this = this; - options.selector = _this; - var checker = new mw.DestinationChecker( options ); - // this should really be done with triggers - _this.checkTitle = function() { checker.checkTitle(); }; - return _this; - }; -} )( jQuery ); +$.fn.destinationChecked = function( options ) { + var _this = this; + options.selector = _this; + var checker = new mw.DestinationChecker( options ); + // this should really be done with triggers + _this.checkTitle = function() { checker.checkTitle(); }; + return _this; +}; +}( mediaWiki, jQuery ) ); diff --git a/resources/mw.ErrorDialog.js b/resources/mw.ErrorDialog.js index 8fe40e0..dd0f99b 100644 --- a/resources/mw.ErrorDialog.js +++ b/resources/mw.ErrorDialog.js @@ -46,4 +46,4 @@ }; -} )( window.mediaWiki, jQuery ); +}( mediaWiki, jQuery ) ); diff --git a/resources/mw.Firefogg.js b/resources/mw.Firefogg.js index c9cc3c8..9495180 1
[MediaWiki-commits] [Gerrit] Add files with no coverage at all to the coverage report as ... - change (mediawiki...WikibaseQueryEngine)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/80948 Change subject: Add files with no coverage at all to the coverage report as well .. Add files with no coverage at all to the coverage report as well Change-Id: Id6bb0282a13008dd127c1c48d8c5766722c34724 --- M phpunit.xml.dist 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQueryEngine refs/changes/48/80948/1 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 808cbf3..3262652 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -21,4 +21,9 @@ tests/integration + + +src + + -- To view, visit https://gerrit.wikimedia.org/r/80948 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6bb0282a13008dd127c1c48d8c5766722c34724 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix phpcs errors & warnings - change (mediawiki...UploadWizard)
jenkins-bot has submitted this change and it was merged. Change subject: Fix phpcs errors & warnings .. Fix phpcs errors & warnings Change-Id: Ib978bc6c269239e05986a656f798bb145fc950ca --- M UploadWizard.php M UploadWizardHooks.php 2 files changed, 40 insertions(+), 19 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/UploadWizard.php b/UploadWizard.php index 3699ad9..e2d182a 100644 --- a/UploadWizard.php +++ b/UploadWizard.php @@ -28,7 +28,16 @@ $wgExtensionCredits['other'][] = array( 'path' => __FILE__, 'name' => 'Upload Wizard', - 'author' => array( 'Neil Kandalgaonkar', 'Jeroen De Dauw', 'Mark Holmquist', 'Ryan Kaldari', 'Michael Dale', 'Ankur Anand', 'Nischay Nahata', 'Yuvi Panda' ), + 'author' => array( + 'Neil Kandalgaonkar', + 'Jeroen De Dauw', + 'Mark Holmquist', + 'Ryan Kaldari', + 'Michael Dale', + 'Ankur Anand', + 'Nischay Nahata', + 'Yuvi Panda' + ), 'version' => '1.3', 'descriptionmsg' => 'uploadwizard-desc', 'url' => 'https://www.mediawiki.org/wiki/Extension:UploadWizard' @@ -76,11 +85,11 @@ ); $wgResourceModules['ext.uploadWizard.formDataTransport'] = array( -'scripts' => 'mw.FormDataTransport.js', + 'scripts' => 'mw.FormDataTransport.js', ) + $uploadWizardModuleInfo; $wgResourceModules['ext.uploadWizard.iFrameTransport'] = array( -'scripts' => 'mw.IframeTransport.js', + 'scripts' => 'mw.IframeTransport.js', ) + $uploadWizardModuleInfo; $wgResourceModules['ext.uploadWizard.apiUploadHandler'] = array( @@ -124,7 +133,6 @@ // Init the upload wizard config array // UploadWizard.config.php includes default configuration -// any value can be modified in localSettings.php by setting $wgUploadWizardConfig['name'] = 'value; $wgUploadWizardConfig = array(); /* Define and configure default namespaces, as defined on Mediawiki.org diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php index 83e4b65..6f72cfa 100644 --- a/UploadWizardHooks.php +++ b/UploadWizardHooks.php @@ -1,15 +1,14 @@ array( 'dependencies' => array( 'jquery.arrowSteps', @@ -421,10 +420,10 @@ 'mwe-upwiz-feedback-blacklist-subject', 'mwe-upwiz-errordialog-title', 'mwe-upwiz-errordialog-ok', - 'size-gigabytes', - 'size-megabytes', - 'size-kilobytes', - 'size-bytes', + 'size-gigabytes', + 'size-megabytes', + 'size-kilobytes', + 'size-bytes', 'mw-coolcats-confirm-new-title', 'mw-coolcats-confirm-new', 'mw-coolcats-confirm-new-ok', @@ -493,7 +492,10 @@ self::$modules['ext.uploadWizard']['dependencies'][] = 'mediawiki.api.titleblacklist'; } foreach ( self::$modules as $name => $resources ) { - $resourceLoader->register( $name, new ResourceLoaderFileModule( $resources, $localpath, $remotepath ) ); + $resourceLoader->register( + $name, + new ResourceLoaderFileModule( $resources, $localpath, $remotepath ) + ); } return true; } @@ -554,17 +556,24 @@ $ownWork = $licensingOptions['ownWork']; foreach ( $ownWork['licenses'] as $license ) { $licenseMessage = self::getLicenseMessage( $license, $licenseConfig ); - $licenses[wfMessage( 'mwe-upwiz-prefs-license-own', $licenseMessage )->text()] = 'ownwork-' . $license; + $licenseKey = wfMessage( 'mwe-upwiz-prefs-license-own', $licenseMessage )->text(); + $licenses[$licenseKey] = 'ownwork-' . $license; } foreach ( UploadWizardConfig::getThirdPartyLicenses() as $license ) { if ( $license !== 'custom' ) { $licenseMessage = self::getLicenseMessage( $license, $licenseConfig ); - $licenses[wfMessage( 'mwe-upwiz-prefs-license-thirdparty', $licenseMessage )->text()] = 'thirdparty-' . $license; + $licenseKey = wfMessage( 'mwe-upwiz-prefs-license-thirdparty', $licenseMessage )->text(); +
[MediaWiki-commits] [Gerrit] Add a .jshintrc file - change (mediawiki...UploadWizard)
jenkins-bot has submitted this change and it was merged. Change subject: Add a .jshintrc file .. Add a .jshintrc file This should cut down on the number of unnecessary jslint errors Change-Id: I0bf21fa695470a995d074227112aff110a56442a --- A .jshintrc 1 file changed, 42 insertions(+), 0 deletions(-) Approvals: Yuvipanda: Looks good to me, approved jenkins-bot: Verified diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000..c4e265a --- /dev/null +++ b/.jshintrc @@ -0,0 +1,42 @@ +{ + /* Common */ + + // Enforcing + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "quotmark": "single", + "trailing": true, + "undef": true, + "unused": true, + // Legacy + "onevar": true, + + /* Local */ + + // Enforcing + "bitwise": true, + "forin": false, + "regexp": false, + "strict": false, + // Relaxing + "laxbreak": true, + "smarttabs": true, + "multistr": true, + // Environment + "browser": true, + // Legacy + "nomen": true, + + "predef": [ + "mediaWiki", + "jQuery", + "QUnit" + ] +} -- To view, visit https://gerrit.wikimedia.org/r/80524 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0bf21fa695470a995d074227112aff110a56442a Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: MarkTraceur Gerrit-Reviewer: Yuvipanda 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 phpcs errors - change (mediawiki...UploadWizard)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/80946 Change subject: Fix phpcs errors .. Fix phpcs errors Mostly accidental spaces that needed fixing Change-Id: Ib978bc6c269239e05986a656f798bb145fc950ca --- M UploadWizard.php M UploadWizardHooks.php 2 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/46/80946/1 diff --git a/UploadWizard.php b/UploadWizard.php index 3699ad9..1304ad7 100644 --- a/UploadWizard.php +++ b/UploadWizard.php @@ -76,11 +76,11 @@ ); $wgResourceModules['ext.uploadWizard.formDataTransport'] = array( -'scripts' => 'mw.FormDataTransport.js', + 'scripts' => 'mw.FormDataTransport.js', ) + $uploadWizardModuleInfo; $wgResourceModules['ext.uploadWizard.iFrameTransport'] = array( -'scripts' => 'mw.IframeTransport.js', + 'scripts' => 'mw.IframeTransport.js', ) + $uploadWizardModuleInfo; $wgResourceModules['ext.uploadWizard.apiUploadHandler'] = array( diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php index 83e4b65..75795ca 100644 --- a/UploadWizardHooks.php +++ b/UploadWizardHooks.php @@ -421,10 +421,10 @@ 'mwe-upwiz-feedback-blacklist-subject', 'mwe-upwiz-errordialog-title', 'mwe-upwiz-errordialog-ok', - 'size-gigabytes', - 'size-megabytes', - 'size-kilobytes', - 'size-bytes', + 'size-gigabytes', + 'size-megabytes', + 'size-kilobytes', + 'size-bytes', 'mw-coolcats-confirm-new-title', 'mw-coolcats-confirm-new', 'mw-coolcats-confirm-new-ok', -- To view, visit https://gerrit.wikimedia.org/r/80946 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib978bc6c269239e05986a656f798bb145fc950ca Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: Yuvipanda ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow for both ids and sites/titles to be set for wbgetentities - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Allow for both ids and sites/titles to be set for wbgetentities .. Allow for both ids and sites/titles to be set for wbgetentities Bug: 43309 Change-Id: I38bddcf3be55d5d8cf4fbdacb1cc73188ee79dd7 --- M repo/includes/api/GetEntities.php 1 file changed, 8 insertions(+), 2 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/api/GetEntities.php b/repo/includes/api/GetEntities.php index 64ca636..0f2caec 100644 --- a/repo/includes/api/GetEntities.php +++ b/repo/includes/api/GetEntities.php @@ -57,16 +57,22 @@ $params = $this->extractRequestParams(); - if ( !( isset( $params['ids'] ) XOR ( !empty( $params['sites'] ) && !empty( $params['titles'] ) ) ) ) { + if ( !isset( $params['ids'] ) && ( empty( $params['sites'] ) || empty( $params['titles'] ) ) ) { wfProfileOut( __METHOD__ ); $this->dieUsage( 'Either provide the item "ids" or pairs of "sites" and "titles" for corresponding pages', 'param-missing' ); } if ( !isset( $params['ids'] ) ) { + // Since we merge into this, just create it + $params['ids'] = array(); + } + + if ( !empty( $params['sites'] ) ) { $siteLinkCache = StoreFactory::getStore()->newSiteLinkCache(); $siteStore = \SiteSQLStore::newInstance(); $itemByTitleHelper = new ItemByTitleHelper( $this, $siteLinkCache, $siteStore, $this->stringNormalizer ); - $params['ids'] = $itemByTitleHelper->getEntityIds( $params['sites'], $params['titles'], $params['normalize'] ); + $otherIDs = $itemByTitleHelper->getEntityIds( $params['sites'], $params['titles'], $params['normalize'] ); + $params['ids'] = array_merge( $params['ids'], $otherIDs ); } $params['ids'] = $this->uniqueEntities( $params['ids'] ); -- To view, visit https://gerrit.wikimedia.org/r/80790 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38bddcf3be55d5d8cf4fbdacb1cc73188ee79dd7 Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: Addshore Gerrit-Reviewer: Jeroen De Dauw Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Profiler: remove unnecessary checks Should slightly reduce o... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Profiler: remove unnecessary checks Should slightly reduce overhead. .. Profiler: remove unnecessary checks Should slightly reduce overhead. Change-Id: Iff71041f1cbc12b0d28f24752a01c63456cb9eaf --- M includes/profiler/Profiler.php 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php index 5346c34..41a9d60 100644 --- a/includes/profiler/Profiler.php +++ b/includes/profiler/Profiler.php @@ -34,8 +34,8 @@ if ( Profiler::$__instance === null ) { // use this directly to reduce overhead Profiler::instance(); } - if ( Profiler::$__instance && !( Profiler::$__instance instanceof ProfilerStub ) ) { - Profiler::instance()->profileIn( $functionname ); + if ( !( Profiler::$__instance instanceof ProfilerStub ) ) { + Profiler::$__instance->profileIn( $functionname ); } } @@ -47,8 +47,8 @@ if ( Profiler::$__instance === null ) { // use this directly to reduce overhead Profiler::instance(); } - if ( Profiler::$__instance && !( Profiler::$__instance instanceof ProfilerStub ) ) { - Profiler::instance()->profileOut( $functionname ); + if ( !( Profiler::$__instance instanceof ProfilerStub ) ) { + Profiler::$__instance->profileOut( $functionname ); } } @@ -77,7 +77,7 @@ if ( Profiler::$__instance === null ) { // use this directly to reduce overhead Profiler::instance(); } - if ( Profiler::$__instance && !( Profiler::$__instance instanceof ProfilerStub ) ) { + if ( !( Profiler::$__instance instanceof ProfilerStub ) ) { $this->enabled = true; Profiler::$__instance->profileIn( $this->name ); } -- To view, visit https://gerrit.wikimedia.org/r/80532 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff71041f1cbc12b0d28f24752a01c63456cb9eaf Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand Gerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Refactor Cite extension JavaScript and make it pass Jshint - change (mediawiki...Cite)
TheDJ has submitted this change and it was merged. Change subject: Refactor Cite extension JavaScript and make it pass Jshint .. Refactor Cite extension JavaScript and make it pass Jshint Moved the scripts and the CSS into the modules folder directly (like almost all other extensions do), added a .jshintrc to not have jenkins shout at this change and minor stuff. After this change Cite will no longer work with anything older than PHP 5.3! Change-Id: I1c87af794f2a9894fb0d82a5bd97bd2182f028e1 --- A .jshintignore A .jshintrc M Cite.php M SpecialCite.php R modules/ext.cite.popups.js R modules/ext.rtlcite.css R modules/ext.specialcite.css 7 files changed, 51 insertions(+), 16 deletions(-) Approvals: TheDJ: Looks good to me, approved jenkins-bot: Verified diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 000..df46ab9 --- /dev/null +++ b/.jshintignore @@ -0,0 +1 @@ +modules/jquery.tooltip/jquery.tooltip.js diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000..4b356f8 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,34 @@ +{ + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "supernew": true, + "shadow": true, + "noarg": true, + "noempty": true, + "nonew": true, + "quotmark": false, // sometimes double quotes make sense, e.g. "foo's" is better readable than 'foo\'s' + "trailing": true, + "undef": true, + "unused": "vars", // we want to allow unused function parameters + "laxbreak": true, + "laxcomma": false, + "onevar": false, + "bitwise": false, + "forin": false, + "regexp": false, + "strict": true, + "scripturl": true, + + // Environment + "browser": true, + + // Globals + "predef": [ + "jQuery", + "mediaWiki" + ] +} diff --git a/Cite.php b/Cite.php index 0f95765..99d5163 100644 --- a/Cite.php +++ b/Cite.php @@ -28,10 +28,10 @@ 'descriptionmsg' => 'cite-desc', 'url' => 'https://www.mediawiki.org/wiki/Extension:Cite/Cite.php' ); -$wgParserTestFiles[] = dirname( __FILE__ ) . "/citeParserTests.txt"; -$wgParserTestFiles[] = dirname( __FILE__ ) . "/citeCatTreeParserTests.txt"; -$wgExtensionMessagesFiles['Cite'] = dirname( __FILE__ ) . "/Cite.i18n.php"; -$wgAutoloadClasses['Cite'] = dirname( __FILE__ ) . "/Cite_body.php"; +$wgParserTestFiles[] = __DIR__ . "/citeParserTests.txt"; +$wgParserTestFiles[] = __DIR__ . "/citeCatTreeParserTests.txt"; +$wgExtensionMessagesFiles['Cite'] = __DIR__ . "/Cite.i18n.php"; +$wgAutoloadClasses['Cite'] = __DIR__ . "/Cite_body.php"; $wgSpecialPageGroups['Cite'] = 'pagetools'; define( 'CITE_DEFAULT_GROUP', '' ); @@ -66,13 +66,12 @@ // Resources $citeResourceTemplate = array( - 'localBasePath' => dirname(__FILE__) . '/modules', + 'localBasePath' => __DIR__ . '/modules', 'remoteExtPath' => 'Cite/modules' ); -$wgResourceModules['ext.cite'] = $citeResourceTemplate + array( - 'styles' => array(), - 'scripts' => 'ext.cite/ext.cite.js', +$wgResourceModules['ext.cite.popups'] = $citeResourceTemplate + array( + 'scripts' => 'ext.cite.popups.js', 'position' => 'bottom', 'dependencies' => array( 'jquery.tooltip', @@ -87,7 +86,7 @@ /* Add RTL fix for the cite elements */ $wgResourceModules['ext.rtlcite'] = $citeResourceTemplate + array( - 'styles' => 'ext.rtlcite/ext.rtlcite.css', + 'styles' => 'ext.rtlcite.css', 'position' => 'top', ); @@ -100,7 +99,7 @@ global $wgCiteEnablePopups; if ( $wgCiteEnablePopups ) { - $out->addModules( 'ext.cite' ); + $out->addModules( 'ext.cite.popups' ); } /* RTL support quick-fix module */ diff --git a/SpecialCite.php b/SpecialCite.php index 6d9b813..5990f54 100644 --- a/SpecialCite.php +++ b/SpecialCite.php @@ -22,7 +22,7 @@ 'url' => 'https://www.mediawiki.org/wiki/Extension:Cite/Special:Cite.php' ); -$dir = dirname( __FILE__ ) . '/'; +$dir = __DIR__ . '/'; # Internationalisation file $wgExtensionMessagesFiles['SpecialCite'] = $dir . 'SpecialCite.i18n.php'; $wgExtensionMessagesFiles['SpecialCiteAliases'] = $dir . 'SpecialCite.alias.php'; @@ -35,12 +35,12 @@ // Resources $citeResourceTemplate = array( - 'localBasePath' => dirname(__FILE__) . '/modules', + 'localBasePath' => __DIR__ . '/modules', 'remoteExtPath' => 'Cite/modules' ); $wgResourceModules['ext.specialcite'] = $citeResourceTemplate + array( - 'styles' => 'ext.specialcite/ext.specialcite.css', + 'styles' => 'ext.specialcite.css', 'scripts' => array(), 'position' => 'bottom', ); diff --git a/modules/ext.cite/ext.cite.js b/modules/ext.cite.popups.js similarity index 67% rename from modul
[MediaWiki-commits] [Gerrit] Fix for I6234a765 - change (mediawiki...LiquidThreads)
jenkins-bot has submitted this change and it was merged. Change subject: Fix for I6234a765 .. Fix for I6234a765 See bug 46040 comment 7 - check that the value is not undefined Bug: 46040 Change-Id: Ieb2a92ef28355e3f91ebdf1794b333ff6d41fb50 --- M lqt.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/lqt.js b/lqt.js index 8a5248d..9069a9d 100644 --- a/lqt.js +++ b/lqt.js @@ -1601,7 +1601,7 @@ var confirmExitPage = false; $( '.lqt-edit-form' ).each( function( index, element ) { var textArea = $( element ).children( 'form' ).find( 'textarea' ); - if ( element.style.display !== 'none' && textArea.val() !== '' ) { + if ( element.style.display !== 'none' && textArea.val() ) { confirmExitPage = true; } } ); -- To view, visit https://gerrit.wikimedia.org/r/80803 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb2a92ef28355e3f91ebdf1794b333ff6d41fb50 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/LiquidThreads Gerrit-Branch: master Gerrit-Owner: Alex Monk Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: Shirayuki Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Refactor Cite extension JavaScript and make it pass Jshint - change (mediawiki...Cite)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/80944 Change subject: Refactor Cite extension JavaScript and make it pass Jshint .. Refactor Cite extension JavaScript and make it pass Jshint Moved the scripts and the CSS into the modules folder directly (like almost all other extensions do), added a .jshintrc to not have jenkins shout at this change and minor stuff. Change-Id: I1c87af794f2a9894fb0d82a5bd97bd2182f028e1 --- A .jshintignore A .jshintrc M Cite.php M SpecialCite.php R modules/ext.cite.popups.js R modules/ext.rtlcite.css R modules/ext.specialcite.css 7 files changed, 51 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite refs/changes/44/80944/1 diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 000..df46ab9 --- /dev/null +++ b/.jshintignore @@ -0,0 +1 @@ +modules/jquery.tooltip/jquery.tooltip.js diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000..4b356f8 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,34 @@ +{ + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "supernew": true, + "shadow": true, + "noarg": true, + "noempty": true, + "nonew": true, + "quotmark": false, // sometimes double quotes make sense, e.g. "foo's" is better readable than 'foo\'s' + "trailing": true, + "undef": true, + "unused": "vars", // we want to allow unused function parameters + "laxbreak": true, + "laxcomma": false, + "onevar": false, + "bitwise": false, + "forin": false, + "regexp": false, + "strict": true, + "scripturl": true, + + // Environment + "browser": true, + + // Globals + "predef": [ + "jQuery", + "mediaWiki" + ] +} diff --git a/Cite.php b/Cite.php index 0f95765..99d5163 100644 --- a/Cite.php +++ b/Cite.php @@ -28,10 +28,10 @@ 'descriptionmsg' => 'cite-desc', 'url' => 'https://www.mediawiki.org/wiki/Extension:Cite/Cite.php' ); -$wgParserTestFiles[] = dirname( __FILE__ ) . "/citeParserTests.txt"; -$wgParserTestFiles[] = dirname( __FILE__ ) . "/citeCatTreeParserTests.txt"; -$wgExtensionMessagesFiles['Cite'] = dirname( __FILE__ ) . "/Cite.i18n.php"; -$wgAutoloadClasses['Cite'] = dirname( __FILE__ ) . "/Cite_body.php"; +$wgParserTestFiles[] = __DIR__ . "/citeParserTests.txt"; +$wgParserTestFiles[] = __DIR__ . "/citeCatTreeParserTests.txt"; +$wgExtensionMessagesFiles['Cite'] = __DIR__ . "/Cite.i18n.php"; +$wgAutoloadClasses['Cite'] = __DIR__ . "/Cite_body.php"; $wgSpecialPageGroups['Cite'] = 'pagetools'; define( 'CITE_DEFAULT_GROUP', '' ); @@ -66,13 +66,12 @@ // Resources $citeResourceTemplate = array( - 'localBasePath' => dirname(__FILE__) . '/modules', + 'localBasePath' => __DIR__ . '/modules', 'remoteExtPath' => 'Cite/modules' ); -$wgResourceModules['ext.cite'] = $citeResourceTemplate + array( - 'styles' => array(), - 'scripts' => 'ext.cite/ext.cite.js', +$wgResourceModules['ext.cite.popups'] = $citeResourceTemplate + array( + 'scripts' => 'ext.cite.popups.js', 'position' => 'bottom', 'dependencies' => array( 'jquery.tooltip', @@ -87,7 +86,7 @@ /* Add RTL fix for the cite elements */ $wgResourceModules['ext.rtlcite'] = $citeResourceTemplate + array( - 'styles' => 'ext.rtlcite/ext.rtlcite.css', + 'styles' => 'ext.rtlcite.css', 'position' => 'top', ); @@ -100,7 +99,7 @@ global $wgCiteEnablePopups; if ( $wgCiteEnablePopups ) { - $out->addModules( 'ext.cite' ); + $out->addModules( 'ext.cite.popups' ); } /* RTL support quick-fix module */ diff --git a/SpecialCite.php b/SpecialCite.php index 6d9b813..5990f54 100644 --- a/SpecialCite.php +++ b/SpecialCite.php @@ -22,7 +22,7 @@ 'url' => 'https://www.mediawiki.org/wiki/Extension:Cite/Special:Cite.php' ); -$dir = dirname( __FILE__ ) . '/'; +$dir = __DIR__ . '/'; # Internationalisation file $wgExtensionMessagesFiles['SpecialCite'] = $dir . 'SpecialCite.i18n.php'; $wgExtensionMessagesFiles['SpecialCiteAliases'] = $dir . 'SpecialCite.alias.php'; @@ -35,12 +35,12 @@ // Resources $citeResourceTemplate = array( - 'localBasePath' => dirname(__FILE__) . '/modules', + 'localBasePath' => __DIR__ . '/modules', 'remoteExtPath' => 'Cite/modules' ); $wgResourceModules['ext.specialcite'] = $citeResourceTemplate + array( - 'styles' => 'ext.specialcite/ext.specialcite.css', + 'styles' => 'ext.specialcite.css', 'scripts' => array(), 'position' => 'bottom', ); diff --git a/modules/ext.cite/ext.cite.js b/modules/ext.cite.popups.js similarity index 67% rename from modules/ext.cite/ext.cite
[MediaWiki-commits] [Gerrit] Accessibility: Make the collapsible sidebar screen reader fr... - change (mediawiki...Vector)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/80927 Change subject: Accessibility: Make the collapsible sidebar screen reader friendly .. Accessibility: Make the collapsible sidebar screen reader friendly Change-Id: I6dcd8d0a9ef5a1b62582b02d1b95e4635f4f4cf4 --- M modules/ext.vector.collapsibleNav.js 1 file changed, 34 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Vector refs/changes/27/80927/1 diff --git a/modules/ext.vector.collapsibleNav.js b/modules/ext.vector.collapsibleNav.js index 49d8a15..dd2f6f2 100644 --- a/modules/ext.vector.collapsibleNav.js +++ b/modules/ext.vector.collapsibleNav.js @@ -7,9 +7,11 @@ // Use the same function for all navigation headings - don't repeat function toggle( $element ) { + var isCollapsed = $element.parent().is( '.collapsed' ); + $.cookie( 'vector-nav-' + $element.parent().attr( 'id' ), - $element.parent().is( '.collapsed' ), + isCollapsed, { 'expires': 30, 'path': '/' } ); $element @@ -18,6 +20,14 @@ .toggleClass( 'collapsed' ) .find( '.body' ) .slideToggle( 'fast' ); + isCollapsed = !isCollapsed; + + $element + .find( '> a' ) + .attr( { + 'aria-pressed': isCollapsed ? 'false' : 'true', + 'aria-expanded': isCollapsed ? 'false' : 'true' + } ); } /* Browser Support */ @@ -136,7 +146,7 @@ $.cookie( 'accept-language', langs.join( ',' ), { path: '/', expires: 30 - }); + } ); } ); } @@ -193,8 +203,19 @@ .each( function ( i ) { var id = $(this).attr( 'id' ), state = $.cookie( 'vector-nav-' + id ); + + $(this).find( 'ul:first' ).attr( 'id', id + '-list' ); // Add anchor tag to heading for better accessibility - $( this ).find( 'h3' ).wrapInner( $( '' ).click( false ) ); + $( this ).find( 'h3' ).wrapInner( + $( '' ) + .attr( { + href: '#', + 'aria-haspopup': 'true', + 'aria-controls': id + '-list', + role: 'button' + } ) + .click( false ) + ); // In the case that we are not showing the new version, let's show the languages by default if ( state === 'true' || @@ -207,10 +228,20 @@ .find( '.body' ) .hide() // bug 34450 .show(); + $(this).find( 'h3 > a' ) + .attr( { + 'aria-pressed': 'true', + 'aria-expanded': 'true' + } ); } else { $(this) .addClass( 'collapsed' ) .removeClass( 'expanded' ); + $(this).find( 'h3 > a' ) + .attr( { + 'aria-pressed': 'false', + 'aria-expanded': 'false' + } ); } // Re-save cookie if ( state !== null ) { -- To view, visit https://gerrit.wikimedia.org/r/80927 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: ne
[MediaWiki-commits] [Gerrit] Accessibility: Add aria-sort to tablesorter - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/80872 Change subject: Accessibility: Add aria-sort to tablesorter .. Accessibility: Add aria-sort to tablesorter Note, aria-sort is not supported in VO, and in JAWS it seems aria-sort has a check on role === 'columnheader' instead of element.hasRole( 'columnheader' ). sigh Change-Id: I2c414ed0b88bafc04989152acae8298d2130d393 --- M resources/jquery/jquery.tablesorter.js 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/72/80872/1 diff --git a/resources/jquery/jquery.tablesorter.js b/resources/jquery/jquery.tablesorter.js index b71ef83..29e8cdf 100644 --- a/resources/jquery/jquery.tablesorter.js +++ b/resources/jquery/jquery.tablesorter.js @@ -406,12 +406,16 @@ function setHeadersCss( table, $headers, list, css, msg, columnToHeader ) { // Remove all header information and reset titles to default message - $headers.removeClass( css[0] ).removeClass( css[1] ).attr( 'title', msg[1] ); + $headers.removeClass( css[0] ).removeClass( css[1] ).attr( 'title', msg[1] ).removeAttr( 'aria-sort' ); for ( var i = 0; i < list.length; i++ ) { $headers.eq( columnToHeader[ list[i][0] ] ) .addClass( css[ list[i][1] ] ) - .attr( 'title', msg[ list[i][1] ] ); + .attr( { + title: msg[ list[i][1] ], + // This is not fully correct, but aria doesn't support our method of secondary keys + 'aria-sort': ( i == 0 && list[i][1] === 0 ? 'ascending' : 'descending' ) + } ); } } -- To view, visit https://gerrit.wikimedia.org/r/80872 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2c414ed0b88bafc04989152acae8298d2130d393 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki.action.edit.preview: Assorted fixes - change (mediawiki/core)
TheDJ has submitted this change and it was merged. Change subject: mediawiki.action.edit.preview: Assorted fixes .. mediawiki.action.edit.preview: Assorted fixes * Fix some typos * Load mediawiki.action.history.diff as a RL dependency, not via mw.loader.load * Get rid of inappropriate uses of .prop() Change-Id: I4ff0fd1f946644ac651fe6c7b645236124d6d770 --- M resources/Resources.php M resources/mediawiki.action/mediawiki.action.edit.preview.js 2 files changed, 7 insertions(+), 9 deletions(-) Approvals: TheDJ: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/Resources.php b/resources/Resources.php index 6352843..508aabf 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -738,6 +738,7 @@ 'dependencies' => array( 'jquery.form', 'jquery.spinner', + 'mediawiki.action.history.diff', ), ), 'mediawiki.action.history' => array( diff --git a/resources/mediawiki.action/mediawiki.action.edit.preview.js b/resources/mediawiki.action/mediawiki.action.edit.preview.js index 0566a87..ca71a99 100644 --- a/resources/mediawiki.action/mediawiki.action.edit.preview.js +++ b/resources/mediawiki.action/mediawiki.action.edit.preview.js @@ -78,8 +78,8 @@ } ); // Load new preview data. - // TODO: This should use the action=parse API instead of loading the entire page - // Though that requires figuring out how to convert that raw data into proper HTML. + // TODO: This should use the action=parse API instead of loading the entire page, + // although that requires figuring out how to convert that raw data into proper HTML. $previewDataHolder.load( targetUrl + ' ' + copySelectors.join( ',' ), postData, function () { var i, $from; // Copy the contents of the specified elements from the loaded page to the real page. @@ -113,31 +113,28 @@ } // The following elements can change in a preview but are not output - // by the server when they're empty until the preview reponse. + // by the server when they're empty until the preview response. // TODO: Make the server output these always (in a hidden state), so we don't // have to fish and (hopefully) put them in the right place (since skins // can change where they are output). if ( !document.getElementById( 'p-lang' ) && document.getElementById( 'p-tb' ) ) { $( '#p-tb' ).after( - $( '' ).prop( 'id', 'p-lang' ) + $( '' ).attr( 'id', 'p-lang' ) ); } if ( !$( '.mw-summary-preview' ).length ) { $( '.editCheckboxes' ).before( - $( '' ).prop( 'className', 'mw-summary-preview' ) + $( '' ).addClass( 'mw-summary-preview' ) ); } if ( !document.getElementById( 'wikiDiff' ) && document.getElementById( 'wikiPreview' ) ) { $( '#wikiPreview' ).after( - $( '' ).prop( 'id', 'wikiDiff') + $( '' ).attr( 'id', 'wikiDiff') ); } - - // Make sure diff styles are loaded - mw.loader.load( 'mediawiki.action.history.diff' ); $( document.body ).on( 'click', '#wpPreview, #wpDiff', doLivePreview ); } ); -- To view, visit https://gerrit.wikimedia.org/r/76457 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4ff0fd1f946644ac651fe6c7b645236124d6d770 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Matmarex Gerrit-Reviewer: Krinkle Gerrit-Reviewer: TheDJ 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 selenium-webdriver to 2.34 - change (qa/browsertests)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/80870 Change subject: Update selenium-webdriver to 2.34 .. Update selenium-webdriver to 2.34 Without this @browser.execute_script doesn't work. Change-Id: I8d9c427e3325913c445235f2951996904856cf74 --- M Gemfile.lock 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests refs/changes/70/80870/1 diff --git a/Gemfile.lock b/Gemfile.lock index 3c8d98b..bb10da0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ net-http-persistent (2.8) page-object (0.9.1) page_navigation (>= 0.8) - selenium-webdriver (>= 2.33.0) + selenium-webdriver (>= 2.34.0) watir-webdriver (>= 0.6.4) page_navigation (0.9) data_magic (>= 0.14) @@ -41,14 +41,14 @@ rspec-expectations (2.14.0) diff-lcs (>= 1.1.3, < 2.0) rubyzip (0.9.9) -selenium-webdriver (2.33.0) +selenium-webdriver (2.34.0) childprocess (>= 0.2.5) multi_json (~> 1.0) rubyzip websocket (~> 1.0.4) syntax (1.0.0) watir-webdriver (0.6.4) - selenium-webdriver (>= 2.18.0) + selenium-webdriver (>= 2.34.0) websocket (1.0.7) yml_reader (0.2) -- To view, visit https://gerrit.wikimedia.org/r/80870 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d9c427e3325913c445235f2951996904856cf74 Gerrit-PatchSet: 1 Gerrit-Project: qa/browsertests Gerrit-Branch: master Gerrit-Owner: Amire80 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Save real tabs and allow configuration by users via JS hook - change (mediawiki...CodeEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Save real tabs and allow configuration by users via JS hook .. Save real tabs and allow configuration by users via JS hook Bug: 39616 Change-Id: I64c3b9b53f1265f5b9c19edb480040113fa85590 --- A hooks.txt M modules/jquery.codeEditor.js 2 files changed, 9 insertions(+), 0 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/hooks.txt b/hooks.txt new file mode 100644 index 000..531d9eb --- /dev/null +++ b/hooks.txt @@ -0,0 +1,4 @@ +== JS hooks == +'codeEditor.configure' is fired during the set up of the ACE editor +Params: +* {object} session ACE editor session diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index fccc850..2c320d9 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -165,10 +165,15 @@ box.closest('form').submit( context.evt.codeEditorSubmit ); var session = context.codeEditor.getSession(); + // Use proper tabs + session.setUseSoftTabs( false ); + // Bug 47235: Update text field for LivePreview if ( mw.hook ) { // New style hook mw.hook( 'LivePreviewPrepare' ).add( context.evt.codeEditorSubmit ); + + mw.hook( 'codeEditor.configure' ).fire( session ); } // Old, deprecated style for backwards compat // Do this even if mw.hook exists, because the caller wasn't -- To view, visit https://gerrit.wikimedia.org/r/80843 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64c3b9b53f1265f5b9c19edb480040113fa85590 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CodeEditor Gerrit-Branch: master Gerrit-Owner: Alex Monk Gerrit-Reviewer: Helder.wiki Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Special:PagesWithProp: Use Language#formatSize - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Special:PagesWithProp: Use Language#formatSize .. Special:PagesWithProp: Use Language#formatSize Followup to Ib2db241a. Change-Id: I138ecaf20feac162a554591332e5c4d1e3234768 --- M includes/specials/SpecialPagesWithProp.php M languages/messages/MessagesEn.php M languages/messages/MessagesQqq.php 3 files changed, 5 insertions(+), 5 deletions(-) Approvals: Parent5446: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specials/SpecialPagesWithProp.php b/includes/specials/SpecialPagesWithProp.php index 199c5cd..1c77a0c 100644 --- a/includes/specials/SpecialPagesWithProp.php +++ b/includes/specials/SpecialPagesWithProp.php @@ -136,7 +136,7 @@ if ( $isBinary || $isTooLong ) { $message = $this ->msg( $isBinary ? 'pageswithprop-prophidden-binary' : 'pageswithprop-prophidden-long' ) - ->numParams( round( $valueLength / 1024, 2 ) ); + ->params( $this->getLanguage()->formatSize( $valueLength ) ); $propValue = Html::element( 'span', array( 'class' => 'prop-value-hidden' ), $message->text() ); } else { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 67fe889..b29493e 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2676,8 +2676,8 @@ 'pageswithprop-text' => 'This page lists pages that use a particular page property.', 'pageswithprop-prop' => 'Property name:', 'pageswithprop-submit'=> 'Go', -'pageswithprop-prophidden-long' => 'long text property value hidden ($1 kilobytes)', -'pageswithprop-prophidden-binary' => 'binary property value hidden ($1 kilobytes)', +'pageswithprop-prophidden-long' => 'long text property value hidden ($1)', +'pageswithprop-prophidden-binary' => 'binary property value hidden ($1)', 'doubleredirects' => 'Double redirects', 'doubleredirects-summary' => '', # do not translate or duplicate this message to other languages diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 02938d6..0b6bff2 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -4425,13 +4425,13 @@ 'pageswithprop-prophidden-long' => 'Information shown on [[Special:PagesWithProp]] when property value is longer than 1 kilobyte. Parameters: -* $1 - size of property value in kilobytes +* $1 - size of property value, formatted See also: * {{msg-mw|pageswithprop-prophidden-binary}}', 'pageswithprop-prophidden-binary' => 'Information shown on [[Special:PagesWithProp]] when property value contains binary data. Parameters: -* $1 - size of property value in kilobytes +* $1 - size of property value, formatted See also: * {{msg-mw|pageswithprop-prophidden-long}}', -- To view, visit https://gerrit.wikimedia.org/r/79468 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I138ecaf20feac162a554591332e5c4d1e3234768 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Matmarex Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Nemo bis Gerrit-Reviewer: Parent5446 Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] complete the changes and implement the ideas given in change... - change (pywikibot/compat)
DrTrigon has uploaded a new change for review. https://gerrit.wikimedia.org/r/80869 Change subject: complete the changes and implement the ideas given in change 79977 .. complete the changes and implement the ideas given in change 79977 * replace te numerous y/n questions by one 0-3/s selection * output more verbose and meaningful informations * cleaned up other messages to have a smooth (non repeating) output Change-Id: Ieb5f9efbfa4ed82c92ca461a8fb85d463bd247fa --- M externals/__init__.py 1 file changed, 57 insertions(+), 45 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/69/80869/1 diff --git a/externals/__init__.py b/externals/__init__.py index c94047c..3f14c37 100644 --- a/externals/__init__.py +++ b/externals/__init__.py @@ -167,6 +167,7 @@ import os import sys +import inspect import wikipedia as pywikibot # sets externals path #from pywikibot.comms import http @@ -197,27 +198,38 @@ return ("%s-%s" % (platform.system(), platform.dist()[0])).lower() -def show_question(which_files, admin=True): -lowlevel_warning("Required package missing: %s" % which_files) -lowlevel_warning("A required package is missing, but externals can" - " automatically install it.") -if admin: -lowlevel_warning("If you say Yes, externals will need administrator" - " privileges, and you might be asked for the" - " administrator password.") -lowlevel_warning("For more info, please confer:\n" - " http://www.mediawiki.org/wiki/Manual:Pywikipediabot/"; +def show_question(module): +lowlevel_warning("Required package missing: %s\n" + "This package is not installed, but required by the file" + " '%s'." % (module, inspect.stack()[2][1])) +lowlevel_warning("For more and additional information, please confer:\n" + "http://www.mediawiki.org/wiki/Manual:Pywikipediabot/"; "Installation#Dependencies") -lowlevel_warning("Give externals permission to try to install package?" - " (y/N)") -v = raw_input().upper() -return v == 'Y' or v == 'YES' +lowlevel_warning("There are multiple ways to solve this:\n" +"0: automatically determine the best of the following methods (may need\n" +" administrator privileges) [recommended]\n" +"1: install the package using the OS package management system like yum\n" +" or apt (needs administrator privileges)\n" +"2: download the package from its source URL and install it locally into\n" +" the pywikipedia package externals directory [recommended for non-admins]\n" +"3: download the package from its mercurial repo and install it locally into\n" +" the pywikipedia package externals directory\n" +"s: SKIP and solve manually") +v = None +while (v not in [0, 1, 2, 3, 's', '']): +lowlevel_warning("Please choose [0, 1, 2, 3, s - default]: ") +v = raw_input().lower() +try: +v = int(v) +except: +pass +return v def show_patch_question(): global _patch_permission if _patch_permission is None: lowlevel_warning("Give externals permission to execute the patch command?" - " (y/N)") + " [y(es), n(o) - default]: ") v = raw_input().upper() _patch_permission = (v == 'Y') or (v == 'YES') return _patch_permission @@ -253,8 +265,6 @@ raise TypeError("Expected string or list of strings") cmd += ' ' + package -lowlevel_warning("externals wants to install package(s) '%s'" % - package_name) sucmd = "sudo %s" % cmd result = os.system(sucmd) return (result == 0) # 0 indicates success @@ -271,8 +281,6 @@ raise TypeError("Expected string or list of strings") cmd += ' ' + package -lowlevel_warning("externals wants to install package(s) '%s'" % - package_name) sucmd = "su -c'%s'" % cmd result = os.system(sucmd) return (result == 0) @@ -289,8 +297,12 @@ return False else: files = dependency_dictionary[distro] +lowlevel_warning('Installing package(s) "%s"' % files) func = distro.replace('-', '_') + '_install' -if files and (func in globals()) and show_question(files): +lowlevel_warning("Externals will need administrator privileges, and" + " you might get asked for the administrator" + " password. This prompt can be skipped with [Enter].") +if files and (func in globals()): callable_ = globals()[func] return callable_(files) else: @@ -310,7 +322,7 @@ def download_install(package, module,
[MediaWiki-commits] [Gerrit] Use PHP_SAPI instead of php_sapi_name() - change (mediawiki...Parsoid)
jenkins-bot has submitted this change and it was merged. Change subject: Use PHP_SAPI instead of php_sapi_name() .. Use PHP_SAPI instead of php_sapi_name() 'Furthermore, PHP_SAPI rhymes with "happy", whereas "php_sapi_name" rhymes with "lame". QED, etc.' - ori-l Bug: 37957 Change-Id: I87a4fca72cac0d58807faf00eb12c9db07653e64 --- M cpp/php/parsoid.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/cpp/php/parsoid.php b/cpp/php/parsoid.php index d23eef8..5896e5d 100644 --- a/cpp/php/parsoid.php +++ b/cpp/php/parsoid.php @@ -1,5 +1,5 @@ "; +$br = (PHP_SAPI == "cli")? "":""; if(!extension_loaded('parsoid')) { dl('parsoid.' . PHP_SHLIB_SUFFIX); -- To view, visit https://gerrit.wikimedia.org/r/80866 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I87a4fca72cac0d58807faf00eb12c9db07653e64 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Ori.livneh 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 class around diff-empty and add it as notice - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add class around diff-empty and add it as notice .. Add class around diff-empty and add it as notice Add the moment the message is added within a class=diff-multi, which is not true. Bug: 53168 Follow-Up: I458fb688b0001fb674ece65b3fdabf56fc658a29 Change-Id: Ic3040ceca4ff1459181c84f041490e9e72b12802 --- M includes/diff/DifferenceEngine.php 1 file changed, 1 insertion(+), 4 deletions(-) Approvals: Matmarex: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index b102bfc..5444bc1 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -612,10 +612,7 @@ $multi = $this->getMultiNotice(); // Display a message when the diff is empty if ( $body === '' ) { - if ( $multi !== '' ) { - $multi .= ''; - } - $multi .= $this->msg( 'diff-empty' )->parse(); + $notice .= '' . $this->msg( 'diff-empty' )->parse() . "\n"; } return $this->addHeader( $body, $otitle, $ntitle, $multi, $notice ); } -- To view, visit https://gerrit.wikimedia.org/r/80406 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3040ceca4ff1459181c84f041490e9e72b12802 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender Gerrit-Reviewer: Fomafix Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Matmarex Gerrit-Reviewer: Umherirrender Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fix where we get the EntityIdParser from. - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: fix where we get the EntityIdParser from. .. fix where we get the EntityIdParser from. Change-Id: I020d23b81e351e12811c2830d7292fb0b0ec44fb --- M repo/includes/api/GetEntities.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/api/GetEntities.php b/repo/includes/api/GetEntities.php index 64ca636..545bcb3 100644 --- a/repo/includes/api/GetEntities.php +++ b/repo/includes/api/GetEntities.php @@ -38,7 +38,7 @@ protected $stringNormalizer; /** -* @var \Wikibase\EntityIdParser +* @var \Wikibase\Lib\EntityIdParser */ protected $entityIdParser; @@ -46,7 +46,7 @@ parent::__construct( $main, $name, $prefix ); $this->stringNormalizer = WikibaseRepo::getDefaultInstance()->getStringNormalizer(); - $this->entityIdParser = LibRegistry::getDefaultInstance()->getEntityIdParser(); + $this->entityIdParser = WikibaseRepo::getDefaultInstance()->getEntityIdParser(); } /** -- To view, visit https://gerrit.wikimedia.org/r/80792 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I020d23b81e351e12811c2830d7292fb0b0ec44fb Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Aude Gerrit-Reviewer: Jeroen De Dauw Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Tobias Gritschacher Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Deprecate badly designed methods that inherently use global ... - change (mediawiki...WikibaseDataModel)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/80867 Change subject: Deprecate badly designed methods that inherently use global state .. Deprecate badly designed methods that inherently use global state Change-Id: I2e609d81785fbae042c73aa8865e6ea3b3bcf345 --- M DataModel/Snak/SnakObject.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseDataModel refs/changes/67/80867/1 diff --git a/DataModel/Snak/SnakObject.php b/DataModel/Snak/SnakObject.php index 43aa1f7..ac681db 100644 --- a/DataModel/Snak/SnakObject.php +++ b/DataModel/Snak/SnakObject.php @@ -144,6 +144,7 @@ *will be represented using an UnDeserializableValue object. * * @since 0.3 +* @deprecated since 0.4 * * @param array $data * @@ -166,6 +167,7 @@ * Constructs a new snak of specified type and returns it. * * @since 0.3 +* @deprecated since 0.4 * * @param string $snakType * @param array $constructorArguments -- To view, visit https://gerrit.wikimedia.org/r/80867 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e609d81785fbae042c73aa8865e6ea3b3bcf345 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseDataModel Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use PHP_SAPI instead of php_sapi_name() - change (mediawiki...Parsoid)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/80866 Change subject: Use PHP_SAPI instead of php_sapi_name() .. Use PHP_SAPI instead of php_sapi_name() 'Furthermore, PHP_SAPI rhymes with "happy", whereas "php_sapi_name" rhymes with "lame". QED, etc.' - ori-l Bug: 37957 Change-Id: I87a4fca72cac0d58807faf00eb12c9db07653e64 --- M cpp/php/parsoid.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/66/80866/1 diff --git a/cpp/php/parsoid.php b/cpp/php/parsoid.php index d23eef8..5896e5d 100644 --- a/cpp/php/parsoid.php +++ b/cpp/php/parsoid.php @@ -1,5 +1,5 @@ "; +$br = (PHP_SAPI == "cli")? "":""; if(!extension_loaded('parsoid')) { dl('parsoid.' . PHP_SHLIB_SUFFIX); -- To view, visit https://gerrit.wikimedia.org/r/80866 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I87a4fca72cac0d58807faf00eb12c9db07653e64 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: Yuvipanda 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 description of U+FFFD to illegal title exception - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80865 Change subject: Add description of U+FFFD to illegal title exception .. Add description of U+FFFD to illegal title exception Change-Id: If1b9f7fac9712efd0cc8c320b2c9c2e946f2 --- M pywikibot/page.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/65/80865/1 diff --git a/pywikibot/page.py b/pywikibot/page.py index 52e792a..fe7ed5f 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -2954,7 +2954,7 @@ # This code was adapted from Title.php : secureAndSplit() # if u'\ufffd' in t: -raise pywikibot.Error("Title contains illegal char (\\uFFFD)") +raise pywikibot.Error("Title contains illegal char (\\uFFFD 'REPLACEMENT CHARACTER')") # Replace underscores by spaces t = t.replace(u"_", u" ") -- To view, visit https://gerrit.wikimedia.org/r/80865 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1b9f7fac9712efd0cc8c320b2c9c2e946f2 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Creating forms with page section via PageSchemas - change (mediawiki...SemanticForms)
Himeshi has uploaded a new change for review. https://gerrit.wikimedia.org/r/80864 Change subject: Creating forms with page section via PageSchemas .. Creating forms with page section via PageSchemas Implemented creating forms with page sections from the PageSchemas form items. Bug: 46662 Change-Id: Ibd8ba68f8a238658517f9ef0ff249e7373d7decd --- M includes/SF_PageSchemas.php 1 file changed, 97 insertions(+), 73 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/64/80864/1 diff --git a/includes/SF_PageSchemas.php b/includes/SF_PageSchemas.php index 9c67b5c..0b7e984 100644 --- a/includes/SF_PageSchemas.php +++ b/includes/SF_PageSchemas.php @@ -487,15 +487,18 @@ $otherParams = $psPageSection->getObject( 'semanticforms_PageSection' ); } $paramValues = array(); - foreach ( $otherParams as $param => $value ) { - if ( !empty( $param ) ) { - if ( !empty( $value ) ) { - $paramValues[] = $param . '=' . $value; - } else { - $paramValues[] = $param; + if ( !is_null( $otherParams ) ) { + foreach ( $otherParams as $param => $value ) { + if ( !empty( $param ) ) { + if ( !empty( $value ) ) { + $paramValues[] = $param . '=' . $value; + } else { + $paramValues[] = $param; + } } } } + foreach ( $paramValues as $i => $paramAndVal ) { $paramValues[$i] = str_replace( ',', '\,', $paramAndVal ); } @@ -569,6 +572,25 @@ return $form_fields; } + public static function getPageSection( $psPageSection ) { + $pageSection = SFPageSection::create( $psPageSection->getSectionName() ); + $pageSectionArray = $psPageSection->getObject( 'semanticforms_PageSection' ); + if ( !is_null( $pageSectionArray ) ) { + foreach ( $pageSectionArray as $var => $val ) { + if ( $var == 'mandatory' ) { + $pageSection->setIsMandatory( true ); + } elseif ( $var == 'hidden' ) { + $pageSection->setIsHidden( true ); + } elseif ( $var == 'restricted' ) { + $pageSection->setIsRestricted( true ); + } else { + $pageSection->setSectionArgs( $var, $val ); + } + } + } + return $pageSection; + } + /** * Return the list of pages that Semantic Forms could generate from * the current Page Schemas schema. @@ -627,7 +649,7 @@ * of Page Schemas. */ public static function generateForm( $formName, $formTitle, - $formTemplates, $formDataFromSchema, $categoryName ) { + $formItems, $formDataFromSchema, $categoryName ) { global $wgUser; $input = array(); @@ -652,12 +674,6 @@ if ( array_key_exists( 'freeTextLabel', $formDataFromSchema ) ) $freeTextLabel = $formDataFromSchema['freeTextLabel']; - $formItems = array(); - foreach ( $formTemplates as $template ) { - $formItems[] = array( 'type' => 'template', - 'name' => $template->getTemplateName(), - 'item' => $template ); - } $form = SFForm::create( $formName, $formItems ); $form->setAssociatedCategory( $categoryName ); if ( array_key_exists( 'PageNameFormula', $formDataFromSchema ) ) { @@ -683,77 +699,85 @@ public static function generatePages( $pageSchemaObj, $selectedPages ) { global $wgUser; - $psTemplates = $pageSchemaObj->getTemplates(); - - $form_templates = array(); + $psFormItems = $pageSchemaObj->getFormItemsList(); + $form_items = array(); $jobs = array(); $templateHackUsed = false; $isCategoryNameSet = false; // Generate every specified template - foreach ( $psTemplates as $psTemplate ) { -
[MediaWiki-commits] [Gerrit] Added generating pages with page sections - change (mediawiki...PageSchemas)
Himeshi has uploaded a new change for review. https://gerrit.wikimedia.org/r/80863 Change subject: Added generating pages with page sections .. Added generating pages with page sections Added page generation with page sections to the "Generate Pages" special page. Change-Id: I3eeebff10c3deb23be1db8c48836cb376fc24622 --- M PageSchemas.classes.php M specials/PS_EditSchema.php 2 files changed, 45 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageSchemas refs/changes/63/80863/1 diff --git a/PageSchemas.classes.php b/PageSchemas.classes.php index a04a01a..9ff69e2 100644 --- a/PageSchemas.classes.php +++ b/PageSchemas.classes.php @@ -281,8 +281,8 @@ private $mPageXML = null; /* Stores the template objects */ private $mTemplates = array(); - // Stores the page sections - private $mPageSections = array(); + /* Stores the template and page section objects */ + private $mFormItemList = array(); private $mIsPSDefined = true; function __construct ( $categoryName ) { @@ -309,36 +309,44 @@ $pageXMLstr = $row[2]; $this->mPageXML = simplexml_load_string ( $pageXMLstr ); // index for template objects - $i = 0; + $templateCount = 0; $pageSectionCount = 0; - $inherited_templates = array(); + $inherited_template_items = array(); foreach ( $this->mPageXML->children() as $tag => $child ) { if ( $tag == 'InheritsFrom ' ) { $schema_to_inherit = (string) $child->attributes()->schema; - if( $schema_to_inherit !=null ){ + if( $schema_to_inherit != null ) { $inheritedSchemaObj = new PSSchema( $schema_to_inherit ); - $inherited_templates = $inheritedSchemaObj->getTemplates(); + $inherited_template_items = $inheritedSchemaObj->getTemplates(); } } if ( $tag == 'Template' ) { $ignore = (string) $child->attributes()->ignore; - if ( count($child->children()) > 0 ) { - $templateObj = new PSTemplate($child); - $this->mTemplates[$i++]= $templateObj; + if ( count( $child->children() ) > 0 ) { + $templateObj = new PSTemplate( $child ); + $this->mFormItemList[] = array( 'type' => $tag, + 'number' => $templateCount, + 'item' => $templateObj ); + $this->mTemplates[$templateCount]= $templateObj; + $templateCount++; } elseif ( $ignore != "true" ) { // Code to add templates from inherited templates $temp_name = (string) $child->attributes()->name; - foreach( $inherited_templates as $inherited_template ) { - if( $temp_name == $inherited_template->getName() ){ - $this->mTemplates[$i++] = $inherited_template; + foreach( $inherited_template_items as $inherited_template_item ) { + if( $inherited_template_item['type'] == $tag && $temp_name == $inherited_template_item['item']->getName() ) { + $this->mFormItemList[] = array( 'type' => $tag, + 'number' => $templateCount, + 'item' => $inherited_template ); + $this->mTemplates[$templateCount] = $inherited_template; + $templateCount++; } } }
[MediaWiki-commits] [Gerrit] pep8-ified scripts/touch.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80861 Change subject: pep8-ified scripts/touch.py .. pep8-ified scripts/touch.py Change-Id: Ib1f35b181d3f221f9e3c43b1c244784efa9f1249 --- M scripts/touch.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/61/80861/1 diff --git a/scripts/touch.py b/scripts/touch.py index f90ee15..84c2076 100755 --- a/scripts/touch.py +++ b/scripts/touch.py @@ -20,7 +20,7 @@ # # (C) Pywikipedia team # -__version__='$Id$' +__version__ = '$Id$' # # Distributed under the terms of the MIT license. # @@ -43,7 +43,7 @@ # get the page, and save it using the unmodified text. # whether or not getting a redirect throws an exception # depends on the variable self.touch_redirects. -text = page.get(get_redirect = self.touch_redirects) +text = page.get(get_redirect=self.touch_redirects) page.save("Pywikibot touch script") except pywikibot.NoPage: pywikibot.error(u"Page %s does not exist." -- To view, visit https://gerrit.wikimedia.org/r/80861 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1f35b181d3f221f9e3c43b1c244784efa9f1249 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/upload.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80862 Change subject: pep8-ified scripts/upload.py .. pep8-ified scripts/upload.py Change-Id: I941a05ee6a9a3914dc0623720792ff95abeede00 --- M scripts/upload.py 1 file changed, 11 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/62/80862/1 diff --git a/scripts/upload.py b/scripts/upload.py index 090cc0a..f21e6e1 100755 --- a/scripts/upload.py +++ b/scripts/upload.py @@ -24,10 +24,12 @@ # # Distributed under the terms of the MIT license. # -__version__='$Id$' +__version__ = '$Id$' # -import os, sys, time +import os +import sys +import time import urllib import urlparse import tempfile @@ -104,7 +106,7 @@ retrieved = False pywikibot.output( u"Connection closed at byte %s (%s left)" - % (rlen, content_len)) +% (rlen, content_len)) if accept_ranges and rlen > 0: resume = True pywikibot.output(u"Sleeping for %d seconds..." % dt) @@ -139,14 +141,14 @@ u"The filename on the target wiki will default to: %s" % filename) # FIXME: these 2 belong somewhere else, presumably in family -forbidden = '/' # to be extended +forbidden = '/' # to be extended allowed_formats = (u'gif', u'jpg', u'jpeg', u'mid', u'midi', u'ogg', u'png', u'svg', u'xcf', u'djvu', u'ogv', u'oga', u'tif', u'tiff') # ask until it's valid while True: newfn = pywikibot.input( -u'Enter a better name, or press enter to accept:') +u'Enter a better name, or press enter to accept:') if newfn == "": newfn = filename break @@ -160,8 +162,8 @@ if ext not in allowed_formats: choice = pywikibot.inputChoice( u"File format is not one of [%s], but %s. Continue?" - % (u' '.join(allowed_formats), ext), -['yes', 'no'], ['y', 'N'], 'N') +% (u' '.join(allowed_formats), ext), +['yes', 'no'], ['y', 'N'], 'N') if choice == 'n': continue break @@ -195,7 +197,7 @@ filename = self.process_filename() site = self.targetSite -imagepage = pywikibot.ImagePage(site, filename) # normalizes filename +imagepage = pywikibot.ImagePage(site, filename) # normalizes filename imagepage.text = self.description pywikibot.output(u'Uploading file to %s via API' % site) @@ -231,7 +233,7 @@ else: #No warning, upload complete. pywikibot.output(u"Upload successful.") -return filename #data['filename'] +return filename # data['filename'] def run(self): while not self.urlOK(): -- To view, visit https://gerrit.wikimedia.org/r/80862 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I941a05ee6a9a3914dc0623720792ff95abeede00 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/replicate_wiki.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80857 Change subject: pep8-ified scripts/replicate_wiki.py .. pep8-ified scripts/replicate_wiki.py Change-Id: Ie968eb90578614e84c8a16c583a5716d3077e285 --- M scripts/replicate_wiki.py 1 file changed, 28 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/57/80857/1 diff --git a/scripts/replicate_wiki.py b/scripts/replicate_wiki.py index 3e50836..5ed1bd9 100644 --- a/scripts/replicate_wiki.py +++ b/scripts/replicate_wiki.py @@ -31,9 +31,10 @@ from pywikibot import * from itertools import imap + def namespaces(site): '''dict from namespace number to prefix''' -ns = dict(map(lambda n: (site.getNamespaceIndex(n), n), +ns = dict(map(lambda n: (site.getNamespaceIndex(n), n), site.namespaces())) ns[0] = '' return ns @@ -50,7 +51,7 @@ '''Work is done in here.''' def __init__(self, options): - self.options = options +self.options = options if options.original_wiki: original_wiki = options.original_wiki @@ -64,7 +65,7 @@ sites = options.destination_wiki self.original = getSite(original_wiki, family) - + if options.namespace and 'help' in options.namespace: nsd = namespaces(self.original) for k in nsd: @@ -75,7 +76,7 @@ self.differences = {} self.user_diff = {} -print 'Syncing to', +print 'Syncing to', for s in self.sites: self.differences[s] = [] self.user_diff[s] = [] @@ -103,16 +104,16 @@ def check_namespaces(self): '''Check all namespaces, to be ditched for clarity''' namespaces = [ -0, # Main -8, # MediaWiki -152, # DPL -102, # Eigenschap -104, # Type -106, # Formulier -108, # Concept -10, # Sjabloon -] - +0,# Main +8,# MediaWiki +152, # DPL +102, # Eigenschap +104, # Type +106, # Formulier +108, # Concept +10, # Sjabloon +] + if self.options.namespace: print options.namespace namespaces = [int(options.namespace)] @@ -126,9 +127,9 @@ print "\nCHECKING NAMESPACE", namespace pages = imap(lambda p: p.title(), -self.original.allpages('!', namespace=namespace)) + self.original.allpages('!', namespace=namespace)) for p in pages: -if not p in ['MediaWiki:Sidebar', 'MediaWiki:Mainpage', +if not p in ['MediaWiki:Sidebar', 'MediaWiki:Mainpage', 'MediaWiki:Sitenotice', 'MediaWiki:MenuSidebar']: try: self.check_page(p) @@ -137,7 +138,6 @@ except pywikibot.exceptions.IsRedirectPage: print 'error: Redirectpage - todo: handle gracefully' print - def generate_overviews(self): '''Create page on wikis with overview of bot results''' @@ -148,7 +148,7 @@ output += "".join(map(lambda l: '* [[:' + l + "]]\n", self.differences[site])) else: output += "All important pages are the same" - + output += "\n\n== Admins from original that are missing here ==\n\n" if self.user_diff[site]: output += "".join(map(lambda l: '* ' + l.replace('_', ' ') + "\n", self.user_diff[site])) @@ -157,7 +157,6 @@ print output sync_overview_page.put(output, self.put_message(site)) - def put_message(self, site): return site.loggedInAs() + ' sync.py synchronization from ' + str(self.original) @@ -179,15 +178,15 @@ print "\nCross namespace, new title: ", new_pagename else: new_pagename = pagename - + page2 = Page(site, new_pagename) if page2.exists(): txt2 = page2.get() - + else: txt2 = '' - -if config.replicate_replace.has_key(str(site)): + +if str(site) in config.replicate_replace: txt_new = multiple_replace(txt1, config.replicate_replace[str(site)]) if txt1 != txt_new: print 'NOTE: text replaced using config.sync_replace' @@ -198,11 +197,11 @@ print "\n", site, 'DIFFERS' self.differences[site].append(pagename) - if self.options.replace: - page2.put(txt1, self.put_message(site)) -else: -sys.stdout.write('.') -sys.stdo
[MediaWiki-commits] [Gerrit] pep8-ified scripts/solve_disambiguation.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80859 Change subject: pep8-ified scripts/solve_disambiguation.py .. pep8-ified scripts/solve_disambiguation.py Change-Id: I8463eef7092e7770847febb95ee190c8306735ce --- M scripts/solve_disambiguation.py 1 file changed, 116 insertions(+), 108 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/59/80859/1 diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index 0d91eff..c6f792a 100644 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -75,14 +75,16 @@ # (C) WikiWichtel, 2004 # (C) Pywikipedia team, 2003-2009 # -__version__='$Id$' +__version__ = '$Id$' # # Distributed under the terms of the MIT license. # # Standard library imports -import re, sys, codecs +import re +import sys +import codecs # Application specific imports import pywikibot @@ -93,7 +95,7 @@ # Disambiguation Needed template dn_template = { -'en' : u'{{dn}}', +'en': u'{{dn}}', } # disambiguation page name format for "primary topic" disambiguations @@ -121,7 +123,7 @@ 'sr': u'%s_(вишезначна одредница)', 'sv': u'%s_(olika betydelser)', 'uk': u'%s_(значення)', -} +} # List pages that will be ignored if they got a link to a disambiguation # page. An example is a page listing disambiguations articles. @@ -309,11 +311,11 @@ u'Wikipedia:Woorden die niet als zoekterm gebruikt kunnen worden', u'Overleg gebruiker:Taka(/.*)?', u"Wikipedia:Links naar doorverwijspagina's/Artikelen", - ], +], 'pl': [ u'Wikipedysta:.+', u'Dyskusja.+:.+', - ], +], 'pt': [ u'Usuário:.+', u'Usuário Discussão:.+', @@ -340,21 +342,24 @@ }, } + def firstcap(string): -return string[0].upper()+string[1:] +return string[0].upper() + string[1:] + def correctcap(link, text): # If text links to a page with title link uncapitalized, uncapitalize link, # otherwise capitalize it linkupper = link.title() linklower = linkupper[0].lower() + linkupper[1:] -if "[[%s]]"%linklower in text or "[[%s|"%linklower in text: +if "[[%s]]" % linklower in text or "[[%s|" % linklower in text: return linklower else: return linkupper + class ReferringPageGeneratorWithIgnore: -def __init__(self, disambPage, primary=False, minimum = 0): +def __init__(self, disambPage, primary=False, minimum=0): self.disambPage = disambPage # if run with the -primary argument, enable the ignore manager self.primaryIgnoreManager = PrimaryIgnoreManager(disambPage, @@ -368,15 +373,14 @@ withTemplateInclusion=False)] pywikibot.output(u"Found %d references." % len(refs)) # Remove ignorables -if self.disambPage.site.family.name in ignore_title \ -and self.disambPage.site.lang \ -in ignore_title[self.disambPage.site.family.name]: +if self.disambPage.site.family.name in ignore_title and \ + self.disambPage.site.lang in ignore_title[self.disambPage.site.family.name]: for ig in ignore_title[self.disambPage.site.family.name ][self.disambPage.site.lang]: -for i in range(len(refs)-1, -1, -1): +for i in range(len(refs) - 1, -1, -1): if re.match(ig, refs[i].title()): pywikibot.log(u'Ignoring page %s' -% refs[i].title()) + % refs[i].title()) del refs[i] elif self.primaryIgnoreManager.isIgnored(refs[i]): del refs[i] @@ -388,20 +392,21 @@ for ref in refs: yield ref + class PrimaryIgnoreManager(object): ''' If run with the -primary argument, reads from a file which pages should not be worked on; these are the ones where the user pressed n last time. If run without the -primary argument, doesn't ignore any pages. ''' -def __init__(self, disambPage, enabled = False): +def __init__(self, disambPage, enabled=False): self.disambPage = disambPage self.enabled = enabled self.ignorelist = [] filename = config.datafilepath( -'disambiguations', -self.disambPage.title(as_filename=True) + '.txt') +'disambiguations', +self.disambPage.title(as_filename=True) + '.txt') try: # The file is stored in the disambiguation/ subdir. # Create if necessary. @@ -424,8 +429,8 @@ if self.enabled: # Skip th
[MediaWiki-commits] [Gerrit] pep8-ified scripts/replace.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80856 Change subject: pep8-ified scripts/replace.py .. pep8-ified scripts/replace.py Change-Id: Id1aed3b2dbb748dde4ec2d672a86ee8ecd6303b7 --- M scripts/replace.py 1 file changed, 29 insertions(+), 28 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/56/80856/1 diff --git a/scripts/replace.py b/scripts/replace.py index cf91baa..76f0636 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -118,12 +118,14 @@ # # (C) Daniel Herding & the Pywikipedia team, 2004-2012 # -__version__='$Id$' +__version__ = '$Id$' # # Distributed under the terms of the MIT license. # -import sys, re, time +import sys +import re +import time import pywikibot from pywikibot import pagegenerators from pywikibot import editor as editarticle @@ -206,7 +208,7 @@ return True if "require-title" in self.exceptions: for req in self.exceptions['require-title']: -if not req.search(title): # if not all requirements are met: +if not req.search(title): # if not all requirements are met: return True return False @@ -311,7 +313,7 @@ if "inside" in self.exceptions: exceptions += self.exceptions['inside'] for old, new in self.replacements: -if self.sleep != None: +if self.sleep is not None: time.sleep(self.sleep) new_text = pywikibot.replaceExcept(new_text, old, new, exceptions, allowoverlap=self.allowoverlap) @@ -344,7 +346,7 @@ if self.isTextExcepted(new_text): pywikibot.output( u'Skipping %s because it contains text that is on the exceptions list.' - % page.title(asLink=True)) +% page.title(asLink=True)) break new_text = self.doReplacements(new_text) if new_text == original_text: @@ -353,7 +355,7 @@ break if self.recursive: newest_text = self.doReplacements(new_text) -while (newest_text!=new_text): +while (newest_text != new_text): new_text = newest_text newest_text = self.doReplacements(new_text) if hasattr(self, "addedCat"): @@ -370,10 +372,9 @@ if self.acceptall: break choice = pywikibot.inputChoice( -u'Do you want to accept these changes?', -['Yes', 'No', 'Edit', 'open in Browser', 'All', - 'Quit'], -['y', 'N', 'e', 'b', 'a', 'q'], 'N') +u'Do you want to accept these changes?', +['Yes', 'No', 'Edit', 'open in Browser', 'All', 'Quit'], +['y', 'N', 'e', 'b', 'a', 'q'], 'N') if choice == 'e': editor = editarticle.TextEditor() as_edited = editor.edit(original_text) @@ -420,6 +421,7 @@ pywikibot.output(u'Skipping %s (locked page)' % (page.title(),)) + def prepareRegexForMySQL(pattern): pattern = pattern.replace('\s', '[:space:]') pattern = pattern.replace('\d', '[:digit:]') @@ -449,7 +451,7 @@ 'text-contains': [], 'inside':[], 'inside-tags': [], -'require-title': [], # using a seperate requirements dict needs some +'require-title': [], # using a seperate requirements dict needs some }# major refactoring of code. # Should the elements of 'replacements' and 'exceptions' be interpreted @@ -500,7 +502,7 @@ xmlFilename = i18n.input('pywikibot-enter-xml-filename') else: xmlFilename = arg[5:] -elif arg =='-sql': +elif arg == '-sql': useSql = True elif arg.startswith('-page'): if len(arg) == 5: @@ -545,23 +547,23 @@ gen = genFactory.getCombinedGenerator() if (len(commandline_replacements) % 2): raise pywikibot.Error, 'require even number of replacements.' -elif (len(commandline_replacements) == 2 and fix == None): +elif (len(commandline_replacements) == 2 and fix is None): replacements.append((commandline_replacements[0], commandline_replacements[1])) if not summary_commandline: -edit_summary = i18n.twtranslate(pywikibot.getSite(), -'replace-replacing', -{'description': ' (-%s +%s)' -
[MediaWiki-commits] [Gerrit] pep8-ified scripts/template.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80860 Change subject: pep8-ified scripts/template.py .. pep8-ified scripts/template.py Change-Id: I7dc726681d930aed5dfcdc256f12ed3417c0b869 --- M scripts/template.py 1 file changed, 18 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/60/80860/1 diff --git a/scripts/template.py b/scripts/template.py index f5d5d10..91ec9ff 100755 --- a/scripts/template.py +++ b/scripts/template.py @@ -104,13 +104,16 @@ # # Distributed under the terms of the MIT license. # -__version__='$Id$' +__version__ = '$Id$' # -import re, sys, string +import re +import sys +import string import pywikibot from pywikibot import i18n from pywikibot import config, pagegenerators, catlib from scripts import replace + def UserEditFilterGenerator(generator, username, timestamp=None, skip=False): """ @@ -129,7 +132,7 @@ found = False for ed in editors: uts = pywikibot.Timestamp.fromISOformat(ed['timestamp']) -if not timestamp or uts>=ts: +if not timestamp or uts >= ts: if username == ed['user']: found = True break @@ -178,7 +181,7 @@ templatePatterns.append(templatePattern) templateRegex = re.compile( r'\{\{ *([mM][sS][gG]:)?(?:%s) *(?P\|[^}]+|) *}}' - % '|'.join(templatePatterns)) +% '|'.join(templatePatterns)) for entry in dump.parse(): if templateRegex.search(entry.text): page = pywikibot.Page(mysite, entry.title) @@ -191,8 +194,8 @@ remove all occurences of the old template, or substitute them with the template's text. """ -def __init__(self, generator, templates, subst = False, remove = False, - editSummary = '', acceptAll = False, addedCat = None): +def __init__(self, generator, templates, subst=False, remove=False, + editSummary='', acceptAll=False, addedCat=None): """ Arguments: * generator- A page generator. @@ -216,9 +219,9 @@ site, u'%s:%s' % (site.namespace(14), self.addedCat)) # get edit summary message if it's empty -if (self.editSummary==''): +if (self.editSummary == ''): Param = {'list': (', ').join(self.templates.keys()), - 'num' : len(self.templates)} + 'num': len(self.templates)} if self.remove: self.editSummary = i18n.twntranslate( site, 'template-removing', Param) @@ -260,11 +263,11 @@ if self.subst and self.remove: replacements.append((templateRegex, '{{subst:%s\g}}' % new)) -exceptions['inside-tags']=['ref', 'gallery'] +exceptions['inside-tags'] = ['ref', 'gallery'] elif self.subst: replacements.append((templateRegex, '{{subst:%s\g}}' % old)) -exceptions['inside-tags']=['ref', 'gallery'] +exceptions['inside-tags'] = ['ref', 'gallery'] elif self.remove: replacements.append((templateRegex, '')) else: @@ -276,6 +279,7 @@ addedCat=self.addedCat, editSummary=self.editSummary) replaceBot.run() + def main(*args): templateNames = [] @@ -349,8 +353,10 @@ gen = genFactory.getCombinedGenerator() if not gen: gens = [] -gens = [pagegenerators.ReferringPageGenerator( -t, onlyTemplateInclusion=True) for t in oldTemplates] +gens = [ +pagegenerators.ReferringPageGenerator(t, onlyTemplateInclusion=True) +for t in oldTemplates +] gen = pagegenerators.CombinedPageGenerator(gens) gen = pagegenerators.DuplicateFilterPageGenerator(gen) -- To view, visit https://gerrit.wikimedia.org/r/80860 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7dc726681d930aed5dfcdc256f12ed3417c0b869 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/redirect.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80855 Change subject: pep8-ified scripts/redirect.py .. pep8-ified scripts/redirect.py Change-Id: I2f649ec203378a44c752343ebd76f91b49e6a3df --- M scripts/redirect.py 1 file changed, 17 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/55/80855/1 diff --git a/scripts/redirect.py b/scripts/redirect.py index bf42437..57778ac 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -56,7 +56,7 @@ # # Distributed under the terms of the MIT license. # -__version__='$Id$' +__version__ = '$Id$' # import re import datetime @@ -120,7 +120,7 @@ or target.startswith(':%s:' % code): if code == self.site.language(): # link to our wiki, but with the lang prefix -target = target[(len(code)+1):] +target = target[(len(code) + 1):] if target.startswith(':'): target = target[1:] else: @@ -168,8 +168,8 @@ if self.api_step: gen.set_query_increment(self.api_step) for p in gen: -done = self.api_until \ - and p.title(withNamespace=False) >= self.api_until +done = (self.api_until and +p.title(withNamespace=False) >= self.api_until) if done: return yield p @@ -323,8 +323,8 @@ if self.offset <= 0: self.offset = 1 -start = datetime.datetime.utcnow() - \ -datetime.timedelta(0, self.offset * 3600) +start = (datetime.datetime.utcnow() - + datetime.timedelta(0, self.offset * 3600)) # self.offset hours ago offset_time = start.strftime("%Y%m%d%H%M%S") pywikibot.output(u'Retrieving %s moved pages via API...' @@ -406,12 +406,9 @@ try: redir_page.delete(reason, prompt=False) except pywikibot.NoUsername: -if (i18n.twhas_key( -targetPage.site.lang, -'redirect-broken-redirect-template') and -i18n.twhas_key(targetPage.site.lang, - 'redirect-remove-broken')) or \ - targetPage.site.lang == '-': +if ((i18n.twhas_key(targetPage.site.lang, 'redirect-broken-redirect-template') and + i18n.twhas_key(targetPage.site.lang, 'redirect-remove-broken') + ) or targetPage.site.lang == '-'): pywikibot.output(u"No sysop in user-config.py, " u"put page to speedy deletion.") content = redir_page.get(get_redirect=True) @@ -420,7 +417,7 @@ content = i18n.twtranslate( targetPage.site.lang, 'redirect-broken-redirect-template' -) + "\n" + content +) + "\n" + content redir_page.put(content, reason) except pywikibot.IsRedirectPage: pywikibot.output(u"Redirect target %s is also a redirect! " @@ -472,7 +469,7 @@ except pywikibot.CircularRedirect, e: try: pywikibot.warning(u"Skipping circular redirect: [[%s]]" - % str(e)) + % str(e)) except UnicodeDecodeError: pywikibot.warning(u"Skipping circular redirect") break @@ -526,7 +523,7 @@ pywikibot.warning( u'Redirect target %s forms a redirect loop.' % targetPage.title(asLink=True)) -break ### doesn't work. edits twice! +break # doesn't work. edits twice! ##try: ##content = targetPage.get(get_redirect=True) ##except pywikibot.SectionError: @@ -696,8 +693,11 @@ else: pywikibot.output(u'Unknown argument: %s' % arg) -if not action or (xmlFilename and moved_pages) \ - or (fullscan and xmlFilename): +if ( +(not action) or +(xmlFilename and moved_pages) or +(fullscan and xmlFilename) +): pywikibot.showHelp('redirect') else: gen = RedirectGenerator(xmlFilename, namespaces, offset, moved_pages, -- To view, visit https://ge
[MediaWiki-commits] [Gerrit] pep8-ified scripts/noreferences.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80854 Change subject: pep8-ified scripts/noreferences.py .. pep8-ified scripts/noreferences.py Change-Id: Ia3c38a54f5d26c834eb8d73915509c11da726cf8 --- M scripts/noreferences.py 1 file changed, 26 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/54/80854/1 diff --git a/scripts/noreferences.py b/scripts/noreferences.py index 51e5906..8c8e0dd 100755 --- a/scripts/noreferences.py +++ b/scripts/noreferences.py @@ -34,9 +34,10 @@ a list of affected articles """ -__version__='$Id$' +__version__ = '$Id$' -import re, sys +import re +import sys import pywikibot from pywikibot import i18n from pywikibot import pagegenerators, catlib @@ -73,7 +74,7 @@ u'Siehe auch', u'Weblink', # bad, but common singular form of Weblinks ], -'dsb':[ +'dsb': [ u'Nožki', ], 'en': [ # no explicit policy on where to put the references @@ -114,7 +115,7 @@ u'Voir aussi', u'Notes' ], -'hsb':[ +'hsb': [ u'Nóžki', ], 'hu': [ @@ -128,12 +129,12 @@ u'Collegamenti esterni', u'Vedi anche', ], -'ja':[ +'ja': [ u'関連項目', u'参考文献', u'外部リンク', ], -'ko':[ # no explicit policy on where to put the references +'ko': [ # no explicit policy on where to put the references u'외부 링크', u'외부링크', u'바깥 고리', @@ -200,7 +201,7 @@ 'da': [ u'Noter', ], -'de': [ #see [[de:WP:REF]] +'de': [ # see [[de:WP:REF]] u'Einzelnachweise', u'Anmerkungen', u'Belege', @@ -210,7 +211,7 @@ u'Quellen', u'Quellenangaben', ], -'dsb':[ +'dsb': [ u'Nožki', ], 'en': [ # not sure about which ones are preferred. @@ -247,7 +248,7 @@ 'he': [ u'הערות שוליים', ], -'hsb':[ +'hsb': [ u'Nóžki', ], 'hu': [ @@ -326,17 +327,17 @@ 'be': [u'Зноскі', u'Примечания', u'Reflist', u'Спіс заўваг', u'Заўвагі'], 'be-x-old': [u'Зноскі'], 'da': [u'Reflist'], -'dsb':[u'Referency'], +'dsb': [u'Referency'], 'en': [u'Reflist', u'Refs', u'FootnotesSmall', u'Reference', u'Ref-list', u'Reference list', u'References-small', u'Reflink', u'Footnotes', u'FootnotesSmall'], 'eo': [u'Referencoj'], 'es': ['Listaref', 'Reflist', 'muchasref'], 'fa': [u'Reflist', u'Refs', u'FootnotesSmall', u'Reference', - u'پانویس', u'پانویسها ', u'پانویس ۲', u'پانویس۲',u'فهرست منابع'], + u'پانویس', u'پانویسها ', u'پانویس ۲', u'پانویس۲', u'فهرست منابع'], 'fi': [u'Viitteet', u'Reflist'], 'fr': [u'Références', u'Notes', u'References', u'Reflist'], -'hsb':[u'Referency'], +'hsb': [u'Referency'], 'hu': [u'reflist', u'források', u'references', u'megjegyzések'], 'is': [u'reflist'], 'it': [u'References'], @@ -353,7 +354,7 @@ 'ru': [u'Reflist', u'Ref-list', u'Refs', u'Sources', u'Примечания', u'Список примечаний', u'Сноска', u'Сноски'], -'szl':[u'Przipisy', u'Připisy'], +'szl': [u'Przipisy', u'Připisy'], 'zh': [u'Reflist', u'RefFoot', u'NoteFoot'], }, } @@ -364,14 +365,14 @@ 'wikipedia': { 'be': u'{{зноскі}}', 'da': u'{{reflist}}', -'dsb':u'{{referency}}', +'dsb': u'{{referency}}', 'fa': u'{{پانویس}}', 'fi': u'{{viitteet}}', -'hsb':u'{{referency}}', +'hsb': u'{{referency}}', 'hu': u'{{Források}}', 'pl': u'{{Przypisy}}', 'ru': u'{{примечания}}', -'szl':u'{{Przipisy}}', +'szl': u'{{Przipisy}}', 'zh': u'{{reflist}}', }, } @@ -394,6 +395,7 @@ 'zh': u'参考资料格式错误的页面', }, } + class XmlDumpNoReferencesPageGenerator: """ @@ -430,7 +432,7 @@ self.refR = re.compile('', re.IGNORECASE) self.referencesR = re.compile('', re.IGNORECASE) self.referencesTagR = re.compile('.*?', - re.IGNORECASE|re.DOTALL) + re.IGNORECASE | re.DOTALL) try: self.referencesTemplates = referencesTemplates[ pywikibot.getSite().family.name][pywikibot.getSite().lang] @@ -454,7 +456,7 @@ return False elif self.referencesTemplates: templateR = u'{{(' + u'|'.join(self.referencesTemplates) + ')' -if re.search(templateR, oldTextCleaned, re.IGNORECASE|re.UNICODE): +if re.search(templateR, oldTextCleaned, re.IGNORECASE | re.UNICODE):
[MediaWiki-commits] [Gerrit] pep8-ified scripts/login.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80853 Change subject: pep8-ified scripts/login.py .. pep8-ified scripts/login.py Change-Id: I00045034e30dc4fa2458290b36f2da441315d822 --- M scripts/login.py 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/53/80853/1 diff --git a/scripts/login.py b/scripts/login.py index 90d73fe..afdc9a4 100755 --- a/scripts/login.py +++ b/scripts/login.py @@ -52,6 +52,7 @@ from pywikibot import config, deprecate_arg from pywikibot.exceptions import NoSuchSite, NoUsername + def main(*args): password = None sysop = False @@ -60,7 +61,7 @@ if arg.startswith("-pass"): if len(arg) == 5: password = pywikibot.input(u'Password for all accounts:', - password = True) + password=True) else: password = arg[6:] elif arg == "-sysop": -- To view, visit https://gerrit.wikimedia.org/r/80853 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00045034e30dc4fa2458290b36f2da441315d822 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/script_wui.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80858 Change subject: pep8-ified scripts/script_wui.py .. pep8-ified scripts/script_wui.py Change-Id: Id9cdb638d43d9a9eefd68099dfd3334aff940841 --- M scripts/script_wui.py 1 file changed, 39 insertions(+), 30 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/58/80858/1 diff --git a/scripts/script_wui.py b/scripts/script_wui.py index 6744de4..9f60317 100755 --- a/scripts/script_wui.py +++ b/scripts/script_wui.py @@ -57,13 +57,19 @@ # ... # --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- # -__version__ = '$Id$' +__version__ = '$Id$' # -import datetime, time -import thread, threading -import sys, os, traceback, gc, resource +import datetime +import time +import thread +import threading +import sys +import os +import traceback +import gc +import resource import re # http://labix.org/lunatic-python @@ -78,25 +84,25 @@ import pywikibot.botirc -bot_config = {'BotName': pywikibot.config.usernames[pywikibot.config.family][pywikibot.config.mylang], +bot_config = { +'BotName': pywikibot.config.usernames[pywikibot.config.family][pywikibot.config.mylang], -# protected !!! ('CSS' or other semi-protected page is essential here) -'ConfCSSshell': u'User:DrTrigon/DrTrigonBot/script_wui-shell.css',# u'User:DrTrigonBot/Simon sagt' ? -'ConfCSScrontab': u'User:DrTrigon/DrTrigonBot/script_wui-crontab.css', +# protected !!! ('CSS' or other semi-protected page is essential here) +'ConfCSSshell': u'User:DrTrigon/DrTrigonBot/script_wui-shell.css',# u'User:DrTrigonBot/Simon sagt' ? +'ConfCSScrontab': u'User:DrTrigon/DrTrigonBot/script_wui-crontab.css', -# (may be protected but not that important... 'CSS' is not needed here !!!) -'ConfCSSoutput':u'User:DrTrigonBot/Simulation', +# (may be protected but not that important... 'CSS' is not needed here !!!) +'ConfCSSoutput': u'User:DrTrigonBot/Simulation', -'CRONMaxDelay': 5*60.0, # check all ~5 minutes +'CRONMaxDelay': 5 * 60.0, # check all ~5 minutes +#'queue_security': ([u'DrTrigon', u'DrTrigonBot'], u'Bot: exec'), +#'queue_security': ([u'DrTrigon'], u'Bot: exec'), -#'queue_security': ([u'DrTrigon', u'DrTrigonBot'], u'Bot: exec'), -#'queue_security': ([u'DrTrigon'], u'Bot: exec'), +# supported and allowed bot scripts +# (at the moment all) -# supported and allowed bot scripts -# (at the moment all) - -# forbidden parameters -# (at the moment none, but consider e.g. '-always' or allow it with '-simulate' only!) +# forbidden parameters +# (at the moment none, but consider e.g. '-always' or allow it with '-simulate' only!) } __simulate = True @@ -124,12 +130,12 @@ # init constants templ = pywikibot.Page(self.site, bot_config['ConfCSSshell']) -cron = pywikibot.Page(self.site, bot_config['ConfCSScrontab']) +cron = pywikibot.Page(self.site, bot_config['ConfCSScrontab']) self.templ = templ.title() -self.cron = cron.title() -self.refs = { self.templ: templ, - self.cron: cron, } +self.cron = cron.title() +self.refs = {self.templ: templ, + self.cron: cron, } pywikibot.output(u'** Pre-loading all relevant page contents') for item in self.refs: # security; first check if page is protected, reject any data if not @@ -176,9 +182,9 @@ # (date supported only, thus [min] and [hour] dropped) entry = crontab.CronTab(timestmp) # find the delay from current minute (does not return 0.0 - but next) -delay = entry.next(datetime.datetime.now().replace(second=0,microsecond=0)-datetime.timedelta(microseconds=1)) +delay = entry.next(datetime.datetime.now().replace(second=0, microsecond=0) - datetime.timedelta(microseconds=1)) #pywikibot.output(u'CRON delay for execution: %.3f (<= %i)' % (delay, bot_config['CRONMaxDelay'])) - + if (delay <= bot_config['CRONMaxDelay']): pywikibot.output(u"CRONTAB: %s / %s / %s" % (page, rev, timestmp)) self.do_check(page.title(), int(rev)) @@ -187,14 +193,15 @@ # Create two threads as follows # (simple 'thread' for more sophisticated code use 'threading') try: -thread.start_new_thread( main_script, (self.refs[page_title], rev, params) ) +thread.start_new_thread(main_script, (self.refs[page_title], rev, params)) except: # (done according to subster in trunk and submit in rewrite/.../data/api.py) # TODO: is this error handlin
[MediaWiki-commits] [Gerrit] pep8-ified scripts/editarticle.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80848 Change subject: pep8-ified scripts/editarticle.py .. pep8-ified scripts/editarticle.py Change-Id: Ic1a00a59d4afedb4302ea8c65f6d5331f25f40d2 --- M scripts/editarticle.py 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/48/80848/1 diff --git a/scripts/editarticle.py b/scripts/editarticle.py index 069ddd2..babf185 100755 --- a/scripts/editarticle.py +++ b/scripts/editarticle.py @@ -81,7 +81,7 @@ def run(self): try: -old = self.page.get(get_redirect = self.options.edit_redirect) +old = self.page.get(get_redirect=self.options.edit_redirect) except pywikibot.NoPage: old = "" textEditor = TextEditor() @@ -99,6 +99,7 @@ else: pywikibot.output(u"Nothing changed") + def main(*args): app = ArticleEditor(*args) app.run() -- To view, visit https://gerrit.wikimedia.org/r/80848 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1a00a59d4afedb4302ea8c65f6d5331f25f40d2 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/data_ingestion.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80847 Change subject: pep8-ified scripts/data_ingestion.py .. pep8-ified scripts/data_ingestion.py Change-Id: I04c5b328e16db2594c6436a68c73cc66ee116ac5 --- M scripts/data_ingestion.py 1 file changed, 16 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/47/80847/1 diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py index df43f9d..386ff91 100755 --- a/scripts/data_ingestion.py +++ b/scripts/data_ingestion.py @@ -5,10 +5,13 @@ ''' import pywikibot -import posixpath, urlparse +import posixpath +import urlparse import urllib -import hashlib, base64 +import hashlib +import base64 import StringIO + class Photo(object): ''' @@ -36,11 +39,11 @@ TODO: Add exception handling ''' if not self.contents: -imageFile=urllib.urlopen(self.URL).read() +imageFile = urllib.urlopen(self.URL).read() self.contents = StringIO.StringIO(imageFile) return self.contents -def findDuplicateImages(self, site = pywikibot.getSite(u'commons', u'commons')): +def findDuplicateImages(self, site=pywikibot.getSite(u'commons', u'commons')): ''' Takes the photo, calculates the SHA1 hash and asks the mediawiki api for a list of duplicates. @@ -76,12 +79,14 @@ def _safeTemplateValue(self, value): return value.replace("|", "{{!}}") + def CSVReader(fileobj, urlcolumn, *args, **kwargs): import csv reader = csv.DictReader(fileobj, *args, **kwargs) for line in reader: yield Photo(line[urlcolumn], line) + class DataIngestionBot: def __init__(self, reader, titlefmt, pagefmt, site=pywikibot.getSite(u'commons', u'commons')): @@ -99,12 +104,12 @@ title = photo.getTitle(self.titlefmt) description = photo.getDescription(self.pagefmt) -bot = upload.UploadRobot(url = photo.URL, - description = description, - useFilename = title, - keepFilename = True, - verifyDescription = False, - targetSite = self.site) +bot = upload.UploadRobot(url=photo.URL, + description=description, + useFilename=title, + keepFilename=True, + verifyDescription=False, + targetSite=self.site) bot._contents = photo.downloadPhoto().getvalue() bot._retrieved = True bot.run() @@ -118,7 +123,7 @@ for photo in self.reader: self._doUpload(photo) -if __name__=="__main__": +if __name__ == "__main__": reader = CSVReader(open('tests/data/csv_ingestion.csv'), 'url') bot = DataIngestionBot(reader, "%(name)s - %(set)s.%(_ext)s", ":user:valhallasw/test_template", pywikibot.getSite('test', 'test')) bot.run() -- To view, visit https://gerrit.wikimedia.org/r/80847 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04c5b328e16db2594c6436a68c73cc66ee116ac5 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/clean_sandbox.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80844 Change subject: pep8-ified scripts/clean_sandbox.py .. pep8-ified scripts/clean_sandbox.py Change-Id: Ie3b2432b3beaed0a9a92fa38341808e6709992fb --- M scripts/clean_sandbox.py 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/44/80844/1 diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py index 54cbc85..c06662c 100755 --- a/scripts/clean_sandbox.py +++ b/scripts/clean_sandbox.py @@ -210,8 +210,7 @@ u'Standard content was changed, sandbox cleaned.') else: edit_delta = datetime.datetime.utcnow() - \ - pywikibot.Timestamp.fromISOformat( - sandboxPage.editTime()) + pywikibot.Timestamp.fromISOformat(sandboxPage.editTime()) delta = self.getOption('delay_td') - edit_delta # Is the last edit more than 'delay' minutes ago? if delta <= datetime.timedelta(0): -- To view, visit https://gerrit.wikimedia.org/r/80844 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3b2432b3beaed0a9a92fa38341808e6709992fb Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/interwiki.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80851 Change subject: pep8-ified scripts/interwiki.py .. pep8-ified scripts/interwiki.py Change-Id: Ic78ca03626ce51fd043afd7d8b8a03c973a544d3 --- M scripts/interwiki.py 1 file changed, 81 insertions(+), 63 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/51/80851/1 diff --git a/scripts/interwiki.py b/scripts/interwiki.py index 713d2d7..ff94157 100755 --- a/scripts/interwiki.py +++ b/scripts/interwiki.py @@ -667,7 +667,8 @@ index = 1 while True: path = config.datafilepath('cache', 'pagestore' + str(index)) -if not os.path.exists(path): break +if not os.path.exists(path): +break index += 1 StoredPage.SPpath = path StoredPage.SPstore = shelve.open(path) @@ -1031,8 +1032,8 @@ if linkedPage in self.foundIn: # We have seen this page before, don't ask again. return False -elif self.originPage and \ - self.originPage.namespace() != linkedPage.namespace(): +elif (self.originPage and + self.originPage.namespace() != linkedPage.namespace()): # Allow for a mapping between different namespaces crossFrom = self.originPage.site.family.crossnamespace.get( self.originPage.namespace(), {}) @@ -1099,8 +1100,9 @@ pywikibot.output(u"NOTE: Ignoring %s for %s in wiktionary mode" % (page, self.originPage)) return True -elif page.title() != self.originPage.title() and \ - self.originPage.site.nocapitalize and page.site.nocapitalize: +elif (page.title() != self.originPage.title() and + self.originPage.site.nocapitalize and + page.site.nocapitalize): pywikibot.output( u"NOTE: Ignoring %s for %s in wiktionary mode because both " u"languages are uncapitalized." @@ -1334,8 +1336,8 @@ if not globalvar.quiet: pywikibot.output( u"NOTE: not following static %sredirects." % redir) -elif page.site.family == redirectTargetPage.site.family \ -and not self.skipPage(page, redirectTargetPage, counter): +elif (page.site.family == redirectTargetPage.site.family and + not self.skipPage(page, redirectTargetPage, counter)): if self.addIfNew(redirectTargetPage, counter, page): if config.interwiki_shownew: pywikibot.output(u"%s: %s gives new %sredirect %s" @@ -1414,21 +1416,21 @@ self.makeForcedStop(counter) try: f = codecs.open( - pywikibot.config.datafilepath('autonomous_problems.dat'), -'a', 'utf-8') + pywikibot.config.datafilepath('autonomous_problems.dat'), +'a', 'utf-8') f.write(u"* %s {Found more than one link for %s}" % (self.originPage, page.site)) if config.interwiki_graph and config.interwiki_graph_url: -filename = interwiki_graph.getFilename(self.originPage, extension = config.interwiki_graph_formats[0]) +filename = interwiki_graph.getFilename(self.originPage, extension=config.interwiki_graph_formats[0]) f.write(u" [%s%s graph]" % (config.interwiki_graph_url, filename)) f.write("\n") f.close() # FIXME: What errors are we catching here? # except: should be avoided!! except: - #raise - pywikibot.output(u'File autonomous_problems.dat open or corrupted! Try again with -restore.') - sys.exit() +#raise +pywikibot.output(u'File autonomous_problems.dat open or corrupted! Try again with -restore.') +sys.exit() iw = () elif page.isEmpty() and not page.isCategory(): globalvar.remove.append(unicode(page)) @@ -1451,7 +1453,7 @@ if self.addIfNew(linkedPage, counter, page): # It is new. Also verify whether it is the second on the # same site -lpsite=linkedPage.site +lpsite = linkedPage.site for prevPage in self.foundIn: if prevPage != link
[MediaWiki-commits] [Gerrit] pep8-ified scripts/cosmetic_changes.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80846 Change subject: pep8-ified scripts/cosmetic_changes.py .. pep8-ified scripts/cosmetic_changes.py Change-Id: I7e2d277215f5ef054d752f30243ea223c5eb0528 --- M scripts/cosmetic_changes.py 1 file changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/46/80846/1 diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py index 9d96562..5acb8ee 100755 --- a/scripts/cosmetic_changes.py +++ b/scripts/cosmetic_changes.py @@ -375,7 +375,8 @@ 'img_right', 'img_none', 'img_framed', 'img_frameless', 'img_border', 'img_upright', ]: aliases = self.site.getmagicwords(magicWord) -if not aliases: continue +if not aliases: +continue text = pywikibot.replaceExcept( text, r'\[\[(?P.+?:.+?\..+?\|) *(' + '|'.join(aliases) + \ @@ -460,10 +461,10 @@ newLink = "[[%s]]" % label # Check if we can create a link with trailing characters # instead of a pipelink -elif len(titleWithSection) <= len(label) and \ - label[:len(titleWithSection)] == titleWithSection \ - and re.sub(trailR, '', -label[len(titleWithSection):]) == '': +elif (len(titleWithSection) <= len(label) and + label[:len(titleWithSection)] == titleWithSection and + re.sub(trailR, '', label[len(titleWithSection):]) == '' + ): newLink = "[[%s]]%s" % (label[:len(titleWithSection)], label[len(titleWithSection):]) else: @@ -472,8 +473,7 @@ # don't capitalize nouns... #if not self.site.nocapitalize: if self.site.sitename() == 'wikipedia:de': -titleWithSection = titleWithSection[0].upper() + \ - titleWithSection[1:] +titleWithSection = titleWithSection[0].upper() + titleWithSection[1:] newLink = "[[%s|%s]]" % (titleWithSection, label) # re-add spaces that were pulled out of the link. # Examples: @@ -879,7 +879,8 @@ def run(self): try: for page in self.generator: -if self.done: break +if self.done: +break self.treat(page) except KeyboardInterrupt: pywikibot.output('\nQuitting program...') -- To view, visit https://gerrit.wikimedia.org/r/80846 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e2d277215f5ef054d752f30243ea223c5eb0528 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/clean_sandbox.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80845 Change subject: pep8-ified scripts/clean_sandbox.py .. pep8-ified scripts/clean_sandbox.py Change-Id: Id0b42c8c1cf468160bbe7d98a6521a69bb746503 --- M scripts/clean_sandbox.py 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/45/80845/1 diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py index 54cbc85..c06662c 100755 --- a/scripts/clean_sandbox.py +++ b/scripts/clean_sandbox.py @@ -210,8 +210,7 @@ u'Standard content was changed, sandbox cleaned.') else: edit_delta = datetime.datetime.utcnow() - \ - pywikibot.Timestamp.fromISOformat( - sandboxPage.editTime()) + pywikibot.Timestamp.fromISOformat(sandboxPage.editTime()) delta = self.getOption('delay_td') - edit_delta # Is the last edit more than 'delay' minutes ago? if delta <= datetime.timedelta(0): -- To view, visit https://gerrit.wikimedia.org/r/80845 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id0b42c8c1cf468160bbe7d98a6521a69bb746503 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/featured.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80849 Change subject: pep8-ified scripts/featured.py .. pep8-ified scripts/featured.py Change-Id: If0956edfb28491f70906c1c4c74dbb105a043c3e --- M scripts/featured.py 1 file changed, 9 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/49/80849/1 diff --git a/scripts/featured.py b/scripts/featured.py index 9c98870..0c3ed50 100644 --- a/scripts/featured.py +++ b/scripts/featured.py @@ -90,6 +90,7 @@ return [page for page in p.getReferences(follow_redirects=False, onlyTemplateInclusion=True)] + def DATA(site, name, hide): dp = pywikibot.ItemPage(site.data_repository(), name) try: @@ -266,7 +267,7 @@ if not self.getOption('nocache') is True: pywikibot.output(u'Writing %d items to cache file %s.' % (len(self.cache), self.filename)) -f = open(self.filename,"wb") +f = open(self.filename, "wb") pickle.dump(self.cache, f) f.close() self.cache = dict() @@ -299,10 +300,10 @@ dp.get() ### Quick and dirty hack - any ideas? -self.fromlang = [key.replace('wiki', '').replace('_', '-') - for key in dp.sitelinks.keys()] +self.fromlang = [key.replace('wiki', '').replace('_', '-') + for key in dp.sitelinks.keys()] else: -return ### 2DO +return # 2DO self.fromlang.sort() self.readcache(task) for code in self.fromlang: @@ -334,10 +335,10 @@ dp.get() ### Quick and dirty hack - any ideas? -self.fromlang = [key.replace('wiki', '').replace('_', '-') - for key in dp.sitelinks.keys()] +self.fromlang = [key.replace('wiki', '').replace('_', '-') + for key in dp.sitelinks.keys()] else: -return ### 2DO +return # 2DO self.fromlang.sort() self.readcache(task) for code in self.fromlang: @@ -403,7 +404,6 @@ cache[p.title()])) continue yield copy(p) - def findTranslated(self, page, oursite=None): quiet = self.getOption('quiet') @@ -473,7 +473,6 @@ pywikibot.output(u"%s -> back interwiki ref target is %s" % (page.title(), backpage.title())) - def getTemplateList(self, lang, task): add_templates = [] remove_templates = [] @@ -522,7 +521,7 @@ return re.compile(ur"\{\{%s\|%s\}\}" % (findtemplate.replace(u' ', u'[ _]'), site.code), re.IGNORECASE) - + quiet = self.getOption('quiet') tosite = self.site if not fromsite.lang in self.cache: @@ -601,7 +600,6 @@ % atrans.title()) except pywikibot.PageNotSaved, e: pywikibot.output(u"Page not saved") - def main(*args): -- To view, visit https://gerrit.wikimedia.org/r/80849 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0956edfb28491f70906c1c4c74dbb105a043c3e Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified scripts/isbn.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80852 Change subject: pep8-ified scripts/isbn.py .. pep8-ified scripts/isbn.py Change-Id: I380b184fa345187c3c46697d372ed87db1ebb4fb --- M scripts/isbn.py 1 file changed, 196 insertions(+), 185 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/52/80852/1 diff --git a/scripts/isbn.py b/scripts/isbn.py index a814c29..76382f3 100755 --- a/scripts/isbn.py +++ b/scripts/isbn.py @@ -36,11 +36,14 @@ """ -__version__='$Id$' +__version__ = '$Id$' + +import sys +import re import pywikibot from pywikibot import pagegenerators, i18n -import sys, re + docuReplacements = { '¶ms;': pagegenerators.parameterHelp, @@ -49,7 +52,7 @@ # Maps each group number to the list of its publisher number ranges. # Taken from http://www.isbn-international.org/converter/ranges.htm ranges = { -'0': [ # English speaking area +'0': [ # English speaking area ('00', '19'), ('200', '699'), ('7000', '8499'), @@ -57,14 +60,14 @@ ('90', '94'), ('950', '999'), ], -'1': [ # English speaking area +'1': [ # English speaking area ('00', '09'), ('100', '399'), ('4000', '5499'), ('55000', '86979'), ('869800', '998999'), ], -'2': [ # French speaking area +'2': [ # French speaking area ('00', '19'), ('200', '349'), ('35000', '3'), @@ -74,7 +77,7 @@ ('90', '94'), ('950', '999'), ], -'3': [ # German speaking area +'3': [ # German speaking area ('00', '02'), ('030', '033'), ('0340', '0369'), @@ -86,7 +89,7 @@ ('90', '94'), ('950', '999'), ], -'4': [ # Japan +'4': [ # Japan ('00', '19'), ('200', '699'), ('7000', '8499'), @@ -94,7 +97,7 @@ ('90', '94'), ('950', '999'), ], -'5': [ # Russian Federation +'5': [ # Russian Federation ('00', '19'), ('200', '699'), ('7000', '8499'), @@ -108,72 +111,72 @@ ('990', '990'), ('9910', ''), ], -'600': [ # Iran +'600': [ # Iran ('00', '09'), ('100', '499'), ('5000', '8999'), ('9', '9'), ], -'601': [ # Kazakhstan +'601': [ # Kazakhstan ('00', '19'), ('200', '699'), ('7000', '7999'), ('8', '84999'), ('85', '99'), ], -'602': [ # Indonesia +'602': [ # Indonesia ('00', '19'), ('200', '799'), ('8000', '9499'), ('95000', '9'), ], -'603': [ # Saudi Arabia +'603': [ # Saudi Arabia ('00', '04'), ('500', '799'), ('8000', '8999'), ('9', '9'), ], -'604': [ # Vietnam +'604': [ # Vietnam ('0', '4'), ('50', '89'), ('900', '979'), ('9800', ''), ], -'605': [ # Turkey +'605': [ # Turkey ('00', '09'), ('100', '399'), ('4000', '5999'), ('6', '8'), ], -'7': [ # China, People's Republic +'7': [ # China, People's Republic ('00', '09'), ('100', '499'), ('5000', '7999'), ('8', '8'), ('90', '99'), ], -'80': [ # Czech Republic; Slovakia +'80': [ # Czech Republic; Slovakia ('00', '19'), ('200', '699'), ('7000', '8499'), ('85000', '8'), ('90', '99'), ], -'81': [ # India +'81': [ # India ('00', '19'), ('200', '699'), ('7000', '8499'), ('85000', '8'), ('90', '99'), ], -'82': [ # Norway +'82': [ # Norway ('00', '19'), ('200', '699'), ('7000', '8999'), ('9', '98999'), ('99', '99'), ], -'83': [ # Poland +'83': [ # Poland ('00', '19'), ('200', '599'), ('6', '6'), @@ -181,7 +184,7 @@ ('85000', '8'), ('90', '99'), ], -'84': [ # Spain +'84': [ # Spain ('00', '19'), ('200', '699'), ('7000', '8499'), @@ -193,7 +196,7 @@ ('95000', '96999'), ('9700', ''), ], -'85': [ # Brazil +'85': [ # Brazil ('00', '19'), ('200', '599'), ('6', '6'), @@ -202,21 +205,21 @@ ('90', '97'), ('98000', '9'), ], -'86': [ # Serbia and Montenegro +'86': [ # Serbia and Montenegro ('00', '29'), ('300', '599'), ('6000', '7999'), ('8', '8'), ('90', '9
[MediaWiki-commits] [Gerrit] Save real tabs - change (mediawiki...CodeEditor)
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/80843 Change subject: Save real tabs .. Save real tabs Bug: 39616 Change-Id: I64c3b9b53f1265f5b9c19edb480040113fa85590 --- M modules/jquery.codeEditor.js 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor refs/changes/43/80843/1 diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index fccc850..70b0c3a 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -180,6 +180,9 @@ session.setUseWorker(false); session.setMode(new (require("ace/mode/" + lang).Mode)); + // Use proper tabs + session.setUseSoftTabs( false ); + // Force the box to resize horizontally to match in future :D var resize = function() { container.width(box.width()); -- To view, visit https://gerrit.wikimedia.org/r/80843 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64c3b9b53f1265f5b9c19edb480040113fa85590 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CodeEditor Gerrit-Branch: master Gerrit-Owner: Alex Monk Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] jquery.suggestions: Use document width instead of wid... - change (mediawiki/core)
TheDJ has submitted this change and it was merged. Change subject: jquery.suggestions: Use document width instead of width for position calculation .. jquery.suggestions: Use document width instead of width for position calculation Almost always, $( 'body' ).width() == $( document ).width(). (This is the case for all core skins, for example.) However, it is technically possible to give a width or large margins and break that assumption, so one of these should be used consistently. Document width is better here because we're using it to do absolute positioning, and usually it's relative to the viewport (ie., document width). This will still break if someone decides to give their a position: absolute, but that would be quite insane, so let's not bother. Bug: 45668 Change-Id: Ib96d1c5c3591495623933e1aa4266b0f13432610 --- M resources/jquery/jquery.suggestions.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: TheDJ: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/jquery/jquery.suggestions.js b/resources/jquery/jquery.suggestions.js index 44382f0..93fba49 100644 --- a/resources/jquery/jquery.suggestions.js +++ b/resources/jquery/jquery.suggestions.js @@ -220,7 +220,7 @@ } else { // Expand from right newCSS.left = 'auto'; - newCSS.right = $( 'body' ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() ); + newCSS.right = $( document ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() ); } context.data.$container.css( newCSS ); -- To view, visit https://gerrit.wikimedia.org/r/72937 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib96d1c5c3591495623933e1aa4266b0f13432610 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Matmarex Gerrit-Reviewer: Hoo man Gerrit-Reviewer: TheDJ Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] SocialProfile: ResourceLoader & RequestContext love. - change (mediawiki...SocialProfile)
Jack Phoenix has submitted this change and it was merged. Change subject: SocialProfile: ResourceLoader & RequestContext love. .. SocialProfile: ResourceLoader & RequestContext love. Huge refactoring that should introduce no negative functional changes. Swapped sajax_* calls to jQuery.(get|post) as per bug #53119. Change-Id: I93e7e67afd0bc36018ade0611e0840b01d515060 --- M SocialProfile.php A SocialProfileHooks.php M SystemGifts/SpecialPopulateAwards.php M SystemGifts/SpecialRemoveMasterSystemGift.php M SystemGifts/SpecialSystemGiftManager.php M SystemGifts/SpecialSystemGiftManagerLogo.php M SystemGifts/SpecialViewSystemGift.php M SystemGifts/SpecialViewSystemGifts.php M SystemGifts/SystemGifts.php M SystemGifts/SystemGiftsClass.php M SystemGifts/TopAwards.php M UserActivity/SiteActivityHook.php M UserActivity/UserActivity.body.php M UserActivity/UserActivity.php M UserBoard/BoardBlast.js M UserBoard/SpecialSendBoardBlast.php M UserBoard/SpecialUserBoard.php M UserBoard/UserBoard.i18n.php M UserBoard/UserBoard.js M UserBoard/UserBoardClass.php M UserBoard/UserBoard_AjaxFunctions.php M UserGifts/Gifts.php M UserGifts/SpecialGiftManager.php M UserGifts/SpecialGiftManagerLogo.php M UserGifts/SpecialGiveGift.php M UserGifts/SpecialRemoveGift.php M UserGifts/SpecialRemoveMasterGift.php M UserGifts/SpecialViewGift.php M UserGifts/SpecialViewGifts.php M UserGifts/UserGifts.js M UserGifts/UserGiftsClass.php M UserProfile/SpecialEditProfile.php M UserProfile/SpecialPopulateExistingUsersProfiles.php M UserProfile/SpecialRemoveAvatar.php M UserProfile/SpecialToggleUserPageType.php M UserProfile/SpecialUpdateProfile.php M UserProfile/SpecialUploadAvatar.php M UserProfile/UserProfile.php M UserProfile/UserProfilePage.js M UserProfile/UserProfilePage.php M UserRelationship/SpecialAddRelationship.php M UserRelationship/SpecialRemoveRelationship.php M UserRelationship/SpecialViewRelationshipRequests.php M UserRelationship/SpecialViewRelationships.php M UserRelationship/UserRelationship.i18n.php M UserRelationship/UserRelationship.js M UserStats/GenerateTopUsersReport.php M UserStats/SpecialUpdateEditCounts.php M UserStats/TopFansByStat.php M UserStats/TopFansRecent.php M UserStats/TopUsers.php M UserStats/TopUsersTag.php M UserStats/UserStatsClass.php M UserWelcome/UserWelcome.php 54 files changed, 2,494 insertions(+), 2,721 deletions(-) Approvals: Jack Phoenix: Verified; Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/79830 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I93e7e67afd0bc36018ade0611e0840b01d515060 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/SocialProfile Gerrit-Branch: master Gerrit-Owner: Jack Phoenix Gerrit-Reviewer: Jack Phoenix ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Accessibility: Don't remove focus outline - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/80813 Change subject: Accessibility: Don't remove focus outline .. Accessibility: Don't remove focus outline This screws with keyboard accessibility. Don't remove it without providing alternative :focus styling. Change-Id: I716c84b34b5adb26691f0d4ecd13739de7b8bdbf --- M resources/mediawiki.ui/mediawiki.ui.vector.css 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/13/80813/1 diff --git a/resources/mediawiki.ui/mediawiki.ui.vector.css b/resources/mediawiki.ui/mediawiki.ui.vector.css index 94e3300..65efd07 100644 --- a/resources/mediawiki.ui/mediawiki.ui.vector.css +++ b/resources/mediawiki.ui/mediawiki.ui.vector.css @@ -288,7 +288,6 @@ } /* line 36, sourcefiles/scss/components/default/_forms.scss */ .mw-ui-vform > div input:not([type=button]):not([type=submit]):not([type=file]) { - outline: 0; border-style: solid; border-width: 1px; border-color: #c9c9c9; -- To view, visit https://gerrit.wikimedia.org/r/80813 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I716c84b34b5adb26691f0d4ecd13739de7b8bdbf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug 51621) Make SBL aware of ContentHandler. - change (mediawiki...SpamBlacklist)
jenkins-bot has submitted this change and it was merged. Change subject: (bug 51621) Make SBL aware of ContentHandler. .. (bug 51621) Make SBL aware of ContentHandler. This changes SpamBlacklist to make use of the new, ContentHandler aware hooks. This change also includes some refactoring and cleanup which made the migration to the new hooks easier. Change-Id: I21e9cc8479f2b95fb53c502f6e279c8a1ea378a5 --- M SpamBlacklist.php M SpamBlacklistHooks.php M SpamBlacklist_body.php 3 files changed, 134 insertions(+), 71 deletions(-) Approvals: Hoo man: Looks good to me, approved Aude: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/SpamBlacklist.php b/SpamBlacklist.php index 5791801..5be78df 100644 --- a/SpamBlacklist.php +++ b/SpamBlacklist.php @@ -10,7 +10,7 @@ $wgExtensionCredits['antispam'][] = array( 'path' => __FILE__, 'name' => 'SpamBlacklist', - 'author' => array( 'Tim Starling', 'John Du Hart' ), + 'author' => array( 'Tim Starling', 'John Du Hart', 'Daniel Kinzler' ), 'url'=> 'https://www.mediawiki.org/wiki/Extension:SpamBlacklist', 'descriptionmsg' => 'spam-blacklist-desc', ); @@ -37,10 +37,19 @@ */ $wgSpamBlacklistSettings =& $wgBlacklistSettings['spam']; -$wgHooks['EditFilterMerged'][] = 'SpamBlacklistHooks::filterMerged'; +if ( !defined( 'MW_SUPPORTS_CONTENTHANDLER' ) ) { + die( "This version of SpamBlacklist requires a version of MediaWiki that supports the ContentHandler facility (supported since MW 1.21)." ); +} + +// filter pages on save +$wgHooks['EditFilterMergedContent'][] = 'SpamBlacklistHooks::filterMergedContent'; $wgHooks['APIEditBeforeSave'][] = 'SpamBlacklistHooks::filterAPIEditBeforeSave'; + +// editing filter rules $wgHooks['EditFilter'][] = 'SpamBlacklistHooks::validate'; -$wgHooks['ArticleSaveComplete'][] = 'SpamBlacklistHooks::articleSave'; +$wgHooks['PageContentSaveComplete'][] = 'SpamBlacklistHooks::pageSaveContent'; + +// email filters $wgHooks['UserCanSendEmail'][] = 'SpamBlacklistHooks::userCanSendEmail'; $wgHooks['AbortNewAccount'][] = 'SpamBlacklistHooks::abortNewAccount'; diff --git a/SpamBlacklistHooks.php b/SpamBlacklistHooks.php index 530df16..54f833c 100644 --- a/SpamBlacklistHooks.php +++ b/SpamBlacklistHooks.php @@ -5,34 +5,53 @@ */ class SpamBlacklistHooks { /** -* Hook function for EditFilterMerged +* Hook function for EditFilterMergedContent * -* @param $editPage EditPage -* @param $text string -* @param $hookErr string -* @param $editSummary string +* @param IContextSource $context +* @param Content$content +* @param Status $status +* @param string $summary +* @param User $user +* @param bool $minoredit +* * @return bool */ - static function filterMerged( $editPage, $text, &$hookErr, $editSummary ) { - global $wgTitle; - if( is_null( $wgTitle ) ) { - # API mode - # wfSpamBlacklistFilterAPIEditBeforeSave already checked the blacklist + static function filterMergedContent( IContextSource $context, Content $content, Status $status, $summary, User $user, $minoredit ) { + $title = $context->getTitle(); + + if ( isset( $title->spamBlackListFiltered ) && $title->spamBlackListFiltered ) { + // already filtered return true; } - $spamObj = BaseBlacklist::getInstance( 'spam' ); - $title = $editPage->mArticle->getTitle(); - $ret = $spamObj->filter( $title, $text, '', $editSummary, $editPage ); - if ( $ret !== false ) { - $editPage->spamPageWithContent( $ret ); + // get the link from the not-yet-saved page content. + $pout = $content->getParserOutput( $title ); + $links = array_keys( $pout->getExternalLinks() ); + + // HACK: treat the edit summary as a link + if ( $summary !== '' ) { + $links[] = $summary; } - // Return convention for hooks is the inverse of $wgFilterCallback - return ( $ret === false ); + + $spamObj = BaseBlacklist::getInstance( 'spam' ); + $matches = $spamObj->filter( $links, $title ); + + if ( $matches !== false ) { + $status->fatal( 'spamprotectiontext' ); + + foreach ( $matches as $match ) { + $status->fatal( 'spamprotectionmatch', $match ); + } + } + + // Always return true, EditPage will loo
[MediaWiki-commits] [Gerrit] Fix for I6234a765 - change (mediawiki...LiquidThreads)
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/80803 Change subject: Fix for I6234a765 .. Fix for I6234a765 See bug 46040 comment 7 - check that the value is not undefined Change-Id: Ieb2a92ef28355e3f91ebdf1794b333ff6d41fb50 --- M lqt.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/03/80803/1 diff --git a/lqt.js b/lqt.js index 8a5248d..a9fb201 100644 --- a/lqt.js +++ b/lqt.js @@ -1601,7 +1601,7 @@ var confirmExitPage = false; $( '.lqt-edit-form' ).each( function( index, element ) { var textArea = $( element ).children( 'form' ).find( 'textarea' ); - if ( element.style.display !== 'none' && textArea.val() !== '' ) { + if ( element.style.display !== 'none' && textArea.val() !== '' && textArea.val() !== undefined ) { confirmExitPage = true; } } ); -- To view, visit https://gerrit.wikimedia.org/r/80803 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb2a92ef28355e3f91ebdf1794b333ff6d41fb50 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LiquidThreads Gerrit-Branch: master Gerrit-Owner: Alex Monk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] bug fix for 1655 - change (pywikibot/compat)
jenkins-bot has submitted this change and it was merged. Change subject: bug fix for 1655 .. bug fix for 1655 * solve sub-optimal messages to user (indicate needed admin rights) * add missing ubuntu package names * message improved in case if NO was chosen Change-Id: Ibe5e42e6c7cf5450ac527dd0fec681d93ced649e --- M externals/__init__.py 1 file changed, 16 insertions(+), 8 deletions(-) Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/externals/__init__.py b/externals/__init__.py index 3bb6677..c94047c 100644 --- a/externals/__init__.py +++ b/externals/__init__.py @@ -55,12 +55,12 @@ # spelling http://svn.wikimedia.org/svnroot/pywikipedia/trunk/spelling/ # $ git submodule add https://gerrit.wikimedia.org/r/p/pywikibot/spelling.git externals/spelling 'BeautifulSoup.py': ({'linux-fedora': ['python-BeautifulSoup'], - 'linux-ubuntu': ['']}, + 'linux-ubuntu': ['python-beautifulsoup']}, { 'url': 'https://pypi.python.org/packages/source/B/BeautifulSoup/BeautifulSoup-3.2.0.tar.gz', 'path': 'BeautifulSoup-3.2.0/BeautifulSoup.py'}, {}), # OK 'irclib': ({'linux-fedora': ['python-irclib'], - 'linux-ubuntu': ['']}, + 'linux-ubuntu': ['python-irclib']}, {}, # http://python-irclib.sourceforge.net/ {}), # OK 'mwparserfromhell': ({}, @@ -197,13 +197,15 @@ return ("%s-%s" % (platform.system(), platform.dist()[0])).lower() -def show_question(which_files): +def show_question(which_files, admin=True): lowlevel_warning("Required package missing: %s" % which_files) lowlevel_warning("A required package is missing, but externals can" - " automatically install it." - " If you say Yes, externals will need administrator" - " privileges, and you might be asked for the administrator" - " password. For more info, please confer:\n" + " automatically install it.") +if admin: +lowlevel_warning("If you say Yes, externals will need administrator" + " privileges, and you might be asked for the" + " administrator password.") +lowlevel_warning("For more info, please confer:\n" " http://www.mediawiki.org/wiki/Manual:Pywikipediabot/"; "Installation#Dependencies") lowlevel_warning("Give externals permission to try to install package?" @@ -308,7 +310,7 @@ def download_install(package, module, path): -if package and show_question(module): +if package and show_question(module, admin=False): lowlevel_warning(u'Download package "%s" from %s' % (module, package['url'])) import mimetypes @@ -393,13 +395,19 @@ lowlevel_warning(u'Trying to install by use of "%s" package management system:' % dist) if (func in globals()) and globals()[func](modules_needed[m][0]): return +else: +lowlevel_warning(u'No suitable package could be installed or found!') lowlevel_warning(u'Trying to install by download from source URL:') if download_install(modules_needed[m][1], m, path): return +else: +lowlevel_warning(u'No suitable package could be installed or found!') lowlevel_warning(u'Trying to install by use of mercurial:') if (len(modules_needed[m]) > 2) and\ mercurial_repo_install(modules_needed[m][2], m, path): return +else: +lowlevel_warning(u'No suitable package could be installed or found!') lowlevel_warning(u'Package "%s" could not be found nor installed!' % m) lowlevel_warning(u'Several scripts might fail, if some modules are not' -- To view, visit https://gerrit.wikimedia.org/r/79977 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe5e42e6c7cf5450ac527dd0fec681d93ced649e Gerrit-PatchSet: 4 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: DrTrigon Gerrit-Reviewer: DrTrigon Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Merlijn van Deen Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve snak testToArrayRoundtrip test. - change (mediawiki...WikibaseDataModel)
jenkins-bot has submitted this change and it was merged. Change subject: Improve snak testToArrayRoundtrip test. .. Improve snak testToArrayRoundtrip test. The ->equals() method basically justchecks to see thet the classtype is correct and the hashes are the same. Having these checks in the test allows failure output to be more usefull This will naturally not pass unitl the issue is fixed in Change: Ic66442813528bb30 Change-Id: Idaa7bc41f1aee70b8e2897fdda4de73ea353a520 --- M tests/phpunit/Snak/SnakTest.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/Snak/SnakTest.php b/tests/phpunit/Snak/SnakTest.php index e8656bf..73c95f6 100644 --- a/tests/phpunit/Snak/SnakTest.php +++ b/tests/phpunit/Snak/SnakTest.php @@ -132,6 +132,7 @@ $copy = \Wikibase\SnakObject::newFromArray( $data ); $this->assertInstanceOf( '\Wikibase\Snak', $copy, 'newFromArray should return object implementing Snak' ); + $this->assertEquals( $snak->getHash(), $copy->getHash(), 'newFromArray should return object with same Hash used previously' ); $this->assertTrue( $snak->equals( $copy ), 'getArray newFromArray roundtrip should work' ); } -- To view, visit https://gerrit.wikimedia.org/r/80795 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idaa7bc41f1aee70b8e2897fdda4de73ea353a520 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikibaseDataModel Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Addshore Gerrit-Reviewer: Anja Jentzsch Gerrit-Reviewer: Ataherivand Gerrit-Reviewer: Aude Gerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Daniel Werner Gerrit-Reviewer: Denny Vrandecic Gerrit-Reviewer: Henning Snater Gerrit-Reviewer: Hoo man Gerrit-Reviewer: Jens Ohlig Gerrit-Reviewer: Jeroen De Dauw Gerrit-Reviewer: John Erling Blad Gerrit-Reviewer: Liangent Gerrit-Reviewer: Lydia Pintscher Gerrit-Reviewer: Markus Kroetzsch Gerrit-Reviewer: Nikola Smolenski Gerrit-Reviewer: Nilesh Gerrit-Reviewer: Tobias Gritschacher Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enhanced RC: Optimization of the initial collapsing - change (mediawiki/core)
TheDJ has submitted this change and it was merged. Change subject: Enhanced RC: Optimization of the initial collapsing .. Enhanced RC: Optimization of the initial collapsing * mediawiki.special.changeslist.enhanced: Hide the rows that would be hidden by jquery.makeCollapsible with CSS to save us some reflows and repaints. This doesn't work on browsers that don't fully support CSS2 (IE6), but it's okay, this will be done in JavaScript with old degraded performance instead. * jquery.makeCollapsible: Allow the element to be hidden on initial toggle without removing and adding back the 'mw-collapsed' class. This wasn't a performance issue in the past, but now it would cause the newly added CSS rules to have to be recalculated (although browsers seem to optimize it and avoid repaints at least). Bug: 51749 Change-Id: I3823c2a67d524e6598e2437e1dd065659d1c7e41 --- M resources/jquery/jquery.makeCollapsible.js M resources/mediawiki.special/mediawiki.special.changeslist.enhanced.css 2 files changed, 18 insertions(+), 4 deletions(-) Approvals: TheDJ: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/jquery/jquery.makeCollapsible.js b/resources/jquery/jquery.makeCollapsible.js index 5ca0b12..0fb66e2 100644 --- a/resources/jquery/jquery.makeCollapsible.js +++ b/resources/jquery/jquery.makeCollapsible.js @@ -172,7 +172,12 @@ } } - wasCollapsed = $collapsible.hasClass( 'mw-collapsed' ); + // This allows the element to be hidden on initial toggle without fiddling with the class + if ( options.wasCollapsed !== undefined ) { + wasCollapsed = options.wasCollapsed; + } else { + wasCollapsed = $collapsible.hasClass( 'mw-collapsed' ); + } // Toggle the state of the collapsible element (that is, expand or collapse) $collapsible.toggleClass( 'mw-collapsed', !wasCollapsed ); @@ -367,11 +372,9 @@ // Initial state if ( options.collapsed || $collapsible.hasClass( 'mw-collapsed' ) ) { - // Remove here so that the toggler goes in the right direction (the class is re-added) - $collapsible.removeClass( 'mw-collapsed' ); // One toggler can hook to multiple elements, and one element can have // multiple togglers. This is the sanest way to handle that. - actionHandler.call( $toggleLink.get( 0 ), null, { instantHide: true } ); + actionHandler.call( $toggleLink.get( 0 ), null, { instantHide: true, wasCollapsed: false } ); } } ); }; diff --git a/resources/mediawiki.special/mediawiki.special.changeslist.enhanced.css b/resources/mediawiki.special/mediawiki.special.changeslist.enhanced.css index 2632c78..bed580d 100644 --- a/resources/mediawiki.special/mediawiki.special.changeslist.enhanced.css +++ b/resources/mediawiki.special/mediawiki.special.changeslist.enhanced.css @@ -37,6 +37,17 @@ display: none; } +/* + * And if it's enabled, let's optimize the collapsing a little: hide the rows + * that would be hidden by jquery.makeCollapsible with CSS to save us some + * reflows and repaints. This doesn't work on browsers that don't fully support + * CSS2 (IE6), but it's okay, this will be done in JavaScript with old degraded + * performance instead. + */ +.client-js table.mw-enhanced-rc.mw-collapsed tr + tr { + display: none; +} + .mw-enhancedchanges-arrow-space { display: inline-block; *display: inline; /* IE7 and below */ -- To view, visit https://gerrit.wikimedia.org/r/74955 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3823c2a67d524e6598e2437e1dd065659d1c7e41 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Matmarex Gerrit-Reviewer: Catrope Gerrit-Reviewer: Helder.wiki Gerrit-Reviewer: Matmarex Gerrit-Reviewer: Nemo bis Gerrit-Reviewer: TheDJ Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified generate_user_files.py - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80801 Change subject: pep8-ified generate_user_files.py .. pep8-ified generate_user_files.py Change-Id: I8f1917d8cb6ad8b87fbf03a3dc238b196540c36c --- M generate_user_files.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/01/80801/1 diff --git a/generate_user_files.py b/generate_user_files.py index 8f4f7dd..ef680df 100644 --- a/generate_user_files.py +++ b/generate_user_files.py @@ -52,7 +52,7 @@ elif _win_version == 6: base_dir = os.path.join(home, "AppData\\Roaming", NAME) else: -base_dir = os.path.join(home, "."+NAME) +base_dir = os.path.join(home, "." + NAME) if not os.path.isdir(base_dir): os.makedirs(base_dir, mode=0700) if not os.path.isabs(base_dir): -- To view, visit https://gerrit.wikimedia.org/r/80801 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f1917d8cb6ad8b87fbf03a3dc238b196540c36c Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pep8-ified family files - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/80800 Change subject: pep8-ified family files .. pep8-ified family files Change-Id: Ie30b3ddf73fc7cfc841789f6bac3cfc0af419d8d --- M pywikibot/families/anarchopedia_family.py M pywikibot/families/battlestarwiki_family.py M pywikibot/families/commons_family.py M pywikibot/families/fon_family.py M pywikibot/families/gentoo_family.py M pywikibot/families/i18n_family.py M pywikibot/families/incubator_family.py M pywikibot/families/lockwiki_family.py M pywikibot/families/lyricwiki_family.py M pywikibot/families/mediawiki_family.py M pywikibot/families/meta_family.py M pywikibot/families/oldwikivoyage_family.py M pywikibot/families/omegawiki_family.py M pywikibot/families/osm_family.py M pywikibot/families/southernapproach_family.py M pywikibot/families/species_family.py M pywikibot/families/strategy_family.py M pywikibot/families/test_family.py M pywikibot/families/vikidia_family.py M pywikibot/families/wikia_family.py M pywikibot/families/wikibooks_family.py M pywikibot/families/wikimedia_family.py M pywikibot/families/wikinews_family.py M pywikibot/families/wikipedia_family.py M pywikibot/families/wikiquote_family.py M pywikibot/families/wikisource_family.py M pywikibot/families/wikitech_family.py M pywikibot/families/wikiversity_family.py M pywikibot/families/wiktionary_family.py M pywikibot/families/wowwiki_family.py 30 files changed, 104 insertions(+), 103 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/00/80800/1 diff --git a/pywikibot/families/anarchopedia_family.py b/pywikibot/families/anarchopedia_family.py index 664a221..037d015 100644 --- a/pywikibot/families/anarchopedia_family.py +++ b/pywikibot/families/anarchopedia_family.py @@ -3,8 +3,8 @@ from pywikibot import family -# The Anarchopedia family +# The Anarchopedia family class Family(family.Family): def __init__(self): family.Family.__init__(self) diff --git a/pywikibot/families/battlestarwiki_family.py b/pywikibot/families/battlestarwiki_family.py index cc41027..c77dc47 100644 --- a/pywikibot/families/battlestarwiki_family.py +++ b/pywikibot/families/battlestarwiki_family.py @@ -3,9 +3,9 @@ from pywikibot import family + # The Battlestar Wiki family, a set of Battlestar wikis. # http://battlestarwiki.org/ - class Family(family.Family): def __init__(self): family.Family.__init__(self) @@ -23,7 +23,7 @@ alphabetic = ['de', 'en', 'es', 'fr', 'tr', 'zh'] -def hostname(self,code): +def hostname(self, code): return '%s.battlestarwiki.org' % code def version(self, code): diff --git a/pywikibot/families/commons_family.py b/pywikibot/families/commons_family.py index e1ad8fa..7daedac 100644 --- a/pywikibot/families/commons_family.py +++ b/pywikibot/families/commons_family.py @@ -4,8 +4,8 @@ from pywikibot import family -# The Wikimedia Commons family +# The Wikimedia Commons family class Family(family.WikimediaFamily): def __init__(self): super(Family, self).__init__() diff --git a/pywikibot/families/fon_family.py b/pywikibot/families/fon_family.py index d4a9f78..5d776f2 100644 --- a/pywikibot/families/fon_family.py +++ b/pywikibot/families/fon_family.py @@ -3,6 +3,7 @@ from pywikibot import family + # The official Beta Wiki. class Family(family.Family): diff --git a/pywikibot/families/gentoo_family.py b/pywikibot/families/gentoo_family.py index c0907d4..1d8e63b 100644 --- a/pywikibot/families/gentoo_family.py +++ b/pywikibot/families/gentoo_family.py @@ -4,11 +4,11 @@ __version__ = '$Id$' + # An inofficial Gentoo wiki project. # Ask for permission at http://gentoo-wiki.com/Help:Bots before running a bot. # Be very careful, and set a long throttle: "until we see it is good one edit # ever minute and one page fetch every 30 seconds, maybe a *bit* faster later". - class Family(family.Family): def __init__(self): diff --git a/pywikibot/families/i18n_family.py b/pywikibot/families/i18n_family.py index ea0c30d..fc7a1af 100644 --- a/pywikibot/families/i18n_family.py +++ b/pywikibot/families/i18n_family.py @@ -4,8 +4,8 @@ from pywikibot import family -# The Wikimedia i18n family +# The Wikimedia i18n family class Family(family.Family): def __init__(self): diff --git a/pywikibot/families/incubator_family.py b/pywikibot/families/incubator_family.py index 1ac3876..2f38409 100644 --- a/pywikibot/families/incubator_family.py +++ b/pywikibot/families/incubator_family.py @@ -4,8 +4,8 @@ from pywikibot import family -# The Wikimedia Incubator family +# The Wikimedia Incubator family class Family(family.WikimediaFamily): def __init__(self): super(Family, self).__init__() diff --git a/pywikibot/families/lockwiki_family.py b/pywikibot/families/lockwiki_family.py index 4a91873..97d06e7 100644 --- a/pywikib
[MediaWiki-commits] [Gerrit] Provide month names via mediawiki.language.months RL module - change (mediawiki/core)
TheDJ has submitted this change and it was merged. Change subject: Provide month names via mediawiki.language.months RL module .. Provide month names via mediawiki.language.months RL module * Deliver appropriate messages via ResourceLoader, for nominative-case, genitive-case and abbreviated month names * Define mw.language.months which provides access to the above data in a structured manner This supersedes the old way to of accessing these using wgMonthNames and wgMonthNamesShort mw.config variables. Genitive month names were previously not available at all. Bug: 46496 Change-Id: I9f48b860d1078a31d620f6f95dde1f19c1c31f79 --- M resources/Resources.php A resources/mediawiki.language/mediawiki.language.months.js 2 files changed, 64 insertions(+), 0 deletions(-) Approvals: TheDJ: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/Resources.php b/resources/Resources.php index 6352843..641c243 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -843,6 +843,16 @@ 'targets' => array( 'desktop', 'mobile' ), ), + 'mediawiki.language.months' => array( + 'scripts' => 'resources/mediawiki.language/mediawiki.language.months.js', + 'dependencies' => 'mediawiki.language', + 'messages' => array_merge( + Language::$mMonthMsgs, + Language::$mMonthGenMsgs, + Language::$mMonthAbbrevMsgs + ) + ), + /* MediaWiki Libs */ 'mediawiki.libs.jpegmeta' => array( diff --git a/resources/mediawiki.language/mediawiki.language.months.js b/resources/mediawiki.language/mediawiki.language.months.js new file mode 100644 index 000..3d4b7ee --- /dev/null +++ b/resources/mediawiki.language/mediawiki.language.months.js @@ -0,0 +1,54 @@ +/** + * Transfer of month names from messages into mw.language. + * + * Loading this module also ensures the availability of appropriate messages via mw.msg. + */ +( function ( mw, $ ) { + var + monthMessages = [ + 'january', 'february', 'march', 'april', + 'may_long', 'june', 'july', 'august', + 'september', 'october', 'november', 'december' + ], + monthGenMessages = [ + 'january-gen', 'february-gen', 'march-gen', 'april-gen', + 'may-gen', 'june-gen', 'july-gen', 'august-gen', + 'september-gen', 'october-gen', 'november-gen', 'december-gen' + ], + monthAbbrevMessages = [ + 'jan', 'feb', 'mar', 'apr', + 'may', 'jun', 'jul', 'aug', + 'sep', 'oct', 'nov', 'dec' + ]; + + // Function suitable for passing to jQuery.map + // Can't use mw.msg directly because jQuery.map passes element index as second argument + function mwMsgMapper( key ) { + return mw.msg( key ); + } + + /** +* Information about month names in current UI language. +* +* Object keys: +* - `names`: array of month names (in nominative case in languages which have the distinction), +* zero-indexed +* - `genitive`: array of month names in genitive case, zero-indexed +* - `abbrev`: array of three-letter-long abbreviated month names, zero-indexed +* - `keys`: object with three keys like the above, containing zero-indexed arrays of message keys +* for appropriate messages which can be passed to mw.msg. +* +* @property +*/ + mw.language.months = { + keys: { + names: monthMessages, + genitive: monthGenMessages, + abbrev: monthAbbrevMessages + }, + names: $.map( monthMessages, mwMsgMapper ), + genitive: $.map( monthGenMessages, mwMsgMapper ), + abbrev: $.map( monthAbbrevMessages, mwMsgMapper ) + }; + +}( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/36391 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9f48b860d1078a31d620f6f95dde1f19c1c31f79 Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Wizardist Gerrit-Reviewer: Amire80 Gerrit-Reviewer: Catrope Gerrit-Reviewer: Hoo man Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Matmarex Gerrit-Reviewer: Mormegil Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: Santhosh Gerrit-Reviewer: Siebrand Gerrit-Reviewer: TheDJ Gerrit-Reviewer: Wizardist Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/ma
[MediaWiki-commits] [Gerrit] Accessibility: Make jump links work in Safari and Chrome - change (mediawiki/core)
TheDJ has uploaded a new change for review. https://gerrit.wikimedia.org/r/80799 Change subject: Accessibility: Make jump links work in Safari and Chrome .. Accessibility: Make jump links work in Safari and Chrome Use Javascript to focus the first tabbable element starting from the target that we jump to. When navigating to an ID, focus only follows if the target is a focusable element (has implicit or explicit tabindex). When navigating to an unfocusable element, the position of focus becomes undefined. Webkit (safari/chrome) keep it on the element that had the focus, IE and Firefox unfocus and on the next tab will select the first tabbable element starting from the target. Change-Id: If1f7f578cc9b1fad7d40d168dc225287a36638fe --- M resources/jquery/jquery.mw-jump.js 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/99/80799/1 diff --git a/resources/jquery/jquery.mw-jump.js b/resources/jquery/jquery.mw-jump.js index e286834..ac3671c 100644 --- a/resources/jquery/jquery.mw-jump.js +++ b/resources/jquery/jquery.mw-jump.js @@ -3,9 +3,15 @@ */ jQuery( function ( $ ) { - $( '.mw-jump' ).on( 'focus blur', 'a', function ( e ) { + $( '.mw-jump' ).on( 'focus blur keypress', 'a', function ( e ) { // Confusingly jQuery leaves e.type as focusout for delegated blur events - if ( e.type === 'blur' || e.type === 'focusout' ) { + if ( e.type === 'keypress' ) { + if ( e.keyCode === 14 ) { + var $dest = $( $( this ).attr( 'href' ) ); + $dest.find( ':tabbable:first' ).focus(); + e.preventDefault(); + } + } else if ( e.type === 'blur' || e.type === 'focusout' ) { $( this ).closest( '.mw-jump' ).css({ height: 0 }); } else { $( this ).closest( '.mw-jump' ).css({ height: 'auto' }); -- To view, visit https://gerrit.wikimedia.org/r/80799 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1f7f578cc9b1fad7d40d168dc225287a36638fe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Give grep a chance to find the usages - change (mediawiki...Translate)
jenkins-bot has submitted this change and it was merged. Change subject: Give grep a chance to find the usages .. Give grep a chance to find the usages Change-Id: Ieea6fdb982163a3329558dae34123cdafdd58425 --- M ffs/MediaWikiComplexMessages.php M specials/SpecialImportTranslations.php 2 files changed, 6 insertions(+), 4 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/ffs/MediaWikiComplexMessages.php b/ffs/MediaWikiComplexMessages.php index 88cb79c..91a4fd3 100644 --- a/ffs/MediaWikiComplexMessages.php +++ b/ffs/MediaWikiComplexMessages.php @@ -45,6 +45,8 @@ } public function getTitle() { + // Give grep a chance to find the usages: + // translate-magic-special, translate-magic-words, translate-magic-namespace return wfMessage( 'translate-magic-' . $this->id )->text(); } diff --git a/specials/SpecialImportTranslations.php b/specials/SpecialImportTranslations.php index 2c3c785..a6014f6 100644 --- a/specials/SpecialImportTranslations.php +++ b/specials/SpecialImportTranslations.php @@ -104,10 +104,10 @@ */ protected function checkError( $msg ) { // Give grep a chance to find the usages: - // translate-import-err-type-not-supported, translate-import-err-dl-failed, - // translate-import-err-ul-failed, translate-import-err-invalid-title, - // translate-import-err-no-such-file, translate-import-err-stale-group, - // translate-import-err-no-headers, translate-import-err-warnings + // translate-import-err-dl-failed, translate-import-err-ul-failed, + // translate-import-err-invalid-title, translate-import-err-no-such-file, + // translate-import-err-stale-group, translate-import-err-no-headers, + // translate-import-err-warnings if ( $msg[0] !== 'ok' ) { $errorWrap = "\n$1\n"; $msg[0] = 'translate-import-err-' . $msg[0]; -- To view, visit https://gerrit.wikimedia.org/r/80798 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieea6fdb982163a3329558dae34123cdafdd58425 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Shirayuki Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Give grep a chance to find the usages - change (mediawiki...Translate)
Shirayuki has uploaded a new change for review. https://gerrit.wikimedia.org/r/80798 Change subject: Give grep a chance to find the usages .. Give grep a chance to find the usages Change-Id: Ieea6fdb982163a3329558dae34123cdafdd58425 --- M ffs/MediaWikiComplexMessages.php M specials/SpecialImportTranslations.php 2 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/98/80798/1 diff --git a/ffs/MediaWikiComplexMessages.php b/ffs/MediaWikiComplexMessages.php index 88cb79c..91a4fd3 100644 --- a/ffs/MediaWikiComplexMessages.php +++ b/ffs/MediaWikiComplexMessages.php @@ -45,6 +45,8 @@ } public function getTitle() { + // Give grep a chance to find the usages: + // translate-magic-special, translate-magic-words, translate-magic-namespace return wfMessage( 'translate-magic-' . $this->id )->text(); } diff --git a/specials/SpecialImportTranslations.php b/specials/SpecialImportTranslations.php index 2c3c785..a6014f6 100644 --- a/specials/SpecialImportTranslations.php +++ b/specials/SpecialImportTranslations.php @@ -104,10 +104,10 @@ */ protected function checkError( $msg ) { // Give grep a chance to find the usages: - // translate-import-err-type-not-supported, translate-import-err-dl-failed, - // translate-import-err-ul-failed, translate-import-err-invalid-title, - // translate-import-err-no-such-file, translate-import-err-stale-group, - // translate-import-err-no-headers, translate-import-err-warnings + // translate-import-err-dl-failed, translate-import-err-ul-failed, + // translate-import-err-invalid-title, translate-import-err-no-such-file, + // translate-import-err-stale-group, translate-import-err-no-headers, + // translate-import-err-warnings if ( $msg[0] !== 'ok' ) { $errorWrap = "\n$1\n"; $msg[0] = 'translate-import-err-' . $msg[0]; -- To view, visit https://gerrit.wikimedia.org/r/80798 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieea6fdb982163a3329558dae34123cdafdd58425 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Shirayuki ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert "Remove additions to deprecated global ..." - change (mediawiki...DataValues)
jenkins-bot has submitted this change and it was merged. Change subject: Revert "Remove additions to deprecated global ..." .. Revert "Remove additions to deprecated global ..." This causes breakages in WikibaseDataModel and Wikibase involving the WikibaseDataModel SnakTest. Reverts 7715fee51c6f7aefe23ea78168f483ce3a66. Change-Id: Ic66442813528bb309d83bb61d2ea509c83421c73 --- M DataValues/DataValues.php 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/DataValues/DataValues.php b/DataValues/DataValues.php index 2a1e9fa..ade49c2 100644 --- a/DataValues/DataValues.php +++ b/DataValues/DataValues.php @@ -73,6 +73,13 @@ */ $wgDataValues = array(); +$wgDataValues['boolean'] = 'DataValues\BooleanValue'; $wgDataValues['globecoordinate'] = 'DataValues\GlobeCoordinateValue'; +$wgDataValues['iri'] = 'DataValues\IriValue'; +$wgDataValues['monolingualtext'] = 'DataValues\MonolingualTextValue'; +$wgDataValues['multilingualtext'] = 'DataValues\MultilingualTextValue'; +$wgDataValues['number'] = 'DataValues\NumberValue'; +$wgDataValues['quantity'] = 'DataValues\QuantityValue'; $wgDataValues['string'] = 'DataValues\StringValue'; $wgDataValues['time'] = 'DataValues\TimeValue'; +$wgDataValues['unknown'] = 'DataValues\UnknownValue'; \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/80794 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic66442813528bb309d83bb61d2ea509c83421c73 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Addshore Gerrit-Reviewer: Anja Jentzsch Gerrit-Reviewer: Ataherivand Gerrit-Reviewer: Aude Gerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Daniel Werner Gerrit-Reviewer: Denny Vrandecic Gerrit-Reviewer: Henning Snater Gerrit-Reviewer: Hoo man Gerrit-Reviewer: Jens Ohlig Gerrit-Reviewer: Jeroen De Dauw Gerrit-Reviewer: John Erling Blad Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Liangent Gerrit-Reviewer: Lydia Pintscher Gerrit-Reviewer: Markus Kroetzsch Gerrit-Reviewer: Nikola Smolenski Gerrit-Reviewer: Nilesh Gerrit-Reviewer: Tobias Gritschacher Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Catch div zero error in ItemByTitleHelper - change (mediawiki...Wikibase)
Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/80797 Change subject: Catch div zero error in ItemByTitleHelper .. Catch div zero error in ItemByTitleHelper Bug: 53037 Change-Id: Ib04b5dd57f2e96d21e7a0af47a18be0a365d097f --- M repo/includes/api/ItemByTitleHelper.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/97/80797/1 diff --git a/repo/includes/api/ItemByTitleHelper.php b/repo/includes/api/ItemByTitleHelper.php index f136c78..9c23e55 100644 --- a/repo/includes/api/ItemByTitleHelper.php +++ b/repo/includes/api/ItemByTitleHelper.php @@ -88,6 +88,11 @@ ); } + // For cases when we have 0 sites we get a div0 error below. Instead we should die gracefully + if( $numSites === 0 ){ + $this->apiBase->dieUsage( 'No valid sites','params-illegal' ); + } + $idxSites = 0; $idxTitles = 0; -- To view, visit https://gerrit.wikimedia.org/r/80797 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib04b5dd57f2e96d21e7a0af47a18be0a365d097f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pwb.bot.debug: Document the `layer` argument - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: pwb.bot.debug: Document the `layer` argument .. pwb.bot.debug: Document the `layer` argument Change-Id: Id1efa0fa1091ccbe65507f488fba6dde3607401e --- M pywikibot/bot.py 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/bot.py b/pywikibot/bot.py index fa7ee43..eb66ad1 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -409,7 +409,10 @@ def debug(text, layer, decoder=None, newline=True, **kwargs): -"""Output a debug record to the log file.""" +"""Output a debug record to the log file. + +@param layer: The name of the logger that text will be sent to. +""" logoutput(text, decoder, newline, DEBUG, layer, **kwargs) -- To view, visit https://gerrit.wikimedia.org/r/80796 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id1efa0fa1091ccbe65507f488fba6dde3607401e Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Mineo Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Merlijn van Deen Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pwb.bot.debug: Document the `layer` argument - change (pywikibot/core)
Mineo has uploaded a new change for review. https://gerrit.wikimedia.org/r/80796 Change subject: pwb.bot.debug: Document the `layer` argument .. pwb.bot.debug: Document the `layer` argument Change-Id: Id1efa0fa1091ccbe65507f488fba6dde3607401e --- M pywikibot/bot.py 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/96/80796/1 diff --git a/pywikibot/bot.py b/pywikibot/bot.py index fa7ee43..eb66ad1 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -409,7 +409,10 @@ def debug(text, layer, decoder=None, newline=True, **kwargs): -"""Output a debug record to the log file.""" +"""Output a debug record to the log file. + +@param layer: The name of the logger that text will be sent to. +""" logoutput(text, decoder, newline, DEBUG, layer, **kwargs) -- To view, visit https://gerrit.wikimedia.org/r/80796 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1efa0fa1091ccbe65507f488fba6dde3607401e Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Mineo ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve snak testToArrayRoundtrip test - change (mediawiki...WikibaseDataModel)
Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/80795 Change subject: Improve snak testToArrayRoundtrip test .. Improve snak testToArrayRoundtrip test The ->equals() method basically justchecks to see thet the classtype is correct and the hashes are the same. Having these checks in the test allows failure output to be more usefull This will naturally not pass unitl the issue is fixed in Change: Ic66442813528bb30 Change-Id: Idaa7bc41f1aee70b8e2897fdda4de73ea353a520 --- M tests/phpunit/Snak/SnakTest.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseDataModel refs/changes/95/80795/1 diff --git a/tests/phpunit/Snak/SnakTest.php b/tests/phpunit/Snak/SnakTest.php index e8656bf..73c95f6 100644 --- a/tests/phpunit/Snak/SnakTest.php +++ b/tests/phpunit/Snak/SnakTest.php @@ -132,6 +132,7 @@ $copy = \Wikibase\SnakObject::newFromArray( $data ); $this->assertInstanceOf( '\Wikibase\Snak', $copy, 'newFromArray should return object implementing Snak' ); + $this->assertEquals( $snak->getHash(), $copy->getHash(), 'newFromArray should return object with same Hash used previously' ); $this->assertTrue( $snak->equals( $copy ), 'getArray newFromArray roundtrip should work' ); } -- To view, visit https://gerrit.wikimedia.org/r/80795 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idaa7bc41f1aee70b8e2897fdda4de73ea353a520 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseDataModel Gerrit-Branch: master Gerrit-Owner: Addshore ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fix where we get the EntityIdParser from - change (mediawiki...Wikibase)
Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/80792 Change subject: fix where we get the EntityIdParser from .. fix where we get the EntityIdParser from Change-Id: I020d23b81e351e12811c2830d7292fb0b0ec44fb --- M repo/includes/api/GetEntities.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/92/80792/1 diff --git a/repo/includes/api/GetEntities.php b/repo/includes/api/GetEntities.php index 64ca636..545bcb3 100644 --- a/repo/includes/api/GetEntities.php +++ b/repo/includes/api/GetEntities.php @@ -38,7 +38,7 @@ protected $stringNormalizer; /** -* @var \Wikibase\EntityIdParser +* @var \Wikibase\Lib\EntityIdParser */ protected $entityIdParser; @@ -46,7 +46,7 @@ parent::__construct( $main, $name, $prefix ); $this->stringNormalizer = WikibaseRepo::getDefaultInstance()->getStringNormalizer(); - $this->entityIdParser = LibRegistry::getDefaultInstance()->getEntityIdParser(); + $this->entityIdParser = WikibaseRepo::getDefaultInstance()->getEntityIdParser(); } /** -- To view, visit https://gerrit.wikimedia.org/r/80792 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I020d23b81e351e12811c2830d7292fb0b0ec44fb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Parse limiation warnings as 'text' - change (mediawiki/core)
Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/80791 Change subject: Parse limiation warnings as 'text' .. Parse limiation warnings as 'text' The default limitation warning messages contains wiki markup to get bold text, which does not get parsed with 'escaped' Change-Id: Ibccfacc9a6b9c43491e3b4ca8f5e8f6a6b1efae9 --- M includes/parser/Parser.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/91/80791/1 diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 1ab29eb..f8d3b64 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3180,7 +3180,7 @@ function limitationWarn( $limitationType, $current = '', $max = '' ) { # does no harm if $current and $max are present but are unnecessary for the message $warning = wfMessage( "$limitationType-warning" )->numParams( $current, $max ) - ->inContentLanguage()->escaped(); + ->inContentLanguage()->text(); $this->mOutput->addWarning( $warning ); $this->addTrackingCategory( "$limitationType-category" ); } -- To view, visit https://gerrit.wikimedia.org/r/80791 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibccfacc9a6b9c43491e3b4ca8f5e8f6a6b1efae9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow for both ids and sites/titles to be set for wbgetentities - change (mediawiki...Wikibase)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/80790 Change subject: Allow for both ids and sites/titles to be set for wbgetentities .. Allow for both ids and sites/titles to be set for wbgetentities Bug: 43309 Change-Id: I38bddcf3be55d5d8cf4fbdacb1cc73188ee79dd7 --- M repo/includes/api/GetEntities.php 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/90/80790/1 diff --git a/repo/includes/api/GetEntities.php b/repo/includes/api/GetEntities.php index 64ca636..81b1390 100644 --- a/repo/includes/api/GetEntities.php +++ b/repo/includes/api/GetEntities.php @@ -57,16 +57,17 @@ $params = $this->extractRequestParams(); - if ( !( isset( $params['ids'] ) XOR ( !empty( $params['sites'] ) && !empty( $params['titles'] ) ) ) ) { + if ( !( isset( $params['ids'] ) && ( !empty( $params['sites'] ) && !empty( $params['titles'] ) ) ) ) { wfProfileOut( __METHOD__ ); $this->dieUsage( 'Either provide the item "ids" or pairs of "sites" and "titles" for corresponding pages', 'param-missing' ); } - if ( !isset( $params['ids'] ) ) { + if ( isset( $params['sites'] ) ) { + // We only need to check if one is defined since we already checked above $siteLinkCache = StoreFactory::getStore()->newSiteLinkCache(); $siteStore = \SiteSQLStore::newInstance(); $itemByTitleHelper = new ItemByTitleHelper( $this, $siteLinkCache, $siteStore, $this->stringNormalizer ); - $params['ids'] = $itemByTitleHelper->getEntityIds( $params['sites'], $params['titles'], $params['normalize'] ); + $params['ids'] = array_merge( $params['ids'], $itemByTitleHelper->getEntityIds( $params['sites'], $params['titles'], $params['normalize'] ) ); } $params['ids'] = $this->uniqueEntities( $params['ids'] ); -- To view, visit https://gerrit.wikimedia.org/r/80790 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38bddcf3be55d5d8cf4fbdacb1cc73188ee79dd7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Legoktm ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement a simple preloading generator for ItemPages - change (pywikibot/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/80789 Change subject: Implement a simple preloading generator for ItemPages .. Implement a simple preloading generator for ItemPages This was not added to pagegenerators since it works in a very narrow set of cases, and isn't what the user expects. Change-Id: I05917eb982f41dcdc92d8e45292ba6c27eac47f7 --- M pywikibot/site.py 1 file changed, 25 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/89/80789/1 diff --git a/pywikibot/site.py b/pywikibot/site.py index bca3feb..66dc2de 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -3398,6 +3398,31 @@ raise pywikibot.data.api.APIError, data['errors'] return data['entities'] +def preloaditempages(self, pagelist, groupsize=50): +"""Yields ItemPages with content prefilled. + +Note that [at least in current implementation] pages may be iterated +in a different order than in the underlying pagelist. + +This only works if we've initalized the page using the ID. If it +was created with ItemPage.fromPage, this is useless. + +@param pagelist: an iterable that yields ItemPage objects +@param groupsize: how many pages to query at a time +@type groupsize: int +""" +from pywikibot.tools import itergroup +for sublist in itergroup(pagelist, groupsize): +pages = [str(p.getID() for p in sublist)] +cache = dict((p.getID(), p) for p in sublist) +req = api.Request(action='wbgetentities', ids='|'.join(pages)) +data = req.submit() +for qid in data['entities']: +if not qid in cache: +continue # This should never be possible... +cache[qid]._content = data['entities'][qid] +yield cache[qid] + def getPropertyType(self, prop): """ This is used sepecifically because we can cache -- To view, visit https://gerrit.wikimedia.org/r/80789 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05917eb982f41dcdc92d8e45292ba6c27eac47f7 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Legoktm ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Removed unneeded else branches in DifferenceEngine - change (mediawiki/core)
IAlex has uploaded a new change for review. https://gerrit.wikimedia.org/r/80788 Change subject: Removed unneeded else branches in DifferenceEngine .. Removed unneeded else branches in DifferenceEngine The "if" always exit, so there is no need to use else branches; also added blank lines for better readability. Change-Id: I7d8321652a90fbba99e53fa0c1fe018492883b8a --- M includes/diff/DifferenceEngine.php 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/88/80788/1 diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index b102bfc..7750058 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -1182,26 +1182,29 @@ function loadText() { if ( $this->mTextLoaded == 2 ) { return true; - } else { - // Whether it succeeds or fails, we don't want to try again - $this->mTextLoaded = 2; } + + // Whether it succeeds or fails, we don't want to try again + $this->mTextLoaded = 2; if ( !$this->loadRevisionData() ) { return false; } + if ( $this->mOldRev ) { $this->mOldContent = $this->mOldRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ); if ( $this->mOldContent === null ) { return false; } } + if ( $this->mNewRev ) { $this->mNewContent = $this->mNewRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ); if ( $this->mNewContent === null ) { return false; } } + return true; } @@ -1213,13 +1216,16 @@ function loadNewText() { if ( $this->mTextLoaded >= 1 ) { return true; - } else { - $this->mTextLoaded = 1; } + + $this->mTextLoaded = 1; + if ( !$this->loadRevisionData() ) { return false; } + $this->mNewContent = $this->mNewRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ); + return true; } } -- To view, visit https://gerrit.wikimedia.org/r/80788 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7d8321652a90fbba99e53fa0c1fe018492883b8a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: IAlex ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits