Chore Account server

Check-in [0977f2e88c]
Login

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

Overview
Comment:Fix config handling. Add per-user config items for imap.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:0977f2e88c01b37701e3911088d7732f7b72cfa37277289d5dbb2ed0a6f54b24
User & Date: ajv-899-334-8894@vsta.org 2016-11-27 18:34:44
Context
2016-11-30
20:27
Get server name into title so bookmarks are more descriptive check-in: 6e9e3d2bcf user: ajv-899-334-8894@vsta.org tags: master, trunk
2016-11-27
18:34
Fix config handling. Add per-user config items for imap. check-in: 0977f2e88c user: ajv-899-334-8894@vsta.org tags: master, trunk
2016-11-24
17:15
Log service registration. Don't let templates ever log in. Start applying per-user enforcement. Supply per-user profile to service. check-in: c1ba559bed user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to main.py.

61
62
63
64
65
66
67

68



69
70
71
72
73
74
75
..
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# Returns (Config, cfg{}, mtime)
#  "mtime" is the os.stat time for file modification, so we can detect
#  changes to the config file and reload.
def load_accounts(fn):
    c = chore.config.Config()
    for e in (

         ("account", "serve"), ("account", "serve", "path"),



         ("account", "name"), ("account", "email"),
         ("account", "pass"), ("domain,") ):
        c.onearg.add(e)

    # Multiple accounts (of course)
    # Each is "account X [templates...]"
    c.args.add( ("account",) )
................................................................................

    # Each account can have multiple services
    c.mults.add( ("account", "serve") )

    # Load the file
    f = open(fn, "r")
    ftm = os.fstat(f.fileno()).st_mtime
    cfg = c.load_cfg_file(f)
    f.close()

    # Transform config dict into something more immediately
    #  useful; keyed by account name, with prototype references
    #  folded into the account
    accts = {}
    for tupname,cfg in cfg["account"]:







>
|
>
>
>







 







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
..
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#
# Returns (Config, cfg{}, mtime)
#  "mtime" is the os.stat time for file modification, so we can detect
#  changes to the config file and reload.
def load_accounts(fn):
    c = chore.config.Config()
    for e in (
         ("account", "serve"),
             ("account", "serve", "path"),
             ("account", "serve", "server"),
             ("account", "serve", "user"),
             ("account", "serve", "pass"),
         ("account", "name"), ("account", "email"),
         ("account", "pass"), ("domain,") ):
        c.onearg.add(e)

    # Multiple accounts (of course)
    # Each is "account X [templates...]"
    c.args.add( ("account",) )
................................................................................

    # Each account can have multiple services
    c.mults.add( ("account", "serve") )

    # Load the file
    f = open(fn, "r")
    ftm = os.fstat(f.fileno()).st_mtime
    cfg = c.load_cfg_file(fn, f)
    f.close()

    # Transform config dict into something more immediately
    #  useful; keyed by account name, with prototype references
    #  folded into the account
    accts = {}
    for tupname,cfg in cfg["account"]: