Coverage for /usr/local/lib/python3.11/dist-packages/pyrocko/squirrel/tool/commands/init.py: 70%

10 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-10-04 09:52 +0000

1# http://pyrocko.org - GPLv3 

2# 

3# The Pyrocko Developers, 21st Century 

4# ---|P------/S----------~Lg---------- 

5 

6''' 

7Implementation of :app:`squirrel init`. 

8''' 

9 

10from pyrocko import squirrel as sq 

11 

12 

13headline = 'Create local environment.' 

14 

15description = headline + ''' 

16 

17Squirrel based applications can either use the user’s global Squirrel 

18environment or a project specific local environment. Running this command in a 

19project's top level directory creates a local environment. Any Squirrel 

20application started thereafter in this directory or any of its subdirectories, 

21will use the local enviroment instead of the global one. 

22 

23The local enviroment consists of a directory ```.squirrel``` which contains 

24the Squirrel's database and a cache directory. 

25 

26A local environment can be removed by removing its ```.squirrel``` directory. 

27 

28The user's global enviroment database resides in Pyrocko’s global cache 

29directory, by default in ```$HOME/.pyrocko/cache/squirrel```. 

30''' 

31 

32 

33def make_subparser(subparsers): 

34 return subparsers.add_parser( 

35 'init', 

36 help=headline, 

37 description=description) 

38 

39 

40def setup(parser): 

41 pass 

42 

43 

44def run(parser, args): 

45 sq.init_environment()