# HG changeset patch # User Stefano Rivera # Date 1328998217 -7200 # Node ID 2748d3afcae5234eb6f77e69d5e25353539a30ef # Parent d9623d453fd9f4f52065a1842db17f47f8d7040a Excise albow. Really. diff -r d9623d453fd9 -r 2748d3afcae5 gamelib/scenes/manual.py --- a/gamelib/scenes/manual.py Sun Feb 12 00:01:03 2012 +0200 +++ b/gamelib/scenes/manual.py Sun Feb 12 00:10:17 2012 +0200 @@ -1,7 +1,5 @@ """The inside of the maintenance manual.""" -from albow.music import change_playlist - from pyntnclick.state import Scene, Thing from pyntnclick.scenewidgets import InteractNoImage, InteractImage @@ -113,10 +111,10 @@ def enter(self): self._scene_playlist = self.sound.get_current_playlist() - change_playlist(None) + self.sound.change_playlist(None) def leave(self): - change_playlist(self._scene_playlist) + self.sound.change_playlist(self._scene_playlist) SCENES = [] diff -r d9623d453fd9 -r 2748d3afcae5 gamelib/version.py --- a/gamelib/version.py Sun Feb 12 00:01:03 2012 +0200 +++ b/gamelib/version.py Sun Feb 12 00:10:17 2012 +0200 @@ -78,5 +78,4 @@ NON_EGG_REQUIREMENTS = [ 'setuptools', 'pygame', - 'albow', ] diff -r d9623d453fd9 -r 2748d3afcae5 pyntnclick/cursor.py --- a/pyntnclick/cursor.py Sun Feb 12 00:01:03 2012 +0200 +++ b/pyntnclick/cursor.py Sun Feb 12 00:10:17 2012 +0200 @@ -2,8 +2,6 @@ # Copyright Boomslang team, 2010 (see COPYING File) # Sprite Cursor -from albow.resource import get_image -from albow.widget import Widget from pygame.sprite import Sprite, RenderUpdates from pygame.rect import Rect import pygame @@ -11,9 +9,14 @@ import pygame.cursors import pygame.mouse +from pyntnclick.widgets.base import Widget + # XXX: Need a way to get at the constants from pyntnclick.constants import GameConstants SCENE_SIZE = GameConstants().scene_size +# XXX: Needs a way to get at resource: +from pyntnclick.resources import Resources +get_image = Resources("Resources").get_image class CursorSprite(Sprite): diff -r d9623d453fd9 -r 2748d3afcae5 pyntnclick/state.py --- a/pyntnclick/state.py Sun Feb 12 00:01:03 2012 +0200 +++ b/pyntnclick/state.py Sun Feb 12 00:10:17 2012 +0200 @@ -2,12 +2,19 @@ import copy -from albow.utils import frame_rect from widgets import BoomLabel from pygame.rect import Rect from pygame.color import Color +def frame_rect(surface, color, rect, thick = 1): + # FIXME: Stolen from albow + surface.fill(color, (rect.left, rect.top, rect.width, thick)) + surface.fill(color, (rect.left, rect.bottom - thick, rect.width, thick)) + surface.fill(color, (rect.left, rect.top, thick, rect.height)) + surface.fill(color, (rect.right - thick, rect.top, thick, rect.height)) + + class Result(object): """Result of interacting with a thing""" diff -r d9623d453fd9 -r 2748d3afcae5 pyntnclick/tools/rect_drawer.py --- a/pyntnclick/tools/rect_drawer.py Sun Feb 12 00:01:03 2012 +0200 +++ b/pyntnclick/tools/rect_drawer.py Sun Feb 12 00:10:17 2012 +0200 @@ -4,16 +4,23 @@ import sys import os.path -script_path = os.path.realpath(os.path.dirname(os.path.dirname(__file__))) -sys.path.append(script_path) +# XXX: Threw away albow +#from albow.root import RootWidget +#from albow.utils import frame_rect +#from albow.widget import Widget +#from albow.controls import Button, Image +#from albow.palette_view import PaletteView +#from albow.file_dialogs import request_old_filename +#from albow.resource import get_font +RootWidget = object +frame_rect = None +Widget = object +Button = object +Image = object +PaletteView = object +request_old_filename = None +get_font = None -from albow.root import RootWidget -from albow.utils import frame_rect -from albow.widget import Widget -from albow.controls import Button, Image -from albow.palette_view import PaletteView -from albow.file_dialogs import request_old_filename -from albow.resource import get_font from pygame.locals import (K_LEFT, K_RIGHT, K_UP, K_DOWN, K_a, K_t, K_d, K_i, K_r, K_o, K_b, K_z, BLEND_RGBA_MIN, SRCALPHA) diff -r d9623d453fd9 -r 2748d3afcae5 pyntnclick/version.py --- a/pyntnclick/version.py Sun Feb 12 00:01:03 2012 +0200 +++ b/pyntnclick/version.py Sun Feb 12 00:10:17 2012 +0200 @@ -79,5 +79,4 @@ NON_EGG_REQUIREMENTS = [ 'setuptools', 'pygame', - 'albow', ] diff -r d9623d453fd9 -r 2748d3afcae5 pyntnclick/widgets/__init__.py --- a/pyntnclick/widgets/__init__.py Sun Feb 12 00:01:03 2012 +0200 +++ b/pyntnclick/widgets/__init__.py Sun Feb 12 00:10:17 2012 +0200 @@ -7,22 +7,23 @@ import textwrap -import albow.controls -import albow.menu -from albow.resource import get_font, get_image from pygame.color import Color from pygame.rect import Rect from pygame.draw import lines as draw_lines from pygame import mouse +from pyntnclick.widgets.base import Widget from pyntnclick.cursor import CursorWidget # XXX: Need a way to get at the constants. from pyntnclick.constants import GameConstants BUTTON_SIZE = GameConstants().button_size +# XXX: Needs a way to get at resource: +from pyntnclick.resources import Resources +get_image = Resources("Resources").get_image -class BoomLabel(albow.controls.Label): +class BoomLabel(Widget): # WAS: albow.controls.Label): trim_line_top = 0 @@ -146,7 +147,7 @@ return False -class HandButton(albow.controls.Image): +class HandButton(Widget): # WAS: albow.controls.Image): """The fancy hand button for the widget""" def __init__(self, action): @@ -159,7 +160,7 @@ self.action() -class PopupMenuButton(albow.controls.Button): +class PopupMenuButton(Widget): # WAS: albow.controls.Button): def __init__(self, text, action): albow.controls.Button.__init__(self, text, action) @@ -169,7 +170,7 @@ self.margin = (BUTTON_SIZE - self.font.get_linesize()) / 2 -class PopupMenu(albow.menu.Menu, CursorWidget): +class PopupMenu(Widget): # WAS: albow.menu.Menu, CursorWidget): def __init__(self, screen): CursorWidget.__init__(self, screen) @@ -192,7 +193,7 @@ self.invoke_item(item) -class BoomImageButton(albow.controls.Image): +class BoomImageButton(Widget): # WAS: albow.controls.Image): """The fancy image button for the screens""" FOLDER = None diff -r d9623d453fd9 -r 2748d3afcae5 setup.py --- a/setup.py Sun Feb 12 00:01:03 2012 +0200 +++ b/setup.py Sun Feb 12 00:10:17 2012 +0200 @@ -56,7 +56,7 @@ ], 'includes': [ # pygame - 'pygame', 'albow', + 'pygame', ], 'excludes': [ 'numpy', @@ -81,7 +81,7 @@ # 'dist_dir': 'dist/suspended-sentence-%s' % version.VERSION_STR, # 'bdist_base': 'build/bdist', 'packages': [ - 'logging', 'encodings', 'pygame', 'albow', 'gamelib', + 'logging', 'encodings', 'pygame', 'gamelib', 'Resources', ], 'excludes': ['numpy'],