71
71
"error" unicode, # NULL | broken | incompatible | dependent
72
72
"error_details" unicode, # error description
73
73
"experimental" boolean, # true if experimental, false if stable
74
+ "deprecated" boolean, # true if deprected, false if actual
74
75
"version_available" unicode, # available version
75
76
"zip_repository" unicode, # the remote repository id
76
77
"download_url" unicode, # url for downloading the plugin
@@ -403,6 +404,9 @@ def xmlDownloaded(self):
403
404
experimental = False
404
405
if pluginNodes .item (i ).firstChildElement ("experimental" ).text ().strip ().upper () in ["TRUE" ,"YES" ]:
405
406
experimental = True
407
+ deprecated = False
408
+ if pluginNodes .item (i ).firstChildElement ("deprecated" ).text ().strip ().upper () in ["TRUE" ,"YES" ]:
409
+ deprecated = True
406
410
icon = pluginNodes .item (i ).firstChildElement ("icon" ).text ().strip ()
407
411
if icon and not icon .startswith ("http" ):
408
412
icon = "http://%s/%s" % ( QUrl (self .mRepositories [reposName ]["url" ]).host () , icon )
@@ -427,6 +431,7 @@ def xmlDownloaded(self):
427
431
"rating_votes" : pluginNodes .item (i ).firstChildElement ("rating_votes" ).text ().strip (),
428
432
"icon" : icon ,
429
433
"experimental" : experimental ,
434
+ "deprecated" : deprecated ,
430
435
"filename" : fileName ,
431
436
"installed" : False ,
432
437
"available" : True ,
@@ -645,6 +650,7 @@ def pluginMetadata(fct):
645
650
"library" : path ,
646
651
"pythonic" : True ,
647
652
"experimental" : pluginMetadata ("experimental" ).strip ().upper () in ["TRUE" ,"YES" ],
653
+ "deprecated" : pluginMetadata ("deprecated" ).strip ().upper () in ["TRUE" ,"YES" ],
648
654
"version_available" : "" ,
649
655
"zip_repository" : "" ,
650
656
"download_url" : path , # warning: local path as url!
@@ -707,12 +713,14 @@ def rebuild(self):
707
713
self .mPlugins [i ] = self .localCache [i ].copy ()
708
714
settings = QSettings ()
709
715
allowExperimental = settings .value (settingsGroup + "/allowExperimental" , False , type = bool )
716
+ allowDeprecated = settings .value (settingsGroup + "/allowDeprecated" , False , type = bool )
710
717
for i in self .repoCache .values ():
711
718
for j in i :
712
719
plugin = j .copy () # do not update repoCache elements!
713
720
key = plugin ["id" ]
714
721
# check if the plugin is allowed and if there isn't any better one added already.
715
722
if (allowExperimental or not plugin ["experimental" ]) \
723
+ and (allowDeprecated or not plugin ["deprecated" ]) \
716
724
and not (self .mPlugins .has_key (key ) and self .mPlugins [key ]["version_available" ] and compareVersions (self .mPlugins [key ]["version_available" ], plugin ["version_available" ]) < 2 ):
717
725
# The mPlugins dict contains now locally installed plugins.
718
726
# Now, add the available one if not present yet or update it if present already.
@@ -729,7 +737,7 @@ def rebuild(self):
729
737
self .mPlugins [key ][attrib ] = plugin [attrib ]
730
738
# other remote metadata is preffered:
731
739
for attrib in ["name" , "description" , "about" , "category" , "tags" , "changelog" , "author_name" , "author_email" , "homepage" ,
732
- "tracker" , "code_repository" , "experimental" , "version_available" , "zip_repository" ,
740
+ "tracker" , "code_repository" , "experimental" , "deprecated" , " version_available" , "zip_repository" ,
733
741
"download_url" , "filename" , "downloads" , "average_vote" , "rating_votes" ]:
734
742
if ( not attrib in translatableAttributes ) or ( attrib == "name" ): # include name!
735
743
if plugin [attrib ]:
0 commit comments