def draw(self, detail):
     d = self.window.begindrawing()
     fg = stdwin.getfgcolor()
     red = stdwin.fetchcolor("red")
     d.cliprect(detail)
     d.erase(detail)
     lh = self.lineheight
     cw = self.charwidth
     for y in range(self.height):
         d.text((0, y * lh), self.lines[y].tostring())
         if self.attrs[y] <> self.blankattr:
             for x in range(len(self.attrs[y])):
                 if self.attrs[y][x] == 7:
                     p1 = x * cw, y * lh
                     p2 = (x + 1) * cw, (y + 1) * lh
                     d.invert((p1, p2))
     x = self.x * cw
     y = self.y * lh
     d.setfgcolor(red)
     d.invert((x, y), (x + cw, y + lh))
     d.setfgcolor(fg)
     d.close()
Esempio n. 2
0
 def draw(self, detail):
     d = self.window.begindrawing()
     fg = stdwin.getfgcolor()
     red = stdwin.fetchcolor('red')
     d.cliprect(detail)
     d.erase(detail)
     lh = self.lineheight
     cw = self.charwidth
     for y in range(self.height):
         d.text((0, y * lh), self.lines[y].tostring())
         if self.attrs[y] <> self.blankattr:
             for x in range(len(self.attrs[y])):
                 if self.attrs[y][x] == 7:
                     p1 = x * cw, y * lh
                     p2 = (x + 1) * cw, (y + 1) * lh
                     d.invert((p1, p2))
     x = self.x * cw
     y = self.y * lh
     d.setfgcolor(red)
     d.invert((x, y), (x + cw, y + lh))
     d.setfgcolor(fg)
     d.close()
Esempio n. 3
0
import posix
import sys
import time
import string

import stdwin
from stdwinevents import *
import mainloop

# Default parameters
DEF_PRINTER = 'oce' # This is CWI specific!
DEF_DELAY = 10

# Color assignments
c_unknown = stdwin.fetchcolor('white')
c_idle = stdwin.fetchcolor('navajo white')
c_ontop = stdwin.fetchcolor('green')
c_smallqueue = stdwin.fetchcolor('yellow')
c_bigqueue = stdwin.fetchcolor('orange')
c_error = stdwin.fetchcolor('red')

def main():
	delay = DEF_DELAY
	#
	try:
		thisuser = posix.environ['LOGNAME']
	except:
		thisuser = posix.environ['USER']
	#
	printers = sys.argv[1:]
Esempio n. 4
0
# Pass this program the Holy Grail script on stdin.
import sys
import string
import stdwin
from stdwinevents import *
try:
	import macspeech
except ImportError:
	macspeech = None
WINWIDTH = 1000
scrw, scrh = stdwin.getscrsize()
if WINWIDTH > 0.8*scrw:
	WINWIDTH = int(0.8*scrw)
BLACK = stdwin.fetchcolor('black')
RED = stdwin.fetchcolor('red')
BLUE = stdwin.fetchcolor('blue')
done='done'
class MacSpeaker:
	def __init__(self):
		self.voices = []
		self.nvoices = macspeech.CountVoices()
		self.curvoice = 1
		self.rate = 1.0
		
	def _newvoice(self):
		vd = macspeech.GetIndVoice(self.curvoice)
		sc = vd.NewChannel()
		self.curvoice = self.curvoice + 1
		if self.curvoice > self.nvoices:
			self.curvoice = 1
Esempio n. 5
0
# Pass this program the Holy Grail script on stdin.
import sys
import string
import stdwin
from stdwinevents import *

try:
    import macspeech
except ImportError:
    macspeech = None

WINWIDTH = 1000
scrw, scrh = stdwin.getscrsize()
if WINWIDTH > 0.8 * scrw:
    WINWIDTH = int(0.8 * scrw)
BLACK = stdwin.fetchcolor('black')
RED = stdwin.fetchcolor('red')
BLUE = stdwin.fetchcolor('blue')

done = 'done'


class MacSpeaker:
    def __init__(self):
        self.voices = []
        self.nvoices = macspeech.CountVoices()
        self.curvoice = 1
        self.rate = 1.0

    def _newvoice(self):
        vd = macspeech.GetIndVoice(self.curvoice)
Esempio n. 6
0
# Pass this program the Holy Grail script on stdin.
import sys
import string
import stdwin
from stdwinevents import *

try:
	import macspeech
except ImportError:
	macspeech = None

WINWIDTH = 1000
scrw, scrh = stdwin.getscrsize()
if WINWIDTH > 0.8*scrw:
	WINWIDTH = int(0.8*scrw)
BLACK = stdwin.fetchcolor('black')
RED = stdwin.fetchcolor('red')
BLUE = stdwin.fetchcolor('blue')

done='done'

class MacSpeaker:
	def __init__(self):
		self.voices = []
		self.nvoices = macspeech.CountVoices()
		self.curvoice = 1
		self.rate = 1.0
		
	def _newvoice(self):
		vd = macspeech.GetIndVoice(self.curvoice)
		sc = vd.NewChannel()