Skip to content
/ TIdy Public
forked from dpebert7/TIdy

Easily format TM1 TurboIntegrator processes

Notifications You must be signed in to change notification settings

Sven-Bo/TIdy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TIdy

An easy python formatter TM1 TurboIntegrator processes

Binder

Features

  • Keyword Highlighting

  • Indentation

  • Deploy Jupyter Notebook quickly using Binder: Binder

  • Automatically copy results to clipboard using pyperclip (Available only when running locally)

Example

from TI import TI
ti = TI(text = "")
ti.set_tab("\t")

string = """
if (1=0) ;
ASCIIOUTPUT('zz.txt', 'Hello world!');
endif;
"""

ti.text = string.split('\n')
ti.tidy()
ti.print_output()

Output:

IF (1 = 0);
	ASCIIOutput('zz.txt', 'Hello world!');
ENDIF;

Known Issues/Improvements

  • Add hanging indentation for long ExecuteProcess statements.

  • Include and document options for removing extra whitespace, shortening comment headers, etc.

  • Include formatting for rule files

  • Expanded testing

Fixed Issues

  • Operators within quotes should not be spaced, E.g. path = '\\main-directory\test.txt';

  • Allow passing of raw .pro files. Note: This is working, but is generally dangerous and should only be with proper testing.

  • \n must not be interpreted as new line, especially when passing string rather than file path. E.g. nResult = nNumerator\nDivisor; should not split into two lines.

  • Correct capitalization at start of word. E.g. stringtonumber (pEndYear) should not become STRingToNumber (pEndYear)

  • Single line if statments, E.g. IF(nCondition = 1, ProcessBreak, 0); should handle indentation correctly

About

Easily format TM1 TurboIntegrator processes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 65.3%
  • Prolog 25.2%
  • Jupyter Notebook 9.5%