Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pysamples
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-04-08 13:53:50 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-04-08 13:53:50 (GMT)
commit0eb9399571a2124ca7d1c917bd7fa2e3080ae85f (patch)
tree8b0a08b877119b31293e1f8894746e29a6070ca3 /pysamples
parent7012569cc1b3d1eb9d99266a3ebc8eac7d276657 (diff)
added COPYING file and reduced size of comments at the top of each code block for easier reading in Pippy (#2748)
Diffstat (limited to 'pysamples')
-rw-r--r--pysamples/COPYING21
-rw-r--r--pysamples/copy_from_heap.py31
-rw-r--r--pysamples/dotted_line.py28
-rw-r--r--pysamples/load_block.py29
-rw-r--r--pysamples/load_journal_entry_to_heap.py31
-rw-r--r--pysamples/paste_to_heap.py27
-rw-r--r--pysamples/push_mouse_event.py32
-rw-r--r--pysamples/push_time.py30
-rw-r--r--pysamples/save_heap_to_journal_entry.py31
-rw-r--r--pysamples/set_rgb.py33
-rw-r--r--pysamples/sinewave.py31
-rw-r--r--pysamples/speak.py34
-rw-r--r--pysamples/uturn.py23
13 files changed, 63 insertions, 318 deletions
diff --git a/pysamples/COPYING b/pysamples/COPYING
new file mode 100644
index 0000000..9cdf1e6
--- /dev/null
+++ b/pysamples/COPYING
@@ -0,0 +1,21 @@
+Copyright (c) 2008-11, Walter Bender
+Copyright (c) 2008-11, TOny Forster
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/pysamples/copy_from_heap.py b/pysamples/copy_from_heap.py
index 5eb7bab..fbca999 100644
--- a/pysamples/copy_from_heap.py
+++ b/pysamples/copy_from_heap.py
@@ -1,37 +1,14 @@
-#Copyright (c) 2010, Walter Bender, Tony Forster
+#Copyright (c) 2010-11, Walter Bender, Tony Forster
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected.
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block; when
# this code is run, the FILO heap will be copied to the clipboard.
def myblock(tw, x): # second argument is ignored
-
- ###########################################################################
- #
- # Copy heap to clipboard
- #
- ###########################################################################
+ ''' Copy heap to clipboard '''
from gtk import Clipboard
from TurtleArt.tautils import data_to_string
diff --git a/pysamples/dotted_line.py b/pysamples/dotted_line.py
index e9c1325..febd409 100644
--- a/pysamples/dotted_line.py
+++ b/pysamples/dotted_line.py
@@ -1,24 +1,5 @@
-#Copyright (c) 2009-10, Walter Bender
+#Copyright (c) 2009-11, Walter Bender
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-#
# This procedure is invoked when the user-definable block on the "extras"
# palette is selected. Some examples of how to use this block are included
# below. Try uncommenting an example or write your own Python code.
@@ -130,12 +111,7 @@
def myblock(tw, line_length):
-
- ###########################################################################
- #
- # Draw a dotted line of length line_length.
- #
- ###########################################################################
+ ''' Draw a dotted line of length line_length. '''
try: # make sure line_length is a number
line_length = float(line_length)
diff --git a/pysamples/load_block.py b/pysamples/load_block.py
index 3e9ec93..a457504 100644
--- a/pysamples/load_block.py
+++ b/pysamples/load_block.py
@@ -1,25 +1,7 @@
#Copyright (c) 2011, Walter Bender
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected.
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block; when
# this code is run, the turtle will create a block at the current
@@ -37,12 +19,7 @@
def myblock(tw, blkname):
-
- ###########################################################################
- #
- # Load a block on to the canvas
- #
- ###########################################################################
+ ''' Load a block on to the canvas '''
from TurtleArt.tapalette import block_names, block_primitives, \
special_names, content_blocks
diff --git a/pysamples/load_journal_entry_to_heap.py b/pysamples/load_journal_entry_to_heap.py
index 512de76..3dd3bb5 100644
--- a/pysamples/load_journal_entry_to_heap.py
+++ b/pysamples/load_journal_entry_to_heap.py
@@ -1,25 +1,7 @@
-#Copyright (c) 2010, Walter Bender, Tony Forster
+#Copyright (c) 2010-11, Walter Bender, Tony Forster
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected.
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block; when
# this code is run, the chooser will be opened for selecting a file
@@ -28,12 +10,7 @@
def myblock(tw, x): # ignore second argument
-
- ###########################################################################
- #
- # Load heap from journal
- #
- ###########################################################################
+ ''' Load heap from journal (Sugar only) '''
from TurtleArt.tautils import chooser
diff --git a/pysamples/paste_to_heap.py b/pysamples/paste_to_heap.py
index cd36732..0371078 100644
--- a/pysamples/paste_to_heap.py
+++ b/pysamples/paste_to_heap.py
@@ -1,22 +1,4 @@
-#Copyright (c) 2010, Walter Bender, Tony Forster
-
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
+#Copyright (c) 2010-11, Walter Bender, Tony Forster
# This procedure is invoked when the user-definable block on the "extras"
# palette is selected.
@@ -27,12 +9,7 @@
def myblock(tw, x): # ignore second argument
-
- ###########################################################################
- #
- # Paste from clipboard to heap
- #
- ###########################################################################
+ ''' Paste from clipboard to heap '''
from gtk import Clipboard
from tautils import data_from_string
diff --git a/pysamples/push_mouse_event.py b/pysamples/push_mouse_event.py
index 9a6c504..b14315c 100644
--- a/pysamples/push_mouse_event.py
+++ b/pysamples/push_mouse_event.py
@@ -1,26 +1,7 @@
-#Copyright (c) 2009-10, Walter Bender, Tony Forster
+#Copyright (c) 2009-11, Walter Bender, Tony Forster
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-#
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected.
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block; when
# this code is run, the current mouse status will be pushed to the
@@ -33,12 +14,7 @@
def myblock(tw, x): # ignore second argument
-
- ###########################################################################
- #
- # Push mouse event to stack
- #
- ###########################################################################
+ ''' Push mouse event to stack '''
if tw.mouse_flag == 1:
# push y first so x will be popped first
diff --git a/pysamples/push_time.py b/pysamples/push_time.py
index 1945ca4..5f86be4 100644
--- a/pysamples/push_time.py
+++ b/pysamples/push_time.py
@@ -1,25 +1,7 @@
-#Copyright (c) 2009-10, Walter Bender
+#Copyright (c) 2009-11, Walter Bender
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected.
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block; when
# this code is run, the current hour, minute, and second are pushed to
@@ -28,15 +10,11 @@
def myblock(tw, x): # ignore second argument
+ ''' Push hours, minutes, seconds onto the FILO. '''
- ###########################################################################
- #
- # Push hours, minutes, seconds onto the FILO.
# Use three 'pop' blocks to retrieve these values.
# Note: because we use a FILO (first in, last out heap),
# the first value you pop off of the FILO will be seconds.
- #
- ###########################################################################
tw.lc.heap.append(localtime().tm_hour)
tw.lc.heap.append(localtime().tm_min)
diff --git a/pysamples/save_heap_to_journal_entry.py b/pysamples/save_heap_to_journal_entry.py
index e9121d4..a06d4d0 100644
--- a/pysamples/save_heap_to_journal_entry.py
+++ b/pysamples/save_heap_to_journal_entry.py
@@ -1,25 +1,7 @@
-#Copyright (c) 2010, Walter Bender, Tony Forster
+#Copyright (c) 2010-11, Walter Bender, Tony Forster
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected.
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block; when
# this code is run, the contents of the FILO heap are saved to a
@@ -28,12 +10,7 @@
def myblock(tw, title):
-
- ###########################################################################
- #
- # Save heap to journal (Sugar only)
- #
- ###########################################################################
+ ''' Save heap to journal (Sugar only) '''
import os.path
from gettext import gettext as _
diff --git a/pysamples/set_rgb.py b/pysamples/set_rgb.py
index c9c0f0c..d4baa48 100644
--- a/pysamples/set_rgb.py
+++ b/pysamples/set_rgb.py
@@ -1,26 +1,7 @@
-#Copyright (c) 2009-10, Walter Bender
+#Copyright (c) 2009-11, Walter Bender
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-#
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected and expanded to 3 arguments.
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected and expanded to 3 arguments.
# Usage: Import this code into a Python (user-definable) block.
# First, expand the Python block to reveal three numerics arguments.
@@ -30,13 +11,7 @@
def myblock(tw, rgb_array):
-
- ###########################################################################
- #
- # Set rgb color from values
- #
- ###########################################################################
-
+ ''' Set rgb color from values '''
rgb = "#%02x%02x%02x" % ((int(rgb_array[0]) % 256),
(int(rgb_array[1]) % 256),
diff --git a/pysamples/sinewave.py b/pysamples/sinewave.py
index 54a0700..4f14c4c 100644
--- a/pysamples/sinewave.py
+++ b/pysamples/sinewave.py
@@ -1,25 +1,7 @@
-#Copyright (c) 2010, Tony Forster
+#Copyright (c) 2010-11, Tony Forster
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected.
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block and
# pass a frequency in Hertz to the Python block. A tone will play over
@@ -27,12 +9,7 @@
def myblock(tw, frequency):
-
- ###########################################################################
- #
- # Plays a sound at frequency frequency
- #
- ###########################################################################
+ ''' Plays a sound at frequency frequency '''
import os
os.system('speaker-test -t sine -l 1 -f %d' % (int(frequency)))
diff --git a/pysamples/speak.py b/pysamples/speak.py
index 03f47bc..7476d64 100644
--- a/pysamples/speak.py
+++ b/pysamples/speak.py
@@ -1,26 +1,7 @@
-#Copyright (c) 2009-10, Walter Bender, Tony Forster
-
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-#
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected.
+#Copyright (c) 2009-11, Walter Bender, Tony Forster
+
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block and
# pass a string to be read by the voice synthesizer. If a second
@@ -29,12 +10,7 @@
def myblock(tw, arg):
-
- ###########################################################################
- #
- # Text to speech
- #
- ###########################################################################
+ ''' Text to speech '''
import os
diff --git a/pysamples/uturn.py b/pysamples/uturn.py
index 3f7f623..0b164a0 100644
--- a/pysamples/uturn.py
+++ b/pysamples/uturn.py
@@ -1,26 +1,7 @@
#Copyright (c) 2011, Walter Bender
-#Permission is hereby granted, free of charge, to any person obtaining a copy
-#of this software and associated documentation files (the "Software"), to deal
-#in the Software without restriction, including without limitation the rights
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-#copies of the Software, and to permit persons to whom the Software is
-#furnished to do so, subject to the following conditions:
-
-#The above copyright notice and this permission notice shall be included in
-#all copies or substantial portions of the Software.
-
-#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-
-#
-# This procedure is invoked when the user-definable block on the "extras"
-# palette is selected.
+# This procedure is invoked when the user-definable block on the
+# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block; when
# it is run, a u-turn block will be added to the Turtle Palette. You