Changeset 3634546 in tol for tolbase


Ignore:
Timestamp:
Dec 10, 2015, 12:53:36 PM (11 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
e87e769
Parents:
00d6ed4
Message:

Se modifica el uso que se hace del paquete trycatch para evitar incompatibilidades con tcl8.6:

+ No se importan los métodos del paquete
+ Se llaman las llamadas a try haciendo uso del namespace: ::trycatach::try

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7096 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tolbase/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/markupviewer/markupviewer.tcl

    r00d6ed4 r3634546  
    190190    # Returns the expanded text of the page, which must exist.
    191191    method pageexpand {name} {
    192       try {
     192      ::trycatch::try {
    193193        set result [$db expand [$db get $name]]
    194194      }
  • tolbase/lib/nbdbmanager/nbdbmanager.tcl

    r00d6ed4 r3634546  
    55package require trycatch
    66
    7 if { [ info commands "try" ] eq "" } {
    8   namespace import ::trycatch::*
    9 }
    10 
     7#(pgea) Se utilizará trycatch sin importar sus métodos
     8#(pgea) para hacer el código compatible con tcl8.6
     9#(pgea) Por ejemplo: ::trycatch::try ...
     10# if { [ info commands "try" ] eq "" } {
     11#   namespace import ::trycatch::*
     12# }
    1113
    1214snit::type nbdbmanagerType {
  • tolbase/lib/notebookdb/notebookdb.tcl

    r00d6ed4 r3634546  
    4242package require markupparser
    4343
    44 namespace eval ::notebookdb::notebookdb:: {
    45     namespace import -force ::trycatch::*
    46 }
     44#(pgea) Se utilizará trycatch sin importar sus métodos
     45#(pgea) para hacer el código compatible con tcl8.6
     46# namespace eval ::notebookdb::notebookdb:: {
     47#     namespace import -force ::trycatch::*
     48# }
    4749
    4850#-----------------------------------------------------------------------
    … …  
    109111            $self.loader alias page $self Loader.Page
    110112
    111             try {
    112                 try {
     113            ::trycatch::try {
     114                ::trycatch::try {
    113115                    $self.loader eval [list source $filename]
    114116                } catch -msg result {
    … …  
    175177        set fname $options(-dbfile)
    176178
    177         try {
     179        ::trycatch::try {
    178180            $self SaveDatabase $fname
    179181        } catch -msg errmsg {
  • tolbase/lib/renderpane/renderpane.tcl

    r00d6ed4 r3634546  
    44package require markupparser
    55
    6 namespace import trycatch::*
     6#(pgea) Se utilizará trycatch sin importar sus métodos
     7#(pgea) para hacer el código compatible con tcl8.6
     8# namespace import trycatch::*
    79interp alias {} prefs {} ::Notebook::prefs
    810
    … …  
    813815        }
    814816
    815         try {
     817        ::trycatch::try {
    816818            set images [LoadImage $fileName $opts(-width) $opts(-height)]
    817819        } catch -msg msg {
  • tolbase/lib/renderpane/userprefs.tcl

    r00d6ed4 r3634546  
    139139
    140140        if {[file exists $fname]} {
    141             try {
     141            ::trycatch::try {
    142142                source [PrefFileName]
    143143                tk scaling $prefs(scaling)
    … …  
    150150    # Save the preferences and notify observers.
    151151    method save {} {
    152         try {
     152        ::trycatch::try {
    153153            set f [open [PrefFileName] w]
    154154
Note: See TracChangeset for help on using the changeset viewer.