Commits

Arne Babenhauserheide  committed 4703715

setuptools fixes to make fungus egg distributable.

  • Participants
  • Parent commits 8ff6d52
  • Tags v0.1.1

Comments (0)

Files changed (4)

File fungus_audio_scene.py

 
 # Also listdir to see the files in the audio dir
 from os import listdir
-from os.path import isfile, join
+from os.path import isfile, join, dirname
 
 #### An example audio scene ####
 
 ## An audio file ##
 sword_file = "sword.wav"
 
+AUDIO_BASE_PATH = join(dirname(__file__), "audio")
+
 ### The Scene itself. 
 
 class Scene(BaseScene): 

File fungus_game.py

     - python fungus_game.py fungus_01_intro.Scene
       Start the fungus Intro
 
-Website: 
+For developers: 
+    - Just clone the fungus project from the Mercurial repository and add your scenes inside it. 
+      Distribute them along with the fungus engine. 
+
+Mercurial repository: 
     - http://freehg.org/u/ArneBab/fungus/
 
-To adjust the default scene, just import another one as Scene
+To adjust the default scene, just import another one as Scene in fungus_game.py
 """
 
 ### Imports ###

File fungus_swarm.py

 from fungus_core import Sprite
 from fungus_scene import BaseScene
 
-from os.path import join
+from os.path import join, dirname
 
 from random import random, choice, randint
 
 
 ### Things needed for the scene
 
+IMAGE_BASE_PATH = join(dirname(__file__), "graphics")
+
 class Blob(Sprite): 
 	"""One of the moving blobs.
 	
 	_unbonded = UNBONDED
 	def __init__(self, sex=None, *args, **kwds): 
 		if sex is None: 
-			super(Blob, self).__init__(image_path=join("graphics", "blobn.png"), *args, **kwds)
+			super(Blob, self).__init__(image_path=join(IMAGE_BASE_PATH, "blobn.png"), *args, **kwds)
 		elif sex=="female":
-			super(Blob, self).__init__(image_path=join("graphics", "blobf.png"), *args, **kwds)
+			super(Blob, self).__init__(image_path=join(IMAGE_BASE_PATH, "blobf.png"), *args, **kwds)
 		else: # male
- 			super(Blob, self).__init__(image_path=join("graphics", "blob.png"), *args, **kwds)
+ 			super(Blob, self).__init__(image_path=join(IMAGE_BASE_PATH, "blob.png"), *args, **kwds)
 		#: The one to move towards
 		self.partner = None
 		#: The last partner
 #    You should have received a copy of the GNU General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>
 
-"""Fungus - Live and survive in a world of mold.
+"""Fungus - A simple scene based game engine building on pyglet.
 """
 
 # We use the advanced setuptools. 
-from setuptools import setup
+from setuptools import setup, find_packages
+#from distutils.core import setup
 # If we have one or more packages, we also need to import find packages  
 # It is currently not necessary. 
 # The corresponding line in setup() is commented out, too. 
 # from setuptools import find_packages
 
-__version__ = "0.1"
+__version__ = "0.1.1"
 
 # Create the description from the docstrings 
 
 LONG_DESCRIPTION += "\n\n" + "\n".join(fungus_game__doc__.split("\n")[3:])
 
 # And the Changelog from Changelog.txt
-#LONG_DESCRIPTION += "\n\n" + __changelog__
+# Load the changelog data
+try: 
+    f = open("Changelog.txt", "r")
+    __changelog__ = f.readlines()
+    __changelog__ = ["  " + line for line in __changelog__]
+    __changelog__ = "\n".join(__changelog__)
+    f.close()
+except: 
+    __changelog__ == ""
+LONG_DESCRIPTION += "\n\nChangelog: \n" + __changelog__
 
 
 # Fire up setup with these values.i- must be modified. 
       version=__version__,
       description=DESCRIPTION,
       long_description=LONG_DESCRIPTION, 
-      author='Phillip Schönherr and Arne Babenhauserheide',
+      author='Phillip Schoenherr and Arne Babenhauserheide',
       author_email='arne_bab@web.de',
       keywords=["game engine", "pyglet"], 
       license="GNU GPL-3 or later", 
       platforms=["any"], 
       requires = ["pyglet"], 
+      # package data
+      packages = find_packages('.'), 
+      #packages = ['graphics'],
+      package_dir = {'graphics': 'graphics'},
+      package_data = {'': ['*.png', '*.wav*']},
       # All classifiers can be found via python setup.py register --list-classifiers
       classifiers = [
             "License :: OSI Approved :: GNU General Public License (GPL)",
 	    "Topic :: Games/Entertainment"
             ],
       url='http://freehg.org/u/ArneBab/fungus',
-      #packages = find_packages('.'), 
-      py_modules=['fungus_core', 'fungus_scene'],
+      py_modules=['fungus_core', 'fungus_scene', 'fungus_swarm', 'fungus_audio_scene', 'fungus_01_intro', 'fungus_game'],
       scripts=["fungus_game.py"]
      )