from vmc.contrib.epsilon.hotfix import require require('twisted', 'filepath_copyTo') import getpass from twisted.python import usage from twisted.python import filepath from vmc.contrib.axiom import attributes, userbase, dependency from vmc.contrib.axiom.scripts import axiomatic class UserbaseMixin: def installOn(self, other): # XXX check installation on other, not store for ls in self.store.query(userbase.LoginSystem): raise usage.UsageError("UserBase already installed") else: ls = userbase.LoginSystem(store=self.store) dependency.installOn(ls, other) return ls class Install(axiomatic.AxiomaticSubCommand, UserbaseMixin): def postOptions(self): self.installOn(self.store) class Create(axiomatic.AxiomaticSubCommand, UserbaseMixin): synopsis = "<username> <domain> [password]" def parseArgs(self, username, domain, password=None): self['username'] = self.decodeCommandLine(username) self['domain'] = self.decodeCommandLine(domain)
# -*- test-case-name: axiom.test.test_attributes -*- import os from decimal import Decimal from vmc.contrib.epsilon import hotfix hotfix.require('twisted', 'filepath_copyTo') from zope.interface import implements from twisted.python import filepath from twisted.python.components import registerAdapter from vmc.contrib.epsilon.extime import Time from vmc.contrib.axiom.slotmachine import Attribute as inmemory from vmc.contrib.axiom.errors import NoCrossStoreReferences, BrokenReference from vmc.contrib.axiom.iaxiom import IComparison, IOrdering, IColumn, IQuery USING_APSW = False _NEEDS_FETCH = object() # token indicating that a value was not found __metaclass__ = type class _ComparisonOperatorMuxer: """