Subversion Repositories Kolibri OS

Rev

Rev 1913 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1913 Rev 2073
Line 13... Line 13...
13
def _import(name):
13
def _import(name):
14
    if name in MODULES:
14
    if name in MODULES:
15
        return MODULES[name]
15
        return MODULES[name]
16
    py = name+".py"
16
    py = name+".py"
17
    tpc = name+".tpc"
17
    tpc = name+".tpc"
18
    print("CP")
-
 
19
    if exists(py):
18
    if exists(py):
20
        if not exists(tpc) or mtime(py) > mtime(tpc):
19
        if not exists(tpc) or mtime(py) > mtime(tpc):
21
            s = load(py)
20
            s = load(py)
22
            code = _compile(s,py)
21
            code = _compile(s,py)
23
            save(tpc,code)
22
            save(tpc,code)
Line 41... Line 40...
41
    g['__code__'] = code
40
    g['__code__'] = code
42
    exec(code,g)
41
    exec(code,g)
43
    return g
42
    return g
Line 44... Line 43...
44
 
43
 
45
def tinypy():
-
 
46
    print("tinypy called")
44
def tinypy():
Line 47... Line 45...
47
    return import_fname(ARGV[0],'__main__')
45
    return import_fname(ARGV[0],'__main__')
48
 
46
 
49
def main(src,dest):
47
def main(src,dest):
50
    s = load(src)
48
    s = load(src)
Line 51... Line 49...
51
    r = _compile(s,src)
49
    r = _compile(s,src)
52
    save(dest,r)
-
 
53
 
50
    save(dest,r)