|
7 | 7 | import os
|
8 | 8 | import sys
|
9 | 9 | import subprocess
|
10 |
| -import utils |
11 | 10 | from docopt import docopt
|
12 |
| -from logger import Logger |
13 |
| -from templategen import Templategen |
14 |
| -from installer import Installer |
15 |
| -from dotfile import Dotfile |
16 |
| -from config import Cfg |
17 | 11 |
|
18 |
| -VERSION = '0.6' |
| 12 | +# local imports |
| 13 | +from . import __version__ as VERSION |
| 14 | +from .logger import Logger |
| 15 | +from .templategen import Templategen |
| 16 | +from .installer import Installer |
| 17 | +from .dotfile import Dotfile |
| 18 | +from .config import Cfg |
| 19 | +from .utils import * |
| 20 | + |
19 | 21 | CUR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
20 | 22 | LOG = Logger()
|
21 | 23 | HOSTNAME = os.uname()[1]
|
|
40 | 42 |
|
41 | 43 | Options:
|
42 | 44 | --profile=<profile> Specify the profile to use [default: %s].
|
43 |
| - -c --cfg=<path> Path to the config [default: %s/config.yaml]. |
| 45 | + -c --cfg=<path> Path to the config [default: config.yaml]. |
44 | 46 | --files=<files> Comma separated list of files to compare.
|
45 | 47 | -n --nodiff Do not diff when installing.
|
46 | 48 | -l --link Import and link.
|
|
50 | 52 | -v --version Show version.
|
51 | 53 | -h --help Show this screen.
|
52 | 54 |
|
53 |
| -""" % (BANNER, HOSTNAME, CUR) |
| 55 | +""" % (BANNER, HOSTNAME) |
54 | 56 |
|
55 | 57 | ###########################################################
|
56 | 58 | # entry point
|
@@ -147,16 +149,16 @@ def importer(opts, conf, paths):
|
147 | 149 | if opts['dry']:
|
148 | 150 | LOG.dry('would run: %s' % (' '.join(cmd)))
|
149 | 151 | else:
|
150 |
| - utils.run(cmd, raw=False, log=False) |
| 152 | + run(cmd, raw=False, log=False) |
151 | 153 | cmd = ['cp', '-R', '-L', dst, srcf]
|
152 | 154 | if opts['dry']:
|
153 | 155 | LOG.dry('would run: %s' % (' '.join(cmd)))
|
154 | 156 | if opts['link']:
|
155 | 157 | LOG.dry('would symlink %s to %s' % (srcf, dst))
|
156 | 158 | else:
|
157 |
| - utils.run(cmd, raw=False, log=False) |
| 159 | + run(cmd, raw=False, log=False) |
158 | 160 | if opts['link']:
|
159 |
| - utils.remove(dst) |
| 161 | + remove(dst) |
160 | 162 | os.symlink(srcf, dst)
|
161 | 163 | if retconf:
|
162 | 164 | LOG.sub('\"%s\" imported' % (path))
|
@@ -226,7 +228,7 @@ def main():
|
226 | 228 |
|
227 | 229 | elif args['compare']:
|
228 | 230 | # compare local dotfiles with dotfiles stored in dotdrop
|
229 |
| - tmp = utils.get_tmpdir() |
| 231 | + tmp = get_tmpdir() |
230 | 232 | if compare(opts, conf, tmp, args['--files']):
|
231 | 233 | LOG.raw('\ntemporary files available under %s' % (tmp))
|
232 | 234 | else:
|
|
0 commit comments