Exemple #1
0
def chooseRealm(caller,target,options):
  realms = backends.listRealms()
  (e,f,g) = getmod.listSelectBox("?",realms,title="Choose a realm to load on startup")
  if f is None or f == "":
    print "Aborted"
  else:
    target.set_text(f)
    setOpt(target,None,options,"loadrealm",2)
Exemple #2
0
def loadRealmCst(parent,self):
  f = ""
  options = backends.listRealms()
  (e,f,g) = getmod.listSelectBox("?",options,title="Choose a realm to load",allownew=True,newname="Realm")
  if f is None:
    print "cancel"
  elif f == "":
    newRealm(self)
  else:
    f = "realms/%s.rlm" % f
    loadRealm(self,f)
Exemple #3
0
def mkRealm(caller,self,fileid,name,rdir):
  global config
  realms = backends.listRealms()
  (e,f,g) = getmod.listSelectBox("?",realms,title="Choose a realm to mimic",abort="None")
  if f is None or f == "":
    print "cancel"
  else:
    print "Creating %s from %s"% (fileid,f)
    old = backends.loadRealm(f)
    config.update(old)
  config['realmname'] = name # "New Realm"
  config['realmdir'] = rdir # "realms/default/"
  config['realmfile'] = fileid
  backends.saveRealm(fileid)
  loadRealm(self,"realms/%s.rlm" % fileid)
  options.optionSetter(caller,self.window,False)
  saveRealm(fileid)