Esempio n. 1
0
def set_completer(options=None):
    if options:
        completer = InputCompleter(options)
        readline.set_completer_delims('')
        readline.set_completer(completer.complete)
    else:
        readline.set_completer(None)
histfile = os.path.join(os.environ["HOME"], ".mterm")

automatic_reload=False
if not pipedinput:
    try:
        readline.read_history_file(histfile)
    except IOError:
        pass
    import atexit
    atexit.register(readline.write_history_file, histfile)
    
    automatic_reload=True
    readline.set_completer(mcomplete)
    readline.parse_and_bind("tab: complete")
    readline.set_completer_delims(' \t\n`!@#$^&*()=+[{]}|;:\'",<>?')

separator = "|"
allquote = False
beeping = False
db = ""
language, output_encoding = locale.getdefaultlocale()

if output_encoding==None:
    output_encoding='UTF8'

if len(sys.argv) >= 2:
    db = sys.argv[1]
    if db=="-q":
        db=':memory:'
Esempio n. 3
0
"""
python demo.py start_url
"""
    if len(sys.argv) != 2:
        sys.exit(USAGE)
    start_page = sys.argv[1]

    readline_config = [
        "tab: complete",
        "set show-all-if-unmodified on",
        "set skip-completed-text on",
        "set completion-ignore-case on"
    ]
    for line in readline_config:
        readline.parse_and_bind(line)
    readline.set_completer_delims('')

    spider = ManualSpider()
    spider.visit(start_page, start=True)

    link = link_prompt(spider.get_all_links())
    if not link:
        sys.exit()
    spider.visit(link)

    max_links_in_menu = 5
    while True:
        links = []
        n = 0
        score_1 = None
        for link in spider.best():
Esempio n. 4
0
histfile = os.path.join(os.environ["HOME"], ".mterm")

automatic_reload = False
if not pipedinput:
    try:
        readline.read_history_file(histfile)
    except IOError:
        pass
    import atexit

    atexit.register(readline.write_history_file, histfile)

    automatic_reload = True
    readline.set_completer(mcomplete)
    readline.parse_and_bind("tab: complete")
    readline.set_completer_delims(' \t\n`!@#$^&*()=+[{]}|;:\'",<>?')

separator = "|"
allquote = False
beeping = False
db = ""
language, output_encoding = locale.getdefaultlocale()

if output_encoding == None:
    output_encoding = 'UTF8'

functions.variables.flowname = 'main'

rawprinter = buildrawprinter(separator)

process_args()