~brian-sidebotham/wxwidgets-cmake/wxpython-2.9.4

« back to all changes in this revision

Viewing changes to wxPython/wx/tools/Editra/tests/syntax/python.python

  • Committer: Brian Sidebotham
  • Date: 2013-08-03 14:30:08 UTC
  • Revision ID: brian.sidebotham@gmail.com-20130803143008-c7806tkych1tp6fc
Initial import into Bazaar

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Syntax Highlight Test File for Python
 
2
# Some Comments about this file
 
3
 
 
4
"""
 
5
A test file for checking styles for the python highlighter.
 
6
This is a docstring
 
7
 
 
8
"""
 
9
__author__ = "Cody Precord"
 
10
 
 
11
# Keyword statement
 
12
import sys
 
13
 
 
14
# Function Definition
 
15
def say_hello():
 
16
    """Prints hello world to the console"""
 
17
    print "Hello World"
 
18
    print "unclosed string
 
19
 
 
20
# Class Definition
 
21
class Greeting:
 
22
    """A class to represent a greeting"""
 
23
    def __init__(self, language):
 
24
        """initializes the greeting"""
 
25
        self._lang = language
 
26
 
 
27
    def __str__(self):
 
28
        """Returns the string representation of the greeting"""
 
29
        if self._lang == "English":
 
30
            return "Hello"
 
31
        elif self._lang == "Spanish":
 
32
            return "Holla"
 
33
        else:
 
34
            return "Sorry I dont know %s" % self._lang
 
35
 
 
36
    # Decorator's (python 2.4+)
 
37
    @property
 
38
    def classdocs(self):
 
39
        return '\n'.join([ x.__doc__ for x in dir(self) if hasattr(x, '__doc__')])
 
40
 
 
41
if __name__ == '__main__':
 
42
    say_hello()
 
43
    print Greeting('English')