Ticket #830: trac_830.diff

File trac_830.diff, 2.0 KB (added by lfaraone, 12 years ago)
  • athena/bin/bugme/bugme

     
    2525            self.firstWarn = 90 
    2626            self.warnInterval = 30 
    2727            self.annoyInterval = 10 
     28        # Hard time limit; user will be killed after this time 
     29        self.killTime = self.timeLimit * 1.5 
    2830        # (foreground, background) 
    2931        self.colors = ('black', 'white') 
    3032        try: 
     
    7375            self.nextWarn = now + self.warnInterval 
    7476            self.nag(((self.timeLimit - elapsed) / 60,  
    7577                      (self.timeLimit - elapsed) % 60)) 
     78        if options.kioskMode and elapsed >= self.killTime: 
     79            # The user has outstayed their welcome, nuke their session 
     80            print "Quitting." 
     81            sys.exit(0) 
     82 
    7683        # It's a little odd to put this here, but it doesn't work in 
    7784        # __init__; see comments in Trac #386 
    7885        self.timerWindow.set_keep_above(True) 
     
    116123    parser.add_option("--debug",  
    117124                     action="store_true", dest="debugMode", default=False, 
    118125                     help="Enable debug mode (time limit of 2 minutes)") 
     126    parser.add_option("--fatal", 
     127                     action="store_true", dest="kioskMode", default=False, 
     128                     help="Kill the user session after 1.5 times the time limit.") 
    119129    (options, args) = parser.parse_args() 
    120130    if len(args) < 1: 
    121131        parser.error("'progname' is required") 
  • debathena/debathena/kiosk/xinitrc

     
    6868cp "$chrome" "$profdir/chrome/userChrome.css" || exit 1 
    6969 
    7070# Launch firefox. 
    71 firefox 
     71if [ "$(machtype -q)" = "quickstation" ] && [ -x /usr/bin/bugme ]; then 
     72    bugme --debug --fatal firefox 
     73else 
     74    firefox 
     75fi 
    7276 
     77 
    7378# Clean up. 
    7479rm -rf .mozilla