Fwd: [pyddr-discuss] A word of thanks and a problem (fwd)

Stephen Thorne stephen at thorne.id.au
Sun Jun 22 23:24:36 EDT 2003


On Sun, Jun 22, 2003 at 09:52:24PM -0400, Hyperjer at aol.com wrote:
> 
> In a message dated 6/22/03 6:41:10 PM, piman at debian.org writes:
> 
> 
> > On Fri, 2003-06-20 at 17:16, Eric Windisch wrote:
> > > A lot of MacOS X users have been interested in this program lately and
> > > all are having problems with using MP3 and/or OGG files with it. I'm
> > > thinking that perhaps there should be a graphical utility for converting
> > > the files and placing them into the proper directories. I know this
> > > would seem to many as extreme 'hand-holding', but (no offense) most Mac
> > > users need that kind of hand-holding.
> > 
> > While I don't think any of the developers are opposed to this kind of
> > hald holding, the larger problem is that neither Brendan nor I - the two
> > guys that write 99% of pyDDR code - have a Mac OS X system. I've never
> > even used one, let alone run or coded pyDDR on one (I still have a hard
> > time thinking of it as anything but a Debian program). So, if someone
> > wants to step up to code such a program, great, but until then there's
> > not much that can be done.
> > --
> > Joe Wreschnig <piman at debian.org>
> > 
> 
> Well then I guess I should start learning some more c++ then

Uhh, hold on a few seconds before you do that.

I started writing a gui to do this on saturday, in wxPython - I didn't get very
far becuase I had some weekend commitments and stuff, but I can continue
working on it.

The start of said program is attached - its definately a work in progress - 
and don't expect it to do anything just yet. :)

Stephen.
-------------- next part --------------

from os import listdir
import wxPython.wx as wx

ID_SEARCH = 100
ID_DIRECTORY = 101
ID_PANEL = 102
ID_LISTBOX = 103

class MusicConvertPanel(wx.wxPanel):
  def __init__(self, parent, ID):
    wx.wxPanel.__init__(self, parent, ID) 
    self.my_parent = parent

    mainbox = wx.wxBoxSizer(wx.wxVERTICAL)

    directory = wx.wxTextCtrl(self, ID_DIRECTORY, "/", 
        style=wx.wxTE_PROCESS_ENTER)
    search_button = wx.wxButton(self, ID_SEARCH, 'Search', 
        style=wx.wxBU_EXACTFIT, 
        size=wx.wxSize(50,-1))

    search_box = wx.wxStaticBoxSizer(
        wx.wxStaticBox(self, -1, 'Directory To Search'), 
        wx.wxHORIZONTAL)
    search_box.Add(directory, 1, wx.wxEXPAND)
    search_box.Add(search_button, 1, 
        flag=wx.wxALIGN_RIGHT)

    listbox = wxListBox(self, ID_LISTBOX, 
        wxPoint(-1, -1), 
        wxSize(230, 200),
        listdir(searchbox.getValue()), 
        wxLB_SINGLE)

    mainbox.Add(search_box)

    self.SetSizer(mainbox)
    self.SetAutoLayout(1)
    mainbox.Fit(self)

class MusicConvertFrame(wx.wxFrame):
  def __init__(self, parent, ID, title):
    wx.wxFrame.__init__(self, parent, ID, title, 
        wx.wxDefaultPosition, wx.wxSize(330, 450), 
        wx.wxFRAME_NO_TASKBAR | wx.wxDEFAULT_FRAME_STYLE)

    self.panel = MusicConvertPanel(self, ID_PANEL)

#controls the application
class MusicConvert(wx.wxApp):
  """ Main application, spawns The main Frame """

  def OnInit(self):
    frame = MusicConvertFrame(wx.NULL, -1, "Music Converter")
    frame.Show(1)
    self.SetTopWindow(frame)
    return 1

if __name__ == '__main__':
  try:
    app = MusicConvert(0)
    app.MainLoop()
  except Exception, e:
    message = e.__str__()
    dlg = wx.wxMessageDialog(None, 
            message, 'Error', wx.wxOK | wx.wxICON_INFORMATION)
    dlg.ShowModal()
    dlg.Destroy()



More information about the pyddr-discuss mailing list