[MediaWiki-commits] [Gerrit] Save user creation comment in wiki content language - change (mediawiki...Translate)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Save user creation comment in wiki content language
..


Save user creation comment in wiki content language

Bug: 58707
Change-Id: I93de493ef1861eebfe17c103c99f47e3b8257a62
---
M api/ApiTranslateSandbox.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Amire80: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/api/ApiTranslateSandbox.php b/api/ApiTranslateSandbox.php
index ba30d1b..0b956b5 100644
--- a/api/ApiTranslateSandbox.php
+++ b/api/ApiTranslateSandbox.php
@@ -131,7 +131,11 @@
$logid = $logEntry-insert();
$logEntry-publish( $logid );
 
-   $user-addNewUserLogEntry( 'create', $this-msg( 
'tsb-promoted-from-sandbox' )-text() );
+   global $wgContLang;
+   $user-addNewUserLogEntry(
+   'create',
+   $this-msg( 'tsb-promoted-from-sandbox' 
)-inLanguage( $wgContLang )-text()
+   );
$this-createUserPage( $user );
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/104523
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I93de493ef1861eebfe17c103c99f47e3b8257a62
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: KartikMistry kartik.mis...@gmail.com
Gerrit-Reviewer: Amire80 amir.ahar...@mail.huji.ac.il
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Replace deprecated SpecialPage::getLang() - change (mediawiki...Configure)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Replace deprecated SpecialPage::getLang()
..


Replace deprecated SpecialPage::getLang()

Change-Id: Ia5157ac1125cd1f527c987d61da834cb747c64ad
---
M specials/ConfigurationPage.php
M specials/SpecialViewConfig.php
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/specials/ConfigurationPage.php b/specials/ConfigurationPage.php
index 0b05598..429d42e 100644
--- a/specials/ConfigurationPage.php
+++ b/specials/ConfigurationPage.php
@@ -61,7 +61,7 @@
}
if ( is_array( $wgConfigureWikis )  
!in_array( $wiki, $wgConfigureWikis ) ) {
$this-getOutput()-wrapWikiMsg( 'div 
class=errorboxstrong$1/strong/div',
-   array( 
'configure-transwiki-not-in-range', $wiki, $this-getLang()-commaList( 
$wgConfigureWikis ), count( $wgConfigureWikis ) ) );
+   array( 
'configure-transwiki-not-in-range', $wiki, $this-getLanguage()-commaList( 
$wgConfigureWikis ), count( $wgConfigureWikis ) ) );
return;
}
}
@@ -306,7 +306,7 @@
 * Show you are editing old version message
 */
protected function showOldVersionMessage( $version ) {
-   $lang = $this-getLang();
+   $lang = $this-getLanguage();
$this-getOutput()-addWikiMsg( 'configure-edit-old',
$lang-timeanddate( $version ),
$lang-date( $version ),
@@ -371,7 +371,7 @@
 
$versions = $wgConf-getArchiveVersions( array( 'wiki' = 
$this-mWiki, 'limit' = 11 ) );
$title = $this-getPageTitle();
-   $lang = $this-getLang();
+   $lang = $this-getLanguage();
$prev = null;
 
ksort( $versions ); ## Put in ascending order for now.
diff --git a/specials/SpecialViewConfig.php b/specials/SpecialViewConfig.php
index 4f47773..e82547c 100644
--- a/specials/SpecialViewConfig.php
+++ b/specials/SpecialViewConfig.php
@@ -138,7 +138,7 @@
 
extract( $this-formatConf );
 
-   $lang = $this-getLang();
+   $lang = $this-getLanguage();
$datime = $lang-timeanddate( $ts );
$date = $lang-date( $ts );
$time = $lang-time( $ts );

-- 
To view, visit https://gerrit.wikimedia.org/r/104393
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia5157ac1125cd1f527c987d61da834cb747c64ad
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Configure
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@wikimedia.org
Gerrit-Reviewer: IAlex coderev...@emsenhuber.ch
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Waldir wal...@email.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Made Changes as per Bug 34999 ref{{{foo}}}/ref is workin... - change (mediawiki...Cite)

2014-01-01 Thread AalekhN (Code Review)
AalekhN has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104794


Change subject: Made Changes as per Bug 34999 ref{{{foo}}}/ref is working 
on the local machine
..

Made Changes as per Bug 34999 ref{{{foo}}}/ref is working on the local
machine

Change-Id: I109637c5fc292535f4ad263012165df9c242e524
---
M Cite_body.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite 
refs/changes/94/104794/1

diff --git a/Cite_body.php b/Cite_body.php
index 08c6072..f093965 100644
--- a/Cite_body.php
+++ b/Cite_body.php
@@ -594,7 +594,7 @@
}
 
# Parse $str to process any unparsed ref tags.
-   $parser-recursiveTagParse( $str );
+   $parser-recursiveTagParse( $str, $parser);
 
# Reset call stack
$this-mRefCallStack = array();

-- 
To view, visit https://gerrit.wikimedia.org/r/104794
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I109637c5fc292535f4ad263012165df9c242e524
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: AalekhN aalekh1...@rediffmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update plural rules to CLDR 24 - change (mediawiki/core)

2014-01-01 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104795


Change subject: Update plural rules to CLDR 24
..

Update plural rules to CLDR 24

* updated plurals.xml with new data from CLDR 24
* Hebrew override removed since CLDR 24 matches with MW plural rules
* Updated syntax of overridden rules to TR35 Rev33 for
  dsb, hsb, be_tarask, cu, bho, sgs
* Removed gv override
* Removed Serbian override LanguageSr.php(removed convertPlural method)
  since CLDR24 match with MW rules. Updated and added more tests.
  Tests updated for Serbocroatian(sh) too. CLDR old versions had 4 plural
  rules and MW had only 3. In CLDR 24, the form 'many' was removed and it
  became identical to the MW. Same for Bosnian(bs), Croatian/hrvatski(hr)

16 more test failing

Change-Id: I9930b290d004667a3bb09e5c1663ec2c9c27d8a6
---
D languages/classes/LanguageHr.php
M languages/classes/LanguageSr.php
M languages/data/plurals-mediawiki.xml
M languages/data/plurals.xml
M tests/phpunit/languages/LanguageBsTest.php
M tests/phpunit/languages/LanguageHrTest.php
M tests/phpunit/languages/LanguageSgsTest.php
M tests/phpunit/languages/LanguageShTest.php
M tests/phpunit/languages/LanguageSrTest.php
9 files changed, 212 insertions(+), 239 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/95/104795/1

diff --git a/languages/classes/LanguageHr.php b/languages/classes/LanguageHr.php
deleted file mode 100644
index 0c65ec7..000
--- a/languages/classes/LanguageHr.php
+++ /dev/null
@@ -1,60 +0,0 @@
-?php
-/**
- * Croatian (hrvatski) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Croatian (hrvatski)
- *
- * @ingroup Language
- */
-class LanguageHr extends Language {
-
-   /**
-* @param $count int
-* @param $forms array
-* @return string
-*/
-   function convertPlural( $count, $forms ) {
-   $forms = $this-handleExplicitPluralForms( $count, $forms );
-   if ( is_string( $forms ) ) {
-   return $forms;
-   }
-   if ( !count( $forms ) ) {
-   return '';
-   }
-   // @todo FIXME: CLDR defines 4 plural forms instead of 3. 
Plural for for decimals is missing.
-   //
http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
-   $forms = $this-preConvertPlural( $forms, 3 );
-
-   if ( $count  10  floor( ( $count % 100 ) / 10 ) == 1 ) {
-   return $forms[2];
-   } else {
-   switch ( $count % 10 ) {
-   case 1: return $forms[0];
-   case 2:
-   case 3:
-   case 4: return $forms[1];
-   default: return $forms[2];
-   }
-   }
-   }
-}
diff --git a/languages/classes/LanguageSr.php b/languages/classes/LanguageSr.php
index 283ef22..a99f4b2 100644
--- a/languages/classes/LanguageSr.php
+++ b/languages/classes/LanguageSr.php
@@ -238,44 +238,4 @@
$this-mConverter = new SrConverter( $this, 'sr', $variants, 
$variantfallbacks, $flags );
$wgHooks['PageContentSaveComplete'][] = $this-mConverter;
}
-
-   /**
-* @param $count int
-* @param $forms array
-*
-* @return string
-*/
-   function convertPlural( $count, $forms ) {
-   $forms = $this-handleExplicitPluralForms( $count, $forms );
-   if ( is_string( $forms ) ) {
-   return $forms;
-   }
-   if ( !count( $forms ) ) {
-   return '';
-   }
-
-   // If the actual number is not mentioned in the expression, 
then just two forms are enough:
-   // singular for $count == 1
-   // plural   for $count != 1
-   // For example, This user belongs to {{PLURAL:$1|one 
group|several groups}}.
-   if ( count( $forms ) === 2 ) {
-  

[MediaWiki-commits] [Gerrit] Added new log subtype for message key instead of hard coded ... - change (mediawiki...Translate)

2014-01-01 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104796


Change subject: Added new log subtype for message key instead of hard coded text
..

Added new log subtype for message key instead of hard coded text

Bug: 58707
Change-Id: I865c0ca1ba6395f5af9d60bc32e17a1d91a1183a
---
M Translate.php
M _autoload.php
M api/ApiTranslateSandbox.php
M i18n/sandbox/en.json
M i18n/sandbox/qqq.json
A utils/PromotedSandboxUsersLogFormatter.php
6 files changed, 43 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/96/104796/1

diff --git a/Translate.php b/Translate.php
index b54ccb2..4e16295 100644
--- a/Translate.php
+++ b/Translate.php
@@ -220,6 +220,8 @@
 $wgLogActionsHandlers['translatorsandbox/promoted'] = 'TranslateLogFormatter';
 $wgLogActionsHandlers['translatorsandbox/rejected'] = 'TranslateLogFormatter';
 
+$wgLogActionsHandlers['newusers/tsbpromoted'] = 
'PromotedSandboxUsersLogFormatter';
+
 // New jobs
 $wgJobClasses['MessageIndexRebuildJob'] = 'MessageIndexRebuildJob';
 $wgJobClasses['MessageUpdateJob'] = 'MessageUpdateJob';
diff --git a/_autoload.php b/_autoload.php
index d8cf84b..2d02bff 100644
--- a/_autoload.php
+++ b/_autoload.php
@@ -97,6 +97,8 @@
 $wgAutoloadClasses['StringMatcher'] = $dir/utils/StringMatcher.php;
 $wgAutoloadClasses['TTMServer'] = $dir/utils/TTMServer.php;
 $wgAutoloadClasses['TranslateLogFormatter'] = 
$dir/utils/TranslateLogFormatter.php;
+$wgAutoloadClasses['PromotedSandboxUsersLogFormatter'] =
+   $dir/utils/PromotedSandboxUsersLogFormatter.php;
 $wgAutoloadClasses['TranslateMetadata'] = $dir/utils/TranslateMetadata.php;
 $wgAutoloadClasses['TranslatePerLanguageStats'] = 
$dir/specials/SpecialTranslationStats.php;
 $wgAutoloadClasses['TranslatePreferences'] = $dir/utils/UserToggles.php;
diff --git a/api/ApiTranslateSandbox.php b/api/ApiTranslateSandbox.php
index 0b956b5..947bbe0 100644
--- a/api/ApiTranslateSandbox.php
+++ b/api/ApiTranslateSandbox.php
@@ -132,10 +132,7 @@
$logEntry-publish( $logid );
 
global $wgContLang;
-   $user-addNewUserLogEntry(
-   'create',
-   $this-msg( 'tsb-promoted-from-sandbox' 
)-inLanguage( $wgContLang )-text()
-   );
+   $user-addNewUserLogEntry( 'tsbpromoted' );
$this-createUserPage( $user );
}
}
diff --git a/i18n/sandbox/en.json b/i18n/sandbox/en.json
index cafe244..b1ee748 100644
--- a/i18n/sandbox/en.json
+++ b/i18n/sandbox/en.json
@@ -48,6 +48,7 @@
 tsb-create-user-page: Create basic user page,
 log-name-translatorsandbox: Translation sandbox,
 log-description-translatorsandbox: A log of actions on translation 
sandbox users,
+logentry-newusers-tsbpromoted: User account $3 was 
{{GENDER:$2|created}},
 logentry-translatorsandbox-promoted: $1 {{GENDER:$2|promoted}} $3 to 
{{GENDER:$4|translator}},
 logentry-translatorsandbox-rejected: $1 {{GENDER:$2|rejected}} the 
request from \$3\ to become a translator
 }
diff --git a/i18n/sandbox/qqq.json b/i18n/sandbox/qqq.json
index 302afba..f6db5e4 100644
--- a/i18n/sandbox/qqq.json
+++ b/i18n/sandbox/qqq.json
@@ -49,6 +49,7 @@
 tsb-create-user-page: Edit summary for user page creation once approved 
as translator. Will be in content language.,
 log-name-translatorsandbox: {{doc-logpage}},
 log-description-translatorsandbox: Log page description,
+logentry-newusers-tsbpromoted: 
{{logentry|[[Special:Log/newusers]]}}\nLogentry for users promoted from 
translator sandbox.\n$2 is the gender of the creator.,
 logentry-translatorsandbox-promoted: {{logentry}}\n* $4 - The name of 
the user that was promoted, can be used for GENDER.,
 logentry-translatorsandbox-rejected: {{logentry}}
 }
\ No newline at end of file
diff --git a/utils/PromotedSandboxUsersLogFormatter.php 
b/utils/PromotedSandboxUsersLogFormatter.php
new file mode 100644
index 000..cbdd85c
--- /dev/null
+++ b/utils/PromotedSandboxUsersLogFormatter.php
@@ -0,0 +1,36 @@
+?php
+/**
+ * Formatter for promoted sandbox users log entries based on 
NewUsersLogFormatter.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, 

[MediaWiki-commits] [Gerrit] Add message wrongpassword as html on Special:ChangeEmail - change (mediawiki/core)

2014-01-01 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104797


Change subject: Add message wrongpassword as html on Special:ChangeEmail
..

Add message wrongpassword as html on Special:ChangeEmail

wrongpassword was primary used as html on Special:UserLogin, so when
reuse add it in the same way (html and Message::text)
login-throttled is also used as html on Special:UserLogin so it should
be here in html, too.

Bug: 56522
Change-Id: Iab4a12e6bf65db0b580a05febf8489d42283d8be
---
M includes/specials/SpecialChangeEmail.php
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/104797/1

diff --git a/includes/specials/SpecialChangeEmail.php 
b/includes/specials/SpecialChangeEmail.php
index d9ef5d7..c9a8a94 100644
--- a/includes/specials/SpecialChangeEmail.php
+++ b/includes/specials/SpecialChangeEmail.php
@@ -135,6 +135,15 @@
$this-getOutput()-wrapWikiMsg( p class='error'\n$1\n/p, 
$msg );
}
 
+   /**
+* @param $msg string
+* @param $args array
+* @since 1.23
+*/
+   protected function errorHtml( $msg, $args = array() ) {
+   $this-getOutput()-addHTML( p class='error'\n . 
$this-msg( $msg, $args )-text() . \n/p );
+   }
+
protected function showForm() {
global $wgRequirePasswordforEmailChange;
$user = $this-getUser();
@@ -232,14 +241,14 @@
$throttleCount = LoginForm::incLoginThrottle( $user-getName() 
);
if ( $throttleCount === true ) {
$lang = $this-getLanguage();
-   $this-error( array( 'login-throttled', 
$lang-formatDuration( $wgPasswordAttemptThrottle['seconds'] ) ) );
+   $this-errorHtml( 'login-throttled', 
$lang-formatDuration( $wgPasswordAttemptThrottle['seconds'] ) );
 
return false;
}
 
global $wgRequirePasswordforEmailChange;
if ( $wgRequirePasswordforEmailChange  
!$user-checkTemporaryPassword( $pass )  !$user-checkPassword( $pass ) ) {
-   $this-error( 'wrongpassword' );
+   $this-errorHtml( 'wrongpassword' );
 
return false;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/104797
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab4a12e6bf65db0b580a05febf8489d42283d8be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender umherirrender_de...@web.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] [BUGFIX] fix TypeError in format string - change (pywikibot/compat)

2014-01-01 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104798


Change subject: [BUGFIX] fix TypeError in format string
..

[BUGFIX] fix TypeError in format string

Change-Id: I7507c4a80f497b2f1484f67518644dfc8680c90d
---
M wikipedia.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/98/104798/1

diff --git a/wikipedia.py b/wikipedia.py
index 9946d0d..b1e1a57 100644
--- a/wikipedia.py
+++ b/wikipedia.py
@@ -10348,7 +10348,7 @@
 format_values = dict(num=num, sec=sec)
 output(u'\03{lightblue}'
u'Waiting for %(num)i pages to be put. '
-   u'Estimated time remaining: %(sec)s%'
+   u'Estimated time remaining: %(sec)s'
'\03{default}' % format_values)
 
 while(_putthread.isAlive()):

-- 
To view, visit https://gerrit.wikimedia.org/r/104798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7507c4a80f497b2f1484f67518644dfc8680c90d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] [BUGFIX] fix TypeError in format string - change (pywikibot/compat)

2014-01-01 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104799


Change subject: [BUGFIX] fix TypeError in format string
..

[BUGFIX] fix TypeError in format string

Change-Id: I73a3b2b0f5481efd9365b7625fbecbab9f58359a
---
M wikipedia.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/99/104799/1

diff --git a/wikipedia.py b/wikipedia.py
index 9946d0d..b1e1a57 100644
--- a/wikipedia.py
+++ b/wikipedia.py
@@ -10348,7 +10348,7 @@
 format_values = dict(num=num, sec=sec)
 output(u'\03{lightblue}'
u'Waiting for %(num)i pages to be put. '
-   u'Estimated time remaining: %(sec)s%'
+   u'Estimated time remaining: %(sec)s'
'\03{default}' % format_values)
 
 while(_putthread.isAlive()):

-- 
To view, visit https://gerrit.wikimedia.org/r/104799
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73a3b2b0f5481efd9365b7625fbecbab9f58359a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] [BUGFIX] fix TypeError in format string - change (pywikibot/compat)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: [BUGFIX] fix TypeError in format string
..


[BUGFIX] fix TypeError in format string

Change-Id: I73a3b2b0f5481efd9365b7625fbecbab9f58359a
---
M wikipedia.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wikipedia.py b/wikipedia.py
index 9946d0d..b1e1a57 100644
--- a/wikipedia.py
+++ b/wikipedia.py
@@ -10348,7 +10348,7 @@
 format_values = dict(num=num, sec=sec)
 output(u'\03{lightblue}'
u'Waiting for %(num)i pages to be put. '
-   u'Estimated time remaining: %(sec)s%'
+   u'Estimated time remaining: %(sec)s'
'\03{default}' % format_values)
 
 while(_putthread.isAlive()):

-- 
To view, visit https://gerrit.wikimedia.org/r/104799
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I73a3b2b0f5481efd9365b7625fbecbab9f58359a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] add templatedata api check - change (mediawiki...GWToolset)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: add templatedata api check
..


add templatedata api check

based on the bug report, i have added an api check for templatedata
that allows the extension to work without it.

i have also updated the INSTALL instructions to reflect the current
intent and limited MediaWiki tempalte use.

Bug: 59085
Change-Id: Ia9d10b6de48a54f803699d296f11b177ab2174b4
---
M INSTALL
M includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
2 files changed, 41 insertions(+), 6 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/INSTALL b/INSTALL
index 78c5828..30e27dd 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,8 +2,11 @@
 =
 
 1. Licensing
-2. Requirements
-3. Configuration
+2. Target Wiki
+3. Required Software
+4. Required MediaWiki Templates
+5. Recommended Extensions
+6. Configuration
a. php.ini
b. DefaultSettings.php
c. LocalSettings.php
@@ -14,7 +17,7 @@
d. FileBackend Security
e. Assign Users
f. Image Folder Permissions
-4. Hidden Categories
+7. Hidden Categories
 
 
 Licensing
@@ -22,14 +25,43 @@
 Licensed under GNU GPL. See LICENSE.txt for more license information.
 
 
