Sections
Timeline
Sub-Sections
Next Change →
Download
Unified Diff
Zip Archive
Metanav
Preferences
About Trac
Links
Slowchop Studios
Gerald Kaszuba
Advertisement

Changeset 27 for pygooglecalc

Show
Ignore:
Timestamp:
22/02/08 00:54:47 (11 months ago)
Author:
gak
Message:

small fixes

Location:
pygooglecalc
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • pygooglecalc/pygooglecalc.py

    r26 r27  
    1313    soup = bs(data) 
    1414    answer = soup.find('h2', {'class': 'r'}) 
    15     answer = answer.font.b 
     15    if not answer: 
     16        return None 
     17    try: 
     18        answer = answer.font.b 
     19    except AttributeError: 
     20        return None 
    1621    answer = strip_ml_tags(str(answer)) 
    17     print answer 
    1822    return answer 
    1923 
     
    5054        return join_char.join(s_list) 
    5155 
    52 get_definition('the speed of light') 
    53 get_definition('1 + 1') 
    5456 
    55