예제 #1
0
def countdown_wait(sec, width=10):
    """
    Wait for X seconds and counts down.

    Return values:
    0 - OK, no interruption
    1 - countdown was interrupted
    """
    unbuffered()
    with CursorOff():
        return wait(sec, width)
예제 #2
0
def countdown_wait(sec, width=10):
    """
    Wait for X seconds and counts down.

    Return values:
    0 - OK, no interruption
    1 - countdown was interrupted
    """
    unbuffered()
    with CursorOff():
        return wait(sec, width)
예제 #3
0
    tree = etree.ElementTree(root)
    if os.path.exists(folder + '/' + BAK):
        tree.write(input, pretty_print=True, xml_declaration=True)
        print '# written to', XML
        print '# please restart Firefox'

def main():
#    proxy = get_us_proxy_from_file()
    proxy = None
    if not proxy:
        try:
            proxy = get_best_us_proxy_from_web()
        except IndexError:
            print >>sys.stderr, 'Warning: no working proxy found.'
            sys.exit(1)
    # else
#    proxy = '97.65.200.194:8080'    # for testing only
    print '#', proxy
    ip = proxy
    port = ""
    if ':' in proxy:
        ip, port = proxy.split(':')

    foxyproxy(ip, port)

#############################################################################

if __name__ == "__main__":
    unbuffered()
    main()
예제 #4
0
        tree.write(input, pretty_print=True, xml_declaration=True)
        print '# written to', XML
        print '# please restart Firefox'


def main():
    #    proxy = get_us_proxy_from_file()
    proxy = None
    if not proxy:
        try:
            proxy = get_best_us_proxy_from_web()
        except IndexError:
            print >> sys.stderr, 'Warning: no working proxy found.'
            sys.exit(1)
    # else
#    proxy = '97.65.200.194:8080'    # for testing only
    print '#', proxy
    ip = proxy
    port = ""
    if ':' in proxy:
        ip, port = proxy.split(':')

    foxyproxy(ip, port)


#############################################################################

if __name__ == "__main__":
    unbuffered()
    main()