? .DS_Store
? fix-msgctxt-order.patch
? msgctxt-to-before-msgid-potx.patch
? potx-drush.patch
Index: potx-cli.php
===================================================================
RCS file: potx-cli.php
diff -N potx-cli.php
--- potx-cli.php	17 Nov 2009 12:25:18 -0000	1.1.2.6.4.4.4.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,138 +0,0 @@
-#!/usr/bin/php
-<?php
-// $Id: potx-cli.php,v 1.1.2.6.4.4.4.2 2009/11/17 12:25:18 goba Exp $
-
-/**
- * @file
- *   Translation template generator for Drupal (command line version).
- *
- *   Extracts translatable strings from t(), t(,array()), format_plural()
- *   and other function calls, plus adds some file specific strings. Only
- *   literal strings with no embedded variables can be extracted. Generates
- *   POT files, errors are printed on STDERR.
- */
-
-if (isset($_SERVER['REQUEST_METHOD'])) {
-  // Try to prevent running this script from the web. It is not designed so.
-  print 'The potx-cli.php script is designed to be used from the command line. Please use the Drupal module web interface to extract strings through the web, instead of this script, if you prefer a web interface.';
-}
-
-// Functions shared with web based interface
-include dirname(__FILE__) .'/potx.inc';
-
-// We need a lot of resources probably, so try to set memory
-// limit higher and set unlimited time for our work.
-$memory_limit = @ini_get('memory_limit');
-if ($memory_limit != '' && (int)$memory_limit < 16) {
-  // ini_get returns the original set value, such as "32M",
-  // so we check for the int version. Before PHP 5.2, this
-  // limit was less then 16M.
-  @ini_set('memory_limit', 16777216);
-}
-@set_time_limit(0);
-
-if (!defined("STDERR")) {
-  define('STDERR', fopen('php://stderr', 'w'));
-}
-
-$files = array();
-$build_mode = POTX_BUILD_SINGLE;
-$argv = $GLOBALS['argv'];
-array_shift ($argv);
-if (count($argv)) {
-  switch ($argv[0]) {
-    case '--help' :
-      print <<<END
-Drupal command line translation template generator
-Usage: potx-cli.php [OPTION]
-
-Possible options:
- --auto
-     Autodiscovers files in current folder (default).
- --files
-     Specify a list of files to generate templates for.
- --mode=core
-     Core extraction mode, .info files folded into general.pot.
- --mode=multiple
-     Multiple file output mode, .info files folded into module pot files.
- --mode=single
-     Single file output mode, every file folded into the single outpout file (default).
- --debug
-     Only perform a 'self test'.
- --help
-     Display this message.
-
-END;
-      return 1;
-      break;
-    case '--files' :
-      array_shift($argv);
-      $files = $argv;
-      break;
-    case '--mode=core' :
-      $build_mode = POTX_BUILD_CORE;
-      break;
-    case '--mode=multiple' :
-      $build_mode = POTX_BUILD_MULTIPLE;
-      break;
-    case '--mode=single' :
-      $build_mode = POTX_BUILD_SINGLE;
-      break;
-    case '--debug' :
-      $files = array(__FILE__);
-      break;
-    case '--auto' :
-      $files = _potx_explore_dir('', '*', POTX_API_CURRENT, TRUE);
-      break;
-  }
-}
-
-// Fall back to --auto, if --files are not specified
-if (empty($files)) {
-  $files = _potx_explore_dir('', '*', POTX_API_CURRENT, TRUE);
-}
-
-foreach ($files as $file) {
-  potx_status('status', "Processing $file...\n");
-  _potx_process_file($file);
-}
-
-_potx_build_files(POTX_STRING_RUNTIME, $build_mode);
-_potx_build_files(POTX_STRING_INSTALLER, POTX_BUILD_SINGLE, 'installer');
-_potx_write_files();
-potx_status('status', "\nDone.\n");
-
-return;
-
-// These are never executed, you can run potx-cli.php on itself to test it
-// -----------------------------------------------------------------------------
-
-$a = t("Double quoted test string" );
-$b = t("Test string with %variable", array('%variable' => t('variable replacement')));
-$c = t('Single qouted test string');
-$d = t("Special\ncharacters");
-$e = t('Special\ncharacters');
-$f = t("Embedded $variable");
-$g = t('Embedded $variable');
-$h = t("more \$special characters");
-$i = t('even more \$special characters');
-$j = t("Mixed 'quote' \"marks\"");
-$k = t('Mixed "quote" \'marks\'');
-$l = t('Some repeating text');
-$m = t("Some repeating text");
-$n = t(embedded_function_call(3));
-$o = format_plural($days, 'one day', '@count days');
-$p = format_plural(embedded_function_call($count), 'one day', '@count days');
-$q = t('Concatenated' . 'string.' . 'You should never do this.');
-$r = t("Test string with @complex %variables !smile", array('@complex' => time(), '%variable' => t('variables'), '!smile' => ':)'));
-
-function embedded_function_call($dummy) { return 12; }
-
-function potxcli_perm() {
-  return array("access potx data", 'administer potx data');
-}
-
-function potxcli_help($section = 'default') {
-  watchdog('help', t('Help called'));
-  return t('This is some help');
-}
Index: potx.drush.inc
===================================================================
RCS file: potx.drush.inc
diff -N potx.drush.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ potx.drush.inc	23 Feb 2010 15:59:14 -0000
@@ -0,0 +1,86 @@
+<?php
+// $Id: l10n_packager.drush.inc,v 1.1.2.2 2010/02/08 16:51:49 goba Exp $
+
+/**
+ * @file
+ *   Translation template extractor module drush integration.
+ */
+
+/**
+ * Implementation of hook_drush_command().
+ * 
+ * @see drush_parse_command() for a list of recognized keys.
+ *
+ * @return
+ *   An associative array describing our command.
+ */
+function potx_drush_command() {
+  $items['potx'] = array(
+    'callback' => 'potx_drush_extract',
+    'description' => 'Extract translatable strings from Drupal source code.',
+  );
+  return $items;
+}
+
+/**
+ * Implementation of hook_drush_help().
+ *
+ * This function is called whenever a drush user calls
+ * 'drush help potx'.
+ *
+ * @param
+ *   A string with the help section (prepended with 'drush:').
+ *
+ * @return
+ *   A string with the help text for our command.
+ */
+function potx_drush_help($section) {
+  if ($section == 'drush:potx') {
+    $help = dt('Generates translation templates from the given Drupal source code in the current working directory.');
+    $help .= "\n". dt('Usage: drush potx [potx-mode] [files]');
+    $help .= "\n\n". dt('Where the possible potx modes are:');
+    $help .= "\n". dt(' single    Single file output mode, every file folded into the single output file (default).');
+    $help .= "\n". dt(' multiple  Multiple file output mode, .info files folded into module .pot files.');
+    $help .= "\n". dt(' core      Drupal core output mode, .info files folded into general.pot.');
+    $help .= "\n\n". dt('If no files are specified, potx will autodiscover files from the current working directory. You can specify concrete files to look at to limit the scope of the operation.');
+    return $help;
+  }
+}
+
+/**
+ * Drush command callback.
+ */
+function potx_drush_extract() {
+  // Include library.
+  include_once drupal_get_path('module', 'potx') .'/potx.inc';
+  
+  $files = array();
+  $build_mode = POTX_BUILD_SINGLE;
+
+  $args = func_get_args();
+  if (in_array($args[0], array('core', 'multiple', 'single'))) {
+    // First argument could be any of the mode names.
+    $build_mode = constant('POTX_BUILD_'. strtoupper($args[0]));
+    unset($args[0]);
+  }
+  if (count($args)) {
+    // Rest of arguments is a list of files.
+    $files = $args;
+  }
+  else {
+    // No file list provided, just autodiscover files.
+    $files = _potx_explore_dir('', '*', POTX_API_CURRENT, TRUE);
+  }
+  
+  foreach ($files as $file) {
+    potx_status('status', "Processing $file...\n");
+    _potx_process_file($file);
+  }
+
+  _potx_build_files(POTX_STRING_RUNTIME, $build_mode);
+  _potx_build_files(POTX_STRING_INSTALLER, POTX_BUILD_SINGLE, 'installer');
+  _potx_write_files();
+  potx_status('status', "\nDone.\n");
+
+  //drush_print(var_export(, TRUE));
+}
Index: potx.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/Attic/potx.inc,v
retrieving revision 1.1.2.17.2.7.2.19.4.11
diff -u -p -r1.1.2.17.2.7.2.19.4.11 potx.inc
--- potx.inc	1 Feb 2010 16:05:56 -0000	1.1.2.17.2.7.2.19.4.11
+++ potx.inc	23 Feb 2010 15:59:14 -0000
@@ -1423,7 +1423,7 @@ function _potx_explore_dir($path = '', $
   }
 
   // Skip API files. Also skip our own files, if that was requested.
-  $skip_pattern = ($skip_self ? '!(potx-cli\.php|potx\.inc|\.api\.php)$!' : '!\.api\.php$!');
+  $skip_pattern = ($skip_self ? '!(potx[-\.].+|\.api\.php)$!' : '!\.api\.php$!');
   foreach ($files as $id => $file_name) {
     if (preg_match($skip_pattern, $file_name)) {
       unset($files[$id]);