-Requirements
-
+Target Wiki
+---
+GWToolset was designed with the intention of running on 
http://commons.wikimedia.org, thus, if
+you are installing it on another wiki you may need to first install extensions 
and import
+MediaWiki templates used on Commons.
+
+
+Required Software
+-
 * MediaWiki = 1.21
 * PHP = 5.3.3
 * [PHP cURL support]( http://www.php.net/manual/en/curl.setup.php )
 * [PHP finfo extension]( http://www.php.net/manual/en/fileinfo.setup.php )
 
 
+Required MediaWiki Templates
+
+In order for GWToolset to map metadata with a MediaWiki template, the 
MediaWiki template must be
+installed in the wiki. Currently, GWToolset is limited to mapping with the 
following, Commons,
+MediaWiki templates which should be imported or available in the wiki:
+
+* [Artwork] ( http://commons.wikimedia.org/wiki/Template:Artwork )
+* [Book] ( http://commons.wikimedia.org/wiki/Template:Book )
+* [Musical work] ( http://commons.wikimedia.org/wiki/Template:Muscial_work )
+* [Photograph] ( http://commons.wikimedia.org/wiki/Template:Photograph )
+* [Specimen] ( http://commons.wikimedia.org/wiki/Template:Specimen )
+
+
+Recommended Extensions
+--
+Installing these extensions will give GWToolset the ability to use the most up 
to date
+MediaWiki template parameters as long as that template provides TemplateData.
+
+* [Scribunto] ( http://www.mediawiki.org/wiki/Extension:Scribunto )
+* [TemplateData] ( http://www.mediawiki.org/wiki/Extension:TemplateData )
+
+
 Configuration
 -
 ### `php.ini`
diff --git a/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php 
b/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
index 3fa1413..5f60d3b 100644
--- a/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
+++ b/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
@@ -98,8 +98,11 @@
 */
protected function retrieveTemplateData( Title $Title ) {
$result = null;
+   global $wgAPIModules, $wgRequest;
 
-   global $wgRequest;
+   if ( !array_key_exists( 'templatedata', $wgAPIModules ) ) {
+   return $result;
+   }
 
$Api = new ApiMain(
new DerivativeRequest(

-- 
To view, visit https://gerrit.wikimedia.org/r/104319
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9d10b6de48a54f803699d296f11b177ab2174b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Dan-nl d_ent...@yahoo.com
Gerrit-Reviewer: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: Dan-nl d_ent...@yahoo.com
Gerrit-Reviewer: Gergő Tisza gti...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] LogEntry: Make newFromRow work with RC object - change (mediawiki/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: LogEntry: Make newFromRow work with RC object
..


LogEntry: Make newFromRow work with RC object

LogEntry::newFromRow is supposed to give a RCDatabaseLogEntry
if the given row is a RC log entry. The previous code only did
this if an array was passed as the $row argument.

This adds a type cast and fixes the function so that the proper
LogEntry subclass is returned no matter what variable type is
passed to the function.

Bug: 52053
Change-Id: I6f64358837b37c54d00a7544e9e8a92c216bbe89
---
M includes/logging/LogEntry.php
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Hoo man: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php
index 76c2280..71b4fc2 100644
--- a/includes/logging/LogEntry.php
+++ b/includes/logging/LogEntry.php
@@ -161,8 +161,9 @@
 * @return DatabaseLogEntry
 */
public static function newFromRow( $row ) {
-   if ( is_array( $row )  isset( $row['rc_logid'] ) ) {
-   return new RCDatabaseLogEntry( (object)$row );
+   $row = (object)$row;
+   if ( isset( $row-rc_logid ) ) {
+   return new RCDatabaseLogEntry( $row );
} else {
return new self( $row );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/104708
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6f64358837b37c54d00a7544e9e8a92c216bbe89
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nullzero nullzero.f...@gmail.com
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Nemo bis federicol...@tiscali.it
Gerrit-Reviewer: Nullzero nullzero.f...@gmail.com
Gerrit-Reviewer: Parent5446 tylerro...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] [BUGFIX] change Site.lang to Site.code - change (pywikibot/core)

2014-01-01 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104800


Change subject: [BUGFIX] change Site.lang to Site.code
..

[BUGFIX] change Site.lang to Site.code

We use the site codes for translation purposes not the language
code. e.g. site code of the Alemannic wikipedia is 'als' whereas the language 
code is 'gsw'. This is also important for all
nonstandard language codes.

Change-Id: I3bd186c06ef3b0506411f944f36f1b999fb35dfe
---
M pywikibot/i18n.py
1 file changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/00/104800/1

diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index bb2b26d..40835c0 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -259,9 +259,9 @@
 
 family = pywikibot.config.family
 # If a site is given instead of a code, use its language
-if hasattr(code, 'lang'):
+if hasattr(code, 'code'):
 family = code.family.name
-code = code.lang
+code = code.code
 
 # Check whether xdict has multiple projects
 if type(xdict) == dict:
@@ -336,8 +336,8 @@
 
 code_needed = False
 # If a site is given instead of a code, use its language
-if hasattr(code, 'lang'):
-lang = code.lang
+if hasattr(code, 'code'):
+lang = code.code
 # check whether we need the language code back
 elif type(code) == list:
 lang = code.pop()
@@ -432,8 +432,8 @@
 if type(parameters) == dict:
 param = parameters
 # If a site is given instead of a code, use its language
-if hasattr(code, 'lang'):
-code = code.lang
+if hasattr(code, 'code'):
+code = code.code
 # we send the code via list and get the alternate code back
 code = [code]
 trans = twtranslate(code, twtitle, None)
@@ -484,8 +484,8 @@
 package = twtitle.split(-)[0]
 transdict = getattr(__import__(i18n, fromlist=[package]), package).msg
 # If a site is given instead of a code, use its language
-if hasattr(code, 'lang'):
-code = code.lang
+if hasattr(code, 'code'):
+code = code.code
 return code in transdict and twtitle in transdict[code]
 
 

-- 
To view, visit https://gerrit.wikimedia.org/r/104800
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3bd186c06ef3b0506411f944f36f1b999fb35dfe
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki-issues - change (mediawiki...GWToolset)

2014-01-01 Thread Dan-nl (Code Review)
Dan-nl has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104801


Change subject: translatewiki-issues
..

translatewiki-issues

received an email with two translatewiki issues:

* 
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Gwtoolset-no-xml-element-found/en
  i have adjusted the parametes and code for Gwtoolset-no-xml-element-found; 
hopefully that will
  help with translation

* 
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Gwtoolset-mediafile-throttle/en
  we want to keep the term throttle over the term threshold. i did re-write the 
copy for
  Gwtoolset-mediafile-throttle-description, which will hopefully make its use 
clearer.

Change-Id: Ibd4f4089a92de73d3bcc85814c84f959ef91949e
---
M GWToolset.i18n.php
M includes/Handlers/Xml/XmlDetectHandler.php
2 files changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GWToolset 
refs/changes/01/104801/1

diff --git a/GWToolset.i18n.php b/GWToolset.i18n.php
index cef683d..fd09c96 100644
--- a/GWToolset.i18n.php
+++ b/GWToolset.i18n.php
@@ -150,7 +150,7 @@
'gwtoolset-ensure-well-formed-xml' = 'Make sure the XML file is 
well-formed with this $1.',
'gwtoolset-file-url-invalid' = 'The file URL was invalid; The file 
does not yet exist in the wiki. You need to first upload the file from your 
computer if you want to use the file URL reference in the form.',
'gwtoolset-mediafile-throttle' = 'Mediafile throttle:',
-   'gwtoolset-mediafile-throttle-description' = 'The throttle controls 
the load Wikimedia Commons will put on your media server during the batch 
upload. You can set the throttle between 1-20 where the number corresponds to 
the number of media requests per minute.',
+   'gwtoolset-mediafile-throttle-description' = 'After the batch preview, 
in step 3, GWToolset uploads the remaining records in your batch upload via 
background jobs. The mediafile throttle controls the number of mediafile 
requests Wikimedia Commons will make against your mediafile server each time a 
background job is run. You can set the mediafile throttle between 1-20. For 
example, if the total number of records in your batch upload is 100 and you set 
the throttle to 20, Wikimedia Commons will run 5 background jobs in order to 
process your entire batch upload. The time between each background upload job 
varies depending on server load and configuration; we anticipate that on 
Wikimedia Commons a GWToolset background job will run at least every 5 
minutes.',
'gwtoolset-mediawiki-template-does-not-exist' = 'MediaWiki template 
strong$1/strong does not exist in the wiki.
 
 Either import the template or select another MediaWiki template to use for 
mapping.',
@@ -174,7 +174,8 @@
 It should be in the namespace strong$3strong.',
'gwtoolset-no-xml-element-found' = 'No XML element found for mapping.
 * Did you enter a value in the form for 
{{int:gwtoolset-record-element-name}}?
-* Is the XML file well-formed? Try this $1.',
+* Is the XML file well-formed? Try this $1.
+$2',
'gwtoolset-page-title-contains-url' = 'The page $1 contains the 
entire wiki URL. Make sure you only enter the page title, e.g. the part of the 
URL after /wiki/',
'gwtoolset-record-element-name' = 'What is the XML element that 
contains each metadata record:',
'gwtoolset-step-1-heading' = 'Step 1: Metadata detection',
@@ -494,7 +495,8 @@
 Refers to {{msg-mw|Gwtoolset-record-element-name}}.
 
 Parameters:
-* $1 - http://www.w3schools.com/xml/xml_validator.asp, a line-break, and 
{{msg-mw|Gwtoolset-back-text-link}}',
+* $1 - http://www.w3schools.com/xml/xml_validator.asp
+* $2 - {{msg-mw|Gwtoolset-back-text-link}}',
'gwtoolset-page-title-contains-url' = 'Appears when the page title 
being requested contains the URL of the site and not just the page title',
'gwtoolset-record-element-name' = 'Label for record element name in 
the HTML form.
 
diff --git a/includes/Handlers/Xml/XmlDetectHandler.php 
b/includes/Handlers/Xml/XmlDetectHandler.php
index b0eae41..d51e944 100644
--- a/includes/Handlers/Xml/XmlDetectHandler.php
+++ b/includes/Handlers/Xml/XmlDetectHandler.php
@@ -454,11 +454,11 @@
}
 
if ( empty( $this-_metadata_example_dom_element ) ) {
-   $msg = 'http://www.w3schools.com/xml/xml_validator.asp' 
. PHP_EOL .
-   $this-_SpecialPage-getBackToFormLink();
+   $msg1 = 
'http://www.w3schools.com/xml/xml_validator.asp';
+   $msg2 = $this-_SpecialPage-getBackToFormLink();
 
throw new GWTException(
-   array( 'gwtoolset-no-xml-element-found' = 
array( $msg ) )
+   array( 'gwtoolset-no-xml-element-found' = 
array( $msg1, $msg2 ) )
);

[MediaWiki-commits] [Gerrit] remove deprecate_arg throttle for Page.delete() - change (pywikibot/core)

2014-01-01 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104802


Change subject: remove deprecate_arg throttle for Page.delete()
..

remove deprecate_arg throttle for Page.delete()

Change-Id: Ifceb46aefbdfe3c708c18b0bdb2d550a9bf035fd
---
M pywikibot/page.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/02/104802/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 6504d10..1bb8618 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1270,7 +1270,7 @@
   noredirect=deleteAndMove)
 
 @deprecate_arg(throttle, None)
-def delete(self, reason=None, prompt=True, throttle=None, mark=False):
+def delete(self, reason=None, prompt=True, mark=False):
 Deletes the page from the wiki. Requires administrator status.
 
 @param reason: The edit summary for the deletion, or rationale

-- 
To view, visit https://gerrit.wikimedia.org/r/104802
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifceb46aefbdfe3c708c18b0bdb2d550a9bf035fd
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add tests for weblib - change (pywikibot/core)

2014-01-01 Thread Merlijn van Deen (Code Review)
Merlijn van Deen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104803


Change subject: Add tests for weblib
..

Add tests for weblib

Change-Id: I417d488ebebc39d05a4ce533b1bbf787801d69b0
---
A tests/weblib_tests.py
1 file changed, 37 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/03/104803/1

diff --git a/tests/weblib_tests.py b/tests/weblib_tests.py
new file mode 100644
index 000..f718417
--- /dev/null
+++ b/tests/weblib_tests.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8  -*-
+#
+# (C) Pywikipedia bot team, 2014
+#
+# Distributed under the terms of the MIT license.
+#
+__version__ = '$Id$'
+
+from urlparse import urlparse
+import pywikibot.weblib as weblib
+from utils import unittest
+
+class TestArchiveSites(unittest.TestCase):
+def testInternetArchiveNewest(self):
+archivedversion = weblib.getInternetArchiveURL('http://google.com')
+parsed = urlparse(archivedversion)
+self.assertIn(parsed.scheme, [u'http', u'https'])
+self.assertEqual(parsed.netloc, u'web.archive.org')
+self.assertTrue(parsed.path.endswith('www.google.com/'))
+
+def testInternetArchiveOlder(self):
+archivedversion = weblib.getInternetArchiveURL('http://google.com', 
'200606')
+parsed = urlparse(archivedversion)
+self.assertIn(parsed.scheme, [u'http', u'https'])
+self.assertEqual(parsed.netloc, u'web.archive.org')
+self.assertTrue(parsed.path.endswith('www.google.com/'))
+self.assertIn('200606', parsed.path)
+
+def testWebCiteOlder(self):
+archivedversion = weblib.getWebCitationURL('http://google.com', 
'20130101')
+self.assertEqual(archivedversion, 
'http://www.webcitation.org/6DHSeh2L0')
+
+if __name__ == '__main__':
+try:
+unittest.main()
+except SystemExit:
+pass

-- 
To view, visit https://gerrit.wikimedia.org/r/104803
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I417d488ebebc39d05a4ce533b1bbf787801d69b0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Weblib: add docs, replace string concat with urlencode - change (pywikibot/core)

2014-01-01 Thread Merlijn van Deen (Code Review)
Merlijn van Deen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104804


Change subject: Weblib: add docs, replace string concat with urlencode
..

Weblib: add docs, replace string concat with urlencode

Change-Id: I18c8b7b4c47aba68cffd3435be7fdf4056e3620d
---
M pywikibot/weblib.py
1 file changed, 39 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/04/104804/1

diff --git a/pywikibot/weblib.py b/pywikibot/weblib.py
index d068925..c2ad86e 100644
--- a/pywikibot/weblib.py
+++ b/pywikibot/weblib.py
@@ -11,21 +11,31 @@
 #
 __version__ = '$Id$'
 
-import pywikibot
+import urllib
 from pywikibot.comms import http
 
 
 def getInternetArchiveURL(url, timestamp=None):
-Return archived URL by Internet Archive.
-# See [[:mw:Archived Pages]] and http://archive.org/help/wayback_api.php
+Return archived URL by Internet Archive.
+
+Parameters:
+url - url to search an archived version for
+timestamp - requested archive date. The version closest to that moment
+is returned. Format: MMDDhhmmss or part thereof.
+
+See [[:mw:Archived Pages]] and http://archive.org/help/wayback_api.php
+for more details.
+
 import json
-query = u'http://archive.org/wayback/available?'
-query += u'url='
-query += url
-if not timestamp is None:
-query += u'timestamp='
-query += timestamp
-jsontext = http.request(uri=query, site=None)
+uri = u'http://archive.org/wayback/available?'
+
+query = {'url': url}
+
+if timestamp is not None:
+query['timestamp'] = timestamp
+
+uri = uri + urllib.urlencode(query)
+jsontext = http.request(uri=uri, site=None)
 if closest in jsontext:
 data = json.loads(jsontext)
 return data['archived_snapshots']['closest']['url']
@@ -34,17 +44,27 @@
 
 
 def getWebCitationURL(url, timestamp=None):
-Return archived URL by Web Citation.
-# See http://www.webcitation.org/doc/WebCiteBestPracticesGuide.pdf
+Return archived URL by Web Citation.
+
+Parameters:
+url - url to search an archived version for
+timestamp - requested archive date. The version closest to that moment
+is returned. Format: MMDDhhmmss or part thereof.
+
+See http://www.webcitation.org/doc/WebCiteBestPracticesGuide.pdf
+for more details
+
 import xml.etree.ElementTree as ET
-query = u'http://www.webcitation.org/query?'
-query += u'returnxml=true'
-query += u'url='
-query += url
+uri = u'http://www.webcitation.org/query?'
+
+query = {'returnxml': 'true',
+ 'url': url}
+
 if not timestamp is None:
-query += u'date='
-query += timestamp
-xmltext = http.request(uri=query, site=None)
+query['date'] = timestamp
+
+uri = uri + urllib.urlencode(query)
+xmltext = http.request(uri=uri, site=None)
 if success in xmltext:
 data = ET.fromstring(xmltext)
 return data.find('.//webcite_url').text

-- 
To view, visit https://gerrit.wikimedia.org/r/104804
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18c8b7b4c47aba68cffd3435be7fdf4056e3620d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] weblinkchecker.py : XML and archived URL - change (pywikibot/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: weblinkchecker.py : XML and archived URL
..


weblinkchecker.py : XML and archived URL

Same as the follow for compat:
* I7ba4f460897316ae1f5cbcca0080f8c3262d9abf : read XML dump
* I46c1737aea471691cd90f9ec21e3592ce0c69fde : Internet Archive and Web Citation

Bug: 55039
Bug: 58815
Change-Id: I7279da01b0527c974ea53dc1f234a9268dbc8d43
---
A pywikibot/weblib.py
M scripts/weblinkchecker.py
2 files changed, 123 insertions(+), 29 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/weblib.py b/pywikibot/weblib.py
new file mode 100644
index 000..d068925
--- /dev/null
+++ b/pywikibot/weblib.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8  -*-
+
+Functions for manipulating external links
+or querying third-party sites.
+
+
+#
+# (C) Pywikibot team, 2013
+#
+# Distributed under the terms of the MIT license.
+#
+__version__ = '$Id$'
+
+import pywikibot
+from pywikibot.comms import http
+
+
+def getInternetArchiveURL(url, timestamp=None):
+Return archived URL by Internet Archive.
+# See [[:mw:Archived Pages]] and http://archive.org/help/wayback_api.php
+import json
+query = u'http://archive.org/wayback/available?'
+query += u'url='
+query += url
+if not timestamp is None:
+query += u'timestamp='
+query += timestamp
+jsontext = http.request(uri=query, site=None)
+if closest in jsontext:
+data = json.loads(jsontext)
+return data['archived_snapshots']['closest']['url']
+else:
+return None
+
+
+def getWebCitationURL(url, timestamp=None):
+Return archived URL by Web Citation.
+# See http://www.webcitation.org/doc/WebCiteBestPracticesGuide.pdf
+import xml.etree.ElementTree as ET
+query = u'http://www.webcitation.org/query?'
+query += u'returnxml=true'
+query += u'url='
+query += url
+if not timestamp is None:
+query += u'date='
+query += timestamp
+xmltext = http.request(uri=query, site=None)
+if success in xmltext:
+data = ET.fromstring(xmltext)
+return data.find('.//webcite_url').text
+else:
+return None
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index fe138c7..40f283a 100644
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -36,6 +36,11 @@
 -namespace   Only process templates in the namespace with the given number or
  name. This parameter may be used multiple times.
 
+-xml Should be used instead of a simple page fetching method from
+ pagegenerators.py for performance and load issues
+
+-xmlstartPage to start with when using an XML dump
+
 -ignore  HTTP return codes to ignore. Can be provided several times :
 -ignore:401 -ignore:500
 
@@ -112,6 +117,8 @@
 from pywikibot import i18n
 from pywikibot import config
 from pywikibot import pagegenerators
+from pywikibot import xmlreader
+from pywikibot import weblib
 
 docuReplacements = {
 'params;': pagegenerators.parameterHelp
@@ -177,29 +184,45 @@
 yield m.group('urlb')
 
 
-class InternetArchiveConsulter:
-def __init__(self, url):
-self.url = url
+class XmlDumpPageGenerator:
+Xml generator that yiels pages containing a web link
 
-def getArchiveURL(self):
-pywikibot.output(u'Consulting the Internet Archive for %s' % self.url)
-archiveURL = 'http://web.archive.org/web/*/%s' % self.url
+def __init__(self, xmlFilename, xmlStart, namespaces):
+self.xmlStart = xmlStart
+self.namespaces = namespaces
+self.skipping = bool(xmlStart)
+self.site = pywikibot.getSite()
+
+dump = xmlreader.XmlDump(xmlFilename)
+self.parser = dump.parse()
+
+def __iter__(self):
+return self
+
+def next(self):
 try:
-f = urllib2.urlopen(archiveURL)
-except urllib2.HTTPError:
-# The Internet Archive yields a 403 error when the site was not
-# archived due to robots.txt restrictions.
-return
-except UnicodeEncodeError:
-return
-data = f.read()
-if f.headers.get('content-encoding', None) == 'gzip':
-# Since 2008, the Internet Archive returns pages in GZIPed
-# compression format. Unfortunatelly urllib2 doesn't handle
-# the decompression for us, so we have to do it ourselves.
-data = gzip.GzipFile(fileobj=StringIO.StringIO(data)).read()
-if Search Results for  in data:
-return archiveURL
+for entry in self.parser:
+if self.skipping:
+if entry.title != self.xmlStart:
+continue
+self.skipping = False
+page = pywikibot.Page(self.site, entry.title)
+  

[MediaWiki-commits] [Gerrit] Update comment for wfMsgExt() - change (mediawiki/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update comment for wfMsgExt()
..


Update comment for wfMsgExt()

Change-Id: Ia705a5a1bcef6d2b5c94a003b44e7d15b58df249
---
M includes/GlobalFunctions.php
1 file changed, 12 insertions(+), 11 deletions(-)

Approvals:
  IAlex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 5d3a4d8..3250ec8 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1622,18 +1622,19 @@
  * @deprecated since 1.18
  *
  * @param string $key key of the message
- * @param array $options processing rules. Can take the following options:
- *   iparse/i: parses wikitext to HTML
- *   iparseinline/i: parses wikitext to HTML and removes the surrounding
+ * @param array $options processing rules.
+ *   Can take the following options:
+ * parse: parses wikitext to HTML
+ * parseinline: parses wikitext to HTML and removes the surrounding
  *   p's added by parser or tidy
- *   iescape/i: filters message through htmlspecialchars
- *   iescapenoentities/i: same, but allows entity references like #160; 
through
- *   ireplaceafter/i: parameters are substituted after parsing or escaping
- *   iparsemag/i: transform the message using magic phrases
- *   icontent/i: fetch message for content language instead of interface
- * Also can accept a single associative argument, of the form 'language' = 
'xx':
- *   ilanguage/i: Language object or language code to fetch message for
- *   (overridden by icontent/i).
+ * escape: filters message through htmlspecialchars
+ * escapenoentities: same, but allows entity references like #160; through
+ * replaceafter: parameters are substituted after parsing or escaping
+ * parsemag: transform the message using magic phrases
+ * content: fetch message for content language instead of interface
+ *   Also can accept a single associative argument, of the form 'language' = 
'xx':
+ * language: Language object or language code to fetch message for
+ *   (overridden by content).
  * Behavior for conflicting options (e.g., parse+parseinline) is undefined.
  *
  * @return String

-- 
To view, visit https://gerrit.wikimedia.org/r/100981
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia705a5a1bcef6d2b5c94a003b44e7d15b58df249
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@wikimedia.org
Gerrit-Reviewer: IAlex coderev...@emsenhuber.ch
Gerrit-Reviewer: Siebrand siebr...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update docs for Revision::getRevisionText() - change (mediawiki/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update docs for Revision::getRevisionText()
..


Update docs for Revision::getRevisionText()

Change-Id: I9e4218bec9fd69a50e06ba9fcd8bdf8461163a47
---
M includes/Revision.php
1 file changed, 8 insertions(+), 8 deletions(-)

Approvals:
  IAlex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Revision.php b/includes/Revision.php
index 71b1858..1ad0b4a 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -1203,15 +1203,15 @@
/**
  * Get revision text associated with an old or archive row
  * $row is usually an object from wfFetchRow(), both the flags and the 
text
- * field must be included
+ * field must be included.
  *
- * @param $row Object: the text data
- * @param string $prefix table prefix (default 'old_')
- * @param string|false $wiki the name of the wiki to load the revision 
text from
- * (same as the the wiki $row was loaded from) or false to 
indicate the local
- * wiki (this is the default). Otherwise, it must be a 
symbolic wiki database
- * identifier as understood by the LoadBalancer class.
- * @return String: text the text requested or false on failure
+ * @param stdClass $row The text data
+ * @param string $prefix Table prefix (default 'old_')
+ * @param string|bool $wiki The name of the wiki to load the revision 
text from
+ *   (same as the the wiki $row was loaded from) or false to indicate 
the local
+ *   wiki (this is the default). Otherwise, it must be a symbolic wiki 
database
+ *   identifier as understood by the LoadBalancer class.
+ * @return string Text the text requested or false on failure
  */
public static function getRevisionText( $row, $prefix = 'old_', $wiki = 
false ) {
wfProfileIn( __METHOD__ );

-- 
To view, visit https://gerrit.wikimedia.org/r/102655
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9e4218bec9fd69a50e06ba9fcd8bdf8461163a47
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@wikimedia.org
Gerrit-Reviewer: IAlex coderev...@emsenhuber.ch
Gerrit-Reviewer: Reedy re...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use SpecialPage::getPageTitle() instead of SpecialPage::getT... - change (mediawiki/core)

2014-01-01 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104805


Change subject: Use SpecialPage::getPageTitle() instead of 
SpecialPage::getTitle()
..

Use SpecialPage::getPageTitle() instead of SpecialPage::getTitle()

Follow-up I2a3db995c2 (869d547).

Change-Id: Ifc6824bb1c28f4c5ac8a374208b25cbd8b3bf755
---
M includes/specials/SpecialUserlogin.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/104805/1

diff --git a/includes/specials/SpecialUserlogin.php 
b/includes/specials/SpecialUserlogin.php
index 661960b..3e67d56 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -857,7 +857,7 @@
$this-getOutput()-addHTML( Xml::element( 'p', array( 'class' 
= 'error' ), $error ) );
$reset = new SpecialChangePassword();
$derivative = new DerivativeContext( $this-getContext() );
-   $derivative-setTitle( $reset-getTitle() );
+   $derivative-setTitle( $reset-getPageTitle() );
$reset-setContext( $derivative );
$reset-execute( null );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/104805
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc6824bb1c28f4c5ac8a374208b25cbd8b3bf755
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] category.py: Replaced catlib except in move bot. - change (pywikibot/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: category.py: Replaced catlib except in move bot.
..


category.py: Replaced catlib except in move bot.

Removed catlib with other functions.
Used easier syntax without Link class to create
Category objects.

Change-Id: I5360fd4bebeb2d736fb5b86fc6d71a921acbebfb
---
M scripts/category.py
1 file changed, 14 insertions(+), 14 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/category.py b/scripts/category.py
index a72d33a..e009f86 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -500,7 +500,7 @@
 self.overwrite = overwrite
 self.showImages = showImages
 self.site = pywikibot.getSite()
-self.cat = catlib.Category(pywikibot.Link('Category:' + catTitle))
+self.cat = pywikibot.Category(self.site, catTitle)
 self.list = pywikibot.Page(self.site, listTitle)
 self.subCats = subCats
 self.talkPages = talkPages
@@ -554,7 +554,7 @@
  pagesonly=False):
 self.editSummary = editSummary
 self.site = pywikibot.getSite()
-self.cat = catlib.Category(pywikibot.Link('Category:' + catTitle))
+self.cat = pywikibot.Category(self.site, catTitle)
 # get edit summary message
 self.useSummaryForDeletion = useSummaryForDeletion
 self.batchMode = batchMode
@@ -574,9 +574,9 @@
 for article in articles:
 if not self.titleRegex or re.search(self.titleRegex,
 article.title()):
-catlib.change_category(article, self.cat, None,
-   comment=self.editSummary,
-   inPlace=self.inPlace)
+article.change_category(self.cat, None,
+comment=self.editSummary,
+inPlace=self.inPlace)
 if self.pagesonly:
 return
 
@@ -587,9 +587,9 @@
  % self.cat.title())
 else:
 for subcategory in subcategories:
-catlib.change_category(subcategory, self.cat, None,
-   comment=self.editSummary,
-   inPlace=self.inPlace)
+subcategory.change_category(self.cat, None,
+comment=self.editSummary,
+inPlace=self.inPlace)
 # Deletes the category page
 if self.cat.exists() and self.cat.isEmptyCategory():
 if self.useSummaryForDeletion and self.editSummary:
@@ -708,8 +708,8 @@
 if current_cat == original_cat:
 pywikibot.output('No changes necessary.')
 else:
-catlib.change_category(article, original_cat, current_cat,
-   comment=self.editSummary)
+article.change_category(original_cat, current_cat,
+comment=self.editSummary)
 flag = True
 elif choice in ['j', 'J']:
 newCatTitle = pywikibot.input(u'Please enter the category the '
@@ -721,8 +721,8 @@
 flag = True
 elif choice in ['r', 'R']:
 # remove the category tag
-catlib.change_category(article, original_cat, None,
-   comment=self.editSummary)
+article.change_category(original_cat, None,
+comment=self.editSummary)
 flag = True
 elif choice == '?':
 contextLength += 500
@@ -755,7 +755,7 @@
 flag = True
 
 def run(self):
-cat = catlib.Category(pywikibot.Link('Category:' + self.catTitle))
+cat = pywikibot.Category(self.site, self.catTitle)
 
 articles = set(cat.articles())
 if len(articles) == 0:
@@ -847,7 +847,7 @@
 * maxDepth - the limit beyond which no subcategories will be listed
 
 
-cat = catlib.Category(pywikibot.Link('Category:' + self.catTitle))
+cat = pywikibot.Category(self.site, catTitle)
 tree = self.treeview(cat)
 if self.filename:
 pywikibot.output(u'Saving results in %s' % self.filename)

-- 
To view, visit https://gerrit.wikimedia.org/r/104738
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5360fd4bebeb2d736fb5b86fc6d71a921acbebfb
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Pyfisch pyfi...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van 

[MediaWiki-commits] [Gerrit] retab mail.pp - change (operations/puppet)

2014-01-01 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104806


Change subject: retab mail.pp
..

retab mail.pp

No code change.

Change-Id: I85de611b4535ec8fb5fd5e2fb722db3129c58cb5
---
M manifests/mail.pp
1 file changed, 396 insertions(+), 396 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/06/104806/1

diff --git a/manifests/mail.pp b/manifests/mail.pp
index 49d40c2..59f7ecd 100644
--- a/manifests/mail.pp
+++ b/manifests/mail.pp
@@ -1,445 +1,445 @@
 # mail.pp
 
 class exim {
-   class constants {
-   $primary_mx = [ 208.80.152.186, 
2620::860:2:219:b9ff:fedd:c027 ]
-   }
+class constants {
+$primary_mx = [ 208.80.152.186, 2620::860:2:219:b9ff:fedd:c027 ]
+}
 
-   class config($install_type=light, $queuerunner=queueonly) {
-   package { [ exim4-config, exim4-daemon-${install_type} ]: 
ensure = latest }
+class config($install_type=light, $queuerunner=queueonly) {
+package { [ exim4-config, exim4-daemon-${install_type} ]: ensure 
= latest }
 
-   if $install_type == heavy {
-   exec { mkdir /var/spool/exim4/scan:
-   require = Package[exim4-daemon-heavy],
-   path = /bin:/usr/bin,
-   creates = /var/spool/exim4/scan
-   }
+if $install_type == heavy {
+exec { mkdir /var/spool/exim4/scan:
+require = Package[exim4-daemon-heavy],
+path = /bin:/usr/bin,
+creates = /var/spool/exim4/scan
+}
 
-   mount { [ /var/spool/exim4/scan, 
/var/spool/exim4/db ]:
-   device = none,
-   fstype = tmpfs,
-   options = defaults,
-   ensure = mounted
-   }
+mount { [ /var/spool/exim4/scan, /var/spool/exim4/db ]:
+device = none,
+fstype = tmpfs,
+options = defaults,
+ensure = mounted
+}
 
-   file { [ /var/spool/exim4/scan, /var/spool/exim4/db 
]:
-   ensure = directory,
-   owner = Debian-exim,
-   group = Debian-exim
-   }
+file { [ /var/spool/exim4/scan, /var/spool/exim4/db ]:
+ensure = directory,
+owner = Debian-exim,
+group = Debian-exim
+}
 
-   # add nagios to the Debian-exim group to allow 
check_disk tmpfs mounts (puppet still can't manage existing users?! so just 
Exec)
-   exec { nagios_to_exim_group:
-   command = usermod -a -G Debian-exim nagios,
-   path = /usr/sbin;
-   }
+# add nagios to the Debian-exim group to allow check_disk tmpfs 
mounts (puppet still can't manage existing users?! so just Exec)
+exec { nagios_to_exim_group:
+command = usermod -a -G Debian-exim nagios,
+path = /usr/sbin;
+}
 
-   Exec[mkdir /var/spool/exim4/scan] - 
Mount[/var/spool/exim4/scan] - File[/var/spool/exim4/scan]
-   Package[exim4-daemon-heavy] - 
Mount[/var/spool/exim4/db] - File[/var/spool/exim4/db]
-   }
+Exec[mkdir /var/spool/exim4/scan] - 
Mount[/var/spool/exim4/scan] - File[/var/spool/exim4/scan]
+Package[exim4-daemon-heavy] - Mount[/var/spool/exim4/db] - 
File[/var/spool/exim4/db]
+}
 
-   file {
-   /etc/default/exim4:
-   require = Package[exim4-config],
-   owner = root,
-   group = root,
-   mode = 0444,
-   content = template(exim/exim4.default.erb);
-   /etc/exim4/aliases/:
-   require = Package[exim4-config],
-   mode = 0755,
-   owner = root,
-   group = root,
-   ensure = directory;
-   }
-   }
+file {
+/etc/default/exim4:
+require = Package[exim4-config],
+owner = root,
+group = root,
+mode = 0444,
+content = template(exim/exim4.default.erb);
+/etc/exim4/aliases/:
+require = Package[exim4-config],
+mode = 0755,
+owner = root,
+group = root,
+ensure = directory;
+}
+}
 
-   

[MediaWiki-commits] [Gerrit] mail.pp puppet lint fixes - change (operations/puppet)

2014-01-01 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104807


Change subject: mail.pp puppet lint fixes
..

mail.pp puppet lint fixes

* double quoted string containing no variables
* indentation of = is not properly aligned
* unquoted file mode
* unquoted resource title
* made statements and titles on the same line, reindenting block
* split file statement definining several files at once
* ensure found on line but it's not the first attribute. Thus had to
  remove trailing semicolon and replace them with commas
* split long comment lines

Change-Id: I5d4692c25c58eee59d5911f735e228eb108bd8fe
---
M manifests/mail.pp
1 file changed, 227 insertions(+), 211 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/07/104807/1

diff --git a/manifests/mail.pp b/manifests/mail.pp
index 59f7ecd..787ebc9 100644
--- a/manifests/mail.pp
+++ b/manifests/mail.pp
@@ -2,102 +2,107 @@
 
 class exim {
 class constants {
-$primary_mx = [ 208.80.152.186, 2620::860:2:219:b9ff:fedd:c027 ]
+$primary_mx = [ '208.80.152.186', '2620::860:2:219:b9ff:fedd:c027' ]
 }
 
-class config($install_type=light, $queuerunner=queueonly) {
-package { [ exim4-config, exim4-daemon-${install_type} ]: ensure 
= latest }
-
-if $install_type == heavy {
-exec { mkdir /var/spool/exim4/scan:
-require = Package[exim4-daemon-heavy],
-path = /bin:/usr/bin,
-creates = /var/spool/exim4/scan
-}
-
-mount { [ /var/spool/exim4/scan, /var/spool/exim4/db ]:
-device = none,
-fstype = tmpfs,
-options = defaults,
-ensure = mounted
-}
-
-file { [ /var/spool/exim4/scan, /var/spool/exim4/db ]:
-ensure = directory,
-owner = Debian-exim,
-group = Debian-exim
-}
-
-# add nagios to the Debian-exim group to allow check_disk tmpfs 
mounts (puppet still can't manage existing users?! so just Exec)
-exec { nagios_to_exim_group:
-command = usermod -a -G Debian-exim nagios,
-path = /usr/sbin;
-}
-
-Exec[mkdir /var/spool/exim4/scan] - 
Mount[/var/spool/exim4/scan] - File[/var/spool/exim4/scan]
-Package[exim4-daemon-heavy] - Mount[/var/spool/exim4/db] - 
File[/var/spool/exim4/db]
+class config($install_type='light', $queuerunner='queueonly') {
+package { [
+'exim4-config',
+exim4-daemon-${install_type}
+]: ensure = latest
 }
 
-file {
-/etc/default/exim4:
-require = Package[exim4-config],
-owner = root,
-group = root,
-mode = 0444,
-content = template(exim/exim4.default.erb);
-/etc/exim4/aliases/:
-require = Package[exim4-config],
-mode = 0755,
-owner = root,
-group = root,
-ensure = directory;
+if $install_type == 'heavy' {
+exec { 'mkdir /var/spool/exim4/scan':
+require = Package[exim4-daemon-heavy],
+path= '/bin:/usr/bin',
+creates = '/var/spool/exim4/scan'
+}
+
+mount { [ '/var/spool/exim4/scan', '/var/spool/exim4/db' ]:
+ensure  = mounted,
+device  = 'none',
+fstype  = 'tmpfs',
+options = 'defaults',
+}
+
+file { [ '/var/spool/exim4/scan', '/var/spool/exim4/db' ]:
+ensure = directory,
+owner  = Debian-exim,
+group  = Debian-exim
+}
+
+# add nagios to the Debian-exim group to allow check_disk tmpfs
+# mounts (puppet still can't manage existing users?! so just Exec)
+exec { 'nagios_to_exim_group':
+command = 'usermod -a -G Debian-exim nagios',
+path= '/usr/sbin';
+}
+
+Exec['mkdir /var/spool/exim4/scan'] - 
Mount['/var/spool/exim4/scan'] - File['/var/spool/exim4/scan']
+Package[exim4-daemon-heavy] - Mount['/var/spool/exim4/db'] - 
File['/var/spool/exim4/db']
+}
+
+file { '/etc/default/exim4':
+require = Package[exim4-config],
+owner   = root,
+group   = root,
+mode= '0444',
+content = template('exim/exim4.default.erb'),
+}
+file { '/etc/exim4/aliases/':
+ensure  = directory,
+require = Package[exim4-config],
+owner   = root,
+group   = root,
+mode= '0755',
 }
 }
 
 class service {
-Class[exim::config] - Class[exim::service]

[MediaWiki-commits] [Gerrit] retab realm.pp - change (operations/puppet)

2014-01-01 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104808


Change subject: retab realm.pp
..

retab realm.pp

Change-Id: I9b0e7f15929aae97fb39650dd17e662642dabba6
---
M manifests/realm.pp
1 file changed, 115 insertions(+), 115 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/08/104808/1

diff --git a/manifests/realm.pp b/manifests/realm.pp
index 59bfb45..293777d 100644
--- a/manifests/realm.pp
+++ b/manifests/realm.pp
@@ -3,15 +3,15 @@
 #
 
 if $::realm == undef {
-   $realm = production
+$realm = production
 }
 
 if $::instanceproject == undef {
-   $instanceproject = ''
+$instanceproject = ''
 }
 
 if $::projectgroup == undef {
-   $projectgroup = project-$instanceproject
+$projectgroup = project-$instanceproject
 }
 
 # TODO: redo this in a much better way
@@ -19,41 +19,41 @@
 
 # Determine the site the server is in
 if $::ipaddress_eth0 != undef {
-   $main_ipaddress = $ipaddress_eth0
+$main_ipaddress = $ipaddress_eth0
 } elsif $::ipaddress_bond0 != undef {
-   $main_ipaddress = $ipaddress_bond0
+$main_ipaddress = $ipaddress_bond0
 } else {
-   $main_ipaddress = $ipaddress
+$main_ipaddress = $ipaddress
 }
 
 $site = $main_ipaddress ? {
-   /^208\.80\.15[23]\./  = pmtpa,
-   /^208\.80\.15[45]\./  = eqiad,
-   /^10\.[0-4]\./= pmtpa,
-   /^10\.6[48]\./= eqiad,
-   /^91\.198\.174\./ = esams,
-   /^198\.35\.26\.([0-9]|[1-5][0-9]|6[0-2])/ = ulsfo,
-   /^10\.128\./  = ulsfo,
-   default   = (undefined)
+/^208\.80\.15[23]\./  = pmtpa,
+/^208\.80\.15[45]\./  = eqiad,
+/^10\.[0-4]\./= pmtpa,
+/^10\.6[48]\./= eqiad,
+/^91\.198\.174\./ = esams,
+/^198\.35\.26\.([0-9]|[1-5][0-9]|6[0-2])/ = ulsfo,
+/^10\.128\./  = ulsfo,
+default   = (undefined)
 }
 
 $mw_primary = $::realm ? {
-   'production' = eqiad,
-   default = $::site
+'production' = eqiad,
+default = $::site
 }
 
 $network_zone = $main_ipaddress ? {
-   /^10./  = internal,
-   default = public
+/^10./  = internal,
+default = public
 }
 
 # TODO: create hash of all LVS service IPs
 
 # Set some basic variables
 $nameservers = $site ? {
-   esams = [ 91.198.174.6, 208.80.152.131 ],
-   pmtpa = [ 208.80.152.131, 208.80.152.132 ],
-   default = [ 208.80.154.239, 208.80.152.131 ],
+esams = [ 91.198.174.6, 208.80.152.131 ],
+pmtpa = [ 208.80.152.131, 208.80.152.132 ],
+default = [ 208.80.154.239, 208.80.152.131 ],
 }
 # Allow per-server nameserver prefixes
 $nameservers_prefix = []
@@ -71,106 +71,106 @@
 ## puppet-accessible list of private wikis
 ## please keep alphabetized
 $private_wikis = [ 'arbcom_dewiki',
-   'arbcom_enwiki',
-   'arbcom_fiwiki',
-   'arbcom_nlwiki',
-   'auditcomwiki',
-   'boardgovcomwiki',
-   'boardwiki',
-   'chairwiki',
-   'chapcomwiki',
-   'checkuserwiki',
-   'collabwiki',
-   'execwiki',
-   'fdcwiki',
-   'grantswiki',
-   'iegcomwiki',
-   'ilwikimedia',
-   'internalwiki',
-   'movementroleswiki',
-   'noboard_chapterswikimedia',
-   'officewiki',
-   'ombudsmenwiki',
-   'otrs_wikiwiki',
-   'searchcomwiki',
-   'spcomwiki',
-   'stewardwiki',
-   'transitionteamwiki',
-   'wg_enwiki',
-   'wikimaniateamwiki', ]
+'arbcom_enwiki',
+'arbcom_fiwiki',
+'arbcom_nlwiki',
+'auditcomwiki',
+'boardgovcomwiki',
+'boardwiki',
+'chairwiki',
+'chapcomwiki',
+'checkuserwiki',
+'collabwiki',
+'execwiki',
+'fdcwiki',
+'grantswiki',
+'iegcomwiki',
+'ilwikimedia',
+'internalwiki',
+'movementroleswiki',
+'noboard_chapterswikimedia',
+'officewiki',
+'ombudsmenwiki',
+'otrs_wikiwiki',
+'searchcomwiki',
+'spcomwiki',
+'stewardwiki',
+'transitionteamwiki',
+'wg_enwiki',
+'wikimaniateamwiki', ]
 
 $private_tables = [ 'accountaudit_login',
-   'arbcom1_vote',
-   'archive_old',
-   'blob_orphans',
-   'blob_tracking',
-   'bv2009_edits',
-   'categorylinks_old',
-   'click_tracking',
-   'cu_changes',
-   'cu_log',
-   

[MediaWiki-commits] [Gerrit] realm.pp puppet lint fixes - change (operations/puppet)

2014-01-01 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104809


Change subject: realm.pp puppet lint fixes
..

realm.pp puppet lint fixes

* double quoted string containing no variables
* variable not enclosed in {}
* split $all_prefixes array to have each of its member on its own line

Change-Id: I61b6314466c89070f58006117f07c3639ca2265e
---
M manifests/realm.pp
1 file changed, 22 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/09/104809/1

diff --git a/manifests/realm.pp b/manifests/realm.pp
index 293777d..77df7ff 100644
--- a/manifests/realm.pp
+++ b/manifests/realm.pp
@@ -3,7 +3,7 @@
 #
 
 if $::realm == undef {
-$realm = production
+$realm = 'production'
 }
 
 if $::instanceproject == undef {
@@ -11,11 +11,16 @@
 }
 
 if $::projectgroup == undef {
-$projectgroup = project-$instanceproject
+$projectgroup = project-${instanceproject}
 }
 
 # TODO: redo this in a much better way
-$all_prefixes = [ 208.80.152.0/22, 91.198.174.0/24, 198.35.26.0/23, 
185.15.56.0/22 ]
+$all_prefixes = [
+'208.80.152.0/22',
+'91.198.174.0/24',
+'198.35.26.0/23',
+'185.15.56.0/22',
+]
 
 # Determine the site the server is in
 if $::ipaddress_eth0 != undef {
@@ -27,33 +32,33 @@
 }
 
 $site = $main_ipaddress ? {
-/^208\.80\.15[23]\./  = pmtpa,
-/^208\.80\.15[45]\./  = eqiad,
-/^10\.[0-4]\./= pmtpa,
-/^10\.6[48]\./= eqiad,
-/^91\.198\.174\./ = esams,
-/^198\.35\.26\.([0-9]|[1-5][0-9]|6[0-2])/ = ulsfo,
-/^10\.128\./  = ulsfo,
-default   = (undefined)
+/^208\.80\.15[23]\./  = 'pmtpa',
+/^208\.80\.15[45]\./  = 'eqiad',
+/^10\.[0-4]\./= 'pmtpa',
+/^10\.6[48]\./= 'eqiad',
+/^91\.198\.174\./ = 'esams',
+/^198\.35\.26\.([0-9]|[1-5][0-9]|6[0-2])/ = 'ulsfo',
+/^10\.128\./  = 'ulsfo',
+default   = '(undefined)'
 }
 
 $mw_primary = $::realm ? {
-'production' = eqiad,
+'production' = 'eqiad',
 default = $::site
 }
 
 $network_zone = $main_ipaddress ? {
-/^10./  = internal,
-default = public
+/^10./  = 'internal',
+default = 'public'
 }
 
 # TODO: create hash of all LVS service IPs
 
 # Set some basic variables
 $nameservers = $site ? {
-esams = [ 91.198.174.6, 208.80.152.131 ],
-pmtpa = [ 208.80.152.131, 208.80.152.132 ],
-default = [ 208.80.154.239, 208.80.152.131 ],
+'esams' = [ '91.198.174.6', '208.80.152.131' ],
+'pmtpa' = [ '208.80.152.131', '208.80.152.132' ],
+default = [ '208.80.154.239', '208.80.152.131' ],
 }
 # Allow per-server nameserver prefixes
 $nameservers_prefix = []

-- 
To view, visit https://gerrit.wikimedia.org/r/104809
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61b6314466c89070f58006117f07c3639ca2265e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar has...@free.fr

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix bad usage of empty() function - change (mediawiki/core)

2014-01-01 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104810


Change subject: Fix bad usage of empty() function
..

Fix bad usage of empty() function

Use a strict comparison to null since this member variable is always defined.

Change-Id: Ida7d7ecb2d65458b7f93daa886b3c2b319ffc07e
---
M includes/Title.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/104810/1

diff --git a/includes/Title.php b/includes/Title.php
index 5ab9e94..a0628dc 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -1265,8 +1265,7 @@
 * @return String the prefixed title, with spaces
 */
public function getPrefixedText() {
-   // @todo FIXME: Bad usage of empty() ?
-   if ( empty( $this-mPrefixedText ) ) {
+   if ( $this-mPrefixedText === null ) {
$s = $this-prefix( $this-mTextform );
$s = str_replace( '_', ' ', $s );
$this-mPrefixedText = $s;

-- 
To view, visit https://gerrit.wikimedia.org/r/104810
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida7d7ecb2d65458b7f93daa886b3c2b319ffc07e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] code improvements - change (pywikibot/core)

2014-01-01 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104811


Change subject: code improvements
..

code improvements

- check for a valid speedy deletion template on live wiki
- use Site.code instead of Site.lang as key for twn dictionaries
  this should also solve that bug pointed out at
  https://sourceforge.net/p/pywikipediabot/bugs/1577/
  (there might be a fallback from code to lang on i18n library)

Change-Id: I39dd03bc04846f129ee20c7959a57e4685e87d94
---
M scripts/redirect.py
1 file changed, 27 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/11/104811/1

diff --git a/scripts/redirect.py b/scripts/redirect.py
index 0487f2a..e64f6c5 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -394,6 +394,25 @@
 self.always = True
 return True
 
+def has_valid_template(self, site, twtitle):
+Check whether a template from translatewiki.net does exist on real
+wiki
+
+@param site - a site object
+@param twtitle - a sting which is the i18n key
+
+
+if not i18n.twhas_key(site, twtitle):
+return False
+template_msg = i18n.twtranslate(site, twtitle)
+template = re.findall(u'.*?{{(.*?)[|}]', template_msg)
+if not template:
+return False
+title = template[0]
+# we need the site object to verify templates on different projects
+page = pywikibot.Page(site, title, ns=10)
+return page.exists()
+
 def delete_broken_redirects(self):
 # get reason for deletion text
 for redir_name in self.generator.retrieve_broken_redirects():
@@ -476,22 +495,21 @@
redir_page.title(asLink=True))):
 reason = i18n.twtranslate(self.site,
   'redirect-remove-broken')
-try:
+if self.site.logged_in(sysop=True):
 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 == '-'):
+else:
+if (self.has_valid_template(
+targetPage.site,
+'redirect-broken-redirect-template') and
+i18n.twhas_key(targetPage.site.code,
+   'redirect-remove-broken')):
 pywikibot.output(uNo sysop in user-config.py, 
  uput page to speedy deletion.)
 content = redir_page.get(get_redirect=True)
 ### TODO: Add bot's signature if needed
 ###   Not supported via TW yet
 content = i18n.twtranslate(
-targetPage.site.lang,
+targetPage.site.code,
 'redirect-broken-redirect-template'
 ) + \n + content
 redir_page.put(content, reason)

-- 
To view, visit https://gerrit.wikimedia.org/r/104811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39dd03bc04846f129ee20c7959a57e4685e87d94
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] [BUGFIX] change Site.lang to Site.code - change (pywikibot/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: [BUGFIX] change Site.lang to Site.code
..


[BUGFIX] change Site.lang to Site.code

The i18n files use WMF language codes instead of ISO 639 language
codes. This means we also have to use these in our translations.

e.g. site code of the Alemannic wikipedia is 'als' whereas the
language code is 'gsw'. The i18n files use 'als', while we now
try to lookup 'gsw', which does not exist.

Change-Id: I3bd186c06ef3b0506411f944f36f1b999fb35dfe
---
M pywikibot/i18n.py
1 file changed, 8 insertions(+), 8 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index bb2b26d..40835c0 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -259,9 +259,9 @@
 
 family = pywikibot.config.family
 # If a site is given instead of a code, use its language
-if hasattr(code, 'lang'):
+if hasattr(code, 'code'):
 family = code.family.name
-code = code.lang
+code = code.code
 
 # Check whether xdict has multiple projects
 if type(xdict) == dict:
@@ -336,8 +336,8 @@
 
 code_needed = False
 # If a site is given instead of a code, use its language
-if hasattr(code, 'lang'):
-lang = code.lang
+if hasattr(code, 'code'):
+lang = code.code
 # check whether we need the language code back
 elif type(code) == list:
 lang = code.pop()
@@ -432,8 +432,8 @@
 if type(parameters) == dict:
 param = parameters
 # If a site is given instead of a code, use its language
-if hasattr(code, 'lang'):
-code = code.lang
+if hasattr(code, 'code'):
+code = code.code
 # we send the code via list and get the alternate code back
 code = [code]
 trans = twtranslate(code, twtitle, None)
@@ -484,8 +484,8 @@
 package = twtitle.split(-)[0]
 transdict = getattr(__import__(i18n, fromlist=[package]), package).msg
 # If a site is given instead of a code, use its language
-if hasattr(code, 'lang'):
-code = code.lang
+if hasattr(code, 'code'):
+code = code.code
 return code in transdict and twtitle in transdict[code]
 
 

-- 
To view, visit https://gerrit.wikimedia.org/r/104800
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3bd186c06ef3b0506411f944f36f1b999fb35dfe
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Russell Blau russb...@imapmail.org
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Prevent Page.change_category from readding newCat. - change (pywikibot/core)

2014-01-01 Thread Pyfisch (Code Review)
Pyfisch has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104812


Change subject: Prevent Page.change_category from readding newCat.
..

Prevent Page.change_category from readding newCat.

Currently change_category also adds newCat if it
is already present at the target page. This
behavior had to be fixed manually by calling
functions like category.py and causes extra code
and complexity.

Change-Id: I95ba291e78c2f187f4d4a881b39fa44096cca9b6
---
M pywikibot/page.py
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/12/104812/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index f0150cd..2cda41e 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1479,6 +1479,10 @@
 % (self.title(asLink=True), oldCat.title()))
 return
 
+# This prevents the bot from adding newCat if it is already present.
+if newCat in cats:
+newCat = None
+
 if inPlace or self.namespace() == 10:
 oldtext = self.get(get_redirect=True)
 newtext = pywikibot.replaceCategoryInPlace(oldtext, oldCat, newCat)

-- 
To view, visit https://gerrit.wikimedia.org/r/104812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95ba291e78c2f187f4d4a881b39fa44096cca9b6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Pyfisch pyfi...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Prevent Page.change_category from readding newCat. - change (pywikibot/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Prevent Page.change_category from readding newCat.
..


Prevent Page.change_category from readding newCat.

Currently change_category also adds newCat if it
is already present at the target page. This
behavior had to be fixed manually by calling
functions like category.py and causes extra code
and complexity.

Change-Id: I95ba291e78c2f187f4d4a881b39fa44096cca9b6
---
M pywikibot/page.py
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/page.py b/pywikibot/page.py
index f0150cd..2cda41e 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1479,6 +1479,10 @@
 % (self.title(asLink=True), oldCat.title()))
 return
 
+# This prevents the bot from adding newCat if it is already present.
+if newCat in cats:
+newCat = None
+
 if inPlace or self.namespace() == 10:
 oldtext = self.get(get_redirect=True)
 newtext = pywikibot.replaceCategoryInPlace(oldtext, oldCat, newCat)

-- 
To view, visit https://gerrit.wikimedia.org/r/104812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I95ba291e78c2f187f4d4a881b39fa44096cca9b6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Pyfisch pyfi...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use SpecialPage::getPageTitle() instead of SpecialPage::getT... - change (mediawiki/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use SpecialPage::getPageTitle() instead of 
SpecialPage::getTitle()
..


Use SpecialPage::getPageTitle() instead of SpecialPage::getTitle()

Follow-up I2a3db995c2 (869d547).

Change-Id: Ifc6824bb1c28f4c5ac8a374208b25cbd8b3bf755
---
M includes/specials/SpecialUserlogin.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Parent5446: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialUserlogin.php 
b/includes/specials/SpecialUserlogin.php
index 661960b..3e67d56 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -857,7 +857,7 @@
$this-getOutput()-addHTML( Xml::element( 'p', array( 'class' 
= 'error' ), $error ) );
$reset = new SpecialChangePassword();
$derivative = new DerivativeContext( $this-getContext() );
-   $derivative-setTitle( $reset-getTitle() );
+   $derivative-setTitle( $reset-getPageTitle() );
$reset-setContext( $derivative );
$reset-execute( null );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/104805
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifc6824bb1c28f4c5ac8a374208b25cbd8b3bf755
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Parent5446 tylerro...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] category: Dummy added -hist option for move action - change (pywikibot/core)

2014-01-01 Thread Pyfisch (Code Review)
Pyfisch has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104813


Change subject: category: Dummy added -hist option for move action
..

category: Dummy added -hist option for move action

Added boilerplate code for -hist option which is
not yet ported from compat to core. Raise a not
Implemented error if it the option is used.

Change-Id: I2f583377b3b32127ce968ed05306cda38247d1b0
---
M scripts/category.py
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/13/104813/1

diff --git a/scripts/category.py b/scripts/category.py
index e009f86..5827639 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -38,6 +38,8 @@
   English.
 
 Options for move action:
+ * -hist- Creates a nice wikitable on the talk page of target category
+  that contains detailed page history of the source category.
  * -nodelete- Don't delete the old category after move
 
 Options for several actions:
@@ -391,7 +393,7 @@
 def __init__(self, oldCatTitle, newCatTitle, batchMode=False,
  editSummary='', inPlace=False, moveCatPage=True,
  deleteEmptySourceCat=True, titleRegex=None,
- useSummaryForDeletion=True):
+ useSummaryForDeletion=True, withHistory=True):
 self.editSummary = editSummary
 self.oldCat = pywikibot.Category(
 pywikibot.Link('Category:' + oldCatTitle))
@@ -402,8 +404,11 @@
 self.deleteEmptySourceCat = deleteEmptySourceCat
 self.titleRegex = titleRegex
 self.useSummaryForDeletion = useSummaryForDeletion
+self.withHistory = withHistory
 
 def run(self):
+if self.withHistory:
+raise NotImplentedError(History printing is not yet enabled.)
 site = pywikibot.getSite()
 newCat = pywikibot.Category(
 pywikibot.Link('Category:' + self.newCatTitle))
@@ -873,6 +878,7 @@
 recurse = False
 titleRegex = None
 pagesonly = False
+withHistory = True
 
 # This factory is responsible for processing command line arguments
 # that are also used by other scripts and that determine on which pages
@@ -943,6 +949,8 @@
 create_pages = True
 elif arg == '-redirect':
 follow_redirects = True
+elif arg == '-hist':
+withHistory = True
 else:
 genFactory.handleArg(arg)
 pywikibot.Site().login()
@@ -976,7 +984,8 @@
 bot = CategoryMoveRobot(oldCatTitle, newCatTitle, batchMode,
 editSummary, inPlace,
 deleteEmptySourceCat=deleteEmptySourceCat,
-titleRegex=titleRegex)
+titleRegex=titleRegex,
+withHistory=withHistory)
 bot.run()
 elif action == 'tidy':
 catTitle = pywikibot.input(u'Which category do you want to tidy up?')

-- 
To view, visit https://gerrit.wikimedia.org/r/104813
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f583377b3b32127ce968ed05306cda38247d1b0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Pyfisch pyfi...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] prevent fatal when passing null to getInnerHtml - change (mediawiki...Flow)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: prevent fatal when passing null to getInnerHtml
..


prevent fatal when passing null to getInnerHtml

passing null was causing a fatal error, instead allow it and add
some debug logging to indicate there is a problem.

Change-Id: Idbe23d14ae963bfac13d7fb7e2b6b2ea1080cd64
---
M includes/Redlinker.php
1 file changed, 14 insertions(+), 6 deletions(-)

Approvals:
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Redlinker.php b/includes/Redlinker.php
index 344d671..e6c3c38 100644
--- a/includes/Redlinker.php
+++ b/includes/Redlinker.php
@@ -219,7 +219,13 @@
} );
 
$body = $dom-getElementsByTagName( 'body' )-item( 0 );
-   return Redlinker::getInnerHtml( $body );
+
+   if ( $body ) {
+   return Redlinker::getInnerHtml( $body );
+   } else {
+   wfDebugLog( __CLASS__, __FUNCTION__ . ' : Source 
content ' . md5( $content ) . ' resulted in no body' );
+   return '';
+   }
}
 
/**
@@ -275,18 +281,20 @@
}
}
}
-   
+
/**
 * Helper method retrieves the html of the nodes children
 *
 * @param DOMNode $node
 * @return string html of the nodes children
 */
-   static public function getInnerHtml( DOMNode $node ) {
+   static public function getInnerHtml( DOMNode $node = null ) {
$html = array();
-   $dom = $node-ownerDocument;
-   foreach ( $node-childNodes as $child ) {
-   $html[] = $dom-saveHTML( $child );
+   if ( $node ) {
+   $dom = $node-ownerDocument;
+   foreach ( $node-childNodes as $child ) {
+   $html[] = $dom-saveHTML( $child );
+   }
}
return implode( '', $html );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/104791
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idbe23d14ae963bfac13d7fb7e2b6b2ea1080cd64
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update constructor arguments - change (mediawiki...Flow)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update constructor arguments
..


Update constructor arguments

Change-Id: I3831c766dbc46b4398ebf9fb347aad4939946326
---
M includes/Templating.php
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Templating.php b/includes/Templating.php
index c986f51..ac979a1 100644
--- a/includes/Templating.php
+++ b/includes/Templating.php
@@ -20,6 +20,11 @@
 
 class Templating {
/**
+* @var UserNameBatch
+*/
+   protected $usernames;
+
+   /**
 * @var UrlGenerator
 */
public $urlGenerator;
@@ -157,7 +162,8 @@
$this-globals['user'], // There is no guarantee of 
this existing
$root,
$actionMenu,
-   $this-urlGenerator
+   $this-urlGenerator,
+   $this-usernames
);
if ( !$actionMenu-isAllowed( 'view' ) ) {
return '';

-- 
To view, visit https://gerrit.wikimedia.org/r/104792
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3831c766dbc46b4398ebf9fb347aad4939946326
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Require Module: to be prefixed - change (mediawiki...WikimediaIncubator)

2014-01-01 Thread Ebe123 (Code Review)
Ebe123 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104814


Change subject: Require Module: to be prefixed
..

Require Module: to be prefixed

Get the Module: and Module_talk: namespaces (ns: 828, 829)
to be prefixed according to the WikimediaIncubator
extension.

Bug: 59187
Change-Id: Ibcec527bf33210c926a96d3e843a50d05fae9861
---
M WikimediaIncubator.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaIncubator 
refs/changes/14/104814/1

diff --git a/WikimediaIncubator.php b/WikimediaIncubator.php
index 484c8e9..2493e2b 100644
--- a/WikimediaIncubator.php
+++ b/WikimediaIncubator.php
@@ -55,6 +55,7 @@
NS_MAIN, NS_TALK,
NS_TEMPLATE, NS_TEMPLATE_TALK,
NS_CATEGORY, NS_CATEGORY_TALK,
+   NS_MODULE, NS_MODULE_TALK,
 );
 $wmincLangCodeLength = 12; // can be changed if needed (depends on policy)
 // Pseudo category namespaces like Category:Maintenance:Delete, for easy 
whitelisting and structure

-- 
To view, visit https://gerrit.wikimedia.org/r/104814
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcec527bf33210c926a96d3e843a50d05fae9861
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaIncubator
Gerrit-Branch: master
Gerrit-Owner: Ebe123 beauleetien...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] No variable assignment on return statement - change (mediawiki/core)

2014-01-01 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104815


Change subject: No variable assignment on return statement
..

No variable assignment on return statement

Split the variable assignment and the return statement in two lines for
better readability.

When there was two return statements in one method the logic was swapped
to have only one return statement.

Change-Id: Id7a01b4a2df96036435f9e1a9be5678dd124b0af
---
M includes/EditPage.php
M includes/Linker.php
M includes/Title.php
M includes/WikiFilePage.php
M includes/WikiPage.php
M includes/logging/DeleteLogFormatter.php
M includes/logging/LogFormatter.php
M includes/resourceloader/ResourceLoader.php
M includes/resourceloader/ResourceLoaderFileModule.php
M includes/resourceloader/ResourceLoaderStartUpModule.php
M includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php
M includes/resourceloader/ResourceLoaderUserOptionsModule.php
M includes/upload/UploadBase.php
M languages/LanguageConverter.php
14 files changed, 81 insertions(+), 53 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/15/104815/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index f86cae4..ba49378 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -1913,12 +1913,10 @@
function getBaseRevision() {
if ( !$this-mBaseRevision ) {
$db = wfGetDB( DB_MASTER );
-   $baseRevision = Revision::loadFromTimestamp(
+   $this-mBaseRevision = Revision::loadFromTimestamp(
$db, $this-mTitle, $this-edittime );
-   return $this-mBaseRevision = $baseRevision;
-   } else {
-   return $this-mBaseRevision;
}
+   return $this-mBaseRevision;
}
 
/**
diff --git a/includes/Linker.php b/includes/Linker.php
index 27f8ab4..9e489e7 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -2137,7 +2137,8 @@
}
 
wfProfileOut( __METHOD__ );
-   return self::$accesskeycache[$name] = $accesskey;
+   self::$accesskeycache[$name] = $accesskey;
+   return self::$accesskeycache[$name];
}
 
/**
diff --git a/includes/Title.php b/includes/Title.php
index 5ab9e94..1c63e14 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -2892,15 +2892,15 @@
# alone to cache the result.  There's no point in having it 
hanging
# around uninitialized in every Title object; therefore we only 
add it
# if needed and don't declare it statically.
-   if ( isset( $this-mHasSubpages ) ) {
-   return $this-mHasSubpages;
+   if ( !isset( $this-mHasSubpages ) ) {
+   $this-mHasSubpages = false;
+   $subpages = $this-getSubpages( 1 );
+   if ( $subpages instanceof TitleArray ) {
+   $this-mHasSubpages = (bool)$subpages-count();
+   }
}
 
-   $subpages = $this-getSubpages( 1 );
-   if ( $subpages instanceof TitleArray ) {
-   return $this-mHasSubpages = (bool)$subpages-count();
-   }
-   return $this-mHasSubpages = false;
+   return $this-mHasSubpages;
}
 
/**
@@ -2922,7 +2922,7 @@
if ( $limit  -1 ) {
$options['LIMIT'] = $limit;
}
-   return $this-mSubpages = TitleArray::newFromResult(
+   $this-mSubpages = TitleArray::newFromResult(
$dbr-select( 'page',
array( 'page_id', 'page_namespace', 
'page_title', 'page_is_redirect' ),
$conds,
@@ -2930,6 +2930,7 @@
$options
)
);
+   return $this-mSubpages;
}
 
/**
@@ -2990,7 +2991,8 @@
 */
public function getArticleID( $flags = 0 ) {
if ( $this-getNamespace()  0 ) {
-   return $this-mArticleID = 0;
+   $this-mArticleID = 0;
+   return $this-mArticleID;
}
$linkCache = LinkCache::singleton();
if ( $flags  self::GAID_FOR_UPDATE ) {
@@ -3019,7 +3021,8 @@
}
# Calling getArticleID() loads the field from cache as needed
if ( !$this-getArticleID( $flags ) ) {
-   return $this-mRedirect = false;
+   $this-mRedirect = false;
+   return $this-mRedirect;
}
 
$linkCache = LinkCache::singleton();
@@ 

[MediaWiki-commits] [Gerrit] Add tests for weblib - change (pywikibot/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add tests for weblib
..


Add tests for weblib

Change-Id: I417d488ebebc39d05a4ce533b1bbf787801d69b0
---
A tests/weblib_tests.py
1 file changed, 38 insertions(+), 0 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/weblib_tests.py b/tests/weblib_tests.py
new file mode 100644
index 000..08c4804
--- /dev/null
+++ b/tests/weblib_tests.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8  -*-
+#
+# (C) Pywikipedia bot team, 2014
+#
+# Distributed under the terms of the MIT license.
+#
+__version__ = '$Id$'
+
+from urlparse import urlparse
+import pywikibot.weblib as weblib
+from utils import unittest
+
+
+class TestArchiveSites(unittest.TestCase):
+def testInternetArchiveNewest(self):
+archivedversion = weblib.getInternetArchiveURL('http://google.com')
+parsed = urlparse(archivedversion)
+self.assertIn(parsed.scheme, [u'http', u'https'])
+self.assertEqual(parsed.netloc, u'web.archive.org')
+self.assertTrue(parsed.path.endswith('www.google.com/'))
+
+def testInternetArchiveOlder(self):
+archivedversion = weblib.getInternetArchiveURL('http://google.com', 
'200606')
+parsed = urlparse(archivedversion)
+self.assertIn(parsed.scheme, [u'http', u'https'])
+self.assertEqual(parsed.netloc, u'web.archive.org')
+self.assertTrue(parsed.path.endswith('www.google.com/'))
+self.assertIn('200606', parsed.path)
+
+def testWebCiteOlder(self):
+archivedversion = weblib.getWebCitationURL('http://google.com', 
'20130101')
+self.assertEqual(archivedversion, 
'http://www.webcitation.org/6DHSeh2L0')
+
+if __name__ == '__main__':
+try:
+unittest.main()
+except SystemExit:
+pass

-- 
To view, visit https://gerrit.wikimedia.org/r/104803
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I417d488ebebc39d05a4ce533b1bbf787801d69b0
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Repair missed conversion to new username lookup - change (mediawiki...Flow)

2014-01-01 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104816


Change subject: Repair missed conversion to new username lookup
..

Repair missed conversion to new username lookup

Change-Id: Ib79a13da59c79db54fbd24ef3837db1b5ff6a7d0
---
M includes/Model/AbstractRevision.php
M includes/Templating.php
M includes/View/Post.php
3 files changed, 17 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/16/104816/1

diff --git a/includes/Model/AbstractRevision.php 
b/includes/Model/AbstractRevision.php
index 8535860..da1efe8 100644
--- a/includes/Model/AbstractRevision.php
+++ b/includes/Model/AbstractRevision.php
@@ -518,6 +518,14 @@
return $this-lastEditId;
}
 
+   public function getLastContentEditUserId() {
+   return $this-lastEditUserId;
+   }
+
+   public function getLastContentEditUserIp() {
+   return $this-lastEditUserIp;
+   }
+
public function getModeratedByUserId() {
return $this-moderatedByUserId;
}
diff --git a/includes/Templating.php b/includes/Templating.php
index ac979a1..c453780 100644
--- a/includes/Templating.php
+++ b/includes/Templating.php
@@ -441,7 +441,7 @@
 
// Messages: flow-hide-post-content, 
flow-delete-post-content, flow-suppress-post-content
//   flow-hide-title-content, 
flow-delete-title-content, flow-suppress-title-content
-   $message = wfMessage( flow-$state-$type-content, 
$user, $this-getUserLinks( $revision, $user ) );
+   $message = wfMessage( flow-$state-$type-content, 
$username, $this-getUserLinks( $revision, $permissionsUser ) );
if ( $message-exists() ) {
return $message-escaped();
} else {
diff --git a/includes/View/Post.php b/includes/View/Post.php
index f5eab29..b079d94 100644
--- a/includes/View/Post.php
+++ b/includes/View/Post.php
@@ -165,12 +165,18 @@
 
public function createModifiedTipsyHtml( AbstractBlock $block ) {
$html = '';
-   if ( $this-post-getLastContentEditorName() ) {
+   if ( $this-post-getLastContentEditId() ) {
+   $name = $this-usernames-get(
+   wfWikiId(),
+   $this-post-getLastContentEditUserId(),
+   $this-post-getLastContentEditUserIp()
+   );
+
$html .= Html::openElement( 'div', array( 'class' = 
'flow-content-modified-tipsy-flyout' ) );
$html .= Html::element(
'div',
array( 'class' = 'flow-last-modified-user' ),
-   wfMessage( 'flow-last-modified-by', 
$this-post-getLastContentEditorName() )-text()
+   wfMessage( 'flow-last-modified-by', $name 
)-text()
);
$html .= Html::openElement( 'div', array( 'class' = 
'flow-show-change-link' ) );
$html .= Html::element( 'a', array( 'href' = 
$this-getLatestDiffLink( $block ) ), wfMessage( 'flow-show-change' )-text() );

-- 
To view, visit https://gerrit.wikimedia.org/r/104816
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib79a13da59c79db54fbd24ef3837db1b5ff6a7d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson ebernhard...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Weblib: add docs, replace string concat with urlencode - change (pywikibot/core)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Weblib: add docs, replace string concat with urlencode
..


Weblib: add docs, replace string concat with urlencode

Change-Id: I18c8b7b4c47aba68cffd3435be7fdf4056e3620d
---
M pywikibot/weblib.py
1 file changed, 39 insertions(+), 19 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/weblib.py b/pywikibot/weblib.py
index d068925..c2ad86e 100644
--- a/pywikibot/weblib.py
+++ b/pywikibot/weblib.py
@@ -11,21 +11,31 @@
 #
 __version__ = '$Id$'
 
-import pywikibot
+import urllib
 from pywikibot.comms import http
 
 
 def getInternetArchiveURL(url, timestamp=None):
-Return archived URL by Internet Archive.
-# See [[:mw:Archived Pages]] and http://archive.org/help/wayback_api.php
+Return archived URL by Internet Archive.
+
+Parameters:
+url - url to search an archived version for
+timestamp - requested archive date. The version closest to that moment
+is returned. Format: MMDDhhmmss or part thereof.
+
+See [[:mw:Archived Pages]] and http://archive.org/help/wayback_api.php
+for more details.
+
 import json
-query = u'http://archive.org/wayback/available?'
-query += u'url='
-query += url
-if not timestamp is None:
-query += u'timestamp='
-query += timestamp
-jsontext = http.request(uri=query, site=None)
+uri = u'http://archive.org/wayback/available?'
+
+query = {'url': url}
+
+if timestamp is not None:
+query['timestamp'] = timestamp
+
+uri = uri + urllib.urlencode(query)
+jsontext = http.request(uri=uri, site=None)
 if closest in jsontext:
 data = json.loads(jsontext)
 return data['archived_snapshots']['closest']['url']
@@ -34,17 +44,27 @@
 
 
 def getWebCitationURL(url, timestamp=None):
-Return archived URL by Web Citation.
-# See http://www.webcitation.org/doc/WebCiteBestPracticesGuide.pdf
+Return archived URL by Web Citation.
+
+Parameters:
+url - url to search an archived version for
+timestamp - requested archive date. The version closest to that moment
+is returned. Format: MMDDhhmmss or part thereof.
+
+See http://www.webcitation.org/doc/WebCiteBestPracticesGuide.pdf
+for more details
+
 import xml.etree.ElementTree as ET
-query = u'http://www.webcitation.org/query?'
-query += u'returnxml=true'
-query += u'url='
-query += url
+uri = u'http://www.webcitation.org/query?'
+
+query = {'returnxml': 'true',
+ 'url': url}
+
 if not timestamp is None:
-query += u'date='
-query += timestamp
-xmltext = http.request(uri=query, site=None)
+query['date'] = timestamp
+
+uri = uri + urllib.urlencode(query)
+xmltext = http.request(uri=uri, site=None)
 if success in xmltext:
 data = ET.fromstring(xmltext)
 return data.find('.//webcite_url').text

-- 
To view, visit https://gerrit.wikimedia.org/r/104804
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I18c8b7b4c47aba68cffd3435be7fdf4056e3620d
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Leaking script to create language models from translations - change (mediawiki...Translate)

2014-01-01 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104817


Change subject: Leaking script to create language models from translations
..

Leaking script to create language models from translations

https://github.com/crodas/LanguageDetector

The models produced with this data has much better language
coverage then the provided samples - though it has hard time
guessing between the different Chinese languages.

Change-Id: I25bf123d2908ab1df0b0333be3095820b05d1b59
---
A scripts/create-language-models.php
1 file changed, 224 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/17/104817/1

diff --git a/scripts/create-language-models.php 
b/scripts/create-language-models.php
new file mode 100644
index 000..66275ec
--- /dev/null
+++ b/scripts/create-language-models.php
@@ -0,0 +1,224 @@
+?php
+/**
+ * ...
+ *
+ * @author Niklas Laxstrom
+ *
+ * @copyright Copyright © 2012-2013, Niklas Laxström
+ * @license GPL-2.0+
+ * @file
+ */
+
+// Standard boilerplate to define $IP
+if ( getenv( 'MW_INSTALL_PATH' ) !== false ) {
+   $IP = getenv( 'MW_INSTALL_PATH' );
+} else {
+   $dir = __DIR__;
+   $IP = $dir/../../..;
+}
+require_once $IP/maintenance/Maintenance.php;
+
+class LanguageModelCreator extends Maintenance {
+   protected $changes = array();
+
+   public function __construct() {
+   parent::__construct();
+   $this-mDescription = '...';
+   }
+
+   public function execute() {
+   global $wgTranslateMessageNamespaces;
+
+   ini_set( 'memory_limit', '5G' );
+
+   $messages = 5000;
+
+   $languages = TranslateUtils::getLanguageNames( 'en' );
+   $cache = wfGetCache( CACHE_DB );
+   $key = wfMemckey( __METHOD__, $messages );
+   $pages = array();
+
+   $pages = $cache-get( $key );
+   if ( !is_array( $pages ) ) {
+   $dbr = wfGetDB( DB_SLAVE );
+   $conds = array();
+   $conds[] = 'page_title' . $dbr-buildLike( 
$dbr-anyString(), '/', $dbr-anyString() );
+   $conds['page_namespace'] = 
$wgTranslateMessageNamespaces;
+
+   echo Before query\n;
+   $res = $dbr-select(
+   array( 'page' ),
+   array( 'page_title, page_id' ),
+   $conds,
+   __METHOD__
+   );
+   echo After query\n;
+
+   $total = $res-numRows();
+   $index = 0;
+
+   foreach ( $res as $row ) {
+   $index++;
+   $code = substr( $row-page_title, strrpos( 
$row-page_title, '/' ) + 1 );
+   if ( isset( $languages[$code] ) ) {
+   $pages[$code][] = $row-page_id;
+   }
+
+   if ( $index % 1 === 0 ) {
+   $progress = number_format( $index / 
$total * 100, 2 );
+   echo $progress%\n;
+   }
+   }
+
+   echo \n;
+
+   foreach ( array_keys( $pages ) as $code ) {
+   if ( count( $pages[$code] )  $messages ) {
+   $pages[$code] = array_slice( 
$pages[$code], 0, $messages );
+   }
+
+   $pages[$code] = implode( '|', $pages[$code] );
+   }
+
+   echo After code map\n;
+
+   ksort( $pages );
+
+   echo After sort map\n;
+
+   $cache-set( $key, $pages, 3600*24 );
+   echo After set map\n;
+   }
+
+   unset( $pages['qqq'] );
+   unset( $pages['de-formal'] );
+   unset( $pages['nl-informal'] );
+   unset( $pages['en-gb'] );
+
+   $pids = array();
+   $threads = 2;
+   foreach ( $pages as $code = $pageids ) {
+   $pid = ( $threads  1 ) ? pcntl_fork() : -1;
+
+   if ( $pid === 0 ) {
+   // Child, reseed because there is no bug in PHP:
+   // http://bugs.php.net/bug.php?id=42465
+   mt_srand( getmypid() );
+   $this-analyzeLanguage( $code, $pageids );
+   exit();
+   } elseif ( $pid === -1 ) {
+   // Fork failed or one thread, do it 

[MediaWiki-commits] [Gerrit] Prepare for composer support - change (mediawiki...Translate)

2014-01-01 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104818


Change subject: Prepare for composer support
..

Prepare for composer support

Change-Id: I77becf4b2ae7907e693ed84745d297dde8faaebe
---
M Resources.php
M Translate.php
M _autoload.php
M composer.json
4 files changed, 178 insertions(+), 172 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/18/104818/1

diff --git a/Resources.php b/Resources.php
index d25ca98..5c8ff8d 100644
--- a/Resources.php
+++ b/Resources.php
@@ -6,6 +6,8 @@
  * @license GPL-2.0+
  */
 
+global $wgResourceModules;
+
 $resourcePaths = array(
'localBasePath' = __DIR__,
'remoteExtPath' = 'Translate'
@@ -475,7 +477,7 @@
 ) + $resourcePaths;
 
 // BC for MediaWiki = 1.21
-$wgHooks['ResourceLoaderRegisterModules'][] =
+$GLOBALS['wgHooks']['ResourceLoaderRegisterModules'][] =
function ( ResourceLoader $rl ) use ( $resourcePaths ) {
if ( !in_array( 'jquery.chosen', $rl-getModuleNames() ) ) {
$rl-register(
diff --git a/Translate.php b/Translate.php
index b54ccb2..732d7a1 100644
--- a/Translate.php
+++ b/Translate.php
@@ -17,12 +17,12 @@
 /**
  * Version number used in extension credits and in other places where needed.
  */
-define( 'TRANSLATE_VERSION', '2013-12-31' );
+define( 'TRANSLATE_VERSION', '2014-01-01' );
 
 /**
  * Extension credits properties.
  */
-$wgExtensionCredits['specialpage'][] = array(
+$GLOBALS['wgExtensionCredits']['specialpage'][] = array(
'path' = __FILE__,
'name' = 'Translate',
'version' = TRANSLATE_VERSION,
@@ -44,188 +44,188 @@
  * @cond file_level_code
  */
 
-$wgMessagesDirs['PageTranslation'] = __DIR__ . /i18n/pagetranslation;
-$wgMessagesDirs['Translate'] = __DIR__ . /i18n/core;
-$wgMessagesDirs['TranslateGroupDescriptions'] = __DIR__ . 
/i18n/groupdescriptions;
-$wgMessagesDirs['TranslateSearch'] = __DIR__ . /i18n/search;
-$wgMessagesDirs['TranslateSandbox'] = __DIR__ . /i18n/sandbox;
+$GLOBALS['wgMessagesDirs']['PageTranslation'] = __DIR__ . 
/i18n/pagetranslation;
+$GLOBALS['wgMessagesDirs']['Translate'] = __DIR__ . /i18n/core;
+$GLOBALS['wgMessagesDirs']['TranslateGroupDescriptions'] = __DIR__ . 
/i18n/groupdescriptions;
+$GLOBALS['wgMessagesDirs']['TranslateSearch'] = __DIR__ . /i18n/search;
+$GLOBALS['wgMessagesDirs']['TranslateSandbox'] = __DIR__ . /i18n/sandbox;
 
 // Register extension messages and other localisation.
-$wgExtensionMessagesFiles['Translate'] = $dir/Translate.i18n.php;
-$wgExtensionMessagesFiles['PageTranslation'] = $dir/PageTranslation.i18n.php;
-$wgExtensionMessagesFiles['TranslateGroupDescriptions'] =
+$GLOBALS['wgExtensionMessagesFiles']['Translate'] = $dir/Translate.i18n.php;
+$GLOBALS['wgExtensionMessagesFiles']['PageTranslation'] = 
$dir/PageTranslation.i18n.php;
+$GLOBALS['wgExtensionMessagesFiles']['TranslateGroupDescriptions'] =
$dir/TranslateGroupDescriptions.i18n.php;
-$wgExtensionMessagesFiles['TranslateSearch'] = $dir/TranslateSearch.i18n.php;
-$wgExtensionMessagesFiles['TranslateSandbox'] = 
$dir/TranslateSandbox.i18n.php;
-$wgExtensionMessagesFiles['TranslateAlias'] = $dir/Translate.alias.php;
+$GLOBALS['wgExtensionMessagesFiles']['TranslateSearch'] = 
$dir/TranslateSearch.i18n.php;
+$GLOBALS['wgExtensionMessagesFiles']['TranslateSandbox'] = 
$dir/TranslateSandbox.i18n.php;
+$GLOBALS['wgExtensionMessagesFiles']['TranslateAlias'] = 
$dir/Translate.alias.php;
 
 // Register initialization code
-$wgExtensionFunctions[] = 'TranslateHooks::setupTranslate';
-$wgHooks['CanonicalNamespaces'][] = 'TranslateHooks::setupNamespaces';
-$wgHooks['UnitTestsList'][] = 'TranslateHooks::setupUnitTests';
-$wgHooks['LoadExtensionSchemaUpdates'][] = 'TranslateHooks::schemaUpdates';
-$wgHooks['ParserTestTables'][] = 'TranslateHooks::parserTestTables';
-$wgHooks['PageContentLanguage'][] = 'TranslateHooks::onPageContentLanguage';
+$GLOBALS['wgExtensionFunctions'][] = 'TranslateHooks::setupTranslate';
+$GLOBALS['wgHooks']['CanonicalNamespaces'][] = 
'TranslateHooks::setupNamespaces';
+$GLOBALS['wgHooks']['UnitTestsList'][] = 'TranslateHooks::setupUnitTests';
+$GLOBALS['wgHooks']['LoadExtensionSchemaUpdates'][] = 
'TranslateHooks::schemaUpdates';
+$GLOBALS['wgHooks']['ParserTestTables'][] = 'TranslateHooks::parserTestTables';
+$GLOBALS['wgHooks']['PageContentLanguage'][] = 
'TranslateHooks::onPageContentLanguage';
 
 // Register special pages into MediaWiki
-$wgSpecialPages['Translate'] = 'SpecialTranslate';
-$wgSpecialPageGroups['Translate'] = 'wiki';
-$wgSpecialPages['Translations'] = 'SpecialTranslations';
-$wgSpecialPageGroups['Translations'] = 'pages';
+$GLOBALS['wgSpecialPages']['Translate'] = 'SpecialTranslate';
+$GLOBALS['wgSpecialPageGroups']['Translate'] = 'wiki';
+$GLOBALS['wgSpecialPages']['Translations'] = 'SpecialTranslations';
+$GLOBALS['wgSpecialPageGroups']['Translations'] = 

[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (mediawiki...Configure)

2014-01-01 Thread Reedy (Code Review)
Reedy has submitted this change and it was merged.

Change subject: Localisation updates from https://translatewiki.net.
..


Localisation updates from https://translatewiki.net.

Change-Id: I69193c1b47ae56283efe2eca8593e1368e8d9be1
---
M Configure.i18n.php
1 file changed, 24 insertions(+), 0 deletions(-)

Approvals:
  Reedy: Verified; Looks good to me, approved



diff --git a/Configure.i18n.php b/Configure.i18n.php
index 51a297a..f7233f4 100644
--- a/Configure.i18n.php
+++ b/Configure.i18n.php
@@ -4545,6 +4545,7 @@
  */
 $messages['fa'] = array(
'configure' = 'پیکربندی ویکی',
+   'configure-desc' = 'اجازه دادن به کاربران مجاز به 
[[Special:Configure|configure]] ویکی از طریق یک رابط مبتنی بر شبکه',
'configure-desc-group' = 'گروه',
'configure-desc-key' = 'کلید',
'configure-desc-ns' = 'فضای نام',
@@ -4552,15 +4553,23 @@
'configure-edit-core' = 'مدیاویکی',
'configure-edit-ext' = 'افزونه‌ها',
'configure-viewconfig-default-diff' = 'تغییرات از تنظیمات پیش‌فرض',
+   'configure-ext-ext-dependencies' = '''هشدار:''' این گستره نیازمند است 
{{PLURAL:$2|extension|extensions}} زیر فعال شده باشد: $1.,
+   'configure-ext-ext-dependency-err' = '''خطا:''' گسترهٔ $1 نیازمند 
فعال شدن گسترهٔ $2 است.,
'configure-ext-doc' = 'بە راهنمای آنلاین مراجعه کنید',
+   'configure-ext-schemachange' = '''هشدار:''' این گستره نیازمند یک 
[http://www.mediawiki.org/wiki/Manual:Update.php database update] برای به درستی 
کار کردن است!,
'configure-ext-settings' = 'تنظیمات',
+   'configure-ext-settings-dep-errors' = 'این گستره به دلیل 
{{PLURAL:$1|setting has|settings have}} زیر،یک مقدار غیر قابل قبول، نمی‌تواند 
فعال باشد:',
'configure-ext-settings-dep-error' = '$1: مقدار مورد نیاز: $2، مقدار 
فعلی: $3',
'configure-ext-use-extension' = 'استفاده از این فرمت',
'configure-ext-use' = 'استفاده',
'configure-form-reason' = 'دلیل:',
'configure-customised' = ''این تنظیمات شخصی‌سازی شده‌است'',
'configure-arrayinput-oneperline' = '«(یکی در هر خط)»',
+   'configure-summary' = 'این صفحهٔ ویژه به شما برای پیکربندی این ویکی، 
اجازه می‌دهد.برای اطلاعات بیشتر 
[http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration 
settings] را مشاهده کنید.',
'configure-btn-save' = 'ذخیرهٔ تنظیمات',
+   'configure-db-error' = 'پایگاه اطلاعاتی را که شما برای کنترل پیکربندی 
($1) تعیین کردید، وجود ندارد.لطفاً آن را ایجاد کنید و configure.sql را ارائه 
دهید یا نامش را درست کنید.',
+   'configure-db-table-error' = 'پایگاه اطلاعاتی را که شما تعیین کردید، 
جدول‌های مورد نیاز را ندارد. لطفاً configure.sql را در آن پایگاه اطلاعاتی ارائه 
دهید.',
+   'configure-directory-not-writable' = 'فهرست استفاده شده برای ذخیرهٔ 
تنظیمات، code$1/code ، قابل نوشتن نیست.لطفاً به وسیلهٔ پی‌اچ‌پی برای 
استفاده از این گستره، آن را قابل نوشتن کنید.',
'configure-edit-old' = '''هشدار''': شما در حال ویرایش یک نسخهٔ 
strongقدیمی/strong از پیکربندی هستید (به تاریخ $1).,
'configure-error' = 'پیکربندی نمی‌تواند ذخیره شود',
'configure-js-add' = 'افزودن ورودی جدید',
@@ -4578,7 +4587,9 @@
'configure-js-search-legend' = 'تنظیمات جستجو',
'configure-js-search-prompt' = 'پرس و جو:',
'configure-no-diff' = 'بین نسخه های انتخاب شده تغییری وجود ندارد.',
+   'configure-no-directory' = 'فهرست استفاده شده برای ذخیرهٔ تنظیمات، 
code$1/code ، وجود ندارد.لطفاً آن را ایجاد کنید یا برای استفادهٔ این گستره، 
آن را تغییر دهید.',
'configure-no-old' = 'هیچ نسخه قدیمی از تنظیمات در دسترس نیست.',
+   'configure-no-setup' = 'شما باید برای استفاده از این گستره، صریحاً با 
codeefConfigureSetup()/code در پوشهٔ LocalSettings.php خود تماس بگیرید.',
'configure-no-transwiki' = 'شما مجاز به تغییر تنظیمات در ویکی های دیگر 
نیستید.',
'configure-old' = 'نسخه‌های قدیمی',
'configure-old-versions' = 'فهرست پیکربندی های نسخه های قدیمی:',
@@ -4587,6 +4598,7 @@
'configure-old-summary' = '$1 توسط $2 $4 $3',
'configure-saved' = 'تنظیمات ذخیره شد.',
'configure-backlink' = 'بازگشت به فرم',
+   'configure-image-url-explanation' = 'برای یک عکس، یو‌آرال یا نام یک 
عکس را در این این ویکی (بدون فضای نامی) وارد کنید. زمانی که شما زمینه را ترک 
می‌کنید، پیش‌نمایش نمایش خواهد داده شد.',
'configure-section-robots' = 'خزنده وب',
'configure-section-features' = 'ویژگی‌ها',
'configure-section-general' = 'تنظیمات عمومی',
@@ -4647,10 +4659,12 @@
'configure-section-output' = 'خروجی',
'configure-select-wiki' = 'انتخاب ویکی',
'configure-select-wiki-desc' = 'آن ویکی را که می‌خواهید پیکربندی کنید 
مشخص کنید.',
+   'configure-select-wiki-view-desc' = 'ویکی را انتخاب کنید که می‌خواهید 
نسخه‌های پیکربندی را ببینید.',
'configure-select-wiki-view-all' = 'تمام ویکی‌ها',
'configure-select-wiki-view-specific' = 'ویکی خاص:',

[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (mediawiki...EventLogging)

2014-01-01 Thread Reedy (Code Review)
Reedy has submitted this change and it was merged.

Change subject: Localisation updates from https://translatewiki.net.
..


Localisation updates from https://translatewiki.net.

Change-Id: Ifb373a63f4e92fe024f51be9150f685861216101
---
M EventLogging.i18n.php
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Reedy: Verified; Looks good to me, approved



diff --git a/EventLogging.i18n.php b/EventLogging.i18n.php
index badf36d..69ce4ff 100644
--- a/EventLogging.i18n.php
+++ b/EventLogging.i18n.php
@@ -493,6 +493,7 @@
'eventlogging-invalid-json' = '无效的JSON',
'eventlogging-revision-id' = '修订$1',
'eventlogging-code-sample-logging-on-server-side' = 'PHP 日志',
+   'eventlogging-code-sample-module-setup' = '设置PHP以供JavaScript日志记录',
'eventlogging-code-sample-logging-on-client-side' = 'JavaScript 日志',
 );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/104841
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb373a63f4e92fe024f51be9150f685861216101
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: L10n-bot l10n-...@translatewiki.net
Gerrit-Reviewer: Reedy re...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Added custom label for links in category pages - change (mediawiki/core)

2014-01-01 Thread Gomoko (Code Review)
Gomoko has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104905


Change subject: Added custom label for links in category pages
..

Added custom label for links in category pages

CategoryViewer.php: Allows to give custom label to display in the category
page, using existing syntax for category definition in pages, with label
appended.
Example: [[Category:Cat|Key|Label]]
  will display Label in the page Category:Cat for the link to the
  current page.
Without this label, the page title will be displayed (as today).

Change-Id: I4ece7ec42afc825f27d89b7647404c5f03c172f2
---
M includes/CategoryViewer.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/104905/1

diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index 55d9c1e..be2b1ef 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -252,10 +252,10 @@
 * @param $pageLength
 * @param $isRedirect bool
 */
-   function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
+   function addPage( $title, $sortkey, $pageLength, $isRedirect = false, 
$alias ) {
global $wgContLang;
 
-   $link = Linker::link( $title );
+   $link = Linker::link( $title, 
strpos($alias,'|')===false?null:substr($alias,strpos($alias,'|')+1) );
if ( $isRedirect ) {
// This seems kind of pointless given 'mw-redirect' 
class,
// but keeping for back-compatibility with user css.
@@ -317,7 +317,7 @@
array(
'USE INDEX' = array( 'categorylinks' 
= 'cl_sortkey' ),
'LIMIT' = $this-limit + 1,
-   'ORDER BY' = $this-flip[$type] ? 
'cl_sortkey DESC' : 'cl_sortkey',
+   'ORDER BY' = $this-flip[$type] ? 
if(instr(cl_sortkey,'|')=0,cl_sortkey,concat(substring(cl_sortkey,1,instr(cl_sortkey,'|')-1),substring(cl_sortkey,instr(cl_sortkey,'\n'
 DESC : 
if(instr(cl_sortkey,'|')=0,cl_sortkey,concat(substring(cl_sortkey,1,instr(cl_sortkey,'|')-1),substring(cl_sortkey,instr(cl_sortkey,'\n',
),
array(
'categorylinks' = array( 'INNER JOIN', 
'cl_from = page_id' ),
@@ -353,7 +353,7 @@
} elseif ( $title-getNamespace() == NS_FILE ) {
$this-addImage( $title, $humanSortkey, 
$row-page_len, $row-page_is_redirect );
} else {
-   $this-addPage( $title, $humanSortkey, 
$row-page_len, $row-page_is_redirect );
+   $this-addPage( $title, 
substr($humanSortkey,0,strpos($humanSortkey,'|')===false?strlen($humanSortkey):strpos($humanSortkey,'|')),
 $row-page_len, $row-page_is_redirect, $row-cl_sortkey_prefix );
}
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/104905
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ece7ec42afc825f27d89b7647404c5f03c172f2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gomoko gom...@yahoo.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Repair missed conversion to new username lookup - change (mediawiki...Flow)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Repair missed conversion to new username lookup
..


Repair missed conversion to new username lookup

Change-Id: Ib79a13da59c79db54fbd24ef3837db1b5ff6a7d0
---
M includes/Model/AbstractRevision.php
M includes/Templating.php
M includes/View/Post.php
3 files changed, 17 insertions(+), 3 deletions(-)

Approvals:
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Model/AbstractRevision.php 
b/includes/Model/AbstractRevision.php
index 8535860..da1efe8 100644
--- a/includes/Model/AbstractRevision.php
+++ b/includes/Model/AbstractRevision.php
@@ -518,6 +518,14 @@
return $this-lastEditId;
}
 
+   public function getLastContentEditUserId() {
+   return $this-lastEditUserId;
+   }
+
+   public function getLastContentEditUserIp() {
+   return $this-lastEditUserIp;
+   }
+
public function getModeratedByUserId() {
return $this-moderatedByUserId;
}
diff --git a/includes/Templating.php b/includes/Templating.php
index ac979a1..c453780 100644
--- a/includes/Templating.php
+++ b/includes/Templating.php
@@ -441,7 +441,7 @@
 
// Messages: flow-hide-post-content, 
flow-delete-post-content, flow-suppress-post-content
//   flow-hide-title-content, 
flow-delete-title-content, flow-suppress-title-content
-   $message = wfMessage( flow-$state-$type-content, 
$user, $this-getUserLinks( $revision, $user ) );
+   $message = wfMessage( flow-$state-$type-content, 
$username, $this-getUserLinks( $revision, $permissionsUser ) );
if ( $message-exists() ) {
return $message-escaped();
} else {
diff --git a/includes/View/Post.php b/includes/View/Post.php
index f5eab29..b079d94 100644
--- a/includes/View/Post.php
+++ b/includes/View/Post.php
@@ -165,12 +165,18 @@
 
public function createModifiedTipsyHtml( AbstractBlock $block ) {
$html = '';
-   if ( $this-post-getLastContentEditorName() ) {
+   if ( $this-post-getLastContentEditId() ) {
+   $name = $this-usernames-get(
+   wfWikiId(),
+   $this-post-getLastContentEditUserId(),
+   $this-post-getLastContentEditUserIp()
+   );
+
$html .= Html::openElement( 'div', array( 'class' = 
'flow-content-modified-tipsy-flyout' ) );
$html .= Html::element(
'div',
array( 'class' = 'flow-last-modified-user' ),
-   wfMessage( 'flow-last-modified-by', 
$this-post-getLastContentEditorName() )-text()
+   wfMessage( 'flow-last-modified-by', $name 
)-text()
);
$html .= Html::openElement( 'div', array( 'class' = 
'flow-show-change-link' ) );
$html .= Html::element( 'a', array( 'href' = 
$this-getLatestDiffLink( $block ) ), wfMessage( 'flow-show-change' )-text() );

-- 
To view, visit https://gerrit.wikimedia.org/r/104816
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib79a13da59c79db54fbd24ef3837db1b5ff6a7d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add an ability to change the copyright warning in editor and... - change (mediawiki...MobileFrontend)

2014-01-01 Thread M4tx (Code Review)
M4tx has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104906


Change subject: Add an ability to change the copyright warning in editor and 
uploader
..

Add an ability to change the copyright warning in editor and uploader

* License for editor is now taken from LocalSettings.php
* There's a way to hook into both license texts from code now

Bug: 56639
Change-Id: Ib8a1ce46d8b3dc5ea444cc538e48be0cb280222f
---
M MobileFrontend.i18n.php
M MobileFrontend.php
M includes/Resources.php
A includes/modules/LicenseTextModule.php
4 files changed, 88 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/06/104906/1

diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php
index e72f067..0b21467 100644
--- a/MobileFrontend.i18n.php
+++ b/MobileFrontend.i18n.php
@@ -305,7 +305,7 @@
'mobile-frontend-photo-upload-error-file-type' = 'Please only upload 
images.',
'mobile-frontend-photo-upload-error-filename' = 'Error, please provide 
a more descriptive summary.',
'mobile-frontend-photo-upload-success-article' = 'Success! Your image 
is now live on this page.',
-   'mobile-frontend-photo-license' = 'By uploading this image, you agree 
to our [//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to 
release your image under the [//creativecommons.org/licenses/by-sa/3.0/ 
Creative Commons Attribution-ShareAlike 3.0 License].',
+   'mobile-frontend-photo-license' = 'By uploading this image, you agree 
to release it under the [//creativecommons.org/licenses/by-sa/3.0/ Creative 
Commons Attribution-ShareAlike 3.0 License].',
'mobile-frontend-photo-submit' = 'Submit',
'mobile-frontend-photo-cancel' = 'Cancel',
'mobile-frontend-photo-upload-user-count' = 
'{{PLURAL:$1|span1/span upload|span$1/span uploads}}',
@@ -328,7 +328,10 @@
'mobile-frontend-editor-save' = 'Save',
'mobile-frontend-editor-cancel' = 'Cancel',
'mobile-frontend-editor-keep-editing' = 'Keep editing',
-   'mobile-frontend-editor-license' = 'By saving changes, you agree to 
our [//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to 
release your text under the [//creativecommons.org/licenses/by-sa/3.0/ CC BY-SA 
3.0 License] and 
[//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License 
GFDL].',
+   'mobile-frontend-editor-copyright' = Please note that all 
contributions to {{SITENAME}} are considered to be released under the $2 (see 
$1 for details).
+'''Do not submit copyrighted work without permission!''',
+   'mobile-frontend-editor-copyright2' = Please note that all 
contributions to {{SITENAME}} may be edited, altered, or removed by other 
contributors (see $1 for details).
+'''Do not submit copyrighted work without permission!''',
'mobile-frontend-editor-placeholder' = 'This section is empty. Be the 
first to expand it!',
'mobile-frontend-editor-summary-placeholder' = 'Tell us what you 
changed (optional)',
'mobile-frontend-editor-cancel-confirm' = 'Do you really want to 
abandon your edit?',
@@ -697,6 +700,15 @@
 {{Identical|Privacy}}',
'mobile-frontend-footer-sitename' = 'Name of site',
'mobile-frontend-footer-license' = 'License shown in footer',
+   'mobile-frontend-editor-copyright' = Copyright warning displayed 
under the edit box in editor. Parameters:
+* $1 - link
+* $2 - license name
+'''See also'''
+* {{msg-mw|Copyrightwarning}},
+   'mobile-frontend-editor-copyright2' = Copyright warning displayed 
under the edit box in editor
+*$1 - license name
+'''See also'''
+* {{msg-mw|Copyrightwarning2}},
'mobile-frontend-copyright' = A short sentence explaining that the 
content of the page is available under a particular license. Parameters:
 * $1 - license name
 '''See also'''
@@ -922,7 +934,7 @@
'mobile-frontend-photo-upload-error-file-type' = 'Text that displays 
when user tries to preview something that cannot be rendered in an img tag 
(e.g. mp3 or video)',
'mobile-frontend-photo-upload-error-filename' = 'Text that displays 
when an image fails to upload due to filename',
'mobile-frontend-photo-upload-success-article' = 'Text that displays 
when an image has been successfully added to a page.',
-   'mobile-frontend-photo-license' = 'Text notifying user of license that 
image will be published under. You can change the URL to a local Wikipedia 
URL, but you cannot make it point to the country specific CC BY-SA 3.0 
license.',
+   'mobile-frontend-photo-license' = 'Text notifying user of license that 
image will be published under. You cannot make it point to the country specific 
CC BY-SA 3.0 license.',
'mobile-frontend-photo-submit' = 'Caption for the submit button on the 
image uplaod form.
 {{Identical|Submit}}',

[MediaWiki-commits] [Gerrit] Add support for new MobileFrontend copyright warnings - change (mediawiki...WikimediaMessages)

2014-01-01 Thread M4tx (Code Review)
M4tx has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104907


Change subject: Add support for new MobileFrontend copyright warnings
..

Add support for new MobileFrontend copyright warnings

Bug: 56639
Change-Id: Ia9d362063de362731a6ef5b86c2e2e9f20429d0c
---
M WikimediaMessages.i18n.php
M WikimediaMessages.php
2 files changed, 16 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/07/104907/1

diff --git a/WikimediaMessages.i18n.php b/WikimediaMessages.i18n.php
index dce7e01..2d15eff 100644
--- a/WikimediaMessages.i18n.php
+++ b/WikimediaMessages.i18n.php
@@ -249,6 +249,8 @@
 See a href=https://wikimediafoundation.org/wiki/Terms_of_Use; 
title=Wikimedia Foundation Terms of UseTerms of Use/a for details.',
'wikimedia-copyrightwarning' = 'By clicking the {{int:savearticle}} 
button, you agree to the [https://wikimediafoundation.org/wiki/Terms_of_Use 
Terms of Use], and you irrevocably agree to release your contribution under the 
[https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License
 CC BY-SA 3.0 License] and the 
[https://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License
 GFDL].
 You agree that a hyperlink or URL is sufficient attribution under the Creative 
Commons license.',
+   'wikimedia-mobile-copyrightwarning' = 'By clicking the 
{{int:savearticle}} button, you agree to the 
[https://wikimediafoundation.org/wiki/Terms_of_Use Terms of Use], and you 
irrevocably agree to release your contribution under the 
[https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License
 CC BY-SA 3.0 License] and the 
[https://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License
 GFDL].',
+   'wikimedia-mobile-photo-copyrightwarning' = 'By uploading this image, 
you agree to our [//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and 
agree to release your image under the 
[//creativecommons.org/licenses/by-sa/3.0/ Creative Commons 
Attribution-ShareAlike 3.0 License].',
 
# Wikidata-specific messages
'wikibase-sitelinks-wikivoyage' = 'Wikivoyage pages linked to this 
item',
@@ -571,6 +573,8 @@
 Refers to {{msg-mw|Savearticle}}.
 
 {{Identical/Wikimedia-licensing}}',
+   'wikimedia-mobile-copyrightwarning' = 'Editor copyright warning shown 
on mobile devices. Shorter version of {{msg-mw|wikimedia-copyrightwarning}}.',
+   'wikimedia-mobile-photo-copyrightwarning' = 'Media upload copyright 
warning shown on mobile devices.',
'wikibase-sitelinks-wikivoyage' = 'Section heading on Wikidata item 
page for Wikivoyage site links',
'wikibase-sitelinks-commons' = 'Section heading on Wikidata item page 
for Wikimedia Commons site links',
'wikibase-sitelinks-sitename-commonswiki' = 'Name that should be shown 
in the first column of the sitelink table for Wikimedia Commons links.
diff --git a/WikimediaMessages.php b/WikimediaMessages.php
index 16e7192..75fc2fe 100644
--- a/WikimediaMessages.php
+++ b/WikimediaMessages.php
@@ -37,6 +37,8 @@
// with the CC/GFDL semi-dual license fun!
$wgHooks['SkinCopyrightFooter'][] = 
'efWikimediaSkinCopyrightFooter';
$wgHooks['EditPageCopyrightWarning'][] = 
'efWikimediaEditPageCopyrightWarning';
+   $wgHooks['EditPageMobileCopyrightWarning'][] = 
'efWikimediaEditPageMobileCopyrightWarning';
+   $wgHooks['UploadMobileCopyrightWarning'][] = 
'efWikimediaUploadMobileCopyrightWarning';
}
 }
 
@@ -45,6 +47,16 @@
return true;
 }
 
+function efWikimediaEditPageMobileCopyrightWarning( $title, $msg ) {
+   $msg = array( 'wikimedia-mobile-copyrightwarning' );
+   return true;
+}
+
+function efWikimediaUploadMobileCopyrightWarning( $title, $msg ) {
+   $msg = array( 'wikimedia-mobile-photo-copyrightwarning' );
+   return true;
+}
+
 /**
  * @param $title Title
  * @param $type

-- 
To view, visit https://gerrit.wikimedia.org/r/104907
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9d362063de362731a6ef5b86c2e2e9f20429d0c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: M4tx m...@m4tx.pl
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Require Module: to be prefixed - change (mediawiki...WikimediaIncubator)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Require Module: to be prefixed
..


Require Module: to be prefixed

Get the Module: and Module_talk: namespaces (ns: 828, 829)
to be prefixed according to the WikimediaIncubator
extension.

Bug: 59187
Change-Id: Ibcec527bf33210c926a96d3e843a50d05fae9861
---
M WikimediaIncubator.php
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  SPQRobin: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/WikimediaIncubator.php b/WikimediaIncubator.php
index 484c8e9..2493e2b 100644
--- a/WikimediaIncubator.php
+++ b/WikimediaIncubator.php
@@ -55,6 +55,7 @@
NS_MAIN, NS_TALK,
NS_TEMPLATE, NS_TEMPLATE_TALK,
NS_CATEGORY, NS_CATEGORY_TALK,
+   NS_MODULE, NS_MODULE_TALK,
 );
 $wmincLangCodeLength = 12; // can be changed if needed (depends on policy)
 // Pseudo category namespaces like Category:Maintenance:Delete, for easy 
whitelisting and structure

-- 
To view, visit https://gerrit.wikimedia.org/r/104814
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibcec527bf33210c926a96d3e843a50d05fae9861
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaIncubator
Gerrit-Branch: master
Gerrit-Owner: Ebe123 beauleetien...@gmail.com
Gerrit-Reviewer: Ebe123 beauleetien...@gmail.com
Gerrit-Reviewer: SPQRobin robinp.1...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make branch versions of *all* extensions on internal release - change (mediawiki...release)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make branch versions of *all* extensions on internal release
..


Make branch versions of *all* extensions on internal release

* This makes backports much easier (e.g. cherry-pick-to in gerrit)

Change-Id: I1d43952cbb3aa78b6265860e935f08320db9ccc3
---
M make-wmf-branch/default.conf
M make-wmf-branch/make-wmf-branch
2 files changed, 7 insertions(+), 12 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/make-wmf-branch/default.conf b/make-wmf-branch/default.conf
index a69d382..d953b5c 100644
--- a/make-wmf-branch/default.conf
+++ b/make-wmf-branch/default.conf
@@ -4,8 +4,9 @@
 # You can override variables in this file by creating a file in the same
 # directory called local.conf
 
-# These extensions are all pulling from HEAD on master
-$normalExtensions = array(
+# Branched extensions - these extensions are branched along with core.
+# Branching instead of using a HEAD checkout makes it easy to backport changes.
+$branchedExtensions = array(
'AbuseFilter',
'AccountAudit',
'ActiveAbstract', // Used as part of dumpBackup
@@ -143,6 +144,7 @@
'Vector',
'VectorBeta',
'VipsScaler',
+   'VisualEditor',
'WikiEditor',
'wikihiero',
'WikiLove',
@@ -173,12 +175,6 @@
'SemanticMediaWiki' = '1.8.x',
'SemanticResultFormats' = '1.8.x',
'Validator' = '0.5.x',
-);
-
-# Branched extensions - these extensions are branched along with core since 
we've got
-# to maintain live hacks for them.
-$branchedExtensions = array(
-   'VisualEditor',
 );
 
 # Repository paths. $baseRepoPath is for operations that require write 
operations
diff --git a/make-wmf-branch/make-wmf-branch b/make-wmf-branch/make-wmf-branch
index 9420048..05148e0 100755
--- a/make-wmf-branch/make-wmf-branch
+++ b/make-wmf-branch/make-wmf-branch
@@ -23,7 +23,7 @@
 class MakeWmfBranch {
var $dryRun;
var $newVersion, $oldVersion, $buildDir;
-   var $normalExtensions, $specialExtensions, $branchedExtensions, 
$patches;
+   var $specialExtensions, $branchedExtensions, $patches;
var $baseRepoPath, $anonRepoPath;
var $noisy;
 
@@ -40,9 +40,8 @@
 
$this-dryRun = $dryRun;
$this-buildDir = $buildDir;
-   $this-normalExtensions = $normalExtensions;
-   $this-specialExtensions = $specialExtensions;
$this-branchedExtensions = $branchedExtensions;
+   $this-specialExtensions = $specialExtensions;
$this-noisy = $noisy;
$this-patches = $patches;
$this-baseRepoPath = $baseRepoPath;
@@ -168,7 +167,7 @@
 
# Add extension submodules
foreach (
-   array_merge( $this-normalExtensions, array_keys( 
$this-specialExtensions ), $this-branchedExtensions )
+   array_merge( array_keys( $this-specialExtensions ), 
$this-branchedExtensions )
as $name ) {
if( in_array( $name, $this-branchedExtensions ) ) {
$this-runCmd( 'git', 'submodule', 'add', '-b', 
$newVersion, '-q',

-- 
To view, visit https://gerrit.wikimedia.org/r/104776
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1d43952cbb3aa78b6265860e935f08320db9ccc3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/release
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Reedy re...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Change Massmessage to Mass message - change (mediawiki...WikimediaMessages)

2014-01-01 Thread TTO (Code Review)
TTO has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104908


Change subject: Change Massmessage to Mass message
..

Change Massmessage to Mass message

This is the format used in the UI of the MassMessage extension.

Bug: 59179
Change-Id: I2ad65a71f9790a9a728f816ea74901611e94334d
---
M WikimediaMessages.i18n.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/08/104908/1

diff --git a/WikimediaMessages.i18n.php b/WikimediaMessages.i18n.php
index 4218763..06df006 100644
--- a/WikimediaMessages.i18n.php
+++ b/WikimediaMessages.i18n.php
@@ -203,9 +203,9 @@
 
# meta.wikimedia.org specific user group
 
-   'group-massmessage-sender'= 'Massmessage senders',
-   'group-massmessage-sender-member' = '{{GENDER:$1|massmessage sender}}',
-   'grouppage-massmessage-sender'= '{{ns:project}}:Massmessage 
senders', # only translate this message to other languages if you have to 
change it
+   'group-massmessage-sender'= 'Mass message senders',
+   'group-massmessage-sender-member' = '{{GENDER:$1|mass message 
sender}}',
+   'grouppage-massmessage-sender'= '{{ns:project}}:Mass message 
senders', # only translate this message to other languages if you have to 
change it
 
'group-oauthadmin'= 'OAuth administrators',
'group-oauthadmin-member' = '{{GENDER:$1|OAuth administrator}}',

-- 
To view, visit https://gerrit.wikimedia.org/r/104908
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ad65a71f9790a9a728f816ea74901611e94334d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: TTO at.li...@live.com.au

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix issue with change 102154, one call to isAllowed was left. - change (mediawiki...Flow)

2014-01-01 Thread Werdna (Code Review)
Werdna has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104909


Change subject: Fix issue with change 102154, one call to isAllowed was left.
..

Fix issue with change 102154, one call to isAllowed was left.

Bug: 59195
Change-Id: Ieaac35f5afc0893bde49e5e760a85f423078f76e
---
M includes/Notifications/Controller.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/09/104909/1

diff --git a/includes/Notifications/Controller.php 
b/includes/Notifications/Controller.php
index 614425c..cf14eec 100644
--- a/includes/Notifications/Controller.php
+++ b/includes/Notifications/Controller.php
@@ -408,7 +408,10 @@
 
$post = reset( $post );
 
-   if ( $post  $post-isAllowed() ) {
+   $user = new User;
+   $actionPermissions = new RevisionActionPermissions( 
Container::get( 'flow_actions' ), $user );
+
+   if ( $post  $actionPermissions-isAllowed( $post, 
'view' ) ) {
$userid = $post-getCreatorId();
if ( $userid ) {
$users[$userid] = User::newFromId( 
$userid );

-- 
To view, visit https://gerrit.wikimedia.org/r/104909
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieaac35f5afc0893bde49e5e760a85f423078f76e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna agarr...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] When executing an action on a post, just replace the .flow-p... - change (mediawiki...Flow)

2014-01-01 Thread Werdna (Code Review)
Werdna has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104910


Change subject: When executing an action on a post, just replace the 
.flow-post, not the whole .flow-post-container.
..

When executing an action on a post, just replace the .flow-post,
not the whole .flow-post-container.

Bug: 58747
Change-Id: I724a0358d60e458337a8dac32469007ee5d806d8
---
M modules/discussion/forms.js
M modules/moderation/moderation.js
2 files changed, 13 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/10/104910/1

diff --git a/modules/discussion/forms.js b/modules/discussion/forms.js
index 2e3115f..4e194f9 100644
--- a/modules/discussion/forms.js
+++ b/modules/discussion/forms.js
@@ -159,8 +159,8 @@
}
).done( function ( output ) {
var $content = $( 
output.rendered );
-   $post.closest( 
'.flow-post-container' )
-   .replaceWith( $content 
);
+   $post.closest( '.flow-post' )
+   .replaceWith( 
$content.find( '.flow-post' ) );
$content
.trigger( 'flow_init' );
} );
diff --git a/modules/moderation/moderation.js b/modules/moderation/moderation.js
index c867b21..37f5c44 100644
--- a/modules/moderation/moderation.js
+++ b/modules/moderation/moderation.js
@@ -70,7 +70,8 @@
function( promise ) {
promise.done( 
function( output ) {

var confirmationMsg,
-   
$newContainer = $( output.rendered );
+   
$renderedReplacement = $( output.rendered ),
+   
$newContainer;
 

// Messages used here:

// flow-moderation-confirmation-suppress-post
@@ -94,7 +95,15 @@

) )

);
 
-   
$resultContainer.replaceWith( $newContainer );
+   
if ( targetType === 'post' ) {
+   
$newContainer = $renderedReplacement.find( '.flow-post' );
+   
$postContainer.children( '.flow-post' )
+   
.replaceWith( $newContainer );
+   
} else if ( targetType === 'topic' ) {
+   
$newContainer = $renderedReplacement;
+   
$topicContainer.replaceWith( $newContainer );
+   
}
+

$newContainer.trigger( 'flow_init' );
} )
.fail( 
function() {

-- 
To view, visit https://gerrit.wikimedia.org/r/104910
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I724a0358d60e458337a8dac32469007ee5d806d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna agarr...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix fatal error comparing revisions - change (mediawiki...Flow)

2014-01-01 Thread Werdna (Code Review)
Werdna has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104911


Change subject: Fix fatal error comparing revisions
..

Fix fatal error comparing revisions

Change-Id: I295e387a54cf4d7067245d97c107e8d65deaca2c
---
M templates/compare-revisions.html.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/11/104911/1

diff --git a/templates/compare-revisions.html.php 
b/templates/compare-revisions.html.php
index ec1258b..47fcf3b 100644
--- a/templates/compare-revisions.html.php
+++ b/templates/compare-revisions.html.php
@@ -20,7 +20,7 @@
 
 $differenceEngine-showDiffStyle();
 
-$getRevisionHeader = function( $revision ) use ( $templating, $block ) {
+$getRevisionHeader = function( $revision ) use ( $templating, $block, $user ) {
$timestamp = $templating-render(
'flow:timestamp.html.php',
array(

-- 
To view, visit https://gerrit.wikimedia.org/r/104911
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I295e387a54cf4d7067245d97c107e8d65deaca2c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna agarr...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Post content with more than 5 lines is showing a scrollbar - change (mediawiki...Flow)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Post content with more than 5 lines is showing a scrollbar
..


Post content with more than 5 lines is showing a scrollbar

It turns out this is caused by the tipsy link, somehow the icon is
creating an overflow even the height/width are the same as icon
height/width.  Adding overflow: hidden seems to fixe the
problem.  Not sure if this is a good fix but this does address
the issue, :)

Change-Id: Iae275a3d1c18e7b9693811e20cf3e742a48f23be
---
M modules/discussion/styles/modified.less
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Werdna: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/discussion/styles/modified.less 
b/modules/discussion/styles/modified.less
index 1bfc037..0df43dd 100644
--- a/modules/discussion/styles/modified.less
+++ b/modules/discussion/styles/modified.less
@@ -7,6 +7,8 @@
display: inline-block;
text-indent: -px;
vertical-align: middle;
+   /* Stops tipsy from causing a scroll bar */
+   overflow: hidden;
 
background-position: center;
background-size: 14px auto;

-- 
To view, visit https://gerrit.wikimedia.org/r/104758
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iae275a3d1c18e7b9693811e20cf3e742a48f23be
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Bsitu bs...@wikimedia.org
Gerrit-Reviewer: Spage sp...@wikimedia.org
Gerrit-Reviewer: Werdna agarr...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix issue with change 102154, one call to isAllowed was left. - change (mediawiki...Flow)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix issue with change 102154, one call to isAllowed was left.
..


Fix issue with change 102154, one call to isAllowed was left.

Bug: 59195
Change-Id: Ieaac35f5afc0893bde49e5e760a85f423078f76e
---
M includes/Notifications/Controller.php
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Spage: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Notifications/Controller.php 
b/includes/Notifications/Controller.php
index 614425c..a1c46fe 100644
--- a/includes/Notifications/Controller.php
+++ b/includes/Notifications/Controller.php
@@ -393,6 +393,9 @@
$users = array();
$container = Container::getContainer();
 
+   $user = new User;
+   $actionPermissions = new RevisionActionPermissions( 
Container::get( 'flow_actions' ), $user );
+
foreach ( $posts as $postId ) {
$post = $container['storage']-find(
'PostRevision',
@@ -408,7 +411,7 @@
 
$post = reset( $post );
 
-   if ( $post  $post-isAllowed() ) {
+   if ( $post  $actionPermissions-isAllowed( $post, 
'view' ) ) {
$userid = $post-getCreatorId();
if ( $userid ) {
$users[$userid] = User::newFromId( 
$userid );

-- 
To view, visit https://gerrit.wikimedia.org/r/104909
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieaac35f5afc0893bde49e5e760a85f423078f76e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna agarr...@wikimedia.org
Gerrit-Reviewer: Matthias Mullie mmul...@wikimedia.org
Gerrit-Reviewer: Spage sp...@wikimedia.org
Gerrit-Reviewer: Werdna agarr...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] add templateeditor right for testwiki - change (operations/mediawiki-config)

2014-01-01 Thread Rschen7754 (Code Review)
Rschen7754 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104912


Change subject: add templateeditor right for testwiki
..

add templateeditor right for testwiki

Change-Id: I52a47be04c6aba89562bec40d2438e9df6b7264e
---
M wmf-config/InitialiseSettings.php
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/12/104912/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 3c16c84..cc35f1a 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -3881,6 +3881,7 @@
'hewiki' = array( '', 'autoconfirmed', 'autopatrol', 'sysop'), //bug 
58207
'plwiki' = array( '', 'autoconfirmed', 'editor', 'sysop' ), // bug 
46990
'ptwiki' = array( '', 'autoconfirmed', 'autoreviewer', 'sysop' ), // 
bug 39652
+   'testwiki' = array( '', 'autoconfirmed', 'templateeditor', 'sysop' ), 
// bug 59084
 ),
 # @} end of wgRestrictionLevels
 
@@ -7446,7 +7447,8 @@
'upload_by_url' = true, // For wider testing
'upload' = true, // Exception to bug 12556, used for 
testing of upload tools
),
-   'sysop' = array( 'deleterevision' = true ),
+   'templateeditor' = array( 'templateeditor' = true, 
'tboverride' = true, ), //bug 59084
+   'sysop' = array( 'deleterevision' = true, 'templateeditor' = 
true ),
'reviewer' = array(
'stablesettings' = true,
),
@@ -7700,7 +7702,7 @@
),
'+testwiki' = array(
'bureaucrat' = array( 'researcher', 'centralnoticeadmin' ),
-   'sysop' = array( 'filemover', 'rollbacker', 'accountcreator', 
'confirmed' ),
+   'sysop' = array( 'filemover', 'rollbacker', 'accountcreator', 
'confirmed', 'templateeditor' ),
# 'user' = array( 'editor', 'reviewer' ),
),
// **
@@ -8140,7 +8142,7 @@
),
'+testwiki' = array(
'bureaucrat' = array( 'sysop', 'researcher', 
'translationadmin', 'centralnoticeadmin' ),
-   'sysop' = array( 'filemover', 'rollbacker', 'accountcreator', 
'confirmed' ),
+   'sysop' = array( 'filemover', 'rollbacker', 'accountcreator', 
'confirmed', 'templateeditor' ),
# 'user' = array( 'editor', 'reviewer' ),
),
// **

-- 
To view, visit https://gerrit.wikimedia.org/r/104912
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52a47be04c6aba89562bec40d2438e9df6b7264e
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Rschen7754 rschen7754.w...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Leading semicolon line-bolding made visible in printable ver... - change (mediawiki/core)

2014-01-01 Thread 01tonythomas (Code Review)
01tonythomas has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104913


Change subject: Leading semicolon line-bolding made visible in printable version
..

Leading semicolon line-bolding made visible in printable version

When bolding a line using ; at the start, the text in printable=yes shows
the line without bolding, even though text in the printable version does appear
formatted when using ''' for bolding and '' for italics.

Bug: 49752
Change-Id: I84545fe9c9240293818c1f6f938fc3bba7c2aa06
---
M skins/common/commonPrint.css
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/13/104913/1

diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css
index 2d45653..65f3fbe 100644
--- a/skins/common/commonPrint.css
+++ b/skins/common/commonPrint.css
@@ -163,6 +163,10 @@
font-weight: bold;
 }
 
+dt {
+   font-weight: bold;
+}
+
 p {
margin: 1em 0;
line-height: 1.2em;

-- 
To view, visit https://gerrit.wikimedia.org/r/104913
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84545fe9c9240293818c1f6f938fc3bba7c2aa06
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: 01tonythomas 01tonytho...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Improve fix comment. - change (mediawiki...Flow)

2014-01-01 Thread Spage (Code Review)
Spage has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104914


Change subject: Improve fix comment.
..

Improve fix comment.

Humor me, it took me 30 minutes to figure out the cause.
Follow up to Iae275a3d1c18e7b9693811e20cf3e742a48f23be

Change-Id: I762ad1c59324e96147bb72caa1bb3092bd71459a
---
M modules/discussion/styles/modified.less
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/14/104914/1

diff --git a/modules/discussion/styles/modified.less 
b/modules/discussion/styles/modified.less
index 0df43dd..b1f87fb 100644
--- a/modules/discussion/styles/modified.less
+++ b/modules/discussion/styles/modified.less
@@ -7,7 +7,7 @@
display: inline-block;
text-indent: -px;
vertical-align: middle;
-   /* Stops tipsy from causing a scroll bar */
+   /* Without this the tipsy's offscreen Show changes text causes a 
scroll bar */
overflow: hidden;
 
background-position: center;

-- 
To view, visit https://gerrit.wikimedia.org/r/104914
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I762ad1c59324e96147bb72caa1bb3092bd71459a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Spage sp...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] decrease exhausting memory usage by more than 60% - change (pywikibot/core)

2014-01-01 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104915


Change subject: decrease exhausting memory usage by more than 60%
..

decrease exhausting memory usage by more than 60%

Change-Id: Idb2666d0664cbbddd7dcb011a893dd7d8948
---
M scripts/featured.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/15/104915/1

diff --git a/scripts/featured.py b/scripts/featured.py
index a79770a..28a2630 100644
--- a/scripts/featured.py
+++ b/scripts/featured.py
@@ -398,7 +398,8 @@
 pywikibot.output(
 '\03{lightred}** %s has %i %s articles\03{default}'
 % (site, len(articles), task))
-for p in articles:
+while articles:
+p = articles.pop(0)
 if p.title()  afterpage:
 continue
 
@@ -410,7 +411,7 @@
 pywikibot.output(u(cached) %s - %s % (p.title(),
  cache[p.title()]))
 continue
-yield copy(p)
+yield p
 
 def findTranslated(self, page, oursite=None):
 quiet = self.getOption('quiet')

-- 
To view, visit https://gerrit.wikimedia.org/r/104915
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb2666d0664cbbddd7dcb011a893dd7d8948
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Change Massmessage to Mass message - change (mediawiki...WikimediaMessages)

2014-01-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Change Massmessage to Mass message
..


Change Massmessage to Mass message

This is the format used in the UI of the MassMessage extension.

Bug: 59179
Change-Id: I2ad65a71f9790a9a728f816ea74901611e94334d
---
M WikimediaMessages.i18n.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Siebrand: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/WikimediaMessages.i18n.php b/WikimediaMessages.i18n.php
index 4218763..06df006 100644
--- a/WikimediaMessages.i18n.php
+++ b/WikimediaMessages.i18n.php
@@ -203,9 +203,9 @@
 
# meta.wikimedia.org specific user group
 
-   'group-massmessage-sender'= 'Massmessage senders',
-   'group-massmessage-sender-member' = '{{GENDER:$1|massmessage sender}}',
-   'grouppage-massmessage-sender'= '{{ns:project}}:Massmessage 
senders', # only translate this message to other languages if you have to 
change it
+   'group-massmessage-sender'= 'Mass message senders',
+   'group-massmessage-sender-member' = '{{GENDER:$1|mass message 
sender}}',
+   'grouppage-massmessage-sender'= '{{ns:project}}:Mass message 
senders', # only translate this message to other languages if you have to 
change it
 
'group-oauthadmin'= 'OAuth administrators',
'group-oauthadmin-member' = '{{GENDER:$1|OAuth administrator}}',

-- 
To view, visit https://gerrit.wikimedia.org/r/104908
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2ad65a71f9790a9a728f816ea74901611e94334d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: TTO at.li...@live.com.au
Gerrit-Reviewer: Siebrand siebr...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits