christine_setup.py :  » Media-Sound-Audio » Christine-Media-Player » christine-0.6.1 » win32resources » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Media Sound Audio » Christine Media Player 
Christine Media Player » christine 0.6.1 » win32resources » christine_setup.py
from distutils.core import setup,Extension
import os
import glob
import sys
import py2exe
import shutil

def getFiles(dir):
  """
  Retorna una tupla de tuplas del directorio
  """
  # dig looking for files
  a= os.walk(dir)
  b = True
  filenames = []

  while (b):
    try: 
      (dirpath, dirnames, files) = a.next()
      filenames.append([dirpath, tuple(files)])
    except:
      b = False
  return filenames


origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
  dlls = ("msvcp71.dll", "dwmapi.dll", "jpeg62.dll","mfc71.dll")
  if os.path.basename(pathname).lower() in dlls:
    return 0
  return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL

class Target:
  def __init__(self,**kw):
      self.__dict__.update(kw)
      self.author = 'Marco Islas'
      self.maintainer = 'Marco Antonio Islas Cruz'
      self.maintainer_email = 'markuz@islascruz.org'
      self.url='http://www.christine-project.org'
      self.classifiers=[
              'Development Status :: 4 - Beta',
              'Environment :: GUI',
              'Intended Audience :: End Users/Desktop',
              'License :: OSI Approved :: GNU/GPL v.2.0',
              'Operating System :: Microsoft :: Windows',
              'Operating System :: POSIX',
              'Programming Language :: Python',
              'Programming Language :: C',
              ]
      self.platforms = ['Posix','Windows XP', 'Windows 2000','Windows Vista']
      self.version        = "0.6.0"
      self.compay_name    = "Christine Project"
      self.copyright      = "(c) 2006-2009, Marco Islas"
      self.name           = "Christine Media Player"
      self.description = 'Christine Media Player'
      self.icon_resources =  [(0, "win32resources/christine.ico")]

target = Target(script = "christine.py")

CLibraryModel = Extension(name = 'libchristine.CLibraryModel',
          language = 'c',
                    sources = ['libchristine/CLibraryModel.c'])
ChristineGtkBuilder= Extension(name = 'libchristine.gui.ChristineGtkBuilder',
          language = 'c',
                    sources = ['libchristine/gui/ChristineGtkBuilder.c'],
                include_dirs=['./gtksrc', 'c:\Python26\include',
                              'c:\Python26\include\pygtk-2.0',
                              'c:\Python26\include\pycairo'],
        )



setup(
    windows = [target],
  #Useful for debuggin?, I don't know, but if you want you can use the
  #sources.
    #console = [target],
    options = {
                  'py2exe': {
                      'packages':'encodings,libchristine',
                      'includes': 'cairo, pango, pangocairo, atk, gobject',
                      'optimize': 0,
                      'excludes':'doctest,pdb,unittest,difflib,inspect',
            'compressed': 0,
            'skip_archive':1,
            'unbuffered':True,
                  }
              },

     data_files=[("gui", glob.glob("gui/*.*")),
                 ("gui/pixmaps",glob.glob("gui/pixmaps/*.*")),
    ],
  ext_modules=[CLibraryModel]#,ChristineGtkBuilder],
)

try:
  for i in ['etc','lib','share']:
    shutil.copytree(i,os.path.join('dist',i))
  shutil.copy(os.path.join('c:\\','GTK','bin','jpeg62.dll'),
                             os.path.join('dist','jpeg62.dll'))
except Exception, e:
  pass

shutil.copy(os.path.join("./",'build','lib.win32-%d.%d'%tuple(sys.version_info[:2]),'libchristine','CLibraryModel.pyd'),
    os.path.join('dist','libchristine','CLibraryModel.pyd'))
#shutil.copy(os.path.join("./",'build','lib.win32-%d.%d'%tuple(sys.version_info[:2]),'libchristine','ChristineGtkBuilder.pyd'),
#    os.path.join('dist','libchristine','ChristineGtkBuilder.pyd'))
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.