ianharper / AccuTermClient

Use AccuTerm to interact with a MultiValue server from Sublime Text.
MIT License
4 stars 0 forks source link
multivalue sublime-text

AccuTermClient

AccuTerm client is a plugin for Sublime Text allows you to connect to a MultiValue server using AccuTerm. This plugin allows for source code editing and compiling on remote MV servers as well as executing commands and using the native data conversion processing codes (OCONV/ICONV).

Features

Standard Features

These features will work with all MV DBMS that support Accuterm.

Extended Features

These features require DBMS specific configuration to run. D3, QM, and jBASE are configured automatically. Additional DBMS can be setup manually (see the Settings section below).

Requirements

Installation

Using Sublime Package Manager

  1. Package Control: Install
  2. AccuTermClient

Using Github

  1. cd %appdata%\Sublime Text 3\Packages
  2. git clone https://github.com/ianharper/AccuTermClient.git
  3. Install the PyWin32 Sublime package.

Usage

This package connects to your MV database using AccuTerm's FTSERVER program. To use, launch AccuTerm and run FTSERVER from TCL. AccuTermClient will connect to the AccuTerm server with no additional configuration.

This package expects that all files on your local machine to be contained in a folder that matches the file on the MV server. Files will be named on your local machine with a ".bp" suffix. When uploaded to the MV server this suffix will be removed. Example: C:\code\BP\HELLO.WORLD.bp will be uploaded to BP HELLO.WORLD in the account that FTSERVER is running in.

Commands

Settings

The settings can be accessed in the Preferences>Package Settings>AccuTermClient>Settings. The settings are in json format. Each top level key-value pair will be explained below. Some settings are specific to the MV DBMS, they will have a second key that specifies the DBMS. This key for your DBMS can be found in ACCUTERM,ACCUTERMCTRL, KMTCFG<51>. These settings can be set for general editing in Sublime or for specific Sublime projects.

Setting Key Description
multivalue_syntaxes List of MV syntaxes. Referenced to determine if a file in Sublime is MultiValue.
default_save_location Location to save MV files by default. When editing a file in a Sublime project the project folder will be used instead.
remove_file_extensions File extensions to remove when uploading to the MV server.
compile_command Command to execute when the Sublime Build command is run.
open_with_readu Lock files on MV server when opening.
result_line_regex Regular expression used to find the line number of compile errors. See exec Target Options in the Sublime Docs for details.
list_files_command Command to list all the files in the account. Used in the AccuTermClient List command. The output must contain only the file name, one per line.
list_command This command is run after a file is chosen from the List command. The value is appended to a "SORT (filename) " command to limit the output to only the item names.
syntax_file_locations List of MV syntaxes to apply after downloading. The default values come from the MultiValue Basic Sublime package
command_history MV file and item for the command stack.

Custom Commands

Custom commands can be easily added from Preferences>Package Settings>AccuTermClient>Custom Commands. When added these commands will be shown in Sublime's command palate. The syntax for these commands follows Sublime's command syntax which is in JSON format (with comments).

Example:

[
  {
    // Name the command
    "caption": "Term - Disable page breaks",
    // Set the Sublime command to run
    "command": "accu_term_execute",
    // Set the command to run on the MV server and where to show the output (console, new, append, or replace).
    "args": { "command": "TERM 150,0", "output_to": "console"}
   }
]

Todo