~sir-rainbow/+junk/scribes-on-win

« back to all changes in this revision

Viewing changes to plugins/Preferences/TextWrappingMetadata.py

  • Committer: lateef
  • Date: 2009-11-07 22:21:32 UTC
  • Revision ID: teef@submission-20091107222132-sfz2ji4nzk130wth
Customize preferences based on source code type. Press F12 to show the new preferences GUI.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from SCRIBES.Utils import open_database
2
 
basepath = "Preferences/TextWrapping.gdb"
3
 
 
4
 
def get_value():
5
 
        try:
6
 
                value = True
7
 
                database = open_database(basepath, "r")
8
 
                value = database["text_wrapping"]
9
 
        except KeyError:
10
 
                pass
11
 
        finally:
12
 
                database.close()
13
 
        return value
14
 
 
15
 
def set_value(value):
16
 
        try:
17
 
                database = open_database(basepath, "w")
18
 
                database["text_wrapping"] = value
19
 
        finally:
20
 
                database.close()
21
 
        return