+++ /dev/null
-#!/usr/bin/python
-# adr_conv.py
-#
-# Converts a vCard address book into abook addressbook format
-#
-# Author: Gavin Costello
-# Date: 19.02.2009
-name = '';
-phone = '';
-email = '';
-count = 0;
-
-cfile = open('contacts.vcf', 'r')
-for line in cfile.readlines():
- if (line.startswith('FN')):
- count += 1
- name = line.split(':')[1]
- print
- print u'[%d]' % count
- print u'name=%s' % unicode(name, "utf-8"),
- if (line.startswith('EMAIL')):
- email = line.split(':')[1]
- print u'email=%s' % email,
- if (line.startswith('TEL')):
- tel = line.split(';')[1]
- fulltype = tel.split('=')[1]
- type = fulltype.split(':')[0]
- #print u'type=%s' % type,
- phone = line.split(':')[1]
- if (type.endswith('CELL')):
- print u'mobile=%s' % phone,
- elif (type.endswith('HOME')):
- print u'phone=%s' % phone,
- elif (type.endswith('WORK')):
- print u'work=%s' % phone,
subprocess.Popen(['offlineimap', '-a', self.account, '-f', self.mailbox, '-o', '-k', 'mbnames:enabled=no'])
self.sendLine('DONE')
return True
- print 'Done idling (new mail)'
+ print 'Done idleing (new mail)'
else:
return False
+++ /dev/null
-#!/bin/sh
-
-set -efu
-
-ionice_class=
-ionice_priority=
-nice=
-
-while getopts c:p:n: f; do
- case $f in
- c) ionice_class=$OPTARG;;
- p) ionice_priority=$OPTARG;;
- n) nice=$OPTARG;;
- *) exit 2;;
- esac
-done
-shift $((OPTIND - 1))
-
-cmd=$*
-io=
-
-if pgrep -u "$(id -u)" -xf -- "$cmd" >/dev/null 2>&1; then
- exit 0
-fi
-
-if type ionice >/dev/null 2>&1; then
- [ -n "$ionice_class" ] && { io=1; cmd="-c $ionice_class $cmd"; }
- [ -n "$ionice_priority" ] && { io=1; cmd="-n $ionice_priority $cmd"; }
- [ -n "$io" ] && cmd="ionice $cmd"
-fi
-
-if type nice >/dev/null 2>&1; then
- [ -n "$nice" ] && cmd="nice -n $nice $cmd"
-fi
-
-exec nohup $cmd >/dev/null 2>&1 &