Ignore:
Timestamp:
03/01/11 21:30:52 (8 years ago)
Author:
aspidites
Message:

Patch by Aspidites

+ removed kludge that assisted in detecting strings that started with a space
+ instead, all extra white space is removed from an options value
+ if leading and trailing whitespace is significant, an option's value should be

wrapped in quotes instead

+ updated settings.ini to comply with the above changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/active/character_customization/game/parpg/settings.py

    r760 r761  
    5858        # needed so that the leading space in FontGlyphs isn't accidentally  
    5959        # striped 
    60         if not value.startswith(" "): 
    61             value = str(value.strip()) 
    62         else: 
    63             value = str(value) 
    64  
     60        if (value.startswith("\"") and value.endswith("\"") or 
     61            value.startswith("\'") and value.endswith("\'")): 
     62            # remove quotation marks and evaluate as a string 
     63            value = value[1:-1] 
    6564        if value.startswith('[') and value.endswith(']'): 
    6665            value = [item.strip() for item in value[1:-1].split(',')] 
     
    165164                section = line[1:-2] 
    166165            else: 
    167                 option, value = [item for item in line.split(' = ')] 
     166                option, value = [item.strip() for item in line.split('=', 1)] 
    168167                setattr(getattr(self, section), option, value) 
    169168 
Note: See TracChangeset for help on using the changeset viewer.