Exemplo n.º 1
0
from imouto import Imouto,ImoutoSettings

cfg = ImoutoSettings()
im = Imouto(cfg.getSetting('host'), cfg.getSetting('database'), cfg.getSetting('user'), cfg.getSetting('password'))
ev = im.createEvents(7)
print str(ev) + " events created."
Exemplo n.º 2
0
from imouto import Imouto,ImoutoSettings
import sys

usage = "Usage: imouto collect [collector]"

args = sys.argv
if len(args) < 2:
        print usage
else:

	cfg = ImoutoSettings()
	im = Imouto(cfg.getSetting('host'), cfg.getSetting('database'), cfg.getSetting('user'), cfg.getSetting('password'))

	rows = im.collectorImport(args[1])
	print str(rows) + " entries added or updated."

Exemplo n.º 3
0
from imouto import Imouto,ImoutoSettings
import sys,os,datetime

usage = "Usage: imouto import [gps|bt|sms|calendar|photos|phone] [path]"

cfg = ImoutoSettings()
args = sys.argv
if len(args) < 1:
	print usage
else:
	im = Imouto(cfg.getSetting('host'), cfg.getSetting('database'), cfg.getSetting('user'), cfg.getSetting('password'))
	if len(args) < 2:
		path = cfg.getSetting('home')
	else:
		path = args[2]
	if args[1] == 'gps':
		im.importGpsPath(path)
	elif args[1] == 'bt':
		im.importBluetoothPath(path)
	elif args[1] == 'contacts':
		inf = {}
		inf['people'] = 0
		inf['properties'] = 0
		if os.path.isdir(path):
			dt = datetime.datetime(1970, 1, 1, 0, 0, 0)
			for obj in os.listdir(path):
				if os.path.isdir(path + '/' + obj):
					objp = obj.split('_')
					if len(objp) == 6:
						newdt = datetime.datetime(int(objp[0]), int(objp[1]), int(objp[2]), int(objp[3]), int(objp[4]), int(objp[5]))
						if newdt > dt: