File: asciio_to_text

package info (click to toggle)
asciio 1.51.3-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 712 kB
  • sloc: perl: 9,795; makefile: 10
file content (52 lines) | stat: -rw-r--r-- 1,129 bytes parent folder | download
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
47
48
49
50
51
52
#!/usr/bin/env perl

package main ;

use strict;
use warnings;

use App::Asciio ;

use Module::Util qw(find_installed) ;
use File::Basename ;

#-----------------------------------------------------------------------------

my @asciios ;

my $asciio = new App::Asciio() ;
push @asciios, $asciio ;

my ($command_line_switch_parse_ok, $command_line_parse_message, $asciio_config)
	= $asciio->ParseSwitches([@ARGV], 0) ;

die "Error: '$command_line_parse_message'!" unless $command_line_switch_parse_ok ;

my $setup_paths = [] ;

if(@{$asciio_config->{SETUP_PATHS}})
	{
	$setup_paths = $asciio_config->{SETUP_PATHS} ;
	}
else
	{
	my ($basename, $path, $ext) = File::Basename::fileparse(find_installed('App::Asciio'), ('\..*')) ;
	my $setup_path = $path . $basename . '/setup/' ;
	
	$setup_paths = 
		[
		$setup_path .  'setup.ini', 
		] ;
	}

$asciio->setup($setup_paths) ;

if(defined $asciio_config->{TARGETS}[0])
	{
	$asciio->run_actions_by_name(['Open', $asciio_config->{TARGETS}[0]]) ;
	}
	
$asciio->set_modified_state(0) ;
$asciio->run_script($asciio_config->{SCRIPT}) ;

print $asciio->transform_elements_to_ascii_buffer() ;