@@ -542,16 +542,16 @@ msgid ""
542542"output.write( unistr )\n"
543543"output.close()"
544544msgstr ""
545- "importar códecs \n"
545+ "import codecs \n"
546546"\n"
547547"unistr = u'\\ u0660\\ u2000ab ...'\n"
548548"\n"
549549"(UTF8_encode, UTF8_decode,\n"
550- "UTF8_streamreader, UTF8_streamwriter) = codecs.lookup('UTF-8')\n"
550+ " UTF8_streamreader, UTF8_streamwriter) = codecs.lookup('UTF-8')\n"
551551"\n"
552- "salida = UTF8_streamwriter( open( '/tmp/output', 'wb') )\n"
553- "salida .write( unistr )\n"
554- "salida .close()"
552+ "output = UTF8_streamwriter( open( '/tmp/output', 'wb') )\n"
553+ "output .write( unistr )\n"
554+ "output .close()"
555555
556556#: ../Doc/whatsnew/2.0.rst:243
557557msgid "The following code would then read UTF-8 input from the file::"
@@ -563,9 +563,9 @@ msgid ""
563563"print repr(input.read())\n"
564564"input.close()"
565565msgstr ""
566- "entrada = UTF8_streamreader( abrir ( '/tmp/salida ', 'rb') )\n"
567- "imprimir repr(entrada.leer ())\n"
568- "entrada.cerrar ()"
566+ "input = UTF8_streamreader( open ( '/tmp/output ', 'rb') )\n"
567+ "print repr(input.read ())\n"
568+ "input.close ()"
569569
570570#: ../Doc/whatsnew/2.0.rst:249
571571msgid ""
@@ -640,11 +640,11 @@ msgid ""
640640" string.find(s, substring) != -1,\n"
641641" L)"
642642msgstr ""
643- "# Dada la lista L, crea una lista de todas las cadenas \n"
644- "# que contienen la subcadena S.\n"
643+ "# Given the list L, make a list of all strings \n"
644+ "# containing the substring S.\n"
645645"sublist = filter( lambda s, substring=S:\n"
646- "string.find(s, substring) != -1,\n"
647- "L)"
646+ " string.find(s, substring) != -1,\n"
647+ " L)"
648648
649649#: ../Doc/whatsnew/2.0.rst:286
650650msgid ""
@@ -672,10 +672,10 @@ msgid ""
672672" for exprN in sequenceN\n"
673673" if condition ]"
674674msgstr ""
675- "[ expresión para expr en secuencia1 \n"
676- "para expr2 en secuencia2 ...\n"
677- "para exprN en secuenciaN \n"
678- "si condición ]"
675+ "[ expression for expr in sequence1 \n"
676+ " for expr2 in sequence2 ...\n"
677+ " for exprN in sequenceN \n"
678+ " if condition ]"
679679
680680#: ../Doc/whatsnew/2.0.rst:299
681681msgid ""
@@ -714,14 +714,14 @@ msgid ""
714714" # the expression to the\n"
715715" # resulting list."
716716msgstr ""
717- "para expr1 en secuencia1 :\n"
718- "para expr2 en secuencia2 :\n"
719- "...\n"
720- "para exprN en secuenciaN :\n"
721- "if (condición ):\n"
722- "# Agrega el valor de \n"
723- "# la expresión a la \n"
724- "# lista resultante ."
717+ "for expr1 in sequence1 :\n"
718+ " for expr2 in sequence2 :\n"
719+ " ...\n"
720+ " for exprN in sequenceN :\n"
721+ " if (condition ):\n"
722+ " # Append the value of \n"
723+ " # the expression to the \n"
724+ " # resulting list ."
725725
726726#: ../Doc/whatsnew/2.0.rst:319
727727msgid ""
@@ -745,7 +745,7 @@ msgid ""
745745msgstr ""
746746"seq1 = 'abc'\n"
747747"seq2 = (1,2,3)\n"
748- ">>> [ (x,y) para x en seq1 para y en seq2]\n"
748+ ">>> [ (x,y) for x in seq1 for y in seq2]\n"
749749"[('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('b', 3), ('c', 1),\n"
750750"('c', 2), ('c', 3)]"
751751
@@ -767,10 +767,10 @@ msgid ""
767767"# Correct\n"
768768"[ (x,y) for x in seq1 for y in seq2]"
769769msgstr ""
770- "# Error de sintaxis \n"
771- "[ x,y para x en seq1 para y en seq2]\n"
772- "# Correcto \n"
773- "[ (x,y) para x en seq1 para y en seq2]"
770+ "# Syntax error \n"
771+ "[ x,y for x in seq1 for y in seq2]\n"
772+ "# Correct \n"
773+ "[ (x,y) for x in seq1 for y in seq2]"
774774
775775#: ../Doc/whatsnew/2.0.rst:339
776776msgid ""
@@ -833,15 +833,15 @@ msgid ""
833833"n += 3\n"
834834"print n.value"
835835msgstr ""
836- "clase Número :\n"
837- "def __init__(self, valor ):\n"
838- "self.valor = valor \n"
839- "def __iadd__(self, incremento ):\n"
840- "return Número ( self.valor + incremento )\n"
836+ "class Number :\n"
837+ " def __init__(self, value ):\n"
838+ " self.value = value \n"
839+ " def __iadd__(self, increment ):\n"
840+ " return Number ( self.value + increment )\n"
841841"\n"
842- "n = Número (5)\n"
842+ "n = Number (5)\n"
843843"n += 3\n"
844- "print n.valor "
844+ "print n.value "
845845
846846#: ../Doc/whatsnew/2.0.rst:377
847847msgid ""
@@ -910,7 +910,7 @@ msgid ""
910910msgstr ""
911911">>> 'andrew'.capitalize()\n"
912912"'Andrew'\n"
913- ">>> 'nombredelhost '.replace('os', 'linux')\n"
913+ ">>> 'hostname '.replace('os', 'linux')\n"
914914"'hlinuxtname'\n"
915915">>> 'moshe'.find('sh')\n"
916916"2"
@@ -1174,8 +1174,7 @@ msgstr ""
11741174
11751175#: ../Doc/whatsnew/2.0.rst:526
11761176msgid "print >> sys.stderr, \" Warning: action field not supplied\" "
1177- msgstr ""
1178- "imprimir >> sys.stderr, \" Advertencia: campo de acción no suministrado\" "
1177+ msgstr "print >> sys.stderr, \" Warning: action field not supplied\" "
11791178
11801179#: ../Doc/whatsnew/2.0.rst:528
11811180msgid ""
@@ -1334,8 +1333,8 @@ msgid ""
13341333"f()"
13351334msgstr ""
13361335"def f():\n"
1337- "imprimir \" i=\" ,i\n"
1338- "i = i + 1\n"
1336+ " print \" i=\" ,i\n"
1337+ " i = i + 1\n"
13391338"f()"
13401339
13411340#: ../Doc/whatsnew/2.0.rst:595
@@ -1420,10 +1419,10 @@ msgid ""
14201419" dict[key] = []\n"
14211420" return dict[key]"
14221421msgstr ""
1423- "si dict.has_key( key ): devuelve dict[key]\n"
1424- "de lo contrario :\n"
1425- "dict[key] = []\n"
1426- "devuelve dict[key]"
1422+ "if dict.has_key( key ): return dict[key]\n"
1423+ "else :\n"
1424+ " dict[key] = []\n"
1425+ " return dict[key]"
14271426
14281427#: ../Doc/whatsnew/2.0.rst:633
14291428msgid ""
@@ -1889,9 +1888,9 @@ msgid ""
18891888"setup (name = \" foo\" , version = \" 1.0\" ,\n"
18901889" py_modules = [\" module1\" , \" module2\" ])"
18911890msgstr ""
1892- "desde distutils.core import setup\n"
1893- "setup (nombre = \" foo\" , versión = \" 1.0\" ,\n"
1894- "py_modules = [\" módulo1 \" , \" módulo2 \" ])"
1891+ "from distutils.core import setup\n"
1892+ "setup (name = \" foo\" , version = \" 1.0\" ,\n"
1893+ " py_modules = [\" module1 \" , \" module2 \" ])"
18951894
18961895#: ../Doc/whatsnew/2.0.rst:841
18971896msgid ""
@@ -1907,9 +1906,9 @@ msgid ""
19071906"setup (name = \" foo\" , version = \" 1.0\" ,\n"
19081907" packages = [\" package\" , \" package.subpackage\" ])"
19091908msgstr ""
1910- "desde distutils.core import setup\n"
1911- "setup (nombre = \" foo\" , versión = \" 1.0\" ,\n"
1912- "paquetes = [\" paquete \" , \" paquete.subpaquete \" ])"
1909+ "from distutils.core import setup\n"
1910+ "setup (name = \" foo\" , version = \" 1.0\" ,\n"
1911+ " packages = [\" package \" , \" package.subpackage \" ])"
19131912
19141913#: ../Doc/whatsnew/2.0.rst:848
19151914msgid ""
@@ -1934,18 +1933,18 @@ msgid ""
19341933"setup (name = \" PyXML\" , version = \" 0.5.4\" ,\n"
19351934" ext_modules =[ expat_extension ] )"
19361935msgstr ""
1937- "de distutils.core import setup, Extensión \n"
1936+ "from distutils.core import setup, Extension \n"
19381937"\n"
19391938"expat_extension = Extension('xml.parsers.pyexpat',\n"
1940- "define_macros = [('XML_NS', None)],\n"
1941- "include_dirs = [ 'extensions/expat/xmltok',\n"
1942- "'extensions/expat/xmlparse' ],\n"
1943- "fuentes = [ 'extensions/pyexpat.c',\n"
1944- "'extensions/expat/xmltok/xmltok.c',\n"
1945- "'extensions/expat/xmltok/xmlrole.c', ]\n"
1946- ")\n"
1947- "setup (nombre = \" PyXML\" , versión = \" 0.5.4\" ,\n"
1948- "ext_modules =[ expat_extension ] )"
1939+ " define_macros = [('XML_NS', None)],\n"
1940+ " include_dirs = [ 'extensions/expat/xmltok',\n"
1941+ " 'extensions/expat/xmlparse' ],\n"
1942+ " sources = [ 'extensions/pyexpat.c',\n"
1943+ " 'extensions/expat/xmltok/xmltok.c',\n"
1944+ " 'extensions/expat/xmltok/xmlrole.c', ]\n"
1945+ " )\n"
1946+ "setup (name = \" PyXML\" , version = \" 0.5.4\" ,\n"
1947+ " ext_modules =[ expat_extension ] )"
19491948
19501949#: ../Doc/whatsnew/2.0.rst:864
19511950msgid ""
@@ -2079,20 +2078,20 @@ msgstr ""
20792078"from xml import sax\n"
20802079"\n"
20812080"class SimpleHandler(sax.ContentHandler):\n"
2082- "def startElement(self, name, attrs):\n"
2083- "print 'Inicio del elemento :', name, attrs.keys()\n"
2081+ " def startElement(self, name, attrs):\n"
2082+ " print 'Start of element :', name, attrs.keys()\n"
20842083"\n"
2085- "def endElement(self, name):\n"
2086- "print 'Fin del elemento :', name\n"
2084+ " def endElement(self, name):\n"
2085+ " print 'End of element :', name\n"
20872086"\n"
2088- "# Crear un objeto analizador \n"
2087+ "# Create a parser object \n"
20892088"parser = sax.make_parser()\n"
20902089"\n"
2091- "# Indicarle qué controlador utilizar \n"
2090+ "# Tell it what handler to use \n"
20922091"handler = SimpleHandler()\n"
20932092"parser.setContentHandler( handler )\n"
20942093"\n"
2095- "# ¡Analice un archivo !\n"
2094+ "# Parse a file !\n"
20962095"parser.parse( 'hamlet.xml' )"
20972096
20982097#: ../Doc/whatsnew/2.0.rst:935
@@ -2161,8 +2160,8 @@ msgid ""
21612160"from xml.dom import minidom\n"
21622161"doc = minidom.parse('hamlet.xml')"
21632162msgstr ""
2164- "desde xml.dom importar minidom\n"
2165- "doc = minidom.parse('hamlet.xml')"
2163+ "from xml.dom import minidom\n"
2164+ "doc = minidom.parse('hamlet.xml')"
21662165
21672166#: ../Doc/whatsnew/2.0.rst:964
21682167msgid ""
@@ -2191,9 +2190,9 @@ msgid ""
21912190"print perslist[0].toxml()\n"
21922191"print perslist[1].toxml()"
21932192msgstr ""
2194- "lista pers = doc.getElementsByTagName( 'PERSONA' )\n"
2195- "imprimir lista persistente [0].toxml()\n"
2196- "imprimir lista persistente [1].toxml()"
2193+ "perslist = doc.getElementsByTagName( 'PERSONA' )\n"
2194+ "print perslist [0].toxml()\n"
2195+ "print perslist [1].toxml()"
21972196
21982197#: ../Doc/whatsnew/2.0.rst:977
21992198msgid "For the *Hamlet* XML file, the above few lines output::"
0 commit comments