Ejemplo n.º 1
0
'''
Created on Mar 8, 2010

@author: adriano
'''

import os, glob, commands, xml.dom.minidom, TomboyManager, sys

if len(sys.argv) > 1:
    argsNotes = sys.argv[1]
#    print argsNotes
    if argsNotes == 'p':
        # First Quest: Sync the Planning note about the current day with my N810
        TomboyManager.syncTodayPlanningNote2N810()
    elif argsNotes == 'f':
        # Creating the notes of 'Le Mot: %s' based on the today 'Mots du Jour'
        TomboyManager.searchMotsDuJour()
    elif argsNotes == 'a':
	#Transfer all notes
	TomboyManager.syncAllNotes2N810()
else:
    print ' Usage: manageTomboyNotes [OPTION] ' 
            
            
            
            
            
Ejemplo n.º 2
0
import TomboyRemoteControl
import commands

mainpath = '/home/adriano/Documents/BackupTomboy/'

print 'Arguments received: ',sys.argv

if len(sys.argv) == 3:
    tomboyNoteTitle= sys.argv[1]
    dateBackup = sys.argv[2]

    print 'Searching for  %s note on folder %s' % (tomboyNoteTitle, dateBackup)

#    now = datetime.datetime.now().date()
#    while int(now.day()) != int(dateBackup):
#        now = now - datetime.timedelta(1)

    path = mainpath + 'BackupDay_' + dateBackup
    r = TomboyManager.findNote(tomboyNoteTitle, path)
    if r[0]:
         print r[1]
         contents = commands.getoutput('cat ' + r[1])
         n = TomboyManager.findNote(tomboyNoteTitle)
         if n[0]:
             print n[1]
             note = open(n[1],'wb' )
             note.write(contents)
             note.close()
#             tomboy = TomboyRemoteControl.RemoteControl()
#             tomboy.open_named_note(tomboyNoteTitle)