From 748ff0fee8e61e6bfc9ee751f5cceb817c4fcbc9 Mon Sep 17 00:00:00 2001 From: Aaron Gordon Date: Wed, 19 Dec 2012 07:31:11 +0000 Subject: Added folders --- diff --git a/almostimportstdlib/__init__.py b/almostimportstdlib/__init__.py new file mode 100644 index 0000000..0203dfd --- /dev/null +++ b/almostimportstdlib/__init__.py @@ -0,0 +1,11 @@ +""" +This small package makes py2exe pack the entire Python 2.6.2 stdlib. +It does so by "almost" importing the entire stdlib. +To use it, just import it, and that's it: +py2exe will pack the entire stdlib with your executable. +If you want to change the list of modules, dig in +the code, it's very short. +""" + +from almostimportstdlib import * +from almostimportstdlibmaker import * \ No newline at end of file diff --git a/almostimportstdlib/almostimportstdlib.py b/almostimportstdlib/almostimportstdlib.py new file mode 100644 index 0000000..7d82391 --- /dev/null +++ b/almostimportstdlib/almostimportstdlib.py @@ -0,0 +1,315 @@ +""" +To understand this module, +please refer to the containing pacakge's documentation. +""" + +if False: + import AutoComplete + import AutoCompleteWindow + import AutoExpand + import BaseHTTPServer + import Bastion + import Bindings + import CGIHTTPServer + import CallTipWindow + import CallTips + import Canvas + import ClassBrowser + import CodeContext + import ColorDelegator + import ConfigParser + import Cookie + import Debugger + import Delegator + import Dialog + import DocXMLRPCServer + import EditorWindow + import FileDialog + import FileList + import FixTk + import FormatParagraph + import GrepDialog + import HTMLParser + import HyperParser + import IOBinding + import IdleHistory + import MimeWriter + import MultiCall + import MultiStatusBar + import ObjectBrowser + import OutputWindow + import ParenMatch + import PathBrowser + import Percolator + import PyParse + import PyShell + import Queue + import RemoteDebugger + import RemoteObjectBrowser + import ReplaceDialog + import ScriptBinding + import ScrolledList + import ScrolledText + import SearchDialog + import SearchDialogBase + import SearchEngine + import SimpleDialog + import SimpleHTTPServer + import SimpleXMLRPCServer + import SocketServer + import StackViewer + import StringIO + import Tix + import Tkconstants + import Tkdnd + import Tkinter + import ToolTip + import TreeWidget + import UndoDelegator + import UserDict + import UserList + import UserString + import WidgetRedirector + import WindowList + import ZoomHeight + import _LWPCookieJar + import _MozillaCookieJar + import __future__ + import _abcoll + import _bsddb + import _ctypes + import _ctypes_test + import _elementtree + import _hashlib + import _msi + import _multiprocessing + import _socket + import _sqlite3 + import _ssl + import _strptime + import _testcapi + import _threading_local + import _tkinter + import abc + import aboutDialog + import aifc + import anydbm + import ast + import asynchat + import asyncore + import atexit + import audiodev + import base64 + import bdb + import binhex + import bisect + import bsddb + import bz2 + import cProfile + import calendar + import cgi + import cgitb + import chunk + import cmd + import code + import codecs + import codeop + import collections + import colorsys + import commands + import compileall + import compiler + import configDialog + import configHandler + import configHelpSourceEdit + import configSectionNameDialog + import contextlib + import cookielib + import copy + import copy_reg + import csv + import ctypes + import curses + import dbhash + import decimal + import difflib + import dircache + import dis + import distutils + import doctest + import dumbdbm + import dummy_thread + import dummy_threading + import dynOptionMenuWidget + import email + import encodings + import filecmp + import fileinput + import fnmatch + import formatter + import fpformat + import fractions + import ftplib + import functools + import genericpath + import getopt + import getpass + import gettext + import glob + import gzip + import hashlib + import heapq + import hmac + import hotshot + import htmlentitydefs + import htmllib + import httplib + import idle + import idlelib + import idlever + import ihooks + import imaplib + import imghdr + import imputil + import inspect + import io + import json + import keybindingDialog + import keyword + import lib2to3 + import linecache + import locale + import logging + import macosxSupport + import macpath + import macurl2path + import mailbox + import mailcap + import markupbase + import md5 + import mhlib + import mimetools + import mimetypes + import mimify + import modulefinder + import msilib + import multifile + import multiprocessing + import mutex + import netrc + import new + import nntplib + import ntpath + import nturl2path + import numbers + import opcode + import optparse + import os + import os2emxpath + import pdb + import pickle + import pickletools + import pipes + import pkgutil + import platform + import plistlib + import popen2 + import poplib + import posixfile + import posixpath + import pprint + import profile + import pstats + import pty + import py_compile + import pyclbr + import pydoc + import pydoc_topics + import pyexpat + import quopri + import random + import re + import repr + import rexec + import rfc822 + import rlcompleter + import robotparser + import rpc + import run + import runpy + import sched + import select + import sets + import sgmllib + import sha + import shelve + import shlex + import shutil + import site + import smtpd + import smtplib + import sndhdr + import socket + import sqlite3 + import sre + import sre_compile + import sre_constants + import sre_parse + import ssl + import stat + import statvfs + import string + import stringold + import stringprep + import struct + import subprocess + import sunau + import sunaudio + import symbol + import symtable + import tabbedpages + import tabnanny + import tarfile + import telnetlib + import tempfile + import test + import testcode + import textView + import textwrap + import this + import threading + import timeit + import tkColorChooser + import tkCommonDialog + import tkFileDialog + import tkFont + import tkMessageBox + import tkSimpleDialog + import toaiff + import token + import tokenize + import trace + import traceback + import tty + import turtle + import types + import unicodedata + import unittest + import urllib + import urllib2 + import urlparse + import user + import uu + import uuid + import warnings + import wave + import weakref + import webbrowser + import whichdb + import winsound + import wsgiref + import xdrlib + import xml + import xmllib + import xmlrpclib + import zipfile \ No newline at end of file diff --git a/almostimportstdlib/almostimportstdlibmaker.py b/almostimportstdlib/almostimportstdlibmaker.py new file mode 100644 index 0000000..5415540 --- /dev/null +++ b/almostimportstdlib/almostimportstdlibmaker.py @@ -0,0 +1,42 @@ +""" +This module creates a file called almostimportstdlib.py, which "almost" imports +the entire Python stdlib. (i.e., if False: import...) +Invoke `make()` to generate that file (if it's not generated already.) + +`modules` is supposed to be a list of all the modules of stdlib of Python 2.6.2. +It was created like this: + +print [thing[1] for thing in pkgutil.iter_modules()] +(on a virtual machine with a clean installation of Python 2.6.2.) + +Then copy-pasted into this file. +If you are interesting in import the stdlib of a different version of Python, +feel free to do the same procedure with the virtual machine and replace +`modules` in this file. (Please note this in this comment if you do.) + +Submodules (i.e. email.errors) are not included in `modules`, +But it seems py2exe is careful enough to include them in the package anyway, +just because their parent module might be imported. +""" + +def make(): + """ + Generates the file almostimportstdlib.py which almost imports the stdlib. + See the documentations of the containing package and module. + """ + modules=['AutoComplete', 'AutoCompleteWindow', 'AutoExpand', 'BaseHTTPServer', 'Bastion', 'Bindings', 'CGIHTTPServer', 'CallTipWindow', 'CallTips', 'Canvas', 'ClassBrowser', 'CodeContext', 'ColorDelegator', 'ConfigParser', 'Cookie', 'Debugger', 'Delegator', 'Dialog', 'DocXMLRPCServer', 'EditorWindow', 'FileDialog', 'FileList', 'FixTk', 'FormatParagraph', 'GrepDialog', 'HTMLParser', 'HyperParser', 'IOBinding', 'IdleHistory', 'MimeWriter', 'MultiCall', 'MultiStatusBar', 'ObjectBrowser', 'OutputWindow', 'ParenMatch', 'PathBrowser', 'Percolator', 'PyParse', 'PyShell', 'Queue', 'RemoteDebugger', 'RemoteObjectBrowser', 'ReplaceDialog', 'ScriptBinding', 'ScrolledList', 'ScrolledText', 'SearchDialog', 'SearchDialogBase', 'SearchEngine', 'SimpleDialog', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'SocketServer', 'StackViewer', 'StringIO', 'Tix', 'Tkconstants', 'Tkdnd', 'Tkinter', 'ToolTip', 'TreeWidget', 'UndoDelegator', 'UserDict', 'UserList', 'UserString', 'WidgetRedirector', 'WindowList', 'ZoomHeight', '_LWPCookieJar', '_MozillaCookieJar', '__future__', '_abcoll', '_bsddb', '_ctypes', '_ctypes_test', '_elementtree', '_hashlib', '_msi', '_multiprocessing', '_socket', '_sqlite3', '_ssl', '_strptime', '_testcapi', '_threading_local', '_tkinter', 'abc', 'aboutDialog', 'aifc', 'anydbm', 'ast', 'asynchat', 'asyncore', 'atexit', 'audiodev', 'base64', 'bdb', 'binhex', 'bisect', 'bsddb', 'bz2', 'cProfile', 'calendar', 'cgi', 'cgitb', 'chunk', 'cmd', 'code', 'codecs', 'codeop', 'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'configDialog', 'configHandler', 'configHelpSourceEdit', 'configSectionNameDialog', 'contextlib', 'cookielib', 'copy', 'copy_reg', 'csv', 'ctypes', 'curses', 'dbhash', 'decimal', 'difflib', 'dircache', 'dis', 'distutils', 'doctest', 'dumbdbm', 'dummy_thread', 'dummy_threading', 'dynOptionMenuWidget', 'email', 'encodings', 'filecmp', 'fileinput', 'fnmatch', 'formatter', 'fpformat', 'fractions', 'ftplib', 'functools', 'genericpath', 'getopt', 'getpass', 'gettext', 'glob', 'gzip', 'hashlib', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib', 'httplib', 'idle', 'idlelib', 'idlever', 'ihooks', 'imaplib', 'imghdr', 'imputil', 'inspect', 'io', 'json', 'keybindingDialog', 'keyword', 'lib2to3', 'linecache', 'locale', 'logging', 'macosxSupport', 'macpath', 'macurl2path', 'mailbox', 'mailcap', 'markupbase', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'mimify', 'modulefinder', 'msilib', 'multifile', 'multiprocessing', 'mutex', 'netrc', 'new', 'nntplib', 'ntpath', 'nturl2path', 'numbers', 'opcode', 'optparse', 'os', 'os2emxpath', 'pdb', 'pickle', 'pickletools', 'pipes', 'pkgutil', 'platform', 'plistlib', 'popen2', 'poplib', 'posixfile', 'posixpath', 'pprint', 'profile', 'pstats', 'pty', 'py_compile', 'pyclbr', 'pydoc', 'pydoc_topics', 'pyexpat', 'quopri', 'random', 're', 'repr', 'rexec', 'rfc822', 'rlcompleter', 'robotparser', 'rpc', 'run', 'runpy', 'sched', 'select', 'sets', 'sgmllib', 'sha', 'shelve', 'shlex', 'shutil', 'site', 'smtpd', 'smtplib', 'sndhdr', 'socket', 'sqlite3', 'sre', 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stat', 'statvfs', 'string', 'stringold', 'stringprep', 'struct', 'subprocess', 'sunau', 'sunaudio', 'symbol', 'symtable', 'tabbedpages', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'test', 'testcode', 'textView', 'textwrap', 'this', 'threading', 'timeit', 'tkColorChooser', 'tkCommonDialog', 'tkFileDialog', 'tkFont', 'tkMessageBox', 'tkSimpleDialog', 'toaiff', 'token', 'tokenize', 'trace', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib', 'urllib2', 'urlparse', 'user', 'uu', 'uuid', 'warnings', 'wave', 'weakref', 'webbrowser', 'whichdb', 'winsound', 'wsgiref', 'xdrlib', 'xml', 'xmllib', 'xmlrpclib', 'zipfile'] + import_modules=[(" import " + module) for module in modules] + prologue="""\"\"\" +To understand this module, +please refer to the containing pacakge's documentation. +\"\"\" + +if False: +""" + str = prologue + "\n".join(import_modules) + f = open("almostimportstdlib.py","w") + f.write(str) + f.close() + +if __name__=="__main__": + make() diff --git a/misc/__init__.py b/misc/__init__.py new file mode 100644 index 0000000..d337bdf --- /dev/null +++ b/misc/__init__.py @@ -0,0 +1,3 @@ +""" +A package of miscellanious stuff for the PythonTurtle package. +""" \ No newline at end of file diff --git a/misc/angles.py b/misc/angles.py new file mode 100644 index 0000000..04fe080 --- /dev/null +++ b/misc/angles.py @@ -0,0 +1,8 @@ +""" +Lambda functions for converting angles between radians +and degrees +""" +import math + +deg_to_rad=lambda deg: (deg*math.pi)/180 +rad_to_deg=lambda rad: (rad/math.pi)*180 \ No newline at end of file diff --git a/misc/dumpqueue.py b/misc/dumpqueue.py new file mode 100644 index 0000000..5a5b744 --- /dev/null +++ b/misc/dumpqueue.py @@ -0,0 +1,20 @@ +""" +See documentation for dump_queue defined here. +""" +import Queue + + +def dump_queue(queue): + """ + Empties all pending items in a queue + and returns them in a list. + """ + result=[] + + while True: + try: + thing=queue.get(block=False) + result.append(thing) + except Queue.Empty: + return result + diff --git a/misc/fromresourcefolder.py b/misc/fromresourcefolder.py new file mode 100644 index 0000000..d5c8320 --- /dev/null +++ b/misc/fromresourcefolder.py @@ -0,0 +1,3 @@ +import os +def from_resource_folder(filename): + return os.path.join("resources",filename) \ No newline at end of file diff --git a/resources/help1.png b/resources/help1.png new file mode 100644 index 0000000..0487e58 --- /dev/null +++ b/resources/help1.png Binary files differ diff --git a/resources/help2.png b/resources/help2.png new file mode 100644 index 0000000..5855479 --- /dev/null +++ b/resources/help2.png Binary files differ diff --git a/resources/help3.png b/resources/help3.png new file mode 100644 index 0000000..38bb6cc --- /dev/null +++ b/resources/help3.png Binary files differ diff --git a/resources/help4.png b/resources/help4.png new file mode 100644 index 0000000..8dbccb6 --- /dev/null +++ b/resources/help4.png Binary files differ diff --git a/resources/icon.icns b/resources/icon.icns new file mode 100644 index 0000000..bdfc19a --- /dev/null +++ b/resources/icon.icns Binary files differ diff --git a/resources/icon.ico b/resources/icon.ico new file mode 100644 index 0000000..4723682 --- /dev/null +++ b/resources/icon.ico Binary files differ diff --git a/resources/lets_code.png b/resources/lets_code.png new file mode 100644 index 0000000..068210c --- /dev/null +++ b/resources/lets_code.png Binary files differ diff --git a/resources/teach_me.png b/resources/teach_me.png new file mode 100644 index 0000000..fa86109 --- /dev/null +++ b/resources/teach_me.png Binary files differ diff --git a/resources/turtle.png b/resources/turtle.png new file mode 100644 index 0000000..1ae4ea1 --- /dev/null +++ b/resources/turtle.png Binary files differ -- cgit v0.9.1