Skip to content

Commit

Permalink
More tutorials :)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaschaaf committed Oct 17, 2012
1 parent b5a7b22 commit fee193e
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 56 deletions.
4 changes: 2 additions & 2 deletions tutorial/stage0/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import sys
# for windows
# > python setup.py py2exe
Expand All @@ -19,7 +17,9 @@
from setuptools import setup

setup(
name = "example-app",
app=["example.py"],
version = "0.0",
setup_requires=["py2app"],
options={'py2app':{}},
)
42 changes: 29 additions & 13 deletions tutorial/stage1/setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@

# Use bdist_esky instead of py2exe
import sys
from esky import bdist_esky
from distutils.core import setup

setup(
name = "example-app",
version = "0.1",
# All executables are listed in the "scripts" argument
scripts = ["example.py"],
options = {"py2exe": {
"dll_excludes":["pywintypes26.dll"],
}}
)

# for windows
# > python setup.py bdist_esky
if sys.platform in ['win32','cygwin','win64']:

# Use bdist_esky instead of py2exe
from distutils.core import setup

setup(
name = "example-app",
version = "0.1",
# All executables are listed in the "scripts" argument
scripts = ["example.py"],
options = {"bdist_esky": {
"freezer_module":"py2exe",
}}
)

# for mac
# > python setup.py bdist_esky
elif sys.platform == 'darwin':
setup(
name = "example-app",
version = "0.1",
scripts = ["example.py"],
options = {"bdist_esky": {
"freezer_module":"py2app"
}}
)
35 changes: 28 additions & 7 deletions tutorial/stage2/setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@

import sys
from esky import bdist_esky
from distutils.core import setup

setup(
name = "example-app",
version = "0.2",
scripts = ["example.py"]
)
# for windows
# > python setup.py bdist_esky
if sys.platform in ['win32','cygwin','win64']:

# Use bdist_esky instead of py2exe
from distutils.core import setup

setup(
name = "example-app",
version = "0.2",
# All executables are listed in the "scripts" argument
scripts = ["example.py"],
options = {"bdist_esky": {
"freezer_module":"py2exe",
}}
)

# for mac
# > python setup.py bdist_esky
elif sys.platform == 'darwin':
setup(
name = "example-app",
version = "0.2",
scripts = ["example.py"],
options = {"bdist_esky": {
"freezer_module":"py2app"
}}
)
35 changes: 28 additions & 7 deletions tutorial/stage3/setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@

import sys
from esky import bdist_esky
from distutils.core import setup

setup(
name = "example-app",
version = "0.3",
scripts = ["example.py"]
)
# for windows
# > python setup.py bdist_esky
if sys.platform in ['win32','cygwin','win64']:

# Use bdist_esky instead of py2exe
from distutils.core import setup

setup(
name = "example-app",
version = "0.3",
# All executables are listed in the "scripts" argument
scripts = ["example.py"],
options = {"bdist_esky": {
"freezer_module":"py2exe",
}}
)

# for mac
# > python setup.py bdist_esky
elif sys.platform == 'darwin':
setup(
name = "example-app",
version = "0.3",
scripts = ["example.py"],
options = {"bdist_esky": {
"freezer_module":"py2app"
}}
)
1 change: 1 addition & 0 deletions tutorial/stage4/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

if getattr(sys,"frozen",False):
app = esky.Esky(sys.executable,"https://example-app.com/downloads/")
print "You are running: %s" % app.active_version
try:
if(app.find_update() != None):
app.auto_update()
Expand Down
97 changes: 70 additions & 27 deletions tutorial/stage4/setup.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,74 @@

import os, sys
import os, sys, time
from esky.bdist_esky import Executable
from distutils.core import setup
from glob import glob

subversion = 6;

if sys.platform in ['win32','cygwin','win64']:

data_files = [("images", glob(r'.\images\*.*'))]

# We can customuse the executable's creation by passing an instance
# of Executable() instead of just the script name.
example = Executable("example.py",
# give our app the standard Python icon
icon=os.path.join(sys.prefix,"DLLs","py.ico"),
# we could make the app gui-only by setting this to True
gui_only=False,
# any other keyword args would be passed on to py2exe
)

setup(
data_files=data_files,
name = "example-app",
version = "0.4.%d" % subversion,
scripts = [example],
options = {"bdist_esky":{
# forcibly include some other modules
"includes": ["SocketServer","email"],
# forcibly exclude some other modules
"excludes": ["pydoc"],
# force esky to freeze the app using py2exe
"freezer_module": "py2exe",
# tweak the options used by py2exe
"freezer_options": {"bundle_files":3,"compressed":True},
}}
)

if sys.platform == 'darwin':

data_files = [("images", glob(r'.\images\*.*'))]
app = ['example.py']

example = Executable("example.py",
#icon = os.path.join("images/box.icns"),
)

# We can customuse the executable's creation by passing an instance
# of Executable() instead of just the script name.
example = Executable("example.py",
# give our app the standard Python icon
icon=os.path.join(sys.prefix,"DLLs","py.ico"),
# we could make the app gui-only by setting this to True
gui_only=False,
# any other keyword args would be passed on to py2exe
)

setup(
name = "example-app",
version = "0.4",
scripts = [example],
options = {"bdist_esky":{
# forcibly include some other modules
"includes": ["SocketServer","email"],
# forcibly exclude some other modules
"excludes": ["pydoc"],
# force esky to freeze the app using py2exe
"freezer_module": "py2exe",
# tweak the options used by py2exe
"freezer_options": {"bundle_files":3,"compressed":True},
}},
)
options = {
"bdist_esky":{
# forcibly include some other modules
"includes": [],
# forcibly exclude some other modules
"excludes": ["pydoc"],
# force esky to freeze the app using py2exe
"freezer_module": "py2app",
# tweak the options used by py2exe
"freezer_options": {
"plist" : {
#"LSUIElement" : True,
#'CFBundleIdentifier': 'de.cloudmatrix.esky',
#'CFBundleIconFile' : 'images/box.icns',
}
},
}
}

setup(
app=app,
name = "example-app",
version = "0.4.%d" % subversion,
data_files=data_files,
options=options,
scripts = [example],
)

0 comments on commit fee193e

Please sign in to comment.