Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 336890595e31c6e67cade9609e47b028 > files > 21

txt2tags-2.6-9.mga7.noarch.rpm

#! /usr/bin/env python
#
# dynartslides, a dynamic art slides generator for txt2tags
#
# Copyright (C) 2010, Florent Gallaire <fgallaire@gmail.com>
# License GNU GPLv3
#

import os, sys

if len(sys.argv) < 2:
    print "Please, we need one file as argument."
else:
    if os.name == 'posix':
        import fcntl, termios, struct
        data = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, 4*'00') 
        lines, columns = struct.unpack('4H',data)[:2]
        command = 'txt2tags --slides --width=%s --height=%s -t art %s'%(columns, lines, " ".join(sys.argv[1:]))
        print command
        os.system(command)
    else:
        print "Dynamic capacities are not available on your system."