from axiom.item import Item from axiom import attributes from axiom.upgrade import registerDeletionUpgrader class Settings(Item): typeName = 'mantissa_settings' schemaVersion = 2 installedOn = attributes.reference() def settings1to2(old): new = old.upgradeVersion('mantissa_settings', 1, 2, installedOn=None) new.deleteFromStore() registerDeletionUpgrader(Settings, 1, 2)
else: if itemHasMore: more = True yield None, bool(more or items) if not ran: yield None, more def startService(self): service.Service.startService(self) self.parent.cooperator.coiterate(self.processWhileRunning()) def stopService(self): service.Service.stopService(self) self.store.close() class BatchManholePowerup(item.Item): """ Previously, an L{IConchUser} powerup. This class is only still defined for schema compatibility. Any instances of it will be deleted by an upgrader. See #1001. """ schemaVersion = 2 unused = attributes.integer( doc="Satisfy Axiom requirement for at least one attribute") registerDeletionUpgrader(BatchManholePowerup, 1, 2)
# -*- test-case-name: axiom.test.test_upgrading -*- """ New version of L{axiom.test.oldapp} which upgrades swords by deleting them. """ from axiom.item import Item from axiom.attributes import text from axiom.upgrade import registerDeletionUpgrader class Sword(Item): typeName = 'test_app_sword' schemaVersion = 2 name = text() registerDeletionUpgrader(Sword, 1, 2)
one time that one guy typed in that one search phrase) and a single item which was found in that search. These live in the database to make it easy to display and sort them, but they are deleted when they get kind of oldish. These are no longer used. The upgrader to version 2 unconditionally deletes them. """ schemaVersion = 2 indexedItem = attributes.reference() identifier = attributes.integer() registerDeletionUpgrader(SearchResult, 1, 2) class SearchAggregator(item.Item): implements(ixmantissa.ISearchAggregator, ixmantissa.INavigableElement) powerupInterfaces = (ixmantissa.ISearchAggregator, ixmantissa.INavigableElement) schemaVersion = 1 typeName = 'mantissa_search_aggregator' installedOn = attributes.reference() searches = attributes.integer(default=0) # INavigableElement def getTabs(self):
service = MultiService() store = Store(options['db']) store.querySQL('PRAGMA journal_mode=WAL;') store.querySQL('PRAGMA synchronous=NORMAL;') IService(store).setServiceParent(service) site = Site(IndexRouter(store=store).router.resource()) webService = strports.service(options['port'], site, reactor=reactor) webService.setServiceParent(service) return service class FusionIndexService(Item, Service): """ REMOVED: Old service powerup. """ schemaVersion = 2 powerupInterfaces = [IService] interface = a.bytes(default='', allowNone=False) port = a.integer(default=8443, allowNone=False) caPath = a.text(allowNone=False) certPath = a.text(allowNone=False) registerDeletionUpgrader(FusionIndexService, 1, 2) __all__ = ['FusionIndexServiceMaker']
smtpHost=old.preferredSmarthost, smtpPort=old.smarthostPort, smtpUsername=old.smarthostUsername, smtpPassword=old.smarthostPassword) smarthostFrom.setAsDefault() else: baseFrom.setAsDefault() return old.upgradeVersion(old.typeName, 2, 3, installedOn=old.installedOn) registerUpgrader(composePreferenceCollection2to3, ComposePreferenceCollection.typeName, 2, 3) class Draft(item.Item): """ No longer used. Exists only for upgrade purposes. """ typeName = 'quotient_draft' schemaVersion = 2 empty = attributes.reference() item.declareLegacyItem('quotient_draft', 1, dict(message=attributes.reference(allowNone=False))) registerDeletionUpgrader(Draft, 1, 2)