Hi Tony,
For one time, you can debit my account.

Thanks,
WWsudhir
On Thursday, May 23, 2013, Terry Brown <[email protected]> wrote:
> I've added an abbreviation to my myLeoSettings.leo abbreviations:
> https://gist.github.com/tbnorth/5530059
>
> It's the abbreviation "persist;;" and when you type that you get:
>
> ---cut here---
> import json
>
> json_state_file = "cache_info_file.json"
> if not os.path.exists(json_state_file):
>     json.dump({'cache_items':{}}, open(json_state_file, 'w'))
> cache_info = json.load(open(json_state_file))
>
> def main():
>
>     # do stuff with cache_info...
>
> if __name__ == '__main__':
>
>     try:
>         main()
>     except:
>         json.dump(cache_info, open(json_state_file, 'w'))
> ---cut here---
>
> with appropriate interaction to customize all the parts which, in the
> above example, include "cache_", i.e. the filename and the variable
> name.
>
> The point is it seems silly to create a module and hence a dependency
> for what is barely 4 lines of actual code, but those 4 lines give you
> very handy robust persistence, so something like an editor abbreviation
> is the obvious way to make the available - nothing Leo specific here,
> except that only serious editors have abbreviation like that ;-).
>
> Cheers -Terry
>
> --
> You received this message because you are subscribed to the Google Groups
"leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/leo-editor?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to