예제 #1
0
def main():
    tree = {}

    # Check that the output directory exists
    checkopdir(pagedir)

    try:
        print 'Connecting to %s...' % newshost
        if sys.version[0] == '0':
            s = NNTP.init(newshost)
        else:
            s = NNTP(newshost)
        connected = True
    except (nntplib.error_temp, nntplib.error_perm), x:
        print 'Error connecting to host:', x
        print 'I\'ll try to use just the local list.'
        connected = False
예제 #2
0
def main():
    tree = {}

    # Check that the output directory exists
    checkopdir(pagedir)

    try:
        print 'Connecting to %s...' % newshost
        if sys.version[0] == '0':
            s = NNTP.init(newshost)
        else:
            s = NNTP(newshost)
        connected = True
    except (nntplib.error_temp, nntplib.error_perm), x:
        print 'Error connecting to host:', x
        print 'I\'ll try to use just the local list.'
        connected = False
예제 #3
0
def main():
    global desc

    tree = {}

    # Check that the output directory exists
    checkopdir(pagedir)

    try:
        print('Connecting to ' + newshost + '...')
        if sys.version[0] == '0':
            s = NNTP.init(newshost)
        else:
            s = NNTP(newshost)
        connected = 1
    except (nntplib.error_temp, nntplib.error_perm) as x:
        print('Error connecting to host:', x)
        print('I\'ll try to use just the local list.')
        connected = 0

    # If -a is specified, read the full list of groups from server
    if connected and len(sys.argv) > 1 and sys.argv[1] == '-a':

        groups = getallgroups(s)

    # Otherwise just read the local file and then add
    # groups created since local file last modified.
    else:

        (tree, treedate) = readlocallist(treefile)
        if connected:
            groups = getnewgroups(s, treedate)

    if connected:
        addtotree(tree, groups)
        writelocallist(treefile, tree)

    # Read group descriptions
    readdesc(descfile)

    print('Creating pages...')
    createpage(rootpage, tree, '')
    print('Done')
예제 #4
0
def main():
    global desc

    tree={}

    # Check that the output directory exists
    checkopdir(pagedir)

    try:
        print('Connecting to '+newshost+'...')
        if sys.version[0] == '0':
            s = NNTP.init(newshost)
        else:
            s = NNTP(newshost)
        connected = 1
    except (nntplib.error_temp, nntplib.error_perm) as x:
        print('Error connecting to host:', x)
        print('I\'ll try to use just the local list.')
        connected = 0

    # If -a is specified, read the full list of groups from server
    if connected and len(sys.argv) > 1 and sys.argv[1] == '-a':

        groups = getallgroups(s)

    # Otherwise just read the local file and then add
    # groups created since local file last modified.
    else:

        (tree, treedate) = readlocallist(treefile)
        if connected:
            groups = getnewgroups(s, treedate)

    if connected:
        addtotree(tree, groups)
        writelocallist(treefile,tree)

    # Read group descriptions
    readdesc(descfile)

    print('Creating pages...')
    createpage(rootpage, tree, '')
    print('Done')
예제 #5
0
#! /usr/bin/env python
예제 #6
0
#! /usr/bin/env python