Ignore:
Timestamp:
06/11/10 09:06:50 (11 years ago)
Author:
sc
Message:

client_interface:

  • converted to a standalone object

client_local:

  • intitial checkin
  • launches both server and client interface

client_network:

  • initial checkin
  • launches network-connected version of client interface

configuration.ini

  • initial checkin
  • overrides default settings found in configuration.py

configuration.py

  • function added to import settings from configuration.ini file

setup.py:

  • fully working py2exe script
File:
1 edited

Legend:

Unmodified
Added
Removed
  • remote_control/puzzlebox_brainstorms_configuration.py

    r44 r45  
    99# For more information please refer to http://www.gnu.org/copyleft/gpl.html 
    1010# 
    11 # Last Update: 2010.06.01 
     11# Last Update: 2010.06.10 
    1212# 
    1313##################################################################### 
     
    2222DEBUG = 1 
    2323 
     24CONFIGURATION_FILE_PATH = 'puzzlebox_brainstorms_configuration.ini' 
     25 
    2426DISCRETE_CONTROL_COMMANDS = True 
     27 
     28DEFAULT_WINDOWS_BLUETOOTH_DEVICE = 'COM1' 
     29DEFAULT_LINUX_BLUETOOTH_DEVICE = '/dev/rfcomm0' 
    2530 
    2631##################################################################### 
     
    6267 
    6368if (sys.platform == 'win32'): 
    64         BLUETOOTH_DEVICE = 'COM1' 
     69        BLUETOOTH_DEVICE = DEFAULT_WINDOWS_BLUETOOTH_DEVICE 
    6570else: 
    66         BLUETOOTH_DEVICE = '/dev/rfcomm0' 
     71        BLUETOOTH_DEVICE = DEFAULT_LINUX_BLUETOOTH_DEVICE 
    6772 
    6873MOTORS_MOUNTED_BACKWARDS = True 
     
    169174} # BUTTON_LAYOUT 
    170175 
     176 
     177##################################################################### 
     178# Configuration File Parser 
     179##################################################################### 
     180 
     181if os.path.exists(CONFIGURATION_FILE_PATH): 
     182         
     183        file = open(CONFIGURATION_FILE_PATH, 'r') 
     184         
     185        for line in file.readlines(): 
     186                line = line.strip() 
     187                if len(line) == 0: 
     188                        continue 
     189                if line[0] == '#': 
     190                        continue 
     191                if line.find('=') == -1: 
     192                        continue 
     193                try: 
     194                        exec line 
     195                except: 
     196                        if DEBUG: 
     197                                print "Error recognizing configuration option:", 
     198                                print line 
     199 
Note: See TracChangeset for help on using the changeset viewer.