"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "frontend/xorriso-tcltk" between
xorriso-1.5.2.tar.gz and xorriso-1.5.4.tar.gz

About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.

xorriso-tcltk  (xorriso-1.5.2):xorriso-tcltk  (xorriso-1.5.4)
#!/usr/bin/wish #!/usr/bin/wish
# #
# xorriso-tcltk # xorriso-tcltk
# Copyright (C) 2012 - 2019 # Copyright (C) 2012 - 2021
# Thomas Schmitt <scdbackup@gmx.net>, libburnia project. # Thomas Schmitt <scdbackup@gmx.net>, libburnia project.
# Provided under BSD license: Use, modify, and distribute as you like. # Provided under BSD license: Use, modify, and distribute as you like.
# #
# This is mainly a proof of concept for xorriso serving under a frontend. # This is mainly a proof of concept for xorriso serving under a frontend.
# It exercises several fundamental gestures of communication: # It exercises several fundamental gestures of communication:
# - connecting via two named pipes # - connecting via two named pipes
# - sending commands # - sending commands
# - receiving replies # - receiving replies
# - inquiring the xorriso message sieve # - inquiring the xorriso message sieve
# - using the xorriso parsing service # - using the xorriso parsing service
# #
# It also may serve as educational frontend to xorriso which tells by # It also may serve as educational frontend to xorriso which tells by
# its message window how to operate xorriso by commands and what it will # its message window how to operate xorriso by commands and what it will
# reply. # reply.
# Note that any other language than Tcl/Tk could be used, if it only can # Note that any other language than Tcl/Tk could be used, if it only can
# do i/o via standard input and standard output or via named pipes. # do i/o via standard input and standard output or via named pipes.
# Further it has to perform integer arithmetics and string manipulations. # Further it has to perform integer arithmetics and string manipulations.
# And, well, a graphical widget set would be nice. # And, well, a graphical widget set would be nice.
set own_version "1.5.2" set own_version "1.5.4"
# Minimum version of xorriso to be used as backend process. # Minimum version of xorriso to be used as backend process.
# Older versions of xorriso do not offer commands -msg_op and -launch_frontend # Older versions of xorriso do not offer commands -msg_op and -launch_frontend
set min_xorriso_version "1.2.6" set min_xorriso_version "1.2.6"
proc print_usage {argv0} { proc print_usage {argv0} {
puts stderr "Usage:" puts stderr "Usage:"
puts stderr " $argv0 \[options\]" puts stderr " $argv0 \[options\]"
puts stderr "Options:" puts stderr "Options:"
puts stderr " All options must be given with two dashes (\"--option\") in" puts stderr " All options must be given with two dashes (\"--option\") in"
skipping to change at line 108 skipping to change at line 108
# Connection to xorriso # Connection to xorriso
set cmd_conn "" set cmd_conn ""
set reply_conn "" set reply_conn ""
# The addresses of the named pipes, if such are used (see option -named_pipe) # The addresses of the named pipes, if such are used (see option -named_pipe)
set cmd_pipe_adr "" set cmd_pipe_adr ""
set reply_pipe_adr "" set reply_pipe_adr ""
# The command to send (or the command most recently sent) # The command to send (or the command most recently sent)
set cmdline "" set cmdline ""
# Wether to clear the cmdline after sending # Whether to clear the cmdline after sending
set cmdline_clear true set cmdline_clear true
# Command counter # Command counter
set cmd_sent 0 set cmd_sent 0
# Current -mark synchronization text # Current -mark synchronization text
set mark_count 0 set mark_count 0
# Results of most recent await_all_replies # Results of most recent await_all_replies
set info_list "" set info_list ""
set info_count 0 set info_count 0
set emerging_info "" set emerging_info ""
skipping to change at line 181 skipping to change at line 181
# List of known drive addresses # List of known drive addresses
set devlist "" set devlist ""
# Intermediate storage for messages until the GUI is up with .msglist box # Intermediate storage for messages until the GUI is up with .msglist box
set pre_msglist "" set pre_msglist ""
# Whether overwriting of files in the ISO model is allowed # Whether overwriting of files in the ISO model is allowed
set overwrite_iso_files 1 set overwrite_iso_files 1
# If overwrite_iso_files is 1: Wether overwriting of ISO directories is allowed # If overwrite_iso_files is 1: Whether overwriting of ISO directories is allowed
set overwrite_iso_dirs 0 set overwrite_iso_dirs 0
# Whether overwriting of files on disk is allowed # Whether overwriting of files on disk is allowed
set overwrite_disk_files 0 set overwrite_disk_files 0
# The file where to log commands and replies for debugging purposes # The file where to log commands and replies for debugging purposes
set debug_log_file "" set debug_log_file ""
set debug_log_conn stderr set debug_log_conn stderr
# Whether to log all commands and replies to the debug_log_file # Whether to log all commands and replies to the debug_log_file
skipping to change at line 244 skipping to change at line 244
# Open the connection to a pair of named pipes. Program option -named_pipes # Open the connection to a pair of named pipes. Program option -named_pipes
# #
proc init_frontend_named_pipes {cmd_pipe reply_pipe} { proc init_frontend_named_pipes {cmd_pipe reply_pipe} {
global cmd_conn global cmd_conn
global reply_conn global reply_conn
set cmd_conn [open $cmd_pipe w] set cmd_conn [open $cmd_pipe w]
set reply_conn [open $reply_pipe r] set reply_conn [open $reply_pipe r]
# Note: disencouraged flags would be necessary for opening idle fifo # Note: dissuaded flags would be necessary for opening idle fifo
# set reply_conn [open $reply_pipe {RDONLY NONBLOCK}] # set reply_conn [open $reply_pipe {RDONLY NONBLOCK}]
} }
# Send a command line to the xorriso process. Do not wait for reply. # Send a command line to the xorriso process. Do not wait for reply.
# #
proc send_async_cmd {cmd} { proc send_async_cmd {cmd} {
global cmd_sent cmd_conn debug_logging debug_log_conn global cmd_sent cmd_conn debug_logging debug_log_conn
display_busy 1 display_busy 1
skipping to change at line 884 skipping to change at line 884
"-find / -exec mkisofs_r" "-find / -exec mkisofs_r"
} }
} }
# ------ Parsing by help of xorriso ------ # ------ Parsing by help of xorriso ------
# Parsing by xorriso takes from the frontend the burden to understand # Parsing by xorriso takes from the frontend the burden to understand
# and implement the quoting rules of xorriso input and output. # and implement the quoting rules of xorriso input and output.
# Lines which are supposed to consist of several words get sent to # Lines which are supposed to consist of several words get sent to
# xorriso command -msg_op. The result lines of this command encode # xorriso command -msg_op. The result lines of this command encode
# the words unambigously in one or more text lines. # the words unambiguously in one or more text lines.
# This is supposed to be safe for even the weirdest file names. # This is supposed to be safe for even the weirdest file names.
# Only NUL characters cannot be part of names. # Only NUL characters cannot be part of names.
# Start a bulk parser job by which xorriso shall split the output of e.g. -lsl # Start a bulk parser job by which xorriso shall split the output of e.g. -lsl
# into single words from which this frontend can pick information. # into single words from which this frontend can pick information.
# #
proc start_bulkparse {prefix separators max_words flag num_lines} { proc start_bulkparse {prefix separators max_words flag num_lines} {
global bulk_parse_prefix bulk_parse_separators global bulk_parse_prefix bulk_parse_separators
global bulk_parse_max_words bulk_parse_flag bulk_parse_num_texts global bulk_parse_max_words bulk_parse_flag bulk_parse_num_texts
skipping to change at line 3385 skipping to change at line 3385
# Number of lines in drivelist display # Number of lines in drivelist display
set drivelist_lines 2 set drivelist_lines 2
# Number of lines in ISO directory content display # Number of lines in ISO directory content display
set isolist_lines 8 set isolist_lines 8
# Whether the message box shall export its selection to the whole X display # Whether the message box shall export its selection to the whole X display
set export_msg_selection true set export_msg_selection true
# Wether the item lists shall export their selection # Whether the item lists shall export their selection
set export_selection false set export_selection false
# The number of lines in the display of the help texts # The number of lines in the display of the help texts
set main_help_window_lines 24 set main_help_window_lines 24
set help_window_lines 16 set help_window_lines 16
# The distance of the help text from the help window border # The distance of the help text from the help window border
set help_window_border_width 0 set help_window_border_width 0
# The number of items to display in a tree browser window # The number of items to display in a tree browser window
skipping to change at line 4175 skipping to change at line 4175
bind $entry <Return> $return_cmd bind $entry <Return> $return_cmd
} }
} }
# Bind a help text to a widget. # Bind a help text to a widget.
# #
proc bind_help {to_what help_name} { proc bind_help {to_what help_name} {
bind $to_what <Button-3> "window_help \"$help_name\" grey" bind $to_what <Button-3> "window_help \"$help_name\" grey"
} }
# Create a "/" button and wire it with variable, fileystem type, and help text. # Create a "/" button and wire it with variable, filesystem type,and help text.
# #
proc create_browser_button {button_name var_name which_fs help_name} { proc create_browser_button {button_name var_name which_fs help_name} {
global have_bwidget global have_bwidget
button $button_name -text "/" -command "browse_tree $var_name $which_fs" button $button_name -text "/" -command "browse_tree $var_name $which_fs"
bind_help $button_name $help_name bind_help $button_name $help_name
} }
proc set_overwriting_label {} { proc set_overwriting_label {} {
global overwrite_iso_files overwrite_iso_dirs overwrite_disk_files global overwrite_iso_files overwrite_iso_dirs overwrite_disk_files
skipping to change at line 4449 skipping to change at line 4449
shall be logged if \"Log command script\" is enabled. Commands shall be logged if \"Log command script\" is enabled. Commands
-msg_op \"parse\" and -msg_op \"parse_bulk\" will be logged only as comments. -msg_op \"parse\" and -msg_op \"parse_bulk\" will be logged only as comments.
The item \"Set log script address\" pops up a file tree browser window The item \"Set log script address\" pops up a file tree browser window
which asks for the target of appending to script. Address \"-\" means which asks for the target of appending to script. Address \"-\" means
standard error. Else it must not yet exist or be a writable data file. standard error. Else it must not yet exist or be a writable data file.
The \"Log pipes\" switch controls whether all xorriso commands and replies The \"Log pipes\" switch controls whether all xorriso commands and replies
shall be logged to standard error or to the file that has been given shall be logged to standard error or to the file that has been given
with program argument --pipe_log_file. with program argument --pipe_log_file.
Caution: This log is verbous. Caution: This log is verbose.
The item \"Set pipe log address\" pops up a file tree browser window The item \"Set pipe log address\" pops up a file tree browser window
which asks for the target of pipe logging . Address \"-\" means which asks for the target of pipe logging . Address \"-\" means
standard error. Else it must not yet exist or be a writable data file. standard error. Else it must not yet exist or be a writable data file.
The item \"Execute command script\" executes the commands in a script The item \"Execute command script\" executes the commands in a script
file that should stem from \"Log command script\". file that should stem from \"Log command script\".
At least it must begin by this line: At least it must begin by this line:
# xorriso-tcltk command log script # xorriso-tcltk command log script
Be aware that xorriso will slavishly execute those commands. Better check Be aware that xorriso will slavishly execute those commands. Better check
skipping to change at line 5231 skipping to change at line 5231
set result "$result'\"'\"'" set result "$result'\"'\"'"
if {$idx == [expr [string length $rest] - 1]} { if {$idx == [expr [string length $rest] - 1]} {
break break
} }
set rest [string range $rest [expr $idx + 1] end] set rest [string range $rest [expr $idx + 1] end]
} }
} }
set result "$result'" set result "$result'"
} }
# Count the number of newline chracters in text. # Count the number of newline characters in text.
# #
proc count_newlines {text} { proc count_newlines {text} {
set rest $text set rest $text
set count 0 set count 0
while {[string length $rest]} { while {[string length $rest]} {
set idx [string first "\n" $rest] set idx [string first "\n" $rest]
if {$idx == -1} { if {$idx == -1} {
break break
} else { } else {
set count [expr $count + 1] set count [expr $count + 1]
 End of changes. 10 change blocks. 
10 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)