[casetta] Import cas : error No module named cas

[ Thread Index | Date Index | More lists.tuxfamily.org/casetta Archives ]


Hello,

I wanted to test the new casetta_cli, and I add an error : python said it couldn't load cas module. Indeed, there is a "import cas" in devices_serial.py.
Is it a python module I should install or not ? That's strange because I didn't experinced this problem when I tested the new transfert tool.
Maybe, I didn't really test the new transfert tool because I forgot to do an export PYTHONPATH="svnpath". I know the mailing list is not supposed to be used to have technical support but I really don't know what to do.

I'm working on a picture extractor from backups. I've updated my extract prgm names functions (I replaced a for block by a list comprehension).

And yes the new organisation broke everything... Even the pic2prog.py you sent me don't work anymore.
For the normalize function, blacks pixels are not draw whereas blue are, this is OK for a Graph 65 but for a graph 100, it is bad.

About, the internal transfert tool, you set baudrate to 9600, but the Graph 100+ accepts a baudrate of 38400 (I've to check in the manual, a friend has a Graph 100+).


--
Fabien ANDRE aka Xion345
Linux User #418689 -- fabien.andre.g@xxxxxxxxxx -- xion345@xxxxxxxxxxxxx
... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed. ( Unix for Dummies, Not dated )
# -*- coding: utf-8 -*-

import re

def find_prgmNames(rawback):
    names_pattern = re.compile( """
    [\x00\xee]          # first character (0x00 except if the last prgm have a     
                        # password. In this case, 0xee)
    ([a-zA-Z0-9
    \x99\xa9\xb9\xcd\xce\x89\x20]  # A program name begins by a charater         
    
    [a-zA-Z0-9
    \x99\xa9\xb9\xcd\xce\x89\x20\xff]
    {7})                # End of program name: 7 of the above charaters or 0xff 
    
    .{5}                # 5 charaters
    (.{2})              # offset of the beginning of the prgm data 
    """, re.VERBOSE)
    names_list=names_pattern.findall(rawback)
    return [(i[0].replace('\xff',''), i[1]) for i in names_list]

def find_prgmData(ad, rawback):
    h1=hex(ord(ad[1]))
    h2=hex(ord(ad[0]))
    ad2=int(h1+h2.replace('0x',''), 16)
    i=ad2
    prgm_data=""
    while i > 0:
        prgm_data += (rawback[i])
        if rawback[i] == '\xff':
            break
        i -= 1
    return prgm_data
        
if __name__=="__main__":
    #filename=raw_input('Enter the name of a cafix raw backup : ')
    filename='backup-2.cafix'
    file=open(filename)
    back=file.read()
    file.close()
    names=find_prgmNames(back)
    print names
    print "\n".join(i[0]+str('-')+str(names.index(i)) for i in names)
    num=input('Enter the number of the program you want to extract : ')
    filename=raw_input('Enter the name of the file you want your \
    extracted program to be saved in (prog-yourprogname.cafix): ')
    ext_prog=find_prgmData(names[num][1], back)
    file=open(filename, 'w')
    file.write(ext_prog)
    file.close()


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/