From: Benoît Pin Date: Tue, 4 Mar 2014 15:09:01 +0000 (+0100) Subject: Le dico « methods » qu'on pouvait mettre dans le __init__.py d'un produit n'est plus... X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/commitdiff_plain/d5614bb2e741e23c6afdc8da23aa33d2531f22a5?ds=sidebyside;hp=8f40b26abe44b2589a48b70865a1d4260f041ed4 Le dico « methods » qu'on pouvait mettre dans le __init__.py d'un produit n'est plus supporté (en même temps, ça fait des années qu'ils prévenaient…). Ça rendait inopérant les fonctions de copier / coller. --- diff --git a/__init__.py b/__init__.py index df0ca9b..c7ca0e6 100755 --- a/__init__.py +++ b/__init__.py @@ -38,7 +38,6 @@ import GroupDataTool import RegistrationTool import CalendarTool import AttachmentTool -#from shutdown_dispatcher import ZopeShutdownDispatcher from PloneMisc import IndexIterator, Batch from utils import getCPInfo, popCP @@ -61,13 +60,6 @@ tools = ( MembershipTool.MembershipTool , AttachmentTool.AttachmentTool ) -methods = { -'getCPInfo': getCPInfo, -'getCPInfo__roles__': None, -'popCP' : popCP, -'popCP__roles__' : None -} - # register font extensions registerFileExtension('ttf', FSFile) registerFileExtension('eot', FSFile) @@ -78,8 +70,6 @@ def initialize(registrar) : allow_module('Products.Plinn.PloneMisc') allow_class(IndexIterator) allow_class(Batch) - app = registrar._ProductContext__app - #ZopeShutdownDispatcher(registrar._ProductContext__app) core_cmf_utils.ContentInit( 'Plinn', diff --git a/locales/en/LC_MESSAGES/plinn.mo b/locales/en/LC_MESSAGES/plinn.mo index 1dd78a1..59a3513 100644 Binary files a/locales/en/LC_MESSAGES/plinn.mo and b/locales/en/LC_MESSAGES/plinn.mo differ diff --git a/locales/en/LC_MESSAGES/plinn.po b/locales/en/LC_MESSAGES/plinn.po index df0b49d..a54f656 100644 --- a/locales/en/LC_MESSAGES/plinn.po +++ b/locales/en/LC_MESSAGES/plinn.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plinn 2.0\n" -"POT-Creation-Date: Sun Jan 19 10:49:52 2014\n" +"POT-Creation-Date: Tue Mar 4 15:13:49 2014\n" "PO-Revision-Date: 2013-11-28 13:12+0100\n" "Last-Translator: Benoît PIN\n" "Language-Team: CRI http://cri.ensmp.fr\n" @@ -262,7 +262,7 @@ msgstr "" #: n/skins/custom_content/event_edit_template.pt:78 #: n/skins/custom_content/event_edit_template.pt:103 -#: n/skins/generic/widgets.pt:94 +#: n/skins/generic/widgets.pt:96 msgid "" "${month} / ${day} / ${year}  ${hour} :" " ${minute}" @@ -586,11 +586,6 @@ msgstr "" msgid "Request made by IP ${ip} at ${time}" msgstr "" -#: n/skins/custom_generic/main_template_standard.pt:96 -#: n/skins/photo_theme/main_template_standard.pt:97 -msgid "Skip to content" -msgstr "" - #: n/skins/custom_generic/main_template_standard.pt:111 #: n/skins/custom_generic/talkback_tree.pt:63 #: n/skins/generic/main_template_ajax.pt:12 @@ -1071,21 +1066,21 @@ msgstr "" msgid "locale_date_fmt" msgstr "" -#: n/skins/generic/main_template_macros.pt:78 +#: n/skins/generic/main_template_macros.pt:80 #: n/skins/photo_theme/main_template_macros.pt:91 msgid "You are here:" msgstr "" -#: n/skins/generic/main_template_macros.pt:91 -#: n/skins/generic/main_template_macros.pt:94 -#: n/skins/generic/main_template_macros.pt:112 -#: n/skins/generic/main_template_macros.pt:113 +#: n/skins/generic/main_template_macros.pt:93 +#: n/skins/generic/main_template_macros.pt:96 +#: n/skins/generic/main_template_macros.pt:114 +#: n/skins/generic/main_template_macros.pt:115 #: n/skins/photo_theme/main_template_macros.pt:100 #: n/skins/photo_theme/main_template_macros.pt:113 msgid "Paste" msgstr "" -#: n/skins/generic/main_template_macros.pt:109 +#: n/skins/generic/main_template_macros.pt:111 #: n/skins/photo_theme/main_template_macros.pt:110 msgid "Exit boxes editing" msgstr "" @@ -1146,7 +1141,7 @@ msgstr "" msgid "Register" msgstr "" -#: n/skins/generic/recent_news.pt:21 n/skins/generic/widgets.pt:123 +#: n/skins/generic/recent_news.pt:21 n/skins/generic/widgets.pt:125 msgid "News" msgstr "" @@ -1341,11 +1336,19 @@ msgstr "" msgid "Edit metadata" msgstr "" -#: n/skins/generic/widgets.pt:53 +#: n/skins/generic/widgets.pt:57 msgid "Clipboard" msgstr "" -#: n/skins/generic/widgets.pt:128 +#: n/skins/generic/widgets.pt:63 +msgid "Delete" +msgstr "" + +#: n/skins/generic/widgets.pt:64 +msgid "Empty" +msgstr "" + +#: n/skins/generic/widgets.pt:130 msgid "News Item" msgstr "" @@ -1357,6 +1360,10 @@ msgstr "" msgid "Loading progress..." msgstr "" +#: n/skins/photo_theme/main_template_standard.pt:97 +msgid "Skip to content" +msgstr "" + #: n/skins/photo_theme/realis_main_macros.pt:28 msgid "Join" msgstr "" @@ -1626,9 +1633,6 @@ msgstr "" msgid "December_abbr" msgstr "Dec" -msgid "Delete" -msgstr "" - msgid "depublish" msgstr "" diff --git a/locales/fr/LC_MESSAGES/plinn.mo b/locales/fr/LC_MESSAGES/plinn.mo index 8ed1dc2..3a9c855 100644 Binary files a/locales/fr/LC_MESSAGES/plinn.mo and b/locales/fr/LC_MESSAGES/plinn.mo differ diff --git a/locales/fr/LC_MESSAGES/plinn.po b/locales/fr/LC_MESSAGES/plinn.po index fe1b82d..d08315b 100755 --- a/locales/fr/LC_MESSAGES/plinn.po +++ b/locales/fr/LC_MESSAGES/plinn.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plinn 2.0\n" -"POT-Creation-Date: Sun Jan 19 10:49:52 2014\n" +"POT-Creation-Date: Tue Mar 4 15:13:49 2014\n" "PO-Revision-Date: 2014-01-19 10:51+0100\n" "Last-Translator: Benoît PIN\n" "Language-Team: CRI http://cri.ensmp.fr\n" @@ -68,8 +68,9 @@ msgid "" "the community.\n" msgstr "" "\n" -"Vous venez d'être inscrit en tant que membre du portail « %(portal_title)" -"s », ce qui vous permet de participer à la rédaction des contenus.\n" +"Vous venez d'être inscrit en tant que membre du portail " +"« %(portal_title)s », ce qui vous permet de participer à la rédaction des " +"contenus.\n" #: n/profiles/default/workflows/member_workflow/scripts/sendNotificationEmail.py:43 #: n/profiles/photo/workflows/member_workflow/scripts/sendNotificationEmail.py:43 @@ -269,7 +270,7 @@ msgstr "Début" #: n/skins/custom_content/event_edit_template.pt:78 #: n/skins/custom_content/event_edit_template.pt:103 -#: n/skins/generic/widgets.pt:94 +#: n/skins/generic/widgets.pt:96 msgid "" "${month} / ${day} / ${year}  ${hour} :" " ${minute}" @@ -616,11 +617,6 @@ msgstr "%d/%m/%Y à %H:%M:%S" msgid "Request made by IP ${ip} at ${time}" msgstr "Requête faîte par l'IP ${ip} à ${time}" -#: n/skins/custom_generic/main_template_standard.pt:96 -#: n/skins/photo_theme/main_template_standard.pt:97 -msgid "Skip to content" -msgstr "Sauter au contenu" - #: n/skins/custom_generic/main_template_standard.pt:111 #: n/skins/custom_generic/talkback_tree.pt:63 #: n/skins/generic/main_template_ajax.pt:12 @@ -1122,21 +1118,21 @@ msgstr "Aucun groupe ne dispose du rôle de ${role} dans ce dossier" msgid "locale_date_fmt" msgstr "%d/%m/%Y %Hh%M" -#: n/skins/generic/main_template_macros.pt:78 +#: n/skins/generic/main_template_macros.pt:80 #: n/skins/photo_theme/main_template_macros.pt:91 msgid "You are here:" msgstr "Vous êtes ici :" -#: n/skins/generic/main_template_macros.pt:91 -#: n/skins/generic/main_template_macros.pt:94 -#: n/skins/generic/main_template_macros.pt:112 -#: n/skins/generic/main_template_macros.pt:113 +#: n/skins/generic/main_template_macros.pt:93 +#: n/skins/generic/main_template_macros.pt:96 +#: n/skins/generic/main_template_macros.pt:114 +#: n/skins/generic/main_template_macros.pt:115 #: n/skins/photo_theme/main_template_macros.pt:100 #: n/skins/photo_theme/main_template_macros.pt:113 msgid "Paste" msgstr "Coller" -#: n/skins/generic/main_template_macros.pt:109 +#: n/skins/generic/main_template_macros.pt:111 #: n/skins/photo_theme/main_template_macros.pt:110 msgid "Exit boxes editing" msgstr "Quitter l'édition des boîtes" @@ -1203,7 +1199,7 @@ msgstr "E-mail" msgid "Register" msgstr "Inscrire" -#: n/skins/generic/recent_news.pt:21 n/skins/generic/widgets.pt:123 +#: n/skins/generic/recent_news.pt:21 n/skins/generic/widgets.pt:125 msgid "News" msgstr "Actualités" @@ -1272,7 +1268,10 @@ msgstr "Réinitialisation de mot de passe" msgid "" "Enter your email or your username below and click on the \"Send\" button. " "You will receive an email with a link to reset your password." -msgstr "Entrez votre email ou votre login ci-dessous et cliquez sur « Envoyer ». Vous recevrez un email contenant un lien pour réinitialiser votre mot de passe." +msgstr "" +"Entrez votre email ou votre login ci-dessous et cliquez sur « Envoyer ». " +"Vous recevrez un email contenant un lien pour réinitialiser votre mot de " +"passe." #: n/skins/generic/request_password_reset_template.pt:19 msgid "" @@ -1407,11 +1406,19 @@ msgstr "(pas d'e-mail envoyé)" msgid "Edit metadata" msgstr "Éditer les métadonnées" -#: n/skins/generic/widgets.pt:53 +#: n/skins/generic/widgets.pt:57 msgid "Clipboard" msgstr "Presse-papier" -#: n/skins/generic/widgets.pt:128 +#: n/skins/generic/widgets.pt:63 +msgid "Delete" +msgstr "Supprimer" + +#: n/skins/generic/widgets.pt:64 +msgid "Empty" +msgstr "Vider" + +#: n/skins/generic/widgets.pt:130 msgid "News Item" msgstr "Actualité" @@ -1423,6 +1430,10 @@ msgstr "Vous avez été déconnecté." msgid "Loading progress..." msgstr "Chargement en cours..." +#: n/skins/photo_theme/main_template_standard.pt:97 +msgid "Skip to content" +msgstr "Sauter au contenu" + #: n/skins/photo_theme/realis_main_macros.pt:28 msgid "Join" msgstr "S'inscrire" @@ -1691,9 +1702,6 @@ msgstr "Décembre" msgid "December_abbr" msgstr "Déc" -msgid "Delete" -msgstr "Supprimer" - msgid "depublish" msgstr "dépublier" diff --git a/locales/plinn-manual.pot b/locales/plinn-manual.pot index 04db2bf..8a37572 100644 --- a/locales/plinn-manual.pot +++ b/locales/plinn-manual.pot @@ -240,9 +240,6 @@ msgstr "" msgid "December_abbr" msgstr "" -msgid "Delete" -msgstr "" - msgid "depublish" msgstr "" diff --git a/locales/plinn.pot b/locales/plinn.pot index 6a60223..2ec43c2 100644 --- a/locales/plinn.pot +++ b/locales/plinn.pot @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: 2.0 beta 1\n" -"POT-Creation-Date: Sun Jan 19 10:49:52 2014\n" +"POT-Creation-Date: Tue Mar 4 15:14:36 2014\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Zope 3 Developers \n" @@ -274,7 +274,7 @@ msgstr "" #: n/skins/custom_content/event_edit_template.pt:78 #: n/skins/custom_content/event_edit_template.pt:103 -#: n/skins/generic/widgets.pt:94 +#: n/skins/generic/widgets.pt:96 msgid "${month} / ${day} / ${year}  ${hour} : ${minute}" msgstr "" @@ -585,11 +585,6 @@ msgstr "" msgid "Request made by IP ${ip} at ${time}" msgstr "" -#: n/skins/custom_generic/main_template_standard.pt:96 -#: n/skins/photo_theme/main_template_standard.pt:97 -msgid "Skip to content" -msgstr "" - #: n/skins/custom_generic/main_template_standard.pt:111 #: n/skins/custom_generic/talkback_tree.pt:63 #: n/skins/generic/main_template_ajax.pt:12 @@ -1081,15 +1076,15 @@ msgstr "" msgid "locale_date_fmt" msgstr "" -#: n/skins/generic/main_template_macros.pt:78 +#: n/skins/generic/main_template_macros.pt:80 #: n/skins/photo_theme/main_template_macros.pt:91 msgid "You are here:" msgstr "" -#: n/skins/generic/main_template_macros.pt:91 -#: n/skins/generic/main_template_macros.pt:94 -#: n/skins/generic/main_template_macros.pt:112 -#: n/skins/generic/main_template_macros.pt:113 +#: n/skins/generic/main_template_macros.pt:93 +#: n/skins/generic/main_template_macros.pt:96 +#: n/skins/generic/main_template_macros.pt:114 +#: n/skins/generic/main_template_macros.pt:115 #: n/skins/photo_theme/main_template_macros.pt:100 #: n/skins/photo_theme/main_template_macros.pt:100 #: n/skins/photo_theme/main_template_macros.pt:113 @@ -1097,7 +1092,7 @@ msgstr "" msgid "Paste" msgstr "" -#: n/skins/generic/main_template_macros.pt:109 +#: n/skins/generic/main_template_macros.pt:111 #: n/skins/photo_theme/main_template_macros.pt:110 msgid "Exit boxes editing" msgstr "" @@ -1155,7 +1150,7 @@ msgid "Register" msgstr "" #: n/skins/generic/recent_news.pt:21 -#: n/skins/generic/widgets.pt:123 +#: n/skins/generic/widgets.pt:125 msgid "News" msgstr "" @@ -1345,11 +1340,19 @@ msgstr "" msgid "Edit metadata" msgstr "" -#: n/skins/generic/widgets.pt:53 +#: n/skins/generic/widgets.pt:57 msgid "Clipboard" msgstr "" -#: n/skins/generic/widgets.pt:128 +#: n/skins/generic/widgets.pt:63 +msgid "Delete" +msgstr "" + +#: n/skins/generic/widgets.pt:64 +msgid "Empty" +msgstr "" + +#: n/skins/generic/widgets.pt:130 msgid "News Item" msgstr "" @@ -1361,6 +1364,10 @@ msgstr "" msgid "Loading progress..." msgstr "" +#: n/skins/photo_theme/main_template_standard.pt:97 +msgid "Skip to content" +msgstr "" + #: n/skins/photo_theme/realis_main_macros.pt:28 msgid "Join" msgstr "" @@ -1631,9 +1638,6 @@ msgstr "" msgid "December_abbr" msgstr "" -msgid "Delete" -msgstr "" - msgid "depublish" msgstr "" diff --git a/patch.py b/patch.py index 5f99887..ebc324f 100644 --- a/patch.py +++ b/patch.py @@ -10,6 +10,7 @@ from Products.CMFCore.permissions import ListFolderContents, View, ViewManagemen from Products.CMFCore.PortalFolder import PortalFolder as CMFPortalFolder from Folder import PlinnFolder +from utils import getCPInfo, popCP cmfPortalFolderSecurity = ClassSecurityInfo() @@ -25,6 +26,12 @@ CMFPortalFolder.listCatalogedContents = PlinnFolder.listCatalogedContents.im_fun cmfPortalFolderSecurity.declareProtected(AddPortalContent, 'put_upload') CMFPortalFolder.put_upload = PlinnFolder.put_upload.im_func +cmfPortalFolderSecurity.declarePublic('getCPInfo') +CMFPortalFolder.getCPInfo = getCPInfo + +cmfPortalFolderSecurity.declarePublic('getCP') +CMFPortalFolder.popCP = popCP + cmfPortalFolderSecurity.apply(CMFPortalFolder) diff --git a/skins/generic/widgets.pt b/skins/generic/widgets.pt index d87ea31..83eb628 100644 --- a/skins/generic/widgets.pt +++ b/skins/generic/widgets.pt @@ -48,7 +48,11 @@ -
+
Clipboard
@@ -56,10 +60,8 @@ - + +