Permalink
Browse files

BSD license change

  • Loading branch information...
1 parent a994def commit d1ba6c6c72d40c3081b5ce2f0715f8db818ddc94 @asweigart committed Sep 10, 2011
Showing with 94 additions and 33 deletions.
  1. +31 −1 README
  2. +1 −0 demo_dodger.py
  3. +1 −0 demo_maze.py
  4. +7 −2 demo_reversi.py
  5. +2 −0 demo_shadowtest.py
  6. +2 −0 demo_textboxtest.py
  7. +1 −1 demo_textris.py
  8. +8 −1 demo_tictactoe.py
  9. +41 −28 pygcurse.py
View
@@ -32,4 +32,34 @@ This module is still in alpha and may have bugs. Please submit any bug reports t
- demo_shadowtest.py : A test program that demonstrates Pygcurse's tinting and shadow features, as well as the line drawing function.
- demo_textboxtest.py : A test program that demonstrates Pygcurse's PygcurseTextbox class, which makes it easy to display text boxes on the screen.
-Feel free to play around with them. Email me any questions/comments you have. I'm very much interested in expanding this module with new features (or fixing any bugs).
+Feel free to play around with them. Email me any questions/comments you have. I'm very much interested in expanding this module with new features (or fixing any bugs).
+
+
+
+Simplified BSD License:
+
+Copyright 2011 Al Sweigart. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ of conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY Al Sweigart ''AS IS'' AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Al Sweigart OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those of the
+authors and should not be interpreted as representing official policies, either expressed
+or implied, of Al Sweigart.
View
@@ -2,6 +2,7 @@
# By Al Sweigart al@inventwithpython.com
# This program is a demo for the Pygcurse module.
+# Simplified BSD License, Copyright 2011 Al Sweigart
import pygame, random, sys, time, pygcurse
from pygame.locals import *
View
@@ -3,6 +3,7 @@
# Maze Generation code by Joe Wingbermuehle
# This program is a demo for the Pygcurse module.
+# Simplified BSD License, Copyright 2011 Al Sweigart
import pygcurse, pygame, sys, random, time
from pygame.locals import *
View
@@ -4,13 +4,18 @@
five lines. This demostrates how stdio programs can be converted to Pygcurse
programs with minimal effort.
-Note that this conversion only works for Python 3, since print in Python 2
-is a statement rather than a function.
+Simplified BSD License, Copyright 2011 Al Sweigart
"""
import pygcurse
win = pygcurse.PygcurseWindow(50, 25, 'Reversi')
print = win.pygprint
input = win.input
+# To get this to work in Python 2, comment the previous two lines and
+# uncomment the following lines: (And also modify the print() calls in the code
+# to get rid of the "end" keyword argument.
+#import sys
+#sys.stdout = win
+#input = win.raw_input
win.setscreencolors('aqua', 'black', clear=True)
#===========================================================================
View
@@ -1,3 +1,5 @@
+# Simplified BSD License, Copyright 2011 Al Sweigart
+
import pygcurse, pygame, sys
from pygame.locals import *
win = pygcurse.PygcurseWindow(40, 25)
View
@@ -1,3 +1,5 @@
+# Simplified BSD License, Copyright 2011 Al Sweigart
+
import pygcurse, pygame, sys
from pygame.locals import *
win = pygcurse.PygcurseWindow(40, 25)
View
@@ -1,6 +1,6 @@
# Textris (a Tetris clone)
# By Al Sweigart al@inventwithpython.com
-# Creative Commons BY-NC-SA 3.0 US
+# Simplified BSD License, Copyright 2011 Al Sweigart
import random, time, pygame, sys
import pygcurse as pygcurse
View
@@ -4,13 +4,20 @@
five lines. This demostrates how stdio programs can be converted to Pygcurse
programs with minimal effort.
-Note that this conversion only works for Python 3, since print in Python 2
+Note that this only works for Python 3, since print in Python 2
is a statement rather than a function.
+
+Simplified BSD License, Copyright 2011 Al Sweigart
"""
import pygcurse
win = pygcurse.PygcurseWindow(40, 25, 'Tic Tac Toe')
print = win.pygprint
input = win.input
+# To get this to work in Python 2, comment the previous two lines and
+# uncomment the following lines:
+#import sys
+#sys.stdout = win
+#input = win.raw_input
win.setscreencolors('lime', 'blue', clear=True)
#===========================================================================
View
@@ -1,7 +1,10 @@
"""
+Please forgive any typos or errors in the comments, I'll be cleaning them up as frequently as I can.
+
+
Pygcurse v0.1 alpha
-Pygcurse (pronounced "pig curse") is a curses library emulator that runs on top of the Pygame framework. It provides an easy way to create text adventures, rougelikes, and console-style applications.
+Pygcurse (pronounced "pig curse") is a curses library emulator that runs on top of the Pygame framework. It provides an easy way to create text adventures, roguelikes, and console-style applications.
Unfortunately, the curses library that comes with the Python standard library does not work on Windows. The excellent Console module from effbot provides curses-like features, but it only runs on Windows and not Mac/Linux. By using Pygame, Pygcurse is able to run on all platforms.
@@ -17,6 +20,35 @@
Pygcurse was developed by Al Sweigart (al@inventwithpython.com)
https://github.com/asweigart/pygcurse
+
+
+Simplified BSD License:
+
+Copyright 2011 Al Sweigart. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ of conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY Al Sweigart ''AS IS'' AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Al Sweigart OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those of the
+authors and should not be interpreted as representing official policies, either expressed
+or implied, of Al Sweigart.
"""
import copy
@@ -26,34 +58,8 @@
import pygame
from pygame.locals import *
-# TODO - put this note somewhere: print will by default use the set background color. putchar will jsut use None. (Is this another argument for letting None be the default color?)
-
"""
-List of TODO
-packaging and pypi.
-set up website and bug tracker
-
-arrange modules: pygcurse, pygcurse.ui
-
-Turtle stuff
-Sprite mapping (and also being able to explicitly set the cell size so they match)
-General optimization and speed ups
-Primitive drawing functions
-UI Widgets
- Pyperclip integration for copy/paste and callbacks for keystrokes in input() (can be used for ctrl-v paste, or esc to quit)
- Highlight text in input() for copying/pasting (also set up allowHighlight and default ctrl-v behavior)
-Code comments
-Sphynx documentation
-TESTING!!!
-DEMOS!!!
-
-
-TODO - make tabsize variable?
-
-TODO - add something so that when we autodisplayupdate, we can specify where the surface should be drawn.
-
-The point of using this is that Windows does not have a curses module built in, and it is not code-compatible with Linux curses.
-Also, lets you print anywhere on the screen, in color, with nice fonts, and you can use the mouse and not block while entering text.
+Some nomenclature in this module's comments explained:
Cells:
The space for each character is called a cell in this module. Cells are all of an identical size, which is based on the font being used. (only a single font of a single size can be used in a PygcurseSurface object. Cell coordinates refer to the positions of characters on the surface. Pixel coordinates refer to the position of each pixel.
@@ -69,6 +75,13 @@
4) A string such as 'blue', 'lime', or 'gray' (or any of the strings listed in the colornames gloal dictionary. This dict can be updated with more colors if the user wants.)
5) None, which means use whatever color the cell already uses.
+Region parameters:
+A "region" defines an area of the surface. It can be the following formats:
+ 1) Four-integer tuple (x, y, width, height)
+ 2) Four-integer tuple (x, y, None, None) which means x,y and extending to the right & bottom edge of the surface
+ 3) None or (None, None, None, None) which means the entire surface
+ 4) pygame.Rect object
+
Note about flickering: If your program is experiencing a lot of flicker, than you should disable the self._autoupdate member. By default, this is enabled and the screen is redrawn after each method call that makes a change to the screen.
"""

0 comments on commit d1ba6c6

Please sign in to comment.