Ejemplo n.º 1
0
def main(program_path, vram_ptr, rows, cols):
    with open(program_path, 'rb') as program_file:
        machine = Machine(State())
        machine.state().regs().set(Register.index_from_name('SP'), 0x100, True)
        machine.load(program_file.read())

        def run(console, machine):
            while True:
                machine.next_instr(DisAsm())
                console.refresh(machine.state().ram().read(
                    vram_ptr, rows * cols))

        import console
        console.run(run, machine, rows, cols)
Ejemplo n.º 2
0
def main():
  formatter = Tap(Stdout())
  global_env = init(formatter)
  if option.targets:
    agg = Aggregator()
    agg.add_files(option.targets)
    runner = ScenarioRunner(agg, formatter)
    failed = runner.run(global_env)
  else:
    import console
    console.run(global_env)
  teardown()
  if failed:
      sys.exit(1)
Ejemplo n.º 3
0
def main(program_path, vram_ptr, rows, cols):
    with open(program_path, 'rb') as program_file:
        machine = Machine(State())
        machine.state().regs().set(Register.index_from_name('SP'),
                                      0x100, True)
        machine.load(program_file.read())

        def run(console, machine):
            while True:
                machine.next_instr(DisAsm())
                console.refresh(machine.state().ram().read(vram_ptr,
                                                           rows * cols))

        import console
        console.run(run, machine, rows, cols)
Ejemplo n.º 4
0
                                  rows=rows - PROMPT_HEIGHT,
                                  columns=cols,
                                  buf=edit_buffer,
                                  wrap=False)

        editor = Editor(
            rows - PROMPT_HEIGHT,  # editable area height
            cols,  # editable area width
            rows - PROMPT_HEIGHT,  # prompt row
            PROMPT_HEIGHT,  # height of prompt window(1)
            cols,
            windows=[editwindow, booklistwindow, loginwindow],  #
            initial_focused_window=BOOKLIST_WINDOW)  #BOOKLIST_WINDOW )

        registry = MergedRegistry(
            [console.default_bindings(),
             load_custom_binding()])

        app = Application(editor, registry=registry)
        app.run()

    except:
        _logger.error('application exited with exception: %r' %
                      traceback.format_exc())
        raise
    finally:
        pass


console.run(main, sys.argv)
Ejemplo n.º 5
0
def run_console(global_env):
  import console
  console.run(global_env)
  return 0
Ejemplo n.º 6
0
argParser.add_argument('--stop', action='store_true', help='Stop service')
argParser.add_argument('-r', '--restart', action='store_true', help='Restart service')
argParser.add_argument('--status', action='store_true', help='Print service status')
argParser.add_argument('--console', action='store_true', help='Run as terminal application')

config.ConfigManager.registerArguments(argParser)

args = argParser.parse_args()

config.ConfigManager.processArguments(args)

isWindows = platform.system() == "Windows"

if args.console:
    import console
    console.run()    
else:
    if isWindows:
        import windowsvc
        service = windowsvc.WindowsService
    else:
        import nixsvc
        service = nixsvc.NixService

    printUsage = True
    
    if args.install:
        printUsage = False
        service.Install()
    elif args.uninstall:
        printUsage = False
Ejemplo n.º 7
0
#encoding:utf8
import logging
from config import config
from console import run

if __name__ == "__main__":
	# logging
	logging.basicConfig(filename=config.LOGFILE, level=logging.INFO,
		format="[%(levelname)s] %(asctime)s: %(message)s")

	run()
Ejemplo n.º 8
0
#Servo pins in use
panServo = 7
tiltServo = 18

name = sys.argv[1] 
pans = int(sys.argv[2]) 
tilts = int(sys.argv[3]) 

#Servo configs
minPan = 2.5
maxPan = 12.5
minTilt = 5
maxTilt = 12.5

panStep = round((maxPan-minPan)/pans,1)
tiltStep = round((maxTilt-minTilt)/pans, 1)

for p in functions.step_range(minPan, maxPan, panStep):
    servo.move(panServo,p)
    for t in functions.step_range(minTilt, maxTilt, tiltStep):
        servo.move(tiltServo,t)
        console.run(["./photo.sh", functions.name(name,p,t)])


    




Ejemplo n.º 9
0
from validation import *
from repository import *
from console import run
from tests import runTests
    
runTests()       
run()
Ejemplo n.º 10
0
# Run a standard console if invoked
if __name__ == '__main__':
	import console
	console.run()
Ejemplo n.º 11
0
import sys
import functions
import servo
import console

#Servo pins in use
panServo = 7
tiltServo = 18

name = sys.argv[1]
pans = int(sys.argv[2])
tilts = int(sys.argv[3])

#Servo configs
minPan = 2.5
maxPan = 12.5
minTilt = 5
maxTilt = 12.5

panStep = round((maxPan - minPan) / pans, 1)
tiltStep = round((maxTilt - minTilt) / pans, 1)

for p in functions.step_range(minPan, maxPan, panStep):
    servo.move(panServo, p)
    for t in functions.step_range(minTilt, maxTilt, tiltStep):
        servo.move(tiltServo, t)
        console.run(["./photo.sh", functions.name(name, p, t)])