def dump_vcards():

        for vcard in VCards(VFile(common.opentextfile(sys.argv[1]))):

            print vcard
Exemplo n.º 2
0
 def dump_vcards():
     for vcard in VCards(VFile(common.opentextfile(sys.argv[1]))):
         # pass
         print vcard
Exemplo n.º 3
0
            sel_end-=1
            s='Sel: 0x%X=%d to 0x%X=%d (0x%X=%d bytes)'%(
                sel_start, sel_start, sel_end, sel_end,
                sel_len, sel_len)
        self.SetStatusText(s, self._sel_pane_index)
    def set_val(self, v):
        if v:
            # char
            s='Val: 0x%02X=%d'%(ord(v[0]), ord(v[0]))
            if len(v)>1:
                # short
                u_s=struct.unpack('<H', v[:struct.calcsize('<H')])[0]
                s+=' 0x%04X=%d'%(u_s,  u_s)
            if len(v)>3:
                # int/long
                u_i=struct.unpack('<I', v[:struct.calcsize('<I')])[0]
                s+=' 0x%08X=%d'%(u_i, u_i)
        else:
            s=''
        self.SetStatusText(s, self._val_pane_index)

if __name__=='__main__':
    app=wx.PySimpleApp()
    # Find the data source
    data=None
    if len(sys.argv)==2:
        # From a file
        data=common.opentextfile(sys.argv[1]).read()
    frame=Analyser(data=data)
    app.MainLoop()
Exemplo n.º 4
0
            s = 'Sel: 0x%X=%d to 0x%X=%d (0x%X=%d bytes)' % (
                sel_start, sel_start, sel_end, sel_end, sel_len, sel_len)
        self.SetStatusText(s, self._sel_pane_index)

    def set_val(self, v):
        if v:
            # char
            s = 'Val: 0x%02X=%d' % (ord(v[0]), ord(v[0]))
            if len(v) > 1:
                # short
                u_s = struct.unpack('<H', v[:struct.calcsize('<H')])[0]
                s += ' 0x%04X=%d' % (u_s, u_s)
            if len(v) > 3:
                # int/long
                u_i = struct.unpack('<I', v[:struct.calcsize('<I')])[0]
                s += ' 0x%08X=%d' % (u_i, u_i)
        else:
            s = ''
        self.SetStatusText(s, self._val_pane_index)


if __name__ == '__main__':
    app = wx.PySimpleApp()
    # Find the data source
    data = None
    if len(sys.argv) == 2:
        # From a file
        data = common.opentextfile(sys.argv[1]).read()
    frame = Analyser(data=data)
    app.MainLoop()
Exemplo n.º 5
0
    f=wx.Frame(None, -1, "HTML Test")
    h=HTMLWindow(f, -1)
    f.Show(True)
    h.SetPage(tp.flatten())
    app.MainLoop()
    sys.exit(0)

# a test of the easy printing
if __name__=='__main__':
    import sys

    def OnSlider(evt):
        global scale
        scale=szlist[evt.GetPosition()]

    f=common.opentextfile(sys.argv[1])
    html=f.read()
    f.close()

    app=wx.PySimpleApp()

    f=wx.Frame(None, -1, "Print Test")
    butsetup=wx.Button(f, wx.NewId(), "Setup")
    butpreview=wx.Button(f, wx.NewId(), "Preview")
    butprint=wx.Button(f, wx.NewId(), "Print")

    slider=wx.Slider(f, wx.NewId(), 5, 0, 10, style=wx.SL_HORIZONTAL)

    szlist=[0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4]

    scale=1.0