Skip to content

Commit

Permalink
Merge pull request #277 from vincentcasseau/dev
Browse files Browse the repository at this point in the history
CPlot - validCassiopee: load local DB for the DB admin cassiope
  • Loading branch information
vincentcasseau authored Feb 7, 2025
2 parents 581dc64 + 5c27c7d commit 258a1c4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Cassiopee/CPlot/apps/validCassiopee.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def set(self): pass
#==============================================================================
# Get installation paths of Cassiopee, Fast and all PModules
#==============================================================================
def isDBAdmin():
import getpass
return getpass.getuser() == "cassiope"

def getInstallPaths():
try:
# Check installPath
Expand Down Expand Up @@ -1917,8 +1921,10 @@ def setGUITitleBar(loc='GLOBAL'):
CTK.infoBulle(parent=UpdateButton,
text='Update tests (replace data base files).')
CTK.infoBulle(parent=TextThreads, text='Number of threads.')
ierr = setupGlobal() # Comparison is made against the global valid
if ierr == 1: setupLocal() # Global valid does not exist, default back to local
if isDBAdmin(): setupLocal() # Local valid for the DB admin 'cassiope'
else:
ierr = setupGlobal() # Comparison is made against the global valid
if ierr == 1: setupLocal() # Global valid does not exist, default back to local
TK.mainloop()
else:
# --- Command line execution ---
Expand All @@ -1938,8 +1944,10 @@ def setGUITitleBar(loc='GLOBAL'):
TextThreads = NoDisplayEntry()
getThreads()

if os.access('/stck/cassiope/git/Cassiopee/', os.R_OK) and vcargs.global_db:
setupGlobal(loadSession=vcargs.loadSession)
if (os.access('/stck/cassiope/git/Cassiopee/', os.R_OK) and
vcargs.global_db and not (vcargs.update or isDBAdmin())):
ierr = setupGlobal(loadSession=vcargs.loadSession)
if ierr == 1: setupLocal() # Global valid does not exist, default back to local
else: setupLocal(loadSession=vcargs.loadSession)
purgeSessionLogs(vcargs.purge)
if vcargs.filters:
Expand Down

0 comments on commit 258a1c4

Please sign in to comment.