/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to lib/stdhome/the.py

  • Committer: Tim Marston
  • Date: 2022-06-27 15:51:01 UTC
  • Revision ID: tim@ed.am-20220627155101-znatxg4q91gqs1sc
additional change for brz->bzr

Show diffs side-by-side

added added

removed removed

20
20
 
21
21
 
22
22
import os
23
 
import util
 
23
from . import util
24
24
 
25
25
 
26
26
# the program
29
29
# main command
30
30
command = None
31
31
 
32
 
# main repo
33
 
repo = None
 
32
# config
 
33
config = None
 
34
 
 
35
# repo name, set by late_init() to an instance of Repo
 
36
repo = 'home'
34
37
 
35
38
# verbose level
36
39
verbose = 0
50
53
# home directory
51
54
home_dir = '~/'
52
55
 
53
 
# fully qualified home directory
54
 
full_home_dir = util.canonicalise_path( home_dir )
55
 
 
56
 
 
57
 
def set_repo( repo_name ):
 
56
# fully qualified home directory, set by late_init()
 
57
full_home_dir = None
 
58
 
 
59
# config file
 
60
config_file = os.path.expanduser( '~/.stdhomerc' )
 
61
 
 
62
 
 
63
def late_init():
 
64
 
 
65
        global home_dir, full_home_dir
 
66
        full_home_dir = util.canonicalise_path( home_dir )
 
67
        if verbose >= 2: print("home-dir at " + home_dir)
 
68
 
58
69
        global repo
59
 
        from repo import Repo
60
70
        if repo is not None:
61
 
                raise RuntimeError( 'logic error: the.repo is already set' )
62
 
        repo = Repo( repo_name if repo_name else 'home' )
63
 
 
 
71
                from .repo import Repo
 
72
                repo = Repo( repo )
 
73
                if verbose >= 2: print("repo at " + repo.dir)
 
74
                repo.detect_vcs()