Refactor the console stuff

This commit is contained in:
Marco Pesenti Gritti
2006-08-11 13:05:33 +02:00
parent cb47f17b31
commit 628271959c
6 changed files with 47 additions and 49 deletions
+4 -9
View File
@@ -1,4 +1,3 @@
import logging
import os
import socket
import sys
@@ -9,8 +8,8 @@ def get_display_number():
"""Find a free display number trying to connect to 6000+ ports"""
retries = 20
display_number = 1
display_is_free = False
display_is_free = False
while not display_is_free and retries > 0:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
@@ -57,10 +56,6 @@ class XnestProcess(Process):
class Emulator:
"""The OLPC emulator"""
def __init__(self):
pass
def start(self):
try:
process = XephyrProcess()
@@ -70,6 +65,6 @@ class Emulator:
process = XnestProcess()
process.start()
except:
logging.error('Cannot run the emulator. You need to install \
Xephyr or Xnest.')
print('Cannot run the emulator. You need to install\
Xephyr or Xnest.')
sys.exit(0)