Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #33 - Switch BLISS naming to AIT #45

Merged
merged 2 commits into from
May 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branches:
- master

env:
- BLISS_CONFIG: ${TRAVIS_BUILD_DIR}/data/config/config.yaml
- AIT_CONFIG: ${TRAVIS_BUILD_DIR}/data/config/config.yaml

install:
- pip install .[tests]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions bliss/core/__init__.py → ait/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ def deprecated_func(*args, **kwargs):
return deprecated_func
return deprecated_decorator

sys.modules['bliss'].deprecated = deprecated
sys.modules['bliss'].DEFAULT_CMD_PORT = 3075
sys.modules['ait'].deprecated = deprecated
sys.modules['ait'].DEFAULT_CMD_PORT = 3075
24 changes: 12 additions & 12 deletions bliss/core/api.py → ait/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# information to foreign countries or providing access to foreign persons.

"""
BLISS API
AIT API

The bliss.core.api module provides an Application Programming
The ait.core.api module provides an Application Programming
Interface (API) to your instrument by bringing together the core.cmd
and core.tlm modules in a complementary whole, allowing you to
script instrument interactions, e.g.:
Expand All @@ -40,11 +40,11 @@
import socket
import time

import bliss.core
from bliss.core import cmd, gds, log, pcap, tlm
import ait.core
from ait.core import cmd, gds, log, pcap, tlm

class APIError (Exception):
"""All BLISS API exceptions are derived from this class"""
"""All AIT API exceptions are derived from this class"""
pass


Expand Down Expand Up @@ -109,16 +109,16 @@ def __init__ (self, destination, cmddict=None, verbose=False):
self._verbose = verbose
self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

_def_cmd_hist = os.path.join(bliss.config._ROOT_DIR, 'bliss-cmdhist.pcap')
self.CMD_HIST_FILE = bliss.config.get('command.history.filename', _def_cmd_hist)
_def_cmd_hist = os.path.join(ait.config._ROOT_DIR, 'ait-cmdhist.pcap')
self.CMD_HIST_FILE = ait.config.get('command.history.filename', _def_cmd_hist)
if not os.path.isfile(self.CMD_HIST_FILE):
if not os.path.isdir(os.path.dirname(self.CMD_HIST_FILE)):
self.CMD_HIST_FILE = _def_cmd_hist
msg = (
'command.history.filename directory does not exist. '
'Reverting to default {}'
).format(_def_cmd_hist)
bliss.core.log.warn(msg)
ait.core.log.warn(msg)


def send (self, command, *args, **kwargs):
Expand Down Expand Up @@ -160,7 +160,7 @@ def send (self, command, *args, **kwargs):
return status

def validate(self, command, *args, **kwargs):
if not isinstance(command, bliss.core.cmd.Cmd):
if not isinstance(command, ait.core.cmd.Cmd):
try:
command = self._cmddict.create(command, *args, **kwargs)
except TypeError as e:
Expand Down Expand Up @@ -462,7 +462,7 @@ def start (self):

class Instrument (object):
def __init__(self,
cmdport=bliss.config.get('command.port', bliss.DEFAULT_CMD_PORT),
cmdport=ait.config.get('command.port', ait.DEFAULT_CMD_PORT),
tlmport=3076, defn=None):
if defn is None:
tlmdict = tlm.getDefaultDict()
Expand Down Expand Up @@ -655,8 +655,8 @@ def _sendConfirmPrompt(self, _timeout, options):
return False

def _sendMsgBoxRequest(self, data):
host = bliss.config.get('gui.host', 'localhost')
port = bliss.config.get('gui.port', 8080)
host = ait.config.get('gui.host', 'localhost')
port = ait.config.get('gui.port', 8080)
url = 'http://{}:{}/prompt'.format(host, port)
connTimeout = data['timeout'] * 2

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions bliss/core/bin/bliss_bsc.py → ait/core/bin/ait_bsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# information to foreign countries or providing access to foreign persons.

'''
Usage: bliss-bsc
Usage: ait-bsc

Start the bliss BSC for capturing network traffic into PCAP files
Start the ait BSC for capturing network traffic into PCAP files
and the manager server for RESTful manipulation of active loggers.
'''

Expand All @@ -26,11 +26,11 @@
import yaml
import argparse

import bliss
from bliss.core import bsc
import ait
from ait.core import bsc


config_file = bliss.config.bsc.filename
config_file = ait.config.bsc.filename

def main():
ap = argparse.ArgumentParser(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

'''
Usage:
bliss-bsc-create-handler [options] <name> <loc> <port> <conn_type>
ait-bsc-create-handler [options] <name> <loc> <port> <conn_type>

--service-host=<host> The host for the BSC REST service connection
[default: localhost]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

'''
Usage:
bliss-bsc-stop-handler [options] <name>
ait-bsc-stop-handler [options] <name>

--service-host=<host> The host for the BSC REST service connection
[default: localhost]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import datetime
import sys

from bliss.core import gds,log, pcap
from ait.core import gds,log, pcap

def main():
log.begin()
Expand All @@ -30,4 +30,4 @@ def main():
log.end()

if __name__ == "__main__":
main()
main()
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# information to foreign countries or providing access to foreign persons.

'''
bliss-cmd-send
ait-cmd-send
'''


Expand All @@ -25,8 +25,8 @@
import argparse
from collections import OrderedDict

import bliss
from bliss.core import api, gds, log, util
import ait
from ait.core import api, gds, log, util


def main():
Expand All @@ -37,14 +37,14 @@ def main():
Sends the given command and its arguments to the ISS simulator via UDP.

Examples:
$ bliss-cmd-send OCO3_CMD_START_SEQUENCE_NOW 1
$ ait-cmd-send OCO3_CMD_START_SEQUENCE_NOW 1

"""

arguments = OrderedDict({
'--port': {
'type' : int,
'default' : bliss.config.get('command.port', bliss.DEFAULT_CMD_PORT),
'default' : ait.config.get('command.port', ait.DEFAULT_CMD_PORT),
'help' : 'Port on which to send data'
},
'--verbose': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

'''
Usage:
bliss-create-dirs [options]
ait-create-dirs [options]

Arguments:

Expand All @@ -26,16 +26,16 @@

Description:

BLISS Create Directory Structure
AIT Create Directory Structure

Based on the data paths specified in the BLISS_CONFIG, this software creates
Based on the data paths specified in the AIT_CONFIG, this software creates
daily directories for the GDS based on the paths and any applicable variable
substitution.

Define the Paths
================

Paths should be specified within the 'data' portion of the BLISS_CONFIG. It
Paths should be specified within the 'data' portion of the AIT_CONFIG. It
should follow the following hierarchy within the YAML file:

data:
Expand Down Expand Up @@ -64,7 +64,7 @@
=====================

Variable substituion is also possible using any of the default-, platform-,
or host- level attributes within the BLISS_CONFIG. To include a variable
or host- level attributes within the AIT_CONFIG. To include a variable
in a path use the following syntax, `${variable}`

For example,
Expand Down Expand Up @@ -122,12 +122,12 @@
import argparse
import time

import bliss
from bliss.core import dmc, log
import ait
from ait.core import dmc, log


def createDirStruct(paths, verbose=True):
'''Loops bliss.config._datapaths from BLISS_CONFIG and creates a directory.
'''Loops ait.config._datapaths from AIT_CONFIG and creates a directory.

Replaces year and doy with the respective year and day-of-year.
If neither are given as arguments, current UTC day and year are used.
Expand Down Expand Up @@ -161,20 +161,20 @@ def createDirStruct(paths, verbose=True):
def main():
argparser = argparse.ArgumentParser(
description = """
BLISS Create Directories Script
AIT Create Directories Script

Based on the data paths specified in the BLISS_CONFIG, this software creates
Based on the data paths specified in the AIT_CONFIG, this software creates
daily directories for the GDS based on the paths and any applicable variable
substitution.
""",
epilog = """
Create directories based on some set of variables in a separate YAML config

$ bliss-create-dirs -c vars.yaml
$ ait-create-dirs -c vars.yaml

Create directories starting 3 days from now for 90 days

$ bliss-create-dirs -d 2016-01-01T00:00:00Z
$ ait-create-dirs -d 2016-01-01T00:00:00Z
""",
formatter_class = argparse.RawDescriptionHelpFormatter
)
Expand Down Expand Up @@ -207,26 +207,26 @@ def main():
pathvars = { }

if options.date:
bliss.config._datetime = time.strptime(options.date, dmc.ISO_8601_Format)
ait.config._datetime = time.strptime(options.date, dmc.ISO_8601_Format)

if options.timedelta:
bliss.config._datetime = time.strptime(dmc.getUTCDatetimeDOY(days=options.timedelta),
ait.config._datetime = time.strptime(dmc.getUTCDatetimeDOY(days=options.timedelta),
dmc.DOY_Format)

pathvars['year'] = bliss.config._datetime.tm_year
pathvars['doy'] = '%03d' % bliss.config._datetime.tm_yday
pathvars['year'] = ait.config._datetime.tm_year
pathvars['doy'] = '%03d' % ait.config._datetime.tm_yday

# Add the updated path variables for the date
bliss.config.addPathVariables(pathvars)
ait.config.addPathVariables(pathvars)

bliss.config.reload()
ait.config.reload()

# Create the directory
retcode = createDirStruct(bliss.config._datapaths)
retcode = createDirStruct(ait.config._datapaths)

except Exception as e:
print e
log.error('BLISS Create Directories error: %s' % traceback.format_exc())
log.error('AIT Create Directories error: %s' % traceback.format_exc())

log.end()
return retcode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

'''
Usage:
bliss-dict-writer [options] (--tlm | --cmd)
ait-dict-writer [options] (--tlm | --cmd)

--tlm Run dictionary processor for Telemetry dictionary.
--cmd Run dictionary processor for Command dictionary.
Expand All @@ -26,9 +26,9 @@


Description:
BLISS TLM and CMD Dictionary Definitions to Specified Output Format
AIT TLM and CMD Dictionary Definitions to Specified Output Format

Outputs BLISS TLM and CMD Dictionary Definitions in Specific output format. Currently supports:
Outputs AIT TLM and CMD Dictionary Definitions in Specific output format. Currently supports:
* TLM -> CSV

TODO
Expand All @@ -43,7 +43,7 @@
import sys
import argparse

from bliss.core import log, tlm
from ait.core import log, tlm

def main():
parser = argparse.ArgumentParser(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import datetime
import os

from bliss.core import dmc, log, pcap, util
from ait.core import dmc, log, pcap, util

def main():
ap = argparse.ArgumentParser(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
seconds. This yields nice round number timestamps for filenames. For
example:

bliss-pcap-segment -s 3600 %Y%m%dT%H%M%S.pcap foo.pcap bar.pcap
ait-pcap-segment -s 3600 %Y%m%dT%H%M%S.pcap foo.pcap bar.pcap

If the first packet written to a file has a time of 2017-11-23
19:28:58, the file will be named:
Expand All @@ -43,7 +43,7 @@
import datetime
import os

from bliss.core import log, pcap
from ait.core import log, pcap


def main():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

'''

usage: bliss-seq-decode oco3_seq_SSS_NNN_desc.bin
usage: ait-seq-decode oco3_seq_SSS_NNN_desc.bin

Decodes the given relative time command sequence to text.

Examples:

$ bliss-seq-decode seq/oco3_seq_gps_001_reset.bin
$ ait-seq-decode seq/oco3_seq_gps_001_reset.bin
'''

import os
import sys
import argparse

from bliss.core import gds, log, seq
from ait.core import gds, log, seq


def main():
Expand Down
Loading