Changeset 347

Show
Ignore:
Timestamp:
12/29/07 09:29:45 (1 year ago)
Author:
astraw
Message:

remove whitespace; use namespace packages

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/FlyMovieFormat/motmot/FlyMovieFormat/__init__.py

    r346 r347  
    1 from FlyMovieFormat import * 
  • trunk/FlyMovieFormat/motmot/FlyMovieFormat/playfmf.py

    r346 r347  
    1212import FlyMovieFormat 
    1313import Image 
    14 import imops 
     14import motmot.imops.imops as imops 
    1515 
    1616import wx 
     
    3939        return 'Image sequence (CAUTION: loses timestamps)' 
    4040    def get_saver(self,wx_parent,format,width_height): 
    41          
     41 
    4242        class ImageSequenceSaver(object): 
    4343            def __init__(self,filename,flip_upside_down,format,width_height): 
     
    6161            def close(self): 
    6262                return 
    63              
     63 
    6464        def OnCancelImageSequence(event): 
    6565            dlg2.Close(True) 
     
    8585                                       ) 
    8686                dlg.ShowModal() 
    87                 dlg.Destroy()                       
     87                dlg.Destroy() 
    8888                return 
    8989            filedir=os.path.split(filename)[0] 
     
    150150        saver = self.sub_get_saver(wx_parent,filename,format,widthheight) 
    151151        return saver 
    152                  
     152 
    153153class TxtFileSaverPlugin(GenericSaverPlugin): 
    154154    def get_description(self): 
     
    165165                self.txt_file.close() 
    166166        return TxtSaver(filename) 
    167      
     167 
    168168class FmfFileSaverPlugin(GenericSaverPlugin): 
    169169    def get_description(self): 
     
    183183                self.fmf_file.close() 
    184184        return FmfSaver(filename,format) 
    185      
     185 
    186186class PlotPanel(wx.Panel): 
    187187 
     
    197197        else: 
    198198            self.toolbar = None 
    199                             
     199 
    200200        #self.canvas.mpl_connect('button_press_event',self._onButton) 
    201201 
    202202        # Now put all into a sizer 
    203203        sizer = wx.BoxSizer(wx.VERTICAL) 
    204          
     204 
    205205        # This way of adding to sizer allows resizing 
    206206        sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW) 
    207          
     207 
    208208        if self.toolbar is not None: 
    209209            # On Windows platform, default window size is incorrect, so set 
     
    220220        #self.Fit() 
    221221        #self.Update() 
    222          
     222 
    223223##    def _onButton(self,mouse_event): 
    224224##        if mouse_event.inaxes: 
     
    254254            xlim = a.get_xlim() 
    255255            a.set_xlim((xlim[1],xlim[0])) 
    256          
     256 
    257257        if self.toolbar is not None: 
    258258            self.toolbar.update() 
    259259 
    260260    def GetToolBar(self): 
    261         # You will need to override GetToolBar if you are using an  
     261        # You will need to override GetToolBar if you are using an 
    262262        # unmanaged toolbar in your frame 
    263263        return self.toolbar 
    264                  
     264 
    265265    def onEraseBackground(self, evt): 
    266266        # this is supposed to prevent redraw flicker on some X servers... 
     
    281281    def OnInit(self): 
    282282        self.res = RES 
    283          
     283 
    284284        # main frame and panel --------- 
    285285 
    286286        self.frame = self.res.LoadFrame(None,"MainFrame") 
    287          
     287 
    288288        statbar = matplotlib.backends.backend_wx.StatusBarWx(self.frame) 
    289289        self.frame.SetStatusBar(statbar) 
    290          
     290 
    291291        self.panel = xrc.XRCCTRL(self.frame,"MainPanel") 
    292292 
    293293        # menubar ---------------------- 
    294          
     294 
    295295        menubar = self.res.LoadMenuBarOnFrame(self.frame,"MENUBAR") 
    296296        self.frame_offset = 0 
     
    309309            self.cmap_ids[id]=cmap 
    310310        menubar.Append(colormap_menu,"&Colormap") 
    311              
     311 
    312312        # matplotlib panel ------------- 
    313313 
     
    316316        self.plot_container = xrc.XRCCTRL(self.frame,"plot_container_panel") 
    317317        sizer = wx.BoxSizer(wx.VERTICAL) 
    318          
     318 
    319319        # matplotlib panel itself 
    320320        self.plotpanel = PlotPanel(self.plot_container,statbar=statbar) 
     
    334334 
    335335        # final setup ------------------ 
    336          
     336 
    337337        sizer = self.panel.GetSizer() 
    338          
     338 
    339339        self.frame.SetSize((800,800)) 
    340340        self.frame.Show(1) 
     
    391391        # update display 
    392392        self.OnScroll(None) 
    393      
     393 
    394394    def OnNewMovie(self,filename,corruption_fix=False): 
    395395        if corruption_fix: 
     
    398398            self.allow_partial_frames=False 
    399399        a = self.plotpanel.fig.add_subplot(111) # not really new, just gets axes 
    400          
     400 
    401401        self.fly_movie = FlyMovieFormat.FlyMovie(filename) 
    402402        self.n_frames = self.fly_movie.get_n_frames() 
     
    416416                    self.n_frames = test_frame+1 
    417417                    break 
    418                  
     418 
    419419        self.frame_shape = frame.shape 
    420420        self.first_timestamp=timestamp 
     
    423423        slider.SetRange( self.frame_offset+0, max(self.frame_offset+self.n_frames-1,1) ) 
    424424        slider.SetValue( self.frame_offset+frame_number ) 
    425          
    426         self.frame.SetTitle('playfmf: %s'%(filename,)) # window title     
     425 
     426        self.frame.SetTitle('playfmf: %s'%(filename,)) # window title 
    427427        self.fly_movie = FlyMovieFormat.FlyMovie(filename) 
    428428        self.format = self.fly_movie.get_format() 
    429429        self.width_height = (self.fly_movie.get_width()//(bpp[self.format]//8), 
    430430                             self.fly_movie.get_height()) 
    431          
     431 
    432432        self.plotpanel.init_plot_data(frame,self.format) 
    433433        self.plot_container.Layout() 
     
    446446                frame_number, 
    447447                allow_partial_frames=self.allow_partial_frames) 
    448              
     448 
    449449        self.plotpanel.set_array(frame) 
    450          
     450 
    451451        label = xrc.XRCCTRL(self.frame,"time_rel_label") 
    452452        label.SetLabel('%.1f (msec)'%((timestamp-self.first_timestamp)*1000.0,)) 
    453          
     453 
    454454        label = xrc.XRCCTRL(self.frame,"time_abs_label") 
    455          
     455 
    456456        time_fmt = '%Y-%m-%d %H:%M:%S %Z%z' 
    457457        label.SetLabel('%.3f (sec) %s'%(timestamp, 
    458458                                        time.strftime(time_fmt, time.localtime(timestamp)))) 
    459          
     459 
    460460    def OnQuit(self, event): 
    461461        self.frame.Close(True) 
     
    469469            ymin = int(xrc.XRCCTRL(dlg,"ymin_textctrl").GetValue()) 
    470470            ymax = int(xrc.XRCCTRL(dlg,"ymax_textctrl").GetValue()) 
    471              
     471 
    472472            start = int(xrc.XRCCTRL(dlg,"start_frame").GetValue()) 
    473473            stop = int(xrc.XRCCTRL(dlg,"stop_frame").GetValue()) 
     
    484484                if description == plugin.get_description(): 
    485485                    break 
    486                  
     486 
    487487            assert description == plugin.get_description() 
    488488 
     
    502502                saver.save( save_frame, timestamp ) 
    503503            saver.close() 
    504              
     504 
    505505        dlg = self.res.LoadDialog(self.frame,"EXPORT_DIALOG") 
    506506 
     
    509509            description = plugin.get_description() 
    510510            format_choice_ctrl.Append(description) 
    511          
     511 
    512512        xrc.XRCCTRL(dlg,"xmax_textctrl").SetValue(str(self.width_height[0]-1)) 
    513513        xrc.XRCCTRL(dlg,"ymax_textctrl").SetValue(str(self.width_height[1]-1)) 
    514514        xrc.XRCCTRL(dlg,"stop_frame").SetValue(str(self.n_frames-1)) 
    515          
     515 
    516516        cancel_button=xrc.XRCCTRL(dlg,"cancel_button") 
    517517        wx.EVT_BUTTON(dlg, cancel_button.GetId(),OnCancelExportSmallerMovie) 
     
    522522        finally: 
    523523            dlg.Destroy() 
    524      
     524 
    525525def main(): 
    526526    usage = '%prog FILE [options]' 
    527      
     527 
    528528    parser = OptionParser(usage) 
    529529 
     
    536536                      default=0, 
    537537                      help="add an integer offset to frame numbers") 
    538      
     538 
    539539    (options, args) = parser.parse_args() 
    540540 
     
    544544 
    545545    filename = args[0] 
    546      
     546 
    547547    if (sys.platform.startswith('win') or 
    548548        sys.platform.startswith('darwin')):