Stringscan

Check-in [88823a83f2]
Login

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

Overview
Comment:Tweaks to search
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA3-256:88823a83f2ae8f86b07b857c61c98f399d6f8d39511ae07f89fe879e4583cb16
User & Date: kevin 2020-07-23 13:13:06
Context
2020-07-23
13:13
Tweaks to search Leaf check-in: 88823a83f2 user: kevin tags: trunk
01:54
Minor tweaks check-in: 8f0d68e715 user: kevin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to buildapp.

150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180

xattr -cr build/Stringscan.app

codesign  --signature-size 9400 -f -s "Developer ID Application: Kevin Walzer" --verbose=2  build/Stringscan.app   --entitlements entitlements.plist --options runtime 

echo "Creating and signing DMG file..."

hdiutil create  -srcfolder build -fs HFS+ -volname Stringscan Stringscan.dmg

codesign  --signature-size 9400 -f -s "Developer ID Application: Kevin Walzer" --verbose=2  Stringscan.dmg

notarize Stringscan.dmg

echo "Uploading DMG..."

upload Stringscan.dmg updates

upload stringscan-changes.tcl

upload stringscan-version.tcl

cd ../

#create archive of entire source tree
tar cvfz Stringscan-$1.tgz Stringscan


echo "Done."










|

|

|



|

|

|




|






150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180

xattr -cr build/Stringscan.app

codesign  --signature-size 9400 -f -s "Developer ID Application: Kevin Walzer" --verbose=2  build/Stringscan.app   --entitlements entitlements.plist --options runtime 

echo "Creating and signing DMG file..."

#hdiutil create  -srcfolder build -fs HFS+ -volname Stringscan Stringscan.dmg

#codesign  --signature-size 9400 -f -s "Developer ID Application: Kevin Walzer" --verbose=2  Stringscan.dmg

#notarize Stringscan.dmg

echo "Uploading DMG..."

#upload Stringscan.dmg updates

#upload stringscan-changes.tcl

#upload stringscan-version.tcl

cd ../

#create archive of entire source tree
#tar cvfz Stringscan-$1.tgz Stringscan


echo "Done."



Changes to stringscan.rb.

64
65
66
67
68
69
70

71
72
73
74
75
76
77
..
95
96
97
98
99
100
101
102




103
104
105
106
107
108
109
...
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
...
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
                        $tbox.delete('1.0', 'end')
                        $tbox.configure('state'=>'disabled')
                        $lbox.delete(0, 'end')
                        $direntry.delete(0, 'end')
                        $dirname = filename
                        $direntry.insert('end', filename)
                        $direntry.value = filename

                    end
                rescue
                    raise
                end
            })   			
        set_search_term = Tk.install_cmd(proc{
			|*args|
................................................................................
        Tk.ip_eval("proc execute_search {}  {#{execute_search}}")
      
        drawgui  
    end
    
    #core method; here we search for a string in text files within a directory and  display a list of matching files in the listbox 
    def stringgrep
        $root.update




        $file_list = []
        $grep_list = []
        if $termentry.get == ""
          return
        end
        if $direntry.get == ""
            return
................................................................................
        $dirname = $direntry.get
        $searchterm = $termentry.get
        $bottomlabel.configure('text' => "Searching for \"#{$searchterm}\" in #{$dirname}...")
        $lbox.delete(0, 'end')
        $tbox.configure('state'=>'normal')
        $tbox.delete('1.0', 'end')
        $tbox.configure('state'=>'disabled')
        $root.update
        Find.find("#{$dirname}") do |path|
            $file_list << path unless FileTest.directory?(path)
        end
        for i in $file_list
        begin
            #we are only reading text files here, not binary. 
          text_formats = [".txt", ".html", ".htm", ".shtm", ".shtml", ".jsp", ".asp", ".css", ".xhtml", ".xhtm", ".xml", ".xsl", ".xslt", ".xbl", ".xul", ".rdf", ".dtd", ".xsd", ".xsdl", ".sgml", ".sgm", ".yml", ".js", ".JS", ".php", ".php3", ".php4", ".tcl", ".rb", ".py", ".pl", ".pm", ".sh", ".csh", ".c", ".bat", ".hh", ".hp", ".hpp", ".hxx", ".h++ ", ".cc", ".cp", ".cpp", ".cxx", ".c++", ".m", ".s", ".mm ", ".java", ".jav", ".f", ".for", ".f77", ".f90", ".f95", ".f99", ".el", ".hs", ".lhs ", ".lua ", ".pro", ".bib", ".tex", ".ltx", ".ctx", ".latex", ".texi", ".rss" ]
................................................................................
      end
    $root.bind("#{$accelkey}-Q", proc{shutdown})
    $root.bind("#{$accelkey}-q", proc{shutdown})
    $root.bind("#{$accelkey}-O", proc{choosedir})
    $root.bind("#{$accelkey}-o", proc{choosedir})
    $root.bind("#{$accelkey}-R", proc{stringgrep})
    $root.bind("#{$accelkey}-r", proc{stringgrep})
    $root.update
end

#select search directory
def choosedir
    $tbox.configure('state'=>'normal')
    $tbox.delete('1.0', 'end')
    $tbox.configure('state'=>'disabled')







>







 







|
>
>
>
>







 







<







 







<







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
..
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
...
116
117
118
119
120
121
122

123
124
125
126
127
128
129
...
343
344
345
346
347
348
349

350
351
352
353
354
355
356
                        $tbox.delete('1.0', 'end')
                        $tbox.configure('state'=>'disabled')
                        $lbox.delete(0, 'end')
                        $direntry.delete(0, 'end')
                        $dirname = filename
                        $direntry.insert('end', filename)
                        $direntry.value = filename
                        $bottomlabel.configure('text' => "No data displayed")
                    end
                rescue
                    raise
                end
            })   			
        set_search_term = Tk.install_cmd(proc{
			|*args|
................................................................................
        Tk.ip_eval("proc execute_search {}  {#{execute_search}}")
      
        drawgui  
    end
    
    #core method; here we search for a string in text files within a directory and  display a list of matching files in the listbox 
    def stringgrep
        $lbox.delete(0, 'end')
        $tbox.configure('state'=>'normal')
        $tbox.delete('1.0', 'end')
        $tbox.configure('state'=>'disabled')
        $bottomlabel.configure('text' => "No data displayed")
        $file_list = []
        $grep_list = []
        if $termentry.get == ""
          return
        end
        if $direntry.get == ""
            return
................................................................................
        $dirname = $direntry.get
        $searchterm = $termentry.get
        $bottomlabel.configure('text' => "Searching for \"#{$searchterm}\" in #{$dirname}...")
        $lbox.delete(0, 'end')
        $tbox.configure('state'=>'normal')
        $tbox.delete('1.0', 'end')
        $tbox.configure('state'=>'disabled')

        Find.find("#{$dirname}") do |path|
            $file_list << path unless FileTest.directory?(path)
        end
        for i in $file_list
        begin
            #we are only reading text files here, not binary. 
          text_formats = [".txt", ".html", ".htm", ".shtm", ".shtml", ".jsp", ".asp", ".css", ".xhtml", ".xhtm", ".xml", ".xsl", ".xslt", ".xbl", ".xul", ".rdf", ".dtd", ".xsd", ".xsdl", ".sgml", ".sgm", ".yml", ".js", ".JS", ".php", ".php3", ".php4", ".tcl", ".rb", ".py", ".pl", ".pm", ".sh", ".csh", ".c", ".bat", ".hh", ".hp", ".hpp", ".hxx", ".h++ ", ".cc", ".cp", ".cpp", ".cxx", ".c++", ".m", ".s", ".mm ", ".java", ".jav", ".f", ".for", ".f77", ".f90", ".f95", ".f99", ".el", ".hs", ".lhs ", ".lua ", ".pro", ".bib", ".tex", ".ltx", ".ctx", ".latex", ".texi", ".rss" ]
................................................................................
      end
    $root.bind("#{$accelkey}-Q", proc{shutdown})
    $root.bind("#{$accelkey}-q", proc{shutdown})
    $root.bind("#{$accelkey}-O", proc{choosedir})
    $root.bind("#{$accelkey}-o", proc{choosedir})
    $root.bind("#{$accelkey}-R", proc{stringgrep})
    $root.bind("#{$accelkey}-r", proc{stringgrep})

end

#select search directory
def choosedir
    $tbox.configure('state'=>'normal')
    $tbox.delete('1.0', 'end')
    $tbox.configure('state'=>'disabled')