Eskil

Check-in [7d33a7d9e6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Cleanup for syntax check
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7d33a7d9e6a64f20e0e406634d162d929c00d606
User & Date: peter 2014-11-12 22:52:44.956
Context
2014-11-12
22:59
Bumped revision to 2.6.7 check-in: fc051bcca4 user: peter tags: trunk
22:52
Cleanup for syntax check check-in: 7d33a7d9e6 user: peter tags: trunk
21:24
Added vcsvfs check-in: 199c039bea user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/eskil.syntax.
24
25
26
27
28
29
30









31
32
33
34
35
36
37
###nagelfar syntax ttk::entryX x p*
##nagelfar syntax ::tk::GetSelection x x
##nagelfar syntax ::tk::ScrollButton2Down x x x
##nagelfar syntax console x

##nagelfar syntax registry x x x
##nagelfar package known registry










##nagelfar syntax pdf4tcl::getPaperSize x
##nagelfar syntax pdf4tcl::getPaperSizeList
##nagelfar package known pdf4tcl

##nagelfar syntax twapi::get_foreground_window
##nagelfar syntax twapi::get_window_coordinates x







>
>
>
>
>
>
>
>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
###nagelfar syntax ttk::entryX x p*
##nagelfar syntax ::tk::GetSelection x x
##nagelfar syntax ::tk::ScrollButton2Down x x x
##nagelfar syntax console x

##nagelfar syntax registry x x x
##nagelfar package known registry

##nagelfar syntax vfs::filesystem s x*
##nagelfar subcmd vfs::filesystem mount posixerror
##nagelfar syntax vfs::filesystem\ mount x x
##nagelfar syntax vfs::filesystem\ posixerror x
##nagelfar syntax vfs::matchDirectories x
##nagelfar syntax vfs::matchFiles x
##nagelfar syntax vfs::accessMode x
##nagelfar package known vfs

##nagelfar syntax pdf4tcl::getPaperSize x
##nagelfar syntax pdf4tcl::getPaperSizeList
##nagelfar package known pdf4tcl

##nagelfar syntax twapi::get_foreground_window
##nagelfar syntax twapi::get_window_coordinates x
Changes to src/plugin.tcl.
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
            if {![file readable $file]} continue

            set done($file) 1
            set ch [open $file r]
            set data [read $ch 200]
            if {[regexp {^\#\#Eskil Plugin :(.*?)(\n|$)} $data -> descr]} {
                set root [file rootname [file tail $file]]
                dict set result $root descr $descr 
                dict set result $root file 0
                dict set result $root dir  0
                # Load it all for inspection
                append data [read $ch]
                if {[string first "proc PreProcess " $data] >= 0} {
                    dict set result $root file 1
                }
                if {[string first "proc FileCompare " $data] >= 0} {
                    dict set result $root dir 1
                }
            }
            close $ch
        }
    }
    set resultSort {}
    foreach elem [lsort -dictionary [dict keys $result]] {







|
|
|



|


|







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
            if {![file readable $file]} continue

            set done($file) 1
            set ch [open $file r]
            set data [read $ch 200]
            if {[regexp {^\#\#Eskil Plugin :(.*?)(\n|$)} $data -> descr]} {
                set root [file rootname [file tail $file]]
                dict set result $root "descr" $descr 
                dict set result $root "file" 0
                dict set result $root "dir"  0
                # Load it all for inspection
                append data [read $ch]
                if {[string first "proc PreProcess " $data] >= 0} {
                    dict set result $root "file" 1
                }
                if {[string first "proc FileCompare " $data] >= 0} {
                    dict set result $root "dir" 1
                }
            }
            close $ch
        }
    }
    set resultSort {}
    foreach elem [lsort -dictionary [dict keys $result]] {
Changes to src/vcsvfs.tcl.
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    }
    cd $oldpwd

    # Generate a mount point.
    set tail [string range $dir [string length $root] end]
    set mountpoint "${root} ($rev)"

    dict set mpoints $mountpoint finfo $finfo
    dict set mpoints $mountpoint origroot $root
    dict set mpoints $mountpoint rev $rev
    vfs::filesystem mount $mountpoint [list vcsvfs::fossil::Vfs]

    set result $mountpoint$tail
    #puts $result
    #puts [dict size $finfo]
    #puts [dict get $finfo [lindex $finfo 0]]
    return $result







|
|
|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    }
    cd $oldpwd

    # Generate a mount point.
    set tail [string range $dir [string length $root] end]
    set mountpoint "${root} ($rev)"

    dict set mpoints $mountpoint "finfo" $finfo
    dict set mpoints $mountpoint "origroot" $root
    dict set mpoints $mountpoint "rev" $rev
    vfs::filesystem mount $mountpoint [list vcsvfs::fossil::Vfs]

    set result $mountpoint$tail
    #puts $result
    #puts [dict size $finfo]
    #puts [dict get $finfo [lindex $finfo 0]]
    return $result
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156

# Helper for glob matching in directory
proc vcsvfs::MatchInDirectory {finfo relative actual args} {
    set pattern [lindex $args 0]
    set types [lindex $args 1]
    set allowFile 0
    set allowDir 0
    if {[::vfs::matchDirectories $types]} {set allowDir 1}
    if {[::vfs::matchFiles $types]} {set allowFile 1}

    set result {}
    foreach child [dict keys [dict get $finfo $relative child]] {
        if {![string match $pattern $child]} continue
        set local [file join $relative $child]
        if {[dict get $finfo $local isfile] && !$allowFile} continue
        if {[dict get $finfo $local isdir] && !$allowDir} continue







|
|







141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156

# Helper for glob matching in directory
proc vcsvfs::MatchInDirectory {finfo relative actual args} {
    set pattern [lindex $args 0]
    set types [lindex $args 1]
    set allowFile 0
    set allowDir 0
    if {[vfs::matchDirectories $types]} {set allowDir 1}
    if {[vfs::matchFiles $types]} {set allowFile 1}

    set result {}
    foreach child [dict keys [dict get $finfo $relative child]] {
        if {![string match $pattern $child]} continue
        set local [file join $relative $child]
        if {[dict get $finfo $local isfile] && !$allowFile} continue
        if {[dict get $finfo $local isdir] && !$allowDir} continue
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
            if {$mode ne "r"} {
                # Read only
                vfs::filesystem posixerror $::vfs::posix(EACCES)
                return -code error $::vfs::posix(EACCES)
            }

            set oldpwd [pwd]
            cd [dict get $mpoints $root origroot]
            set rev [dict get $mpoints $root rev]
            set data [exec fossil cat $relative -r $rev]
            cd $oldpwd

            set chId [vcsvfs::CreateDataRefChan $data]
            return [list $chId ""]
        }
        stat {
            set res [dict create dev 0 ino 0 mode 0 nlink 0 uid 0 gid 0 \
                             size 0 atime 0 mtime 0 ctime 0 type file]
            if {[dict get $finfor isdir]} {
                # TBD, fake mtime etc. for directory?
                dict set res type directory
            } else {
                if {![dict exists $finfor mtime]} {
                    set str [dict get $finfor mtimestr]
                    # TBD parse to mtime correct?
                    set mtime [clock scan $str -gmt 1]
                    dict set finfor mtime $mtime
                    # Cache in main dictionary too
                    dict set mpoints $root finfo $relative mtime $mtime
                }
                dict set res mtime [dict get $finfor mtime]
                dict set res size  [dict get $finfor size]
            }
            return $res
        }
        createdirectory - deletefile - removedirectory - utime { 
            # Read-only, always error
        }







|








|









|

|

|







205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
            if {$mode ne "r"} {
                # Read only
                vfs::filesystem posixerror $::vfs::posix(EACCES)
                return -code error $::vfs::posix(EACCES)
            }

            set oldpwd [pwd]
            cd [dict get $mpoints $root "origroot"]
            set rev [dict get $mpoints $root rev]
            set data [exec fossil cat $relative -r $rev]
            cd $oldpwd

            set chId [vcsvfs::CreateDataRefChan $data]
            return [list $chId ""]
        }
        stat {
            set res [dict create dev 0 ino 0 "mode" 0 nlink 0 uid 0 gid 0 \
                             size 0 atime 0 mtime 0 ctime 0 type file]
            if {[dict get $finfor isdir]} {
                # TBD, fake mtime etc. for directory?
                dict set res type directory
            } else {
                if {![dict exists $finfor mtime]} {
                    set str [dict get $finfor mtimestr]
                    # TBD parse to mtime correct?
                    set mtime [clock scan $str -gmt 1]
                    dict set finfor "mtime" $mtime
                    # Cache in main dictionary too
                    dict set mpoints $root "finfo" $relative "mtime" $mtime
                }
                dict set res "mtime" [dict get $finfor "mtime"]
                dict set res size  [dict get $finfor size]
            }
            return $res
        }
        createdirectory - deletefile - removedirectory - utime { 
            # Read-only, always error
        }
Changes to tests/all.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------
# the next line restarts using tclsh \
exec tclsh8.5 "$0" "$@"

set testScript [file normalize [file join [pwd] [info script]]]
set testDir    [file dirname $testScript]

lappend auto_path eskil.vfs/lib

package require tcltest 2.2





|







1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

set testScript [file normalize [file join [pwd] [info script]]]
set testDir    [file dirname $testScript]

lappend auto_path eskil.vfs/lib

package require tcltest 2.2