Exemplo n.º 1
0
 def setUp(self):
     Globals.options = Utility.initOptions()
     Globals.options.ramdb = True
     Utility.initLogging(Globals.options)
     self.views = []
     for i in xrange(2):
         view = Utility.initRepository("", Globals.options, True)
         view.name = "test_view_%d" % i
         self.views.append(view)
         Utility.initTimezone(Globals.options, view)
Exemplo n.º 2
0
 def setUp(self):
     Globals.options = Utility.initOptions()
     Globals.options.ramdb = True
     Utility.initLogging(Globals.options)
     self.views = []
     for i in xrange(2):
         view = Utility.initRepository("", Globals.options, True)
         view.name = "test_view_%d" % i
         self.views.append(view)
         Utility.initTimezone(Globals.options, view)
Exemplo n.º 3
0
def startup(chandlerDirectory=None, **kwds):
    global view, commitOnExit

    Globals.options = Utility.initOptions(**kwds)
    if chandlerDirectory is None:
        Globals.chandlerDirectory = Utility.locateChandlerDirectory()
    else:
        Globals.chandlerDirectory = chandlerDirectory

    os.chdir(Globals.chandlerDirectory)
    Utility.initI18n(Globals.options)

    profileDir = Globals.options.profileDir

    Utility.initLogging(Globals.options)

    parcelPath = Utility.initParcelEnv(Globals.options,
                                       Globals.chandlerDirectory)
    pluginEnv, pluginEggs = Utility.initPluginEnv(Globals.options,
                                                  Globals.options.pluginPath)

    Globals.options.getPassword = getPassword
    repoDir = Utility.locateRepositoryDirectory(profileDir, Globals.options)
    view = Utility.initRepository(repoDir, Globals.options)

    verify, repoVersion, schemaVersion = Utility.verifySchema(view)
    if not verify:
        print "Schema mismatch (%s vs %s).  Try again with startup(create=True)" % (
            repoVersion, schemaVersion)
        return None

    Utility.initCrypto(Globals.options.profileDir)
    Utility.initParcels(Globals.options, view, parcelPath)
    Utility.initPlugins(Globals.options, view, pluginEnv, pluginEggs)
    Utility.initTimezone(Globals.options, view)

    if Globals.options.reload:
        from osaf import dumpreload
        dumpreload.reload(view, Globals.options.reload)

    return view
Exemplo n.º 4
0
def startup(chandlerDirectory=None, **kwds):
    global view, commitOnExit

    Globals.options = Utility.initOptions(**kwds)
    if chandlerDirectory is None:
        Globals.chandlerDirectory = Utility.locateChandlerDirectory()
    else:
        Globals.chandlerDirectory = chandlerDirectory

    os.chdir(Globals.chandlerDirectory)
    Utility.initI18n(Globals.options)

    profileDir = Globals.options.profileDir

    Utility.initLogging(Globals.options)

    parcelPath = Utility.initParcelEnv(Globals.options, 
                                       Globals.chandlerDirectory)
    pluginEnv, pluginEggs = Utility.initPluginEnv(Globals.options,
                                                  Globals.options.pluginPath)

    Globals.options.getPassword = getPassword
    repoDir = Utility.locateRepositoryDirectory(profileDir, Globals.options)
    view = Utility.initRepository(repoDir, Globals.options)

    verify, repoVersion, schemaVersion = Utility.verifySchema(view)
    if not verify:
        print "Schema mismatch (%s vs %s).  Try again with startup(create=True)" %(repoVersion, schemaVersion)
        return None

    Utility.initCrypto(Globals.options.profileDir)
    Utility.initParcels(Globals.options, view, parcelPath)
    Utility.initPlugins(Globals.options, view, pluginEnv, pluginEggs)
    Utility.initTimezone(Globals.options, view)

    if Globals.options.reload:
        from osaf import dumpreload
        dumpreload.reload(view, Globals.options.reload)

    return view
Exemplo n.º 5
0
    Utility.initLogging(Globals.options)

    parcelPath = Utility.initParcelEnv(Globals.options,
                                       Globals.chandlerDirectory)
    pluginEnv, pluginEggs = Utility.initPluginEnv(Globals.options,
                                                  Globals.options.pluginPath)

    view = Utility.initRepository(profileDir, Globals.options)

    verify, repoVersion, schemaVersion = Utility.verifySchema(view)

    Utility.initCrypto(Globals.options.profileDir)
    Utility.initParcels(Globals.options, view, parcelPath)
    Utility.initPlugins(Globals.options, view, pluginEnv, pluginEggs)
    Utility.initTimezone(Globals.options, view)

    outputDir = os.path.join(Globals.chandlerDirectory, 'docs')

    if os.path.isfile('Chandler.py'):
        if not os.path.isdir(outputDir):
            _mkdirs(outputDir)

        generateModelDocs(Globals.chandlerDirectory, view, outputDir)
        generateDocs(outputDir)
    else:
        print "Error: Currently gen_docs.py assumes it is running in the chandler/ directory"

    Utility.stopWakeup()
    Utility.stopTwisted()
    Utility.stopRepository(view, False)
Exemplo n.º 6
0
 def reopenRepository(self):
     view = self.view
     view.commit()
     view.closeView()
     view.openView(timezone=Default)
     Utility.initTimezone(Globals.options, view)
Exemplo n.º 7
0
 def setUp(self):
     Globals.options = Utility.initOptions()
     Globals.options.ramdb = True
     Utility.initLogging(Globals.options)
     self.view = Utility.initRepository("", Globals.options, True)
     Utility.initTimezone(Globals.options, self.view)
Exemplo n.º 8
0
 def setUp(self):
     Globals.options = Utility.initOptions()
     Utility.initLogging(Globals.options)
     self.view = NullRepositoryView()
     Utility.initTimezone(Globals.options, self.view)
Exemplo n.º 9
0
 def reopenRepository(self):
     view = self.view
     view.commit()
     view.closeView()
     view.openView(timezone=Default)
     Utility.initTimezone(Globals.options, view)
Exemplo n.º 10
0
 def setUp(self):
     Globals.options = Utility.initOptions()
     Globals.options.ramdb = True
     Utility.initLogging(Globals.options)
     self.view = Utility.initRepository("", Globals.options, True)
     Utility.initTimezone(Globals.options, self.view)
Exemplo n.º 11
0
 def setUp(self):
     Globals.options = Utility.initOptions()
     Utility.initLogging(Globals.options)
     self.view = NullRepositoryView()
     Utility.initTimezone(Globals.options, self.view)
Exemplo n.º 12
0
    Utility.initLogging(Globals.options)

    parcelPath = Utility.initParcelEnv(Globals.options, 
                                       Globals.chandlerDirectory)
    pluginEnv, pluginEggs = Utility.initPluginEnv(Globals.options,
                                                  Globals.options.pluginPath)

    view = Utility.initRepository(profileDir, Globals.options)

    verify, repoVersion, schemaVersion = Utility.verifySchema(view)

    Utility.initCrypto(Globals.options.profileDir)
    Utility.initParcels(Globals.options, view, parcelPath)
    Utility.initPlugins(Globals.options, view, pluginEnv, pluginEggs)
    Utility.initTimezone(Globals.options, view)

    outputDir = os.path.join(Globals.chandlerDirectory, 'docs')

    if os.path.isfile('Chandler.py'):
        if not os.path.isdir(outputDir):
            _mkdirs(outputDir)

        generateModelDocs(Globals.chandlerDirectory, view, outputDir)
        generateDocs(outputDir)
    else:
        print "Error: Currently gen_docs.py assumes it is running in the chandler/ directory"

    Utility.stopWakeup()
    Utility.stopTwisted()
    Utility.stopRepository(view, False)