Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
email
Commits
2594244a05e2
Commit
7a783c86
authored
Apr 20, 2010
by
Sylvain Thénault
Browse files
backport stable
parents
a10e4468e6f2
c0dd5cd9c4b2
Changes
6
Hide whitespace changes
Inline
Side-by-side
.hgtags
View file @
2594244a
...
...
@@ -12,3 +12,5 @@ d464f813a405376ea3fae96b5abd277a213532b0 cubicweb-email-debian-version-1.6.0-1
bb7aa8c654a45f401d7755b003ac69a5603d8f76 oldstable
22ec2b47db4aff2a92b3038f7f6069eb9cf5936a cubicweb-email-version-1.7.0
688fc001f03e6a52674fee6d70abacf17575f5c0 cubicweb-email-debian-version-1.7.0-1
55d7bb281356fa4586068d9e7e04ede431e39b8c cubicweb-email-version-1.7.1
b3e659b9ed1448d584d04a0ec20d25c2647d1e46 cubicweb-email-debian-version-1.7.1-1
__pkginfo__.py
View file @
2594244a
...
...
@@ -4,12 +4,10 @@
modname
=
'email'
distname
=
"cubicweb-%s"
%
modname
numversion
=
(
1
,
7
,
0
)
numversion
=
(
1
,
7
,
1
)
version
=
'.'
.
join
(
str
(
num
)
for
num
in
numversion
)
license
=
'LGPL'
copyright
=
'''Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE).
http://www.logilab.fr/ -- mailto:contact@logilab.fr'''
author
=
"Logilab"
author_email
=
"contact@logilab.fr"
...
...
@@ -23,39 +21,47 @@ provides tools to import your mail box into a cubicweb instance.
Email are automatically stored into`EmailThreads`.
"""
from
os
import
listdir
from
os.path
import
join
# used packages
__depends__
=
{
'cubicweb'
:
'>= 3.6.0'
,
'cubicweb-file'
:
'>= 1.6.0'
}
__recommends__
=
{
'cubicweb-comment'
:
None
}
# XXX cw < 3.8 bw compat
__use__
=
(
'file'
,)
__recommend__
=
(
'comment'
,)
classifiers
=
[
'Environment :: Web Environment'
,
'Framework :: CubicWeb'
,
'Programming Language :: Python'
,
'Programming Language :: JavaScript'
,
]
from
os
import
listdir
as
_listdir
from
os.path
import
join
,
isdir
from
glob
import
glob
def
listdir
(
dirpath
):
return
[
join
(
dirpath
,
fname
)
for
fname
in
_listdir
(
dirpath
)
if
fname
[
0
]
!=
'.'
and
not
fname
.
endswith
(
'.pyc'
)
and
not
fname
.
endswith
(
'~'
)]
CUBES_DIR
=
join
(
'share'
,
'cubicweb'
,
'cubes'
)
THIS_CUBE_DIR
=
join
(
CUBES_DIR
,
modname
)
try
:
data_files
=
[
[
join
(
CUBES_DIR
,
'email'
),
[
fname
for
fname
in
listdir
(
'.'
)
if
fname
.
endswith
(
'.py'
)
and
fname
!=
'setup.py'
]],
[
join
(
CUBES_DIR
,
'email'
,
'views'
),
[
join
(
'views'
,
fname
)
for
fname
in
listdir
(
'views'
)
if
not
fname
.
endswith
(
'.pyc'
)]],
#[join(CUBES_DIR, 'email', 'data'),
# [join('data', fname) for fname in listdir('data')]],
[
join
(
CUBES_DIR
,
'email'
,
'i18n'
),
[
join
(
'i18n'
,
fname
)
for
fname
in
listdir
(
'i18n'
)]],
[
join
(
CUBES_DIR
,
'email'
,
'migration'
),
[
join
(
'migration'
,
fname
)
for
fname
in
listdir
(
'migration'
)]],
# common files
[
THIS_CUBE_DIR
,
[
fname
for
fname
in
glob
(
'*.py'
)
if
fname
!=
'setup.py'
]],
]
# check for possible extended cube layout
for
dirname
in
(
'entities'
,
'views'
,
'sobjects'
,
'hooks'
,
'schema'
,
'data'
,
'i18n'
,
'migration'
):
if
isdir
(
dirname
):
data_files
.
append
([
join
(
THIS_CUBE_DIR
,
dirname
),
listdir
(
dirname
)])
# Note: here, you'll need to add subdirectories if you want
# them to be included in the debian package
except
OSError
:
# we are in an installed directory
pass
# used packages
__depends_cubes__
=
{
'file'
:
'>= 1.6.0'
,}
__use__
=
tuple
(
__depends_cubes__
)
__depends__
=
{
'cubicweb'
:
'>= 3.6.0'
}
for
key
,
value
in
__depends_cubes__
.
items
():
__depends__
[
'cubicweb-'
+
key
]
=
value
__recommend__
=
(
'comment'
,)
classifiers
=
[
'Environment :: Web Environment'
,
'Framework :: CubicWeb'
,
'Programming Language :: Python'
,
'Programming Language :: JavaScript'
,
]
ccplugin.py
View file @
2594244a
...
...
@@ -40,7 +40,7 @@ class MBOXImportCommand(Command):
"""run the command with its specific arguments"""
appid
=
pop_arg
(
args
,
expected_size_after
=
None
)
cnx
=
config_connect
(
appid
,
self
.
config
)
cnx
.
load_
v
objects
(
cubes
=
None
,
subpath
=
(
'entities'
,))
cnx
.
load_
app
objects
(
cubes
=
None
,
subpath
=
(
'entities'
,))
importer
=
MBOXImporter
(
cnx
,
verbose
=
True
,
interactive
=
self
.
config
.
interactive
)
# set autocommit, add an option to control that if needed
...
...
debian/changelog
View file @
2594244a
cubicweb-email (1.7.1-1) unstable; urgency=low
* new upstream release
-- Sylvain Thénault <sylvain.thenault@logilab.fr> Tue, 20 Apr 2010 12:35:40 +0200
cubicweb-email (1.7.0-1) unstable; urgency=low
* new upstream release
...
...
test/unittest_hooks.py
View file @
2594244a
...
...
@@ -5,7 +5,7 @@ from StringIO import StringIO
from
logilab.common.testlib
import
unittest_main
from
cubicweb.devtools.testlib
import
CubicWebTC
from
cubicweb.
common.
mail
import
construct_message_id
from
cubicweb.mail
import
construct_message_id
MSG
=
u
'''From sthenault@free.fr Tue Jan 23 15:21:10 2007
Return-Path: <sthenault@free.fr>
...
...
views/__init__.py
View file @
2594244a
from
cubicweb.web
import
uicfg
uicfg
.
primaryview_section
.
tag_object_of
((
'Email'
,
'in_thread'
,
'EmailThread'
),
'hidden'
)
uicfg
.
autoform_section
.
tag_subject_of
((
'*'
,
'generated_by'
,
'Email'
),
'main'
,
'hidden'
)
_pvs
=
uicfg
.
primaryview_section
_pvs
.
tag_object_of
((
'Email'
,
'in_thread'
,
'EmailThread'
),
'hidden'
)
# XXX fix cw.web.views.emailaddress.EmailAddressPrimaryView view
# using proper view and uicfg config
_pvs
.
tag_object_of
((
'*'
,
'sender'
,
'EmailAddress'
),
'hidden'
)
_pvs
.
tag_object_of
((
'*'
,
'recipients'
,
'EmailAddress'
),
'hidden'
)
_pvs
.
tag_object_of
((
'*'
,
'cc'
,
'EmailAddress'
),
'hidden'
)
_afs
=
uicfg
.
autoform_section
_afs
.
tag_object_of
((
'*'
,
'sender'
,
'EmailAddress'
),
'main'
,
'hidden'
)
_afs
.
tag_object_of
((
'*'
,
'recipients'
,
'EmailAddress'
),
'main'
,
'hidden'
)
_afs
.
tag_object_of
((
'*'
,
'cc'
,
'EmailAddress'
),
'main'
,
'hidden'
)
_afs
.
tag_subject_of
((
'*'
,
'generated_by'
,
'Email'
),
'main'
,
'hidden'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment