1. Jason Scheirer
  2. sleepytime

Commits

Jason Scheirer  committed e1efccb

Toward a version that uses wx

  • Participants
  • Parent commits ef6dc8f
  • Branches default

Comments (0)

Files changed (3)

File setup.py

View file
+from distutils.core import setup
+
+setup(
+        name="iTunes sleepytime",
+        author="Jason Scheirer",
+        email="jason.scheirer@gmail.com",
+        windows=['sleepytime.py']
+)

File sleepytime.py

View file
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# generated by wxGlade 0.6.3 on Wed Apr  1 17:50:35 2009
+
+import wx
+
+# begin wxGlade: extracode
+# end wxGlade
+
+
+
+class SleepyFrame(wx.Frame):
+    def __init__(self, *args, **kwds):
+        # begin wxGlade: SleepyFrame.__init__
+        kwds["style"] = wx.ICONIZE|wx.CAPTION|wx.MINIMIZE|wx.CLOSE_BOX|wx.MINIMIZE_BOX
+        wx.Frame.__init__(self, *args, **kwds)
+        self.hour_label = wx.StaticText(self, -1, "--", style=wx.ALIGN_CENTRE)
+        self.hour_plus10 = wx.Button(self, -1, "+10")
+        self.hour_plus1 = wx.Button(self, -1, "+1")
+        self.hour_minus1 = wx.Button(self, -1, "-1")
+        self.hour_minus10 = wx.Button(self, -1, "-10")
+        self.minute_label = wx.StaticText(self, -1, "--", style=wx.ALIGN_CENTRE)
+        self.minute_plus10 = wx.Button(self, -1, "+10")
+        self.minute_plus1 = wx.Button(self, -1, "+1")
+        self.minute_minus1 = wx.Button(self, -1, "-1")
+        self.minute_minus10 = wx.Button(self, -1, "-10")
+        self.hour_label_copy_1 = wx.StaticText(self, -1, "--", style=wx.ALIGN_CENTRE)
+        self.second_plus10 = wx.Button(self, -1, "+10")
+        self.second_plus1 = wx.Button(self, -1, "+1")
+        self.second_minus1 = wx.Button(self, -1, "-1")
+        self.second_minus10 = wx.Button(self, -1, "-10")
+        self.status_label = wx.StaticText(self, -1, "Status")
+        self.playpause_button = wx.Button(self, -1, ">")
+
+        self.__set_properties()
+        self.__do_layout()
+
+        self.Bind(wx.EVT_BUTTON, self.hour_plusten, self.hour_plus10)
+        self.Bind(wx.EVT_BUTTON, self.hour_plusone, self.hour_plus1)
+        self.Bind(wx.EVT_BUTTON, self.hour_minusone, self.hour_minus1)
+        self.Bind(wx.EVT_BUTTON, self.hour_minusten, self.hour_minus10)
+        self.Bind(wx.EVT_BUTTON, self.minute_plusten, self.minute_plus10)
+        self.Bind(wx.EVT_BUTTON, self.minute_plusone, self.minute_plus1)
+        self.Bind(wx.EVT_BUTTON, self.minute_minusone, self.minute_minus1)
+        self.Bind(wx.EVT_BUTTON, self.minute_minusten, self.minute_minus10)
+        self.Bind(wx.EVT_BUTTON, self.second_plusten, self.second_plus10)
+        self.Bind(wx.EVT_BUTTON, self.sceond_plusone, self.second_plus1)
+        self.Bind(wx.EVT_BUTTON, self.second_minusone, self.second_minus1)
+        self.Bind(wx.EVT_BUTTON, self.second_minusten, self.second_minus10)
+        self.Bind(wx.EVT_BUTTON, self.PlayPause_click, self.playpause_button)
+        # end wxGlade
+
+    def __set_properties(self):
+        # begin wxGlade: SleepyFrame.__set_properties
+        self.SetTitle("iTunes Sleepytime")
+        self.SetSize((489, 145))
+        self.hour_label.SetMinSize((90, 90))
+        self.hour_label.SetBackgroundColour(wx.Colour(47, 47, 47))
+        self.hour_label.SetForegroundColour(wx.Colour(192, 192, 192))
+        self.hour_label.SetFont(wx.Font(56, wx.MODERN, wx.NORMAL, wx.BOLD, 0, ""))
+        self.hour_plus10.SetMinSize((45, 24))
+        self.hour_plus1.SetMinSize((45, 24))
+        self.hour_minus1.SetMinSize((45, 24))
+        self.hour_minus10.SetMinSize((45, 24))
+        self.minute_label.SetMinSize((90, 90))
+        self.minute_label.SetBackgroundColour(wx.Colour(47, 47, 47))
+        self.minute_label.SetForegroundColour(wx.Colour(192, 192, 192))
+        self.minute_label.SetFont(wx.Font(56, wx.MODERN, wx.NORMAL, wx.BOLD, 0, ""))
+        self.minute_plus10.SetMinSize((45, 24))
+        self.minute_plus1.SetMinSize((45, 24))
+        self.minute_minus1.SetMinSize((45, 24))
+        self.minute_minus10.SetMinSize((45, 24))
+        self.hour_label_copy_1.SetMinSize((90, 90))
+        self.hour_label_copy_1.SetBackgroundColour(wx.Colour(47, 47, 47))
+        self.hour_label_copy_1.SetForegroundColour(wx.Colour(192, 192, 192))
+        self.hour_label_copy_1.SetFont(wx.Font(56, wx.MODERN, wx.NORMAL, wx.BOLD, 0, ""))
+        self.second_plus10.SetMinSize((45, 24))
+        self.second_plus1.SetMinSize((45, 24))
+        self.second_minus1.SetMinSize((45, 24))
+        self.second_minus10.SetMinSize((45, 24))
+        self.status_label.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, 0, ""))
+        self.playpause_button.SetMinSize((30, 30))
+        # end wxGlade
+
+    def __do_layout(self):
+        # begin wxGlade: SleepyFrame.__do_layout
+        sizer_1 = wx.BoxSizer(wx.VERTICAL)
+        sizer_2 = wx.BoxSizer(wx.VERTICAL)
+        sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
+        sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
+        sizer_4_copy_1 = wx.BoxSizer(wx.HORIZONTAL)
+        sizer_5_copy_1 = wx.BoxSizer(wx.VERTICAL)
+        sizer_4_copy = wx.BoxSizer(wx.HORIZONTAL)
+        sizer_5_copy = wx.BoxSizer(wx.VERTICAL)
+        sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
+        sizer_5 = wx.BoxSizer(wx.VERTICAL)
+        sizer_4.Add(self.hour_label, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+        sizer_5.Add(self.hour_plus10, 0, 0, 0)
+        sizer_5.Add(self.hour_plus1, 0, 0, 0)
+        sizer_5.Add(self.hour_minus1, 0, 0, 0)
+        sizer_5.Add(self.hour_minus10, 0, 0, 0)
+        sizer_4.Add(sizer_5, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+        sizer_3.Add(sizer_4, 1, wx.EXPAND, 0)
+        sizer_4_copy.Add(self.minute_label, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+        sizer_5_copy.Add(self.minute_plus10, 0, 0, 0)
+        sizer_5_copy.Add(self.minute_plus1, 0, 0, 0)
+        sizer_5_copy.Add(self.minute_minus1, 0, 0, 0)
+        sizer_5_copy.Add(self.minute_minus10, 0, 0, 0)
+        sizer_4_copy.Add(sizer_5_copy, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+        sizer_3.Add(sizer_4_copy, 1, wx.EXPAND, 0)
+        sizer_4_copy_1.Add(self.hour_label_copy_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+        sizer_5_copy_1.Add(self.second_plus10, 0, 0, 0)
+        sizer_5_copy_1.Add(self.second_plus1, 0, 0, 0)
+        sizer_5_copy_1.Add(self.second_minus1, 0, 0, 0)
+        sizer_5_copy_1.Add(self.second_minus10, 0, 0, 0)
+        sizer_4_copy_1.Add(sizer_5_copy_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+        sizer_3.Add(sizer_4_copy_1, 1, wx.EXPAND, 0)
+        sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
+        sizer_6.Add(self.status_label, 0, wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_6.Add(self.playpause_button, 0, wx.EXPAND, 0)
+        sizer_2.Add(sizer_6, 0, wx.ALIGN_RIGHT, 0)
+        sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
+        self.SetSizer(sizer_1)
+        sizer_1.SetSizeHints(self)
+        self.Layout()
+        # end wxGlade
+
+    def hour_plusten(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `hour_plusten' not implemented!"
+        event.Skip()
+
+    def hour_plusone(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `hour_plusone' not implemented!"
+        event.Skip()
+
+    def hour_minusone(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `hour_minusone' not implemented!"
+        event.Skip()
+
+    def hour_minusten(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `hour_minusten' not implemented!"
+        event.Skip()
+
+    def minute_plusten(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `minute_plusten' not implemented!"
+        event.Skip()
+
+    def minute_plusone(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `minute_plusone' not implemented!"
+        event.Skip()
+
+    def minute_minusone(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `minute_minusone' not implemented!"
+        event.Skip()
+
+    def minute_minusten(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `minute_minusten' not implemented!"
+        event.Skip()
+
+    def second_plusten(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `second_plusten' not implemented!"
+        event.Skip()
+
+    def sceond_plusone(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `sceond_plusone' not implemented!"
+        event.Skip()
+
+    def second_minusone(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `second_minusone' not implemented!"
+        event.Skip()
+
+    def second_minusten(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `second_minusten' not implemented!"
+        event.Skip()
+
+    def PlayPause_click(self, event): # wxGlade: SleepyFrame.<event_handler>
+        print "Event handler `PlayPause_click' not implemented!"
+        event.Skip()
+
+# end of class SleepyFrame
+
+
+if __name__ == "__main__":
+    app = wx.PySimpleApp(0)
+    wx.InitAllImageHandlers()
+    frame_1 = SleepyFrame(None, -1, "")
+    app.SetTopWindow(frame_1)
+    frame_1.Show()
+    app.MainLoop()

File sleepytime.wxg

View file
+<?xml version="1.0"?>
+<!-- generated by wxGlade 0.6.3 on Wed Apr  1 17:49:35 2009 -->
+
+<application path="/home/jscheier/Projects/sleepytime/sleepytime.py" name="" class="" option="0" language="python" top_window="frame_1" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.8" is_template="0">
+    <object class="SleepyFrame" name="frame_1" base="EditFrame">
+        <style>wxICONIZE|wxCAPTION|wxMINIMIZE|wxCLOSE_BOX|wxMINIMIZE_BOX</style>
+        <title>iTunes Sleepytime</title>
+        <sizehints>1</sizehints>
+        <size>489, 145</size>
+        <object class="wxBoxSizer" name="sizer_1" base="EditBoxSizer">
+            <orient>wxVERTICAL</orient>
+            <object class="sizeritem">
+                <flag>wxEXPAND</flag>
+                <border>0</border>
+                <option>1</option>
+                <object class="wxBoxSizer" name="sizer_2" base="EditBoxSizer">
+                    <orient>wxVERTICAL</orient>
+                    <object class="sizeritem">
+                        <flag>wxEXPAND</flag>
+                        <border>0</border>
+                        <option>1</option>
+                        <object class="wxBoxSizer" name="sizer_3" base="EditBoxSizer">
+                            <orient>wxHORIZONTAL</orient>
+                            <object class="sizeritem">
+                                <flag>wxEXPAND</flag>
+                                <border>0</border>
+                                <option>1</option>
+                                <object class="wxBoxSizer" name="sizer_4" base="EditBoxSizer">
+                                    <orient>wxHORIZONTAL</orient>
+                                    <object class="sizeritem">
+                                        <flag>wxALIGN_CENTER_VERTICAL</flag>
+                                        <border>0</border>
+                                        <option>0</option>
+                                        <object class="wxStaticText" name="hour_label" base="EditStaticText">
+                                            <foreground>#c0c0c0</foreground>
+                                            <style>wxALIGN_CENTRE</style>
+                                            <attribute>1</attribute>
+                                            <label>--</label>
+                                            <background>#2f2f2f</background>
+                                            <font>
+                                                <size>56</size>
+                                                <family>modern</family>
+                                                <style>normal</style>
+                                                <weight>bold</weight>
+                                                <underlined>0</underlined>
+                                                <face></face>
+                                            </font>
+                                            <size>90, 90</size>
+                                        </object>
+                                    </object>
+                                    <object class="sizeritem">
+                                        <flag>wxALIGN_CENTER_VERTICAL</flag>
+                                        <border>0</border>
+                                        <option>0</option>
+                                        <object class="wxBoxSizer" name="sizer_5" base="EditBoxSizer">
+                                            <orient>wxVERTICAL</orient>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="hour_plus10" base="EditButton">
+                                                    <label>+10</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">hour_plusten</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="hour_plus1" base="EditButton">
+                                                    <label>+1</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">hour_plusone</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="hour_minus1" base="EditButton">
+                                                    <label>-1</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">hour_minusone</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="hour_minus10" base="EditButton">
+                                                    <label>-10</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">hour_minusten</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                        </object>
+                                    </object>
+                                </object>
+                            </object>
+                            <object class="sizeritem">
+                                <flag>wxEXPAND</flag>
+                                <border>0</border>
+                                <option>1</option>
+                                <object class="wxBoxSizer" name="sizer_4_copy" base="EditBoxSizer">
+                                    <orient>wxHORIZONTAL</orient>
+                                    <object class="sizeritem">
+                                        <flag>wxALIGN_CENTER_VERTICAL</flag>
+                                        <border>0</border>
+                                        <option>0</option>
+                                        <object class="wxStaticText" name="minute_label" base="EditStaticText">
+                                            <foreground>#c0c0c0</foreground>
+                                            <style>wxALIGN_CENTRE</style>
+                                            <attribute>1</attribute>
+                                            <label>--</label>
+                                            <background>#2f2f2f</background>
+                                            <font>
+                                                <size>56</size>
+                                                <family>modern</family>
+                                                <style>normal</style>
+                                                <weight>bold</weight>
+                                                <underlined>0</underlined>
+                                                <face></face>
+                                            </font>
+                                            <size>90, 90</size>
+                                        </object>
+                                    </object>
+                                    <object class="sizeritem">
+                                        <flag>wxALIGN_CENTER_VERTICAL</flag>
+                                        <border>0</border>
+                                        <option>0</option>
+                                        <object class="wxBoxSizer" name="sizer_5_copy" base="EditBoxSizer">
+                                            <orient>wxVERTICAL</orient>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="minute_plus10" base="EditButton">
+                                                    <label>+10</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">minute_plusten</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="minute_plus1" base="EditButton">
+                                                    <label>+1</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">minute_plusone</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="minute_minus1" base="EditButton">
+                                                    <label>-1</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">minute_minusone</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="minute_minus10" base="EditButton">
+                                                    <label>-10</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">minute_minusten</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                        </object>
+                                    </object>
+                                </object>
+                            </object>
+                            <object class="sizeritem">
+                                <flag>wxEXPAND</flag>
+                                <border>0</border>
+                                <option>1</option>
+                                <object class="wxBoxSizer" name="sizer_4_copy_1" base="EditBoxSizer">
+                                    <orient>wxHORIZONTAL</orient>
+                                    <object class="sizeritem">
+                                        <flag>wxALIGN_CENTER_VERTICAL</flag>
+                                        <border>0</border>
+                                        <option>0</option>
+                                        <object class="wxStaticText" name="hour_label_copy_1" base="EditStaticText">
+                                            <foreground>#c0c0c0</foreground>
+                                            <style>wxALIGN_CENTRE</style>
+                                            <attribute>1</attribute>
+                                            <label>--</label>
+                                            <background>#2f2f2f</background>
+                                            <font>
+                                                <size>56</size>
+                                                <family>modern</family>
+                                                <style>normal</style>
+                                                <weight>bold</weight>
+                                                <underlined>0</underlined>
+                                                <face></face>
+                                            </font>
+                                            <size>90, 90</size>
+                                        </object>
+                                    </object>
+                                    <object class="sizeritem">
+                                        <flag>wxALIGN_CENTER_VERTICAL</flag>
+                                        <border>0</border>
+                                        <option>0</option>
+                                        <object class="wxBoxSizer" name="sizer_5_copy_1" base="EditBoxSizer">
+                                            <orient>wxVERTICAL</orient>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="second_plus10" base="EditButton">
+                                                    <label>+10</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">second_plusten</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="second_plus1" base="EditButton">
+                                                    <label>+1</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">sceond_plusone</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="second_minus1" base="EditButton">
+                                                    <label>-1</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">second_minusone</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                            <object class="sizeritem">
+                                                <border>0</border>
+                                                <option>0</option>
+                                                <object class="wxButton" name="second_minus10" base="EditButton">
+                                                    <label>-10</label>
+                                                    <events>
+                                                        <handler event="EVT_BUTTON">second_minusten</handler>
+                                                    </events>
+                                                    <size>45, 24</size>
+                                                </object>
+                                            </object>
+                                        </object>
+                                    </object>
+                                </object>
+                            </object>
+                        </object>
+                    </object>
+                    <object class="sizeritem">
+                        <flag>wxALIGN_RIGHT</flag>
+                        <border>0</border>
+                        <option>0</option>
+                        <object class="wxBoxSizer" name="sizer_6" base="EditBoxSizer">
+                            <orient>wxHORIZONTAL</orient>
+                            <object class="sizeritem">
+                                <flag>wxALIGN_CENTER_VERTICAL</flag>
+                                <border>5</border>
+                                <option>0</option>
+                                <object class="wxStaticText" name="status_label" base="EditStaticText">
+                                    <attribute>1</attribute>
+                                    <label>Status</label>
+                                    <font>
+                                        <size>8</size>
+                                        <family>swiss</family>
+                                        <style>normal</style>
+                                        <weight>bold</weight>
+                                        <underlined>0</underlined>
+                                        <face></face>
+                                    </font>
+                                </object>
+                            </object>
+                            <object class="sizeritem">
+                                <flag>wxEXPAND</flag>
+                                <border>0</border>
+                                <option>0</option>
+                                <object class="wxButton" name="playpause_button" base="EditButton">
+                                    <label>&gt;</label>
+                                    <events>
+                                        <handler event="EVT_BUTTON">PlayPause_click</handler>
+                                    </events>
+                                    <size>30, 30</size>
+                                </object>
+                            </object>
+                        </object>
+                    </object>
+                </object>
+            </object>
+        </object>
+    </object>
+</application>