Пример #1
0
Файл: ljp.py Проект: sa2ajj/ljpy
    info = lj.login (username, password)

    security = list2mask (options.security, info.friendgroups)

    if evalue (None, ljp.batch, options.batch):
        body = body + '\n' + sys.stdin.read ()
    else:
        # At this point we have the following variables holding useful information:
        #  -- body
        #  -- subject
        #  -- props
        #  -- usejournal
        #  -- security

        if 0:
            text = args2text (info = info, event = body, usejournal = usejournal, subject = subject, props = props, security = options.security)

            pass #  process the text

            # subject, usejournal, body, props, security = text2args (info, text)

        print 'Sorry, non-batch mode is not supported yet'
        sys.exit (1)

    body = unicode (body, encoding)

    if subject is not None:
        subject = unicode (subject, encoding)

    if props.has_key ('current_mood'):
        props['current_mood'] = unicode (props['current_mood'], encoding)
Пример #2
0
Файл: lje.py Проект: sa2ajj/ljpy
if options.mood is not None:
    props['current_mood'] = options.mood

if options.music is not None:
    props['current_music'] = options.music

config = Config ()
config.load (evalue ('~/.ljrc', options.config))

server = getattr (config, options.server)

lj = LiveJournal (config.misc.version)

info = lj.login (server.username, server.password)

if 0:
    if subject is not None:
        subject = unicode (subject, 'koi8-r')

    event = unicode (event, 'koi8-r')

    entry = lj.postevent (event,
                subject = subject,
                props = props,
                security = list2mask (options.security, info.friendgroups))

    print 'Posted.\nLink to the post: http://www.livejournal.com/talkread.bml?journal=%s&itemid=%s' % (server.username, entry.itemid*256 + entry.anum)
else:
    sys.stdout.write (args2text (info = info, event = event, subject = subject, props = props, security = options.security))