Commit ec075f20 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

default is stable

--HG--
branch : stable
......@@ -7,3 +7,5 @@ fdc59d77d46ed47f9b22e778a53534505ea4f828 cubicweb-email-debian-version-1_4_0-1
7024ac15f099bc92bea4a5536a525b777d64989e cubicweb-email-debian-version-1_5_0-1
c65e11b67dc4438f9b36023612c8edcdede9a438 cubicweb-email-version-1_5_1
43e059ebb8f64bf5030f0558755d5e50b954ee92 cubicweb-email-debian-version-1_5_1-1
7b237859f2d2617fbebd00f19ca53f77890f89b4 cubicweb-email-version-1.6.0
d464f813a405376ea3fae96b5abd277a213532b0 cubicweb-email-debian-version-1.6.0-1
......@@ -4,7 +4,7 @@
modname = 'email'
distname = "cubicweb-%s" % modname
numversion = (1, 5, 1)
numversion = (1, 6, 0)
version = '.'.join(str(num) for num in numversion)
license = 'LGPL'
......@@ -46,9 +46,9 @@ except OSError:
cube_eid = 20324
# used packages
__depends_cubes__ = {'file': None,}
__depends_cubes__ = {'file': '>= 1.6.0',}
__use__ = tuple(__depends_cubes__)
__depends__ = {'cubicweb': '>= 3.2.0'}
__depends__ = {'cubicweb': '>= 3.5.0'}
for key, value in __depends_cubes__.items():
__depends__['cubicweb-'+key] = value
__recommend__ = ('comment',)
......
cubicweb-email (1.6.0-1) unstable; urgency=low
* new upstream release
-- Sylvain Thénault <sylvain.thenault@logilab.fr> Wed, 07 Oct 2009 10:00:28 +0200
cubicweb-email (1.5.1-1) unstable; urgency=low
* new upstream release
......
......@@ -9,9 +9,7 @@ Homepage: http://www.cubicweb.org/project/cubicweb-email
Package: cubicweb-email
Architecture: all
Conflicts: erudi-blog, erudi-blog-server, erudi-blog-client, erudi-blog-comp
Replaces: erudi-blog, erudi-blog-server, erudi-blog-client, erudi-blog-comp
Depends: cubicweb-common (>= 3.2.0), cubicweb-file
Depends: cubicweb-common (>= 3.5.0), cubicweb-file (>= 1.6.0)
Description: email component for the CubicWeb framework
This CubicWeb component models email messages.
.
......
......@@ -41,10 +41,10 @@ class MBOXImportCommand(Command):
appid = pop_arg(args, expected_size_after=None)
cnx = config_connect(appid, self.config)
cnx.load_vobjects(cubes=None, subpath=('entities',))
importer = MBOXImporter(cnx.cursor(), cnx.get_schema(),
verbose=True, interactive=self.config.interactive)
importer = MBOXImporter(cnx, verbose=True,
interactive=self.config.interactive)
# set autocommit, add an option to control that if needed
importer.autocommit_mode(cnx)
importer.autocommit_mode()
try:
for fpath in args:
if fpath == '-':
......
......@@ -61,7 +61,7 @@ class Email(TreeMixIn, AnyEntity):
alternatives.append(set(p.eid for p in part.alternative))
alternatives[-1].add(part.eid)
else:
result.append((part.ordernum, part))
result.append(part)
if alternatives:
for altset in alternatives:
selected = [parts_by_eid[peid] for peid in altset
......@@ -70,9 +70,8 @@ class Email(TreeMixIn, AnyEntity):
selected = selected[0]
else:
selected = parts_by_eid[altset.pop()]
result.append((selected.ordernum, selected))
result.sort()
return [p[1] for p in result]
result.append(selected)
return sorted(result, key=lambda x: x.ordernum)
def references(self):
result = set()
......
......@@ -17,7 +17,7 @@ from logilab.mtconverter import TransformError
from cubicweb import UnknownEid
from cubicweb.server.pool import PreCommitOperation
from cubicweb.server.hooksmanager import Hook
from cubicweb.sobjects.notification import parse_message_id
from cubicweb.common.mail import parse_message_id
def fix_ownership(session, eid, email):
......@@ -90,10 +90,10 @@ class ExtractEmailChangeState(PreCommitOperation):
if not hasattr(entity, 'in_state'):
self.error('bad change state instruction for eid %s', eid)
continue
transition = entity.can_pass_transition(trname)
if transition:
tr = entity.current_workflow and entity.current_workflow.transition_by_name(trname)
if tr and tr.may_be_fired(entity.eid):
try:
self.change_state(entity, transition)
self.change_state(entity, tr)
except:
self.exception('while changing state off %s from email %s',
entity, self.email)
......@@ -102,8 +102,7 @@ class ExtractEmailChangeState(PreCommitOperation):
trname, entity)
def change_state(self, entity, transition):
entity.change_state(transition.destination_state[0].eid)
trinfo = entity.latest_trinfo()
trinfo = entity.fire_transition(transition)
self.session.execute('SET X generated_by S WHERE X eid %(x)s, S eid %(s)s',
{'x': trinfo.eid, 's': self.email.eid}, 'x')
fix_ownership(self.session, trinfo.eid, self.email)
......
......@@ -11,6 +11,12 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "CC"
msgstr ""
msgid "Date"
msgstr ""
# schema pot file, generated on 2007-08-30 18:06:45
#
# singular and plural forms for each entity type
......@@ -32,6 +38,9 @@ msgstr "Email threads"
msgid "Email_plural"
msgstr "Emails"
msgid "From"
msgstr ""
msgid "New Email"
msgstr "New email"
......@@ -41,6 +50,9 @@ msgstr "New email part"
msgid "New EmailThread"
msgstr "New email thread"
msgid "Subject"
msgstr ""
msgid "This Email"
msgstr "This email"
......@@ -50,6 +62,9 @@ msgstr "This email part"
msgid "This EmailThread"
msgstr "This email thread"
msgid "To"
msgstr ""
msgid "UTC time on which the mail was sent"
msgstr ""
......@@ -63,41 +78,68 @@ msgstr "email part"
msgid "add EmailThread forked_from EmailThread object"
msgstr "fored thread"
msgid "add a Email"
msgstr "add an email"
msgid "add a EmailPart"
msgstr "add an email part"
msgid "add a EmailThread"
msgstr "add an email thread"
# subject and object forms for each relation type
# (no object form for final relation types)
msgid "alternative"
msgstr ""
msgctxt "EmailPart"
msgid "alternative"
msgstr ""
msgid "an email attachment"
msgstr ""
msgid "attachment"
msgstr ""
msgctxt "Email"
msgid "attachment"
msgstr ""
msgctxt "File"
msgid "attachment_object"
msgstr "attachement of"
msgid "attachment_object"
msgstr "attachment of"
msgid "cc"
msgstr ""
msgctxt "Email"
msgid "cc"
msgstr ""
msgctxt "EmailAddress"
msgid "cc_object"
msgstr "cc"
msgid "cc_object"
msgstr "cc"
msgid "cites"
msgstr ""
msgctxt "Email"
msgid "cites"
msgstr ""
msgctxt "Email"
msgid "cites_object"
msgstr "cited by"
msgid "cites_object"
msgstr "cited by"
msgctxt "EmailPart"
msgid "content"
msgstr ""
msgctxt "EmailPart"
msgid "content_format"
msgstr "format"
msgid "creating EmailPart (Email %(linkto)s parts EmailPart)"
msgstr "creating email part for email %(linkto)s"
......@@ -110,6 +152,10 @@ msgstr "creating attachment of email %(linkto)s"
msgid "date"
msgstr ""
msgctxt "Email"
msgid "date"
msgstr ""
msgid "discussion thread"
msgstr ""
......@@ -128,21 +174,53 @@ msgstr "to"
msgid "forked_from"
msgstr "fored from"
msgctxt "EmailThread"
msgid "forked_from"
msgstr "forked from"
msgctxt "EmailThread"
msgid "forked_from_object"
msgstr "forks"
msgid "forked_from_object"
msgstr "forks"
msgid "generated_by"
msgstr "generated by"
msgctxt "Comment"
msgid "generated_by"
msgstr "generated by"
msgctxt "TrInfo"
msgid "generated_by"
msgstr "generated by"
msgctxt "Email"
msgid "generated_by_object"
msgstr "has generated"
msgid "generated_by_object"
msgstr "has generated"
msgid "headers"
msgstr ""
msgctxt "Email"
msgid "headers"
msgstr ""
msgid "in_thread"
msgstr "in thread"
msgctxt "Email"
msgid "in_thread"
msgstr "in thread"
msgctxt "EmailThread"
msgid "in_thread_object"
msgstr "contains"
msgid "in_thread_object"
msgstr "contains"
......@@ -152,9 +230,17 @@ msgstr ""
msgid "messageid"
msgstr "message id"
msgctxt "Email"
msgid "messageid"
msgstr "message id"
msgid "oneline"
msgstr "one line"
msgctxt "EmailPart"
msgid "ordernum"
msgstr "order"
msgid "out of context"
msgstr ""
......@@ -164,8 +250,16 @@ msgstr ""
msgid "parts"
msgstr ""
msgctxt "Email"
msgid "parts"
msgstr ""
msgctxt "EmailPart"
msgid "parts_object"
msgstr "parts"
msgstr "part of"
msgid "parts_object"
msgstr "part of"
msgid "raw headers"
msgstr ""
......@@ -173,38 +267,62 @@ msgstr ""
msgid "recipients"
msgstr ""
msgid "recipients_object"
msgstr "recipients of"
msgctxt "Email"
msgid "recipients"
msgstr ""
msgid "remove this Email"
msgstr "remove this email"
msgctxt "EmailAddress"
msgid "recipients_object"
msgstr "recipient of"
msgid "remove this EmailPart"
msgstr "remove this email part"
msgid "recipients_object"
msgstr "recipient of"
msgid "remove this EmailThread"
msgstr "remove this email thread"
msgid "reply_to"
msgstr "in reply to"
msgctxt "Email"
msgid "reply_to"
msgstr "is a reply to"
msgstr "in reply to"
msgctxt "Email"
msgid "reply_to_object"
msgstr "has reply"
msgstr "reply"
msgid "reply_to_object"
msgstr "reply"
msgctxt "EmailThread"
msgid "see_also"
msgstr "see also"
msgid "sender"
msgstr ""
msgctxt "Email"
msgid "sender"
msgstr ""
msgctxt "EmailAddress"
msgid "sender_object"
msgstr "sender of"
msgstr "has sent"
msgid "sender_object"
msgstr "has sent"
msgid "subject"
msgstr ""
msgctxt "Email"
msgid "subject"
msgstr ""
msgid "thread view"
msgstr ""
msgid "unknown sender"
msgctxt "EmailThread"
msgid "title"
msgstr ""
#~ msgid "see_also"
#~ msgstr "see also"
msgid "unknown sender"
msgstr ""
......@@ -11,6 +11,12 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "CC"
msgstr "CC"
msgid "Date"
msgstr "Date"
# schema pot file, generated on 2007-08-30 18:07:26
#
# singular and plural forms for each entity type
......@@ -32,6 +38,9 @@ msgstr "Enfilades"
msgid "Email_plural"
msgstr "Courriels"
msgid "From"
msgstr "De"
msgid "New Email"
msgstr "Nouveau courriel"
......@@ -41,6 +50,9 @@ msgstr "Nouveau contenu de courriel"
msgid "New EmailThread"
msgstr "Nouvelle enfilade"
msgid "Subject"
msgstr "Sujet"
msgid "This Email"
msgstr "Ce courriel"
......@@ -50,6 +62,9 @@ msgstr "Ce contenu de courriel"
msgid "This EmailThread"
msgstr "Cette enfilade"
msgid "To"
msgstr "À"
msgid "UTC time on which the mail was sent"
msgstr "date (UTC) à laquelle le courriel a été envoyé"
......@@ -63,41 +78,68 @@ msgstr "contenu"
msgid "add EmailThread forked_from EmailThread object"
msgstr "branche"
msgid "add a Email"
msgstr "ajouter un courriel"
msgid "add a EmailPart"
msgstr "ajouter un contenu de courriel"
msgid "add a EmailThread"
msgstr "ajouter une enfilade"
# subject and object forms for each relation type
# (no object form for final relation types)
msgid "alternative"
msgstr "alternative"
msgctxt "EmailPart"
msgid "alternative"
msgstr "alternative"
msgid "an email attachment"
msgstr "attachement d'un courriel"
msgid "attachment"
msgstr "pièce jointe"
msgctxt "Email"
msgid "attachment"
msgstr "pièce jointe"
msgctxt "File"
msgid "attachment_object"
msgstr "pièce jointe"
msgid "attachment_object"
msgstr "pièce jointe de"
msgid "cc"
msgstr "cc"
msgctxt "Email"
msgid "cc"
msgstr "cc"
msgctxt "EmailAddress"
msgid "cc_object"
msgstr "cc"
msgid "cc_object"
msgstr "cc"
msgid "cites"
msgstr "cite"
msgctxt "Email"
msgid "cites"
msgstr "cite"
msgctxt "Email"
msgid "cites_object"
msgstr "cité par"
msgid "cites_object"
msgstr "cité par"
msgctxt "EmailPart"
msgid "content"
msgstr "corps"
msgctxt "EmailPart"
msgid "content_format"
msgstr "format"
msgid "creating EmailPart (Email %(linkto)s parts EmailPart)"
msgstr "création d'un contenu pour le courriel %(linkto)s"
......@@ -110,6 +152,10 @@ msgstr "création d'une pièce jointe au courriel %(linkto)s"
msgid "date"
msgstr "date"
msgctxt "Email"
msgid "date"
msgstr "date"
msgid "discussion thread"
msgstr "enfilade"
......@@ -126,23 +172,55 @@ msgid "email_to"
msgstr "destinataire"
msgid "forked_from"
msgstr "branche dee"
msgstr "branche de"
msgctxt "EmailThread"
msgid "forked_from"
msgstr "branche de"
msgctxt "EmailThread"
msgid "forked_from_object"
msgstr "a pour branches"
msgid "forked_from_object"
msgstr "a pour branches "
msgstr "a pour branches"
msgid "generated_by"
msgstr "généré par"
msgctxt "Comment"
msgid "generated_by"
msgstr "généré par"
msgctxt "TrInfo"
msgid "generated_by"
msgstr "généré par"
msgctxt "Email"
msgid "generated_by_object"
msgstr "a généré"
msgid "generated_by_object"
msgstr "a généré"
msgid "headers"
msgstr "en-têtes"
msgctxt "Email"
msgid "headers"
msgstr "en-têtes"
msgid "in_thread"
msgstr "dans l'enfilade"
msgctxt "Email"
msgid "in_thread"
msgstr "dans l'enfilade"
msgctxt "EmailThread"
msgid "in_thread_object"
msgstr "contient"
msgid "in_thread_object"
msgstr "contient"
......@@ -152,9 +230,17 @@ msgstr "indique qu'une entité a été généré par un courriel"
msgid "messageid"
msgstr "identifiant"
msgctxt "Email"
msgid "messageid"
msgstr "identifiant"
msgid "oneline"
msgstr "une ligne"
msgctxt "EmailPart"
msgid "ordernum"
msgstr "ordre"
msgid "out of context"
msgstr "hors du contexte"
......@@ -164,6 +250,14 @@ msgstr "contenu"
msgid "parts"
msgstr "contient"
msgctxt "Email"
msgid "parts"
msgstr "parties"
msgctxt "EmailPart"
msgid "parts_object"
msgstr "contenu de"
msgid "parts_object"
msgstr "contenu de"
......@@ -173,44 +267,62 @@ msgstr "en-têtes bruts"
msgid "recipients"
msgstr "destinataires"
msgctxt "Email"
msgid "recipients"
msgstr "destinataires"
msgctxt "EmailAddress"
msgid "recipients_object"
msgstr "destinataires de"
msgid "remove this Email"
msgstr "effacer ce courriel"
msgid "remove this EmailPart"
msgstr "effacer ce contenu de courriel"
msgid "recipients_object"
msgstr "destinataires de"
msgid "remove this EmailThread"
msgstr "effacer cette enfilade"
msgid "reply_to"
msgstr "en réponse à"
msgctxt "Email"
msgid "reply_to"
msgstr "en réponse à"
msgctxt "Email"
msgid "reply_to_object"
msgstr "a pour réponse"
msgid "reply_to_object"
msgstr "a pour réponse"