Exemplo n.º 1
0
# encoding: utf-8

from __future__ import print_function

def hello():
    print("Hello world!")


if __name__ == '__main__':
    from marrow.script import execute
    execute(hello)
Exemplo n.º 2
0
def main():
    from marrow.script import execute
    execute(marrowhttpd)
Exemplo n.º 3
0
def main():
    from marrow.script import execute
    execute(Blueprint)
Exemplo n.º 4
0
Arquivo: ls.py Projeto: marrow/script
    ipsum eu metus iaculis ut mollis felis dignissim.
    Praesent rutrum, magna non commodo facilisis, justo elit
    iaculis ipsum, at eleifend nunc ante et ante. Praesent
    fringilla urna vel leo vestibulum nec lobortis tortor
    consequat. Duis et tristique lectus. In consequat auctor
    lorem sed hendrerit. Quisque porta vulputate lobortis.
    
    Nulla facilisi. Sed condimentum bibendum accumsan. Morbi
    tristique nisi et urna malesuada at porttitor nisl
    egestas.
    """
    listing = sorted(os.listdir(path))
    
    if not verbose:
        for item in listing:
            if not all and item[0] == '.': continue
            
            print(item, '\t', end='')
        
        print("\n\nItems in folder: %d" % (len(listing)))
        return 0
    
    for item in listing:
        if not all and item[0] == '.': continue
        st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime = os.stat(os.path.join(path, item))
        print(item, ' ' * (40-len(item)), st_mtime)


if __name__ == '__main__':
    execute(catalog)
Exemplo n.º 5
0
            try: io_loop.stop()
            except: pass
        
        stdout, stderr = proc.communicate()
        
        try:
            rate = float(stdout.split("\n")[0].split()[2].strip())
            print("Result: %s %d/%d KiB, %dR C%d = %0.2f MiB/s" % (ioloop._poll.__class__.__name__, size, block, number, concurrency, rate / 1024.0))
        
        except:
            
            print("\nApacheBench STDERR:\n%s\n\nApacheBench STDOUT:\n%s" % (stderr, stdout))
        
        # Transfer rate:          686506.82 [Kbytes/sec] received
    
    try:
        if not profile:
            do()
        
        else:
            cProfile.runctx('do()', globals(), locals(), 'n%dc%d.prof' % (number, concurrency))
            print("\nProfiling results written to: %s\n" % ('n%dc%d.prof' % (number, concurrency)))
    
    except KeyboardInterrupt:
        print("\nBenchmark cancelled.\n")



if __name__ == '__main__':
    execute(main)
Exemplo n.º 6
0
# encoding: utf-8

def ultima(required, value=None, name="world", switch=False, age=18, *args, **kw):
    print "Hello %s!" % (name, )


if __name__ == '__main__':
    from marrow.script import execute
    execute(ultima)