forked from j-faria/OPEN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopen.py
More file actions
47 lines (40 loc) · 1.47 KB
/
open.py
File metadata and controls
47 lines (40 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 João Faria
# This file is part of OPEN which is licensed under the MIT license.
# You should have received a copy of the license along with OPEN. See LICENSE.
#
"""OPEN - software tools for exoplanet detection.
Usage:
open.py
open.py --nobanner
open.py (-h | --help)
open.py --version
Options:
-h --help Show this screen.
--version Show version.
--nobanner Start OPEN without welcome message.
"""
# standard library imports
import sys
# intra-package imports
from OPEN.ipshell import EmbedShell, cfg
from OPEN.docopt import docopt
from OPEN._OPENversion import __version__
if __name__ == "__main__":
# version info
version = 'OPEN v' + __version__
# command-line argument parser
args = docopt(__doc__, version=version)
if '--art' in sys.argv:
with open('./OPEN/asciiart.txt', 'r') as f: print f.read()
banner = u'Welcome to ' + version + '\n'
banner += u'Created by João Faria | joao.faria@astro.up.pt\n\n'
banner += 'Type "listcommands" for a list of the available commands\n'
banner += 'For help on a specific command, type "command -h" or see http://j-faria.github.io/OPEN'
ipyshell = EmbedShell(config=cfg, user_global_ns=globals(),
banner1 = banner if (not args['--nobanner']) else '',
#banner2 = 'This is in banner 2',
exit_msg = 'Goodbye.')
ipyshell()