Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
CA-16217: Allow access to shell timeout using --shelltimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Southgate committed Jul 21, 2008
1 parent 651dceb commit 8205dd6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
14 changes: 11 additions & 3 deletions XSConsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@

import sys

from XSConsoleConfig import *
from XSConsoleTerm import *
from XSConsoleLang import *

def main():
app = App()
app.Build( ['plugins-base', 'plugins-oem', 'plugins-extras'] )
app.Enter()
if '--shelltimeout' in sys.argv:
# Print a shell timeout value, suitable for TMOUT=`xsconsole --shelltimeout`
if Config.Inst().AllShellsTimeout():
print State.Inst().AuthTimeoutSeconds()
else:
print
else:
app = App()
app.Build( ['plugins-base', 'plugins-oem', 'plugins-extras'] )
app.Enter()

if __name__ == "__main__":
try:
Expand Down
4 changes: 3 additions & 1 deletion XSConsoleConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def FTPServer(self):

def BrandingMap(self):
return {}


def AllShellsTimeout(self):
return True

# Import a more specific configuration if available
if os.path.isfile(sys.path[0]+'/XSConsoleConfigOEM.py'):
Expand Down
2 changes: 1 addition & 1 deletion plugins-base/XSFeatureChangeTimeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def StatusUpdateHandler(cls, inPane):
message += Language.Quantity("minute", timeout) + ". "
message += Lang("Users will be automatically logged out after there has been no keyboard "
"activity for this time. This timeout applies to this console and to "
"local shells started from this console.")
"local shells.")

inPane.AddWrappedTextField(message)

Expand Down

0 comments on commit 8205dd6

Please sign in to comment.