snose

Check-in [bf33015cce]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor formatting changes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | master
Files: files | file ages | folders
SHA3-256: bf33015cceb1d0c6b7f2c352b441713b59bcdd9bb0375edd81db6bb5d4b83292
User & Date: simon 2018-11-16 14:46:06
Context
2018-11-16
14:59
Add a write_index method, avoid repetition check-in: 410d185b80 user: simon tags: trunk, master
14:46
Minor formatting changes check-in: bf33015cce user: simon tags: trunk, master
13:37
Add a load_or_new() method

Haven't really touched this in years so could do with starting to tidy this up
a bit. Lots of repetitive code. check-in: d217d13956 user: simon tags: trunk, master

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to snose.py.

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
..
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
        sync(snclient, True)
    elif options.sync:
        sync(snclient)
    else:
        print('No options supplied')


def snort(snclient,filename): 
    snose = load_or_new()
    #Add new file to Simplenote
    #Need to get file contents
    try:
        with open(filename, 'r') as f:
            content = f.read()
    except IOError as e:
................................................................................
                    json.dump(snose, f, indent=2)
            except IOError as e:
                print("Failed to update .snose index file")
                #But note was added to Simplenote so?
                print("But note was successfully imported to Simplenote with key %s. Try sniffing the file" % returned[0]['key'])


def sniff(snclient,key, filename): #How to ensure remote gets or has snose tag?
    # Add a new mapping only
    snose = load_or_new()
    #Get details about current Simplenote file
    try:
        remote = snclient.get_note(key)
        #What if can't be found, need to abort...
    except IOError as e:







|







 







|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
..
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
        sync(snclient, True)
    elif options.sync:
        sync(snclient)
    else:
        print('No options supplied')


def snort(snclient, filename): 
    snose = load_or_new()
    #Add new file to Simplenote
    #Need to get file contents
    try:
        with open(filename, 'r') as f:
            content = f.read()
    except IOError as e:
................................................................................
                    json.dump(snose, f, indent=2)
            except IOError as e:
                print("Failed to update .snose index file")
                #But note was added to Simplenote so?
                print("But note was successfully imported to Simplenote with key %s. Try sniffing the file" % returned[0]['key'])


def sniff(snclient, key, filename): #How to ensure remote gets or has snose tag?
    # Add a new mapping only
    snose = load_or_new()
    #Get details about current Simplenote file
    try:
        remote = snclient.get_note(key)
        #What if can't be found, need to abort...
    except IOError as e: