11from Products .CMFCore .utils import getToolByName
22from Products .CMFPlone import PloneMessageFactory as _
33from Products .CMFPlone .interfaces import INonInstallable
4- from Products .CMFQuickInstallerTool .interfaces import INonInstallable as \
5- QINonInstallable
64from Products .Five .browser import BrowserView
75from Products .GenericSetup import EXTENSION
86from Products .GenericSetup .tool import UNKNOWN
1210import logging
1311import pkg_resources
1412import transaction
15- import warnings
13+
1614
1715logger = logging .getLogger ('Plone' )
1816
@@ -26,18 +24,6 @@ def __init__(self, *args, **kwargs):
2624 self .ps = getToolByName (self .context , 'portal_setup' )
2725 self .errors = {}
2826
29- def listInstallableProducts (self , skipInstalled = True ):
30- warnings .warn (
31- 'listInstallableProducts is no longer supported since Plone 5.1. '
32- 'It will be removed in Plone 6.0.' ,
33- DeprecationWarning )
34-
35- def listInstalledProducts (self , skipInstalled = True ):
36- warnings .warn (
37- 'listInstalledProducts is no longer supported since Plone 5.1. '
38- 'It will be removed in Plone 6.0.' ,
39- DeprecationWarning )
40-
4127 def is_profile_installed (self , profile_id ):
4228 return self .ps .getLastVersionForProfile (profile_id ) != UNKNOWN
4329
@@ -47,25 +33,8 @@ def is_product_installed(self, product_id):
4733 return False
4834 return self .is_profile_installed (profile ['id' ])
4935
50- def isProductInstalled (self , product_name ):
51- warnings .warn (
52- 'isProductInstalled is deprecated since Plone 5.1. '
53- 'It will be removed in Plone 6.0. '
54- 'Use is_product_installed instead.' ,
55- DeprecationWarning )
56- return self .is_product_installed (product_name )
57-
58- def notifyInstalled (self , productname , ** kwargs ):
59- warnings .warn (
60- 'notifyInstalled is no longer supported since Plone 5.1. '
61- 'It will be removed in Plone 6.0.' ,
62- DeprecationWarning )
63-
6436 def _install_profile_info (self , product_id ):
6537 """List extension profile infos of a given product.
66-
67- From CMFQuickInstallerTool/QuickInstallerTool.py
68- _install_profile_info
6938 """
7039 profiles = self .ps .listProfileInfo ()
7140 # We are only interested in extension profiles for the product.
@@ -82,9 +51,6 @@ def _install_profile_info(self, product_id):
8251 def get_install_profiles (self , product_id ):
8352 """List all installer profile ids of the given name.
8453
85- From CMFQuickInstallerTool/QuickInstallerTool.py
86- getInstallProfiles
87-
8854 TODO Might be superfluous.
8955 """
9056 return [prof ['id' ] for prof in self ._install_profile_info (product_id )]
@@ -153,9 +119,6 @@ def _get_profile(self, product_id, name, strict=True, allow_hidden=False):
153119 def get_install_profile (self , product_id , allow_hidden = False ):
154120 """Return the default install profile.
155121
156- From CMFQuickInstallerTool/QuickInstallerTool.py
157- getInstallProfile
158-
159122 :param product_id: id of product/package
160123 :type product_id: string
161124 :param allow_hidden: Allow getting otherwise hidden profile.
@@ -177,28 +140,9 @@ def get_uninstall_profile(self, product_id):
177140 return self ._get_profile (
178141 product_id , 'uninstall' , strict = True , allow_hidden = True )
179142
180- def isProductInstallable (self , productname ):
181- warnings .warn (
182- 'isProductInstallable is deprecated since Plone 5.1. '
183- 'It will be removed in Plone 6.0. '
184- 'Use is_product_installable instead.' ,
185- DeprecationWarning )
186- return self .is_product_installable (productname )
187-
188- def isProductAvailable (self , productname ):
189- warnings .warn (
190- 'isProductAvailable is deprecated since Plone 5.1. '
191- 'It will be removed in Plone 6.0. '
192- 'Use is_product_installable instead.' ,
193- DeprecationWarning )
194- return self .is_product_installable (productname )
195-
196143 def is_product_installable (self , product_id , allow_hidden = False ):
197144 """Does a product have an installation profile?
198145
199- From CMFQuickInstallerTool/QuickInstallerTool.py
200- isProductInstallable (and the deprecated isProductAvailable)
201-
202146 :param allow_hidden: Allow installing otherwise hidden products.
203147 In the UI this will be False, but you can set it to True in
204148 for example a call from plone.app.upgrade where you want to
@@ -217,14 +161,6 @@ def is_product_installable(self, product_id, allow_hidden=False):
217161 not_installable .extend (gnip ())
218162 if product_id in not_installable :
219163 return False
220- # BBB. For backwards compatibility, we try the INonInstallable
221- # from the old QI as well.
222- not_installable = []
223- utils = getAllUtilitiesRegisteredFor (QINonInstallable )
224- for util in utils :
225- not_installable .extend (util .getNonInstallableProducts ())
226- if product_id in not_installable :
227- return False
228164
229165 profile = self .get_install_profile (
230166 product_id , allow_hidden = allow_hidden )
@@ -271,31 +207,8 @@ def is_product_installable(self, product_id, allow_hidden=False):
271207 return False
272208 return True
273209
274- def getProductFile (self , productname , fname = 'readme.txt' ):
275- warnings .warn (
276- 'getProductFile is no longer supported since Plone 5.1. '
277- 'It will be removed in Plone 6.0.' ,
278- DeprecationWarning )
279-
280- def getProductReadme (self , productname ):
281- warnings .warn (
282- 'getProductReadme is no longer supported since Plone 5.1. '
283- 'It will be removed in Plone 6.0.' ,
284- DeprecationWarning )
285-
286- def getProductVersion (self , productname ):
287- warnings .warn (
288- 'getProductVersion is deprecated since Plone 5.1. '
289- 'It will be removed in Plone 6.0. '
290- 'Use get_product_version instead.' ,
291- DeprecationWarning )
292-
293210 def get_product_version (self , product_id ):
294211 """Return the version of the product (package).
295-
296- From CMFQuickInstallerTool/QuickInstallerTool
297- getProductVersion
298- That implementation used to fall back to getting the version.txt.
299212 """
300213 try :
301214 dist = pkg_resources .get_distribution (product_id )
@@ -311,8 +224,6 @@ def get_latest_upgrade_step(self, profile_id):
311224
312225 If anything errors out then go back to "old way" by returning
313226 'unknown'.
314-
315- From CMFPlone/QuickInstallerTool.py getLatestUpgradeStep
316227 """
317228 profile_version = UNKNOWN
318229 try :
@@ -331,8 +242,6 @@ def upgrade_info(self, product_id):
331242 This is a dict with among others two booleans values, stating if
332243 an upgrade is required and available.
333244
334- From CMFPlone/QuickInstaller.py upgradeInfo
335-
336245 :param product_id: id of product/package
337246 :type product_id: string
338247 :returns: dictionary with info about product
@@ -368,24 +277,6 @@ def upgrade_info(self, product_id):
368277 newVersion = profile_version ,
369278 )
370279
371- def reinstallProducts (self , products , ** kwargs ):
372- """Reinstalls a list of products, the main difference to
373- uninstall/install is that it does not remove portal objects
374- created during install (e.g. tools, etc.)
375- """
376- warnings .warn (
377- 'reinstallProducts is no longer supported since Plone 5.1. '
378- 'It will be removed in Plone 6.0.' ,
379- DeprecationWarning )
380-
381- def upgradeProduct (self , pid ):
382- warnings .warn (
383- 'upgradeProduct is deprecated since Plone 5.1. '
384- 'It will be removed in Plone 6.0. '
385- 'Use upgrade_product instead.' ,
386- DeprecationWarning )
387- return self .upgrade_product (pid )
388-
389280 def upgrade_product (self , product_id ):
390281 """Run the upgrade steps for a product.
391282
@@ -398,34 +289,9 @@ def upgrade_product(self, product_id):
398289 self .ps .upgradeProfile (profile ['id' ])
399290 return True
400291
401- def installProducts (self , products = None , ** kwargs ):
402- warnings .warn (
403- 'installProducts is deprecated since Plone 5.1. '
404- 'It will be removed in Plone 6.0. '
405- 'Use install_product with a single product instead. '
406- 'All keyword arguments are ignored.' ,
407- DeprecationWarning )
408- if products is None :
409- products = []
410- for product_id in products :
411- self .install_product (product_id )
412-
413- def installProduct (self , product_name , ** kwargs ):
414- """Deprecated install product.
415- """
416- warnings .warn (
417- 'installProduct is deprecated since Plone 5.1. '
418- 'It will be removed in Plone 6.0. '
419- 'Use install_product instead. '
420- 'All keyword arguments are ignored.' ,
421- DeprecationWarning )
422- return self .install_product (product_name )
423-
424292 def install_product (self , product_id , allow_hidden = False ):
425293 """Install a product by name.
426294
427- From CMFQuickInstallerTool/QuickInstallerTool.py installProduct
428-
429295 :param product_id: id of product/package
430296 :type product_id: string
431297 :param allow_hidden: Allow installing otherwise hidden products.
@@ -461,20 +327,6 @@ def install_product(self, product_id, allow_hidden=False):
461327 # No problems encountered.
462328 return True
463329
464- def uninstallProducts (self , products = None , ** kwargs ):
465- """Uninstall a list of products.
466- """
467- warnings .warn (
468- 'uninstallProducts is deprecated since Plone 5.1. '
469- 'It will be removed in Plone 6.0. '
470- 'Use uninstall_product with a single product instead. '
471- 'All keyword arguments are ignored.' ,
472- DeprecationWarning )
473- if products is None :
474- products = []
475- for product_id in products :
476- self .uninstall_product (product_id )
477-
478330 def uninstall_product (self , product_id ):
479331 """Uninstall a product by name.
480332
@@ -592,8 +444,7 @@ def marshall_addons(self):
592444
593445 def get_addons (self , apply_filter = None , product_name = None ):
594446 """
595- 100% based on generic setup profiles now. Kinda.
596- For products magic, use the zope quickinstaller I guess.
447+ 100% based on generic setup profiles now.
597448
598449 @filter:= 'installed': only products that are installed and not hidden
599450 'upgrades': only products with upgrades
0 commit comments