From: pin Date: Fri, 21 May 2010 12:53:26 +0000 (+0000) Subject: Ça commence à le faire pour la création de l'exe. Reste à voir comment faire fonction... X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/commitdiff_plain/79aca379ed6dffa4d71d66f513a973d2e3470c5a Ça commence à le faire pour la création de l'exe. Reste à voir comment faire fonctionner les fontes pygame (et autres) git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@186 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/setup_win_exe.py b/setup_win_exe.py index 89ca0e9..c903cd9 100755 --- a/setup_win_exe.py +++ b/setup_win_exe.py @@ -31,7 +31,7 @@ class pygame2exe(py2exe.build_exe.py2exe): #This hack make sure that pygame defa class BuildExe: def __init__(self): #Name of starting .py - self.script = "src/minwii/app.py" + self.script = "src/minwii/start_win.py" #Name of program self.project_name = "MINWii" @@ -139,9 +139,13 @@ class BuildExe: 'icon_resources': [(0, self.icon_file)], 'copyright': self.copyright }], - options = {'py2exe': {'optimize': 2, 'bundle_files': 1, 'compressed': True, \ - 'excludes': self.exclude_modules, 'packages': self.extra_modules, \ - 'dll_excludes': self.exclude_dll} }, + options = {'py2exe': {#'optimize': 2, + 'bundle_files': 1, + #'compressed': True, + 'excludes': self.exclude_modules, + 'packages': self.extra_modules, + 'dll_excludes': self.exclude_dll} + }, zipfile = self.zipfile_name, data_files = extra_datas, dist_dir = self.dist_dir @@ -154,4 +158,4 @@ if __name__ == '__main__': if operator.lt(len(sys.argv), 2): sys.argv.append('py2exe') BuildExe().run() #Run generation - raw_input("Press any key to continue") #Pause to let user see that things ends + #raw_input("Press any key to continue") #Pause to let user see that things ends diff --git a/src/minwii/app.py b/src/minwii/app.py index 55ea722..076ca38 100755 --- a/src/minwii/app.py +++ b/src/minwii/app.py @@ -9,16 +9,16 @@ $URL$ import pygame from pgu.gui import Desktop from pgu.gui import QUIT -from widgets.launch import LaunchScreen -from widgets.home import Home -from widgets.playingscreen import SongPlayingScreen, PlayingScreen -from widgets.instrumentselector import InstrumentSelector -from synth import Synth -from eventutils import EventDispatcher -from musicxml import musicXml2Song -from config import SONG_FILE_PATH -from globals import PLAYING_MODES_DICT -from log import console, LOG_FORMAT_VERSION, envLogger +from minwii.widgets.launch import LaunchScreen +from minwii.widgets.home import Home +from minwii.widgets.playingscreen import SongPlayingScreen, PlayingScreen +from minwii.widgets.instrumentselector import InstrumentSelector +from minwii.synth import Synth +from minwii.eventutils import EventDispatcher +from minwii.musicxml import musicXml2Song +from minwii.config import SONG_FILE_PATH +from minwii.globals import PLAYING_MODES_DICT +from minwii.log import console, LOG_FORMAT_VERSION, envLogger class MinWii(object): diff --git a/src/minwii/start_win.py b/src/minwii/start_win.py new file mode 100755 index 0000000..6eb8d18 --- /dev/null +++ b/src/minwii/start_win.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +""" +lancement de l'application winwii + +$Id$ +$URL$ +""" + + +import pygame +from minwii.app import MinWii + + +def main(wiimoteSupport) : + pygame.init() + minwii = MinWii(wiimoteSupport=wiimoteSupport) + minwii.run() + pygame.quit() + +if __name__ == "__main__" : + main(True) diff --git a/src/minwii/widgets/column.py b/src/minwii/widgets/column.py index 6577296..99f259f 100755 --- a/src/minwii/widgets/column.py +++ b/src/minwii/widgets/column.py @@ -6,21 +6,21 @@ $Id$ $URL$ """ import pygame -import gradients from math import floor -from globals import BACKGROUND_LAYER -from globals import FOREGROUND_LAYER -from globals import hls_to_rgba_8bits -from config import OFF_LUMINANCE -from config import OFF_SATURATION -from config import ON_TOP_LUMINANCE -from config import ON_BOTTOM_LUMINANCE -from config import ON_SATURATION -from config import ON_COLUMN_OVERSIZING -from config import ON_COLUMN_ALPHA -from config import LYRICS_FONT, NOTES_FONT -from config import FONT_COLOR -import events +import minwii.gradients +from minwii.globals import BACKGROUND_LAYER +from minwii.globals import FOREGROUND_LAYER +from minwii.globals import hls_to_rgba_8bits +from minwii.config import OFF_LUMINANCE +from minwii.config import OFF_SATURATION +from minwii.config import ON_TOP_LUMINANCE +from minwii.config import ON_BOTTOM_LUMINANCE +from minwii.config import ON_SATURATION +from minwii.config import ON_COLUMN_OVERSIZING +from minwii.config import ON_COLUMN_ALPHA +from minwii.config import LYRICS_FONT, NOTES_FONT +from minwii.config import FONT_COLOR +import minwii.events class Column(pygame.sprite.DirtySprite) : diff --git a/src/minwii/widgets/cursors.py b/src/minwii/widgets/cursors.py index fa1f673..ad8f383 100755 --- a/src/minwii/widgets/cursors.py +++ b/src/minwii/widgets/cursors.py @@ -10,7 +10,7 @@ import pygame import os from threading import Thread import time -from eventutils import EventHandlerMixin, event_handler +from minwii.eventutils import EventHandlerMixin, event_handler from itertools import cycle class WarpingCursor(pygame.sprite.DirtySprite, EventHandlerMixin): diff --git a/src/minwii/widgets/home.py b/src/minwii/widgets/home.py index afd84ec..e1f95c4 100755 --- a/src/minwii/widgets/home.py +++ b/src/minwii/widgets/home.py @@ -17,7 +17,7 @@ from pgu.gui import CLICK from pgu.gui import QUIT from pgu.gui import CHANGE import pygame -from globals import PLAYING_MODES +from minwii.globals import PLAYING_MODES from songfilebrowser import FileOpenDialog import os.path diff --git a/src/minwii/widgets/instrumentselector.py b/src/minwii/widgets/instrumentselector.py index 6861643..f2ef178 100755 --- a/src/minwii/widgets/instrumentselector.py +++ b/src/minwii/widgets/instrumentselector.py @@ -7,14 +7,14 @@ $URL$ """ import os.path import pygame -from eventutils import event_handler, EventDispatcher, EventHandlerMixin +from minwii.eventutils import event_handler, EventDispatcher, EventHandlerMixin +from minwii.config import FRAMERATE +from minwii.config import INSTRUMENTS +from minwii.globals import BACKGROUND_LAYER +from minwii.globals import FOREGROUND_LAYER +from minwii.globals import CURSOR_LAYER +from minwii.globals import hls_to_rgba_8bits from cursors import WarpingCursor -from config import FRAMERATE -from config import INSTRUMENTS -from globals import BACKGROUND_LAYER -from globals import FOREGROUND_LAYER -from globals import CURSOR_LAYER -from globals import hls_to_rgba_8bits class InstrumentSelector(pygame.sprite.LayeredDirty, EventHandlerMixin) : diff --git a/src/minwii/widgets/playingscreen.py b/src/minwii/widgets/playingscreen.py index 0735825..0591929 100755 --- a/src/minwii/widgets/playingscreen.py +++ b/src/minwii/widgets/playingscreen.py @@ -7,22 +7,22 @@ $Id$ $URL$ """ import pygame -from cursors import WarpingCursor -from column import Column -import events -from eventutils import event_handler, EventDispatcher, EventHandlerMixin import types -from musicxml import Tone -from config import FRAMERATE -from config import FIRST_HUE -from config import MIDI_VELOCITY_RANGE -from config import MIDI_PAN_RANGE -from config import MIDI_VELOCITY_WRONG_NOTE_ATTN +import minwii.events as events +from minwii.eventutils import event_handler, EventDispatcher, EventHandlerMixin +from minwii.musicxml import Tone +from minwii.config import FRAMERATE +from minwii.config import FIRST_HUE +from minwii.config import MIDI_VELOCITY_RANGE +from minwii.config import MIDI_PAN_RANGE +from minwii.config import MIDI_VELOCITY_WRONG_NOTE_ATTN +from minwii.globals import BACKGROUND_LAYER +from minwii.globals import CURSOR_LAYER +from minwii.globals import PLAYING_MODES_DICT -from globals import BACKGROUND_LAYER -from globals import CURSOR_LAYER -from globals import PLAYING_MODES_DICT +from cursors import WarpingCursor +from column import Column class PlayingScreenBase(pygame.sprite.LayeredDirty, EventHandlerMixin) :