Fix imap insert multipart detection

This commit is contained in:
spametki
2013-09-14 16:03:41 -03:00
parent b0f6dc4e16
commit 921cd46c10
2 changed files with 61 additions and 5 deletions
+54 -1
View File
@@ -7,6 +7,7 @@
'%s %%{row} updated': '%s filas actualizadas', '%s %%{row} updated': '%s filas actualizadas',
'%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'(requires internet access, experimental)': '(requires internet access, experimental)',
'(something like "it-it")': '(algo como "it-it")', '(something like "it-it")': '(algo como "it-it")',
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(file **gluon/contrib/plural_rules/%s.py** is not found)', '@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(file **gluon/contrib/plural_rules/%s.py** is not found)',
'@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files', '@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files',
@@ -32,6 +33,7 @@
'application "%s" uninstalled': 'aplicación "%s" desinstalada', 'application "%s" uninstalled': 'aplicación "%s" desinstalada',
'application compiled': 'aplicación compilada', 'application compiled': 'aplicación compilada',
'application is compiled and cannot be designed': 'la aplicación está compilada y no puede ser modificada', 'application is compiled and cannot be designed': 'la aplicación está compilada y no puede ser modificada',
'Application name:': 'Application name:',
'are not used': 'are not used', 'are not used': 'are not used',
'are not used yet': 'are not used yet', 'are not used yet': 'are not used yet',
'Are you sure you want to delete file "%s"?': '¿Está seguro que desea eliminar el archivo "%s"?', 'Are you sure you want to delete file "%s"?': '¿Está seguro que desea eliminar el archivo "%s"?',
@@ -47,6 +49,7 @@
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATENCION: NO EJECUTE VARIAS PRUEBAS SIMULTANEAMENTE, NO SON THREAD SAFE.', 'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATENCION: NO EJECUTE VARIAS PRUEBAS SIMULTANEAMENTE, NO SON THREAD SAFE.',
'ATTENTION: you cannot edit the running application!': 'ATENCION: no puede modificar la aplicación que se ejecuta!', 'ATTENTION: you cannot edit the running application!': 'ATENCION: no puede modificar la aplicación que se ejecuta!',
'Autocomplete': 'Autocomplete', 'Autocomplete': 'Autocomplete',
'Autocomplete Python Code': 'Autocomplete Python Code',
'Available databases and tables': 'Bases de datos y tablas disponibles', 'Available databases and tables': 'Bases de datos y tablas disponibles',
'back': 'atrás', 'back': 'atrás',
'breakpoint': 'breakpoint', 'breakpoint': 'breakpoint',
@@ -54,14 +57,17 @@
'browse': 'buscar', 'browse': 'buscar',
'cache': 'cache', 'cache': 'cache',
'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados', 'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados',
'can be a git repo': 'can be a git repo',
'Cannot be empty': 'No puede estar vacío', 'Cannot be empty': 'No puede estar vacío',
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'No se puede compilar: hay errores en su aplicación. Depure, corrija errores y vuelva a intentarlo.', 'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'No se puede compilar: hay errores en su aplicación. Depure, corrija errores y vuelva a intentarlo.',
'Cannot compile: there are errors in your app:': 'No se puede compilar: hay errores en su aplicación:', 'Cannot compile: there are errors in your app:': 'No se puede compilar: hay errores en su aplicación:',
'cannot create file': 'no es posible crear archivo', 'cannot create file': 'no es posible crear archivo',
'cannot upload file "%(filename)s"': 'no es posible subir archivo "%(filename)s"', 'cannot upload file "%(filename)s"': 'no es posible subir archivo "%(filename)s"',
'Change admin password': 'cambie contraseña admin', 'Change admin password': 'cambie contraseña admin',
'change editor settings': 'change editor settings',
'Change Password': 'Cambie Contraseña', 'Change Password': 'Cambie Contraseña',
'check all': 'marcar todos', 'check all': 'marcar todos',
'Check for upgrades': 'Check for upgrades',
'Check to delete': 'Marque para eliminar', 'Check to delete': 'Marque para eliminar',
'Checking for upgrades...': 'Buscando actulizaciones...', 'Checking for upgrades...': 'Buscando actulizaciones...',
'Clean': 'limpiar', 'Clean': 'limpiar',
@@ -91,6 +97,7 @@
'Current request': 'Solicitud en curso', 'Current request': 'Solicitud en curso',
'Current response': 'Respuesta en curso', 'Current response': 'Respuesta en curso',
'Current session': 'Sesión en curso', 'Current session': 'Sesión en curso',
'currently running': 'currently running',
'currently saved or': 'actualmente guardado o', 'currently saved or': 'actualmente guardado o',
'customize me!': 'Adaptame!', 'customize me!': 'Adaptame!',
'data uploaded': 'datos subidos', 'data uploaded': 'datos subidos',
@@ -107,14 +114,21 @@
'delete plugin': 'eliminar plugin', 'delete plugin': 'eliminar plugin',
'Delete this file (you will be asked to confirm deletion)': 'Delete this file (you will be asked to confirm deletion)', 'Delete this file (you will be asked to confirm deletion)': 'Delete this file (you will be asked to confirm deletion)',
'Delete:': 'Elimine:', 'Delete:': 'Elimine:',
'Deploy': 'Deploy',
'Deploy on Google App Engine': 'Instale en Google App Engine', 'Deploy on Google App Engine': 'Instale en Google App Engine',
'Deploy to OpenShift': 'Deploy to OpenShift',
'Description': 'Descripción', 'Description': 'Descripción',
'design': 'modificar', 'design': 'modificar',
'DESIGN': 'DISEÑO', 'DESIGN': 'DISEÑO',
'Design for': 'Diseño para', 'Design for': 'Diseño para',
'Detailed traceback description': 'Detailed traceback description',
'details': 'details',
'direction: ltr': 'direction: ltr', 'direction: ltr': 'direction: ltr',
'Disable': 'Disable',
'docs': 'docs', 'docs': 'docs',
'done!': 'listo!', 'done!': 'listo!',
'Download': 'Download',
'download files via http:': 'download files via http:',
'download layouts': 'download layouts', 'download layouts': 'download layouts',
'download plugins': 'download plugins', 'download plugins': 'download plugins',
'E-mail': 'Correo electrónico', 'E-mail': 'Correo electrónico',
@@ -122,17 +136,25 @@
'Edit': 'editar', 'Edit': 'editar',
'Edit application': 'Editar aplicación', 'Edit application': 'Editar aplicación',
'edit controller': 'editar controlador', 'edit controller': 'editar controlador',
'edit controller:': 'edit controller:',
'Edit current record': 'Edite el registro actual', 'Edit current record': 'Edite el registro actual',
'Edit Profile': 'Editar Perfil', 'Edit Profile': 'Editar Perfil',
'edit views:': 'editar vistas:', 'edit views:': 'editar vistas:',
'Editing file': 'Editando archivo', 'Editing file': 'Editando archivo',
'Editing file "%s"': 'Editando archivo "%s"', 'Editing file "%s"': 'Editando archivo "%s"',
'Editing Language file': 'Editando archivo de lenguaje', 'Editing Language file': 'Editando archivo de lenguaje',
'Editing myclientapi': 'Editing myclientapi',
'Editing myemail': 'Editing myemail',
'Editing rbare': 'Editing rbare',
'Editing ul': 'Editing ul',
'Enterprise Web Framework': 'Armazón Empresarial para Internet', 'Enterprise Web Framework': 'Armazón Empresarial para Internet',
'Error': 'Error', 'Error': 'Error',
'Error logs for "%(app)s"': 'Bitácora de errores en "%(app)s"', 'Error logs for "%(app)s"': 'Bitácora de errores en "%(app)s"',
'Error snapshot': 'Error snapshot',
'Error ticket': 'Error ticket',
'Errors': 'errores', 'Errors': 'errores',
'Exception instance attributes': 'Atributos de la instancia de Excepción', 'Exception instance attributes': 'Atributos de la instancia de Excepción',
'Expand Abbreviation': 'Expand Abbreviation',
'export as csv file': 'exportar como archivo CSV', 'export as csv file': 'exportar como archivo CSV',
'exposes': 'expone', 'exposes': 'expone',
'exposes:': 'exposes:', 'exposes:': 'exposes:',
@@ -154,6 +176,7 @@
'Find Next': 'Find Next', 'Find Next': 'Find Next',
'Find Previous': 'Find Previous', 'Find Previous': 'Find Previous',
'First name': 'Nombre', 'First name': 'Nombre',
'Frames': 'Frames',
'Functions with no doctests will result in [passed] tests.': 'Funciones sin doctests equivalen a pruebas [aceptadas].', 'Functions with no doctests will result in [passed] tests.': 'Funciones sin doctests equivalen a pruebas [aceptadas].',
'Globals##debug': 'Globals', 'Globals##debug': 'Globals',
'graph model': 'graph model', 'graph model': 'graph model',
@@ -166,6 +189,7 @@
'includes': 'incluye', 'includes': 'incluye',
'insert new': 'inserte nuevo', 'insert new': 'inserte nuevo',
'insert new %s': 'inserte nuevo %s', 'insert new %s': 'inserte nuevo %s',
'inspect attributes': 'inspect attributes',
'Install': 'instalar', 'Install': 'instalar',
'Installed applications': 'Aplicaciones instaladas', 'Installed applications': 'Aplicaciones instaladas',
'Interaction at %s line %s': 'Interaction at %s line %s', 'Interaction at %s line %s': 'Interaction at %s line %s',
@@ -175,10 +199,12 @@
'Invalid action': 'Acción inválida', 'Invalid action': 'Acción inválida',
'Invalid email': 'Correo inválido', 'Invalid email': 'Correo inválido',
'invalid password': 'contraseña inválida', 'invalid password': 'contraseña inválida',
'invalid password.': 'invalid password.',
'Invalid Query': 'Consulta inválida', 'Invalid Query': 'Consulta inválida',
'invalid request': 'solicitud inválida', 'invalid request': 'solicitud inválida',
'invalid ticket': 'tiquete inválido', 'invalid ticket': 'tiquete inválido',
'Key bindings': 'Key bindings', 'Key bindings': 'Key bindings',
'Key bindings for ZenCoding Plugin': 'Key bindings for ZenCoding Plugin',
'language file "%(filename)s" created/updated': 'archivo de lenguaje "%(filename)s" creado/actualizado', 'language file "%(filename)s" created/updated': 'archivo de lenguaje "%(filename)s" creado/actualizado',
'Language files (static strings) updated': 'Archivos de lenguaje (cadenas estáticas) actualizados', 'Language files (static strings) updated': 'Archivos de lenguaje (cadenas estáticas) actualizados',
'languages': 'lenguajes', 'languages': 'lenguajes',
@@ -188,6 +214,7 @@
'Last saved on:': 'Guardado en:', 'Last saved on:': 'Guardado en:',
'License for': 'Licencia para', 'License for': 'Licencia para',
'loading...': 'cargando...', 'loading...': 'cargando...',
'locals': 'locals',
'Locals##debug': 'Locals', 'Locals##debug': 'Locals',
'Login': 'Inicio de sesión', 'Login': 'Inicio de sesión',
'login': 'inicio de sesión', 'login': 'inicio de sesión',
@@ -195,6 +222,7 @@
'Logout': 'fin de sesión', 'Logout': 'fin de sesión',
'Lost Password': 'Contraseña perdida', 'Lost Password': 'Contraseña perdida',
'manage': 'manage', 'manage': 'manage',
'Manage': 'Manage',
'merge': 'combinar', 'merge': 'combinar',
'Models': 'Modelos', 'Models': 'Modelos',
'models': 'modelos', 'models': 'modelos',
@@ -202,16 +230,22 @@
'modules': 'módulos', 'modules': 'módulos',
'Name': 'Nombre', 'Name': 'Nombre',
'new application "%s" created': 'nueva aplicación "%s" creada', 'new application "%s" created': 'nueva aplicación "%s" creada',
'New application wizard': 'New application wizard',
'new plugin installed': 'nuevo plugin instalado', 'new plugin installed': 'nuevo plugin instalado',
'New Record': 'Registro nuevo', 'New Record': 'Registro nuevo',
'new record inserted': 'nuevo registro insertado', 'new record inserted': 'nuevo registro insertado',
'New simple application': 'New simple application',
'next': 'next', 'next': 'next',
'next 100 rows': '100 filas siguientes', 'next 100 rows': '100 filas siguientes',
'NO': 'NO', 'NO': 'NO',
'No databases in this application': 'No hay bases de datos en esta aplicación', 'No databases in this application': 'No hay bases de datos en esta aplicación',
'No Interaction yet': 'No Interaction yet', 'No Interaction yet': 'No Interaction yet',
'no match': 'no encontrado', 'no match': 'no encontrado',
'no package selected': 'no package selected',
'No ticket_storage.txt found under /private folder': 'No ticket_storage.txt found under /private folder',
'online designer': 'online designer',
'or alternatively': 'or alternatively', 'or alternatively': 'or alternatively',
'Or Get from URL:': 'Or Get from URL:',
'or import from csv file': 'o importar desde archivo CSV', 'or import from csv file': 'o importar desde archivo CSV',
'or provide app url:': 'o provea URL de la aplicación:', 'or provide app url:': 'o provea URL de la aplicación:',
'or provide application url:': 'o provea URL de la aplicación:', 'or provide application url:': 'o provea URL de la aplicación:',
@@ -220,6 +254,7 @@
'Overwrite installed app': 'sobreescriba aplicación instalada', 'Overwrite installed app': 'sobreescriba aplicación instalada',
'Pack all': 'empaquetar todo', 'Pack all': 'empaquetar todo',
'Pack compiled': 'empaquete compiladas', 'Pack compiled': 'empaquete compiladas',
'Pack custom': 'Pack custom',
'pack plugin': 'empaquetar plugin', 'pack plugin': 'empaquetar plugin',
'PAM authenticated user, cannot change password here': 'usuario autenticado por PAM, no puede cambiar la contraseña aquí', 'PAM authenticated user, cannot change password here': 'usuario autenticado por PAM, no puede cambiar la contraseña aquí',
'Password': 'Contraseña', 'Password': 'Contraseña',
@@ -236,6 +271,7 @@
'Private files': 'Private files', 'Private files': 'Private files',
'private files': 'private files', 'private files': 'private files',
'Query:': 'Consulta:', 'Query:': 'Consulta:',
'Rapid Search': 'Rapid Search',
'record': 'registro', 'record': 'registro',
'record does not exist': 'el registro no existe', 'record does not exist': 'el registro no existe',
'record id': 'id de registro', 'record id': 'id de registro',
@@ -244,11 +280,14 @@
'Register': 'Registrese', 'Register': 'Registrese',
'Registration key': 'Contraseña de Registro', 'Registration key': 'Contraseña de Registro',
'reload': 'reload', 'reload': 'reload',
'Reload routes': 'Reload routes',
'Remove compiled': 'eliminar compiladas', 'Remove compiled': 'eliminar compiladas',
'Removed Breakpoint on %s at line %s': 'Removed Breakpoint on %s at line %s', 'Removed Breakpoint on %s at line %s': 'Removed Breakpoint on %s at line %s',
'Replace': 'Replace', 'Replace': 'Replace',
'Replace All': 'Replace All', 'Replace All': 'Replace All',
'request': 'request',
'Resolve Conflict file': 'archivo Resolución de Conflicto', 'Resolve Conflict file': 'archivo Resolución de Conflicto',
'response': 'response',
'restore': 'restaurar', 'restore': 'restaurar',
'return': 'return', 'return': 'return',
'revert': 'revertir', 'revert': 'revertir',
@@ -256,26 +295,32 @@
'Rows in table': 'Filas en la tabla', 'Rows in table': 'Filas en la tabla',
'Rows selected': 'Filas seleccionadas', 'Rows selected': 'Filas seleccionadas',
'rules are not defined': 'rules are not defined', 'rules are not defined': 'rules are not defined',
'Run tests in this file': 'Run tests in this file',
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')", "Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')",
'Running on %s': 'Running on %s',
'Save': 'Save', 'Save': 'Save',
'save': 'guardar', 'save': 'guardar',
'Save file:': 'Save file:', 'Save file:': 'Save file:',
'Save file: %s': 'Save file: %s',
'Save via Ajax': 'Save via Ajax', 'Save via Ajax': 'Save via Ajax',
'Saved file hash:': 'Hash del archivo guardado:', 'Saved file hash:': 'Hash del archivo guardado:',
'selected': 'seleccionado(s)', 'selected': 'seleccionado(s)',
'session': 'session',
'session expired': 'sesión expirada', 'session expired': 'sesión expirada',
'Set Breakpoint on %s at line %s: %s': 'Set Breakpoint on %s at line %s: %s', 'Set Breakpoint on %s at line %s: %s': 'Set Breakpoint on %s at line %s: %s',
'shell': 'shell', 'shell': 'shell',
'Site': 'sitio', 'Site': 'sitio',
'some files could not be removed': 'algunos archivos no pudieron ser removidos', 'some files could not be removed': 'algunos archivos no pudieron ser removidos',
'Start searching': 'Start searching', 'Start searching': 'Start searching',
'Start wizard': 'Start wizard',
'state': 'estado', 'state': 'estado',
'static': 'estáticos',
'Static': 'Static', 'Static': 'Static',
'static': 'estáticos',
'Static files': 'Archivos estáticos', 'Static files': 'Archivos estáticos',
'step': 'step', 'step': 'step',
'stop': 'stop', 'stop': 'stop',
'submit': 'enviar', 'submit': 'enviar',
'Submit': 'Submit',
'successful': 'successful', 'successful': 'successful',
'Sure you want to delete this object?': '¿Está seguro que desea eliminar este objeto?', 'Sure you want to delete this object?': '¿Está seguro que desea eliminar este objeto?',
'table': 'tabla', 'table': 'tabla',
@@ -303,6 +348,7 @@
'This is the %(filename)s template': 'Esta es la plantilla %(filename)s', 'This is the %(filename)s template': 'Esta es la plantilla %(filename)s',
'this page to see if a breakpoint was hit and debug interaction is required.': 'this page to see if a breakpoint was hit and debug interaction is required.', 'this page to see if a breakpoint was hit and debug interaction is required.': 'this page to see if a breakpoint was hit and debug interaction is required.',
'Ticket': 'Tiquete', 'Ticket': 'Tiquete',
'Ticket ID': 'Ticket ID',
'Timestamp': 'Timestamp', 'Timestamp': 'Timestamp',
'TM': 'MR', 'TM': 'MR',
'to previous version.': 'a la versión previa.', 'to previous version.': 'a la versión previa.',
@@ -311,10 +357,13 @@
'to use the debugger!': 'to use the debugger!', 'to use the debugger!': 'to use the debugger!',
'toggle breakpoint': 'toggle breakpoint', 'toggle breakpoint': 'toggle breakpoint',
'Toggle Fullscreen': 'Toggle Fullscreen', 'Toggle Fullscreen': 'Toggle Fullscreen',
'Traceback': 'Traceback',
'translation strings for the application': 'cadenas de caracteres de traducción para la aplicación', 'translation strings for the application': 'cadenas de caracteres de traducción para la aplicación',
'Translation strings for the application': 'Translation strings for the application', 'Translation strings for the application': 'Translation strings for the application',
'try': 'intente', 'try': 'intente',
'try something like': 'intente algo como', 'try something like': 'intente algo como',
'Try the mobile interface': 'Try the mobile interface',
'try view': 'try view',
'Type some Python code in here and hit Return (Enter) to execute it.': 'Type some Python code in here and hit Return (Enter) to execute it.', 'Type some Python code in here and hit Return (Enter) to execute it.': 'Type some Python code in here and hit Return (Enter) to execute it.',
'Unable to check for upgrades': 'No es posible verificar la existencia de actualizaciones', 'Unable to check for upgrades': 'No es posible verificar la existencia de actualizaciones',
'unable to create application "%s"': 'no es posible crear la aplicación "%s"', 'unable to create application "%s"': 'no es posible crear la aplicación "%s"',
@@ -332,9 +381,12 @@
'update': 'actualizar', 'update': 'actualizar',
'update all languages': 'actualizar todos los lenguajes', 'update all languages': 'actualizar todos los lenguajes',
'Update:': 'Actualice:', 'Update:': 'Actualice:',
'upgrade now to %s': 'upgrade now to %s',
'upgrade web2py now': 'actualize web2py ahora', 'upgrade web2py now': 'actualize web2py ahora',
'Upload': 'Upload', 'Upload': 'Upload',
'Upload & install packed application': 'Suba e instale aplicación empaquetada', 'Upload & install packed application': 'Suba e instale aplicación empaquetada',
'Upload a package:': 'Upload a package:',
'Upload and install packed application': 'Upload and install packed application',
'upload application:': 'subir aplicación:', 'upload application:': 'subir aplicación:',
'Upload existing application': 'Suba esta aplicación', 'Upload existing application': 'Suba esta aplicación',
'upload file:': 'suba archivo:', 'upload file:': 'suba archivo:',
@@ -348,6 +400,7 @@
'view': 'vista', 'view': 'vista',
'Views': 'Vistas', 'Views': 'Vistas',
'views': 'vistas', 'views': 'vistas',
'Web Framework': 'Web Framework',
'web2py is up to date': 'web2py está actualizado', 'web2py is up to date': 'web2py está actualizado',
'web2py online debugger': 'web2py online debugger', 'web2py online debugger': 'web2py online debugger',
'web2py Recent Tweets': 'Tweets Recientes de web2py', 'web2py Recent Tweets': 'Tweets Recientes de web2py',
+7 -4
View File
@@ -6498,9 +6498,10 @@ class IMAPAdapter(NoSQLAdapter):
def _insert(self, table, fields): def _insert(self, table, fields):
def add_payload(message, obj): def add_payload(message, obj):
payload = Message() payload = Message()
charset = obj.get("encoding", "utf-8") payload.set_charset(obj.get("encoding", "utf-8"))
payload.set_type(obj.get("mime", None)) mime = obj.get("mime", None)
payload.set_charset(charset) if mime:
payload.set_type(mime)
if "text" in obj: if "text" in obj:
payload.set_payload(obj["text"]) payload.set_payload(obj["text"])
elif "payload" in obj: elif "payload" in obj:
@@ -6538,7 +6539,9 @@ class IMAPAdapter(NoSQLAdapter):
else: else:
message[item] = ";".join([i for i in message[item] = ";".join([i for i in
value]) value])
if not message.is_multipart(): if (not message.is_multipart() and
(not message.get_content_type().startswith(
"multipart"))):
if isinstance(content, basestring): if isinstance(content, basestring):
message.set_payload(content) message.set_payload(content)
elif len(content) > 0: elif len(content) > 0: