rwdeliza 0.04 → 0.05

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/Readme.txt +20 -7
  2. data/code/01rwdcore/02helptexthashbegin.rb +10 -0
  3. data/code/01rwdcore/03helptexthash.rb +18 -20
  4. data/code/01rwdcore/runopentinkerdocument.rb +1 -1
  5. data/code/superant.com.rwdeliza/0uninstallapplet.rb +15 -1
  6. data/code/superant.com.rwdtinkerbackwindow/initiateapplets.rb +62 -132
  7. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +9 -7
  8. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +8 -2
  9. data/code/superant.com.rwdtinkerbackwindow/removeappletvariables.rb +6 -6
  10. data/code/superant.com.rwdtinkerbackwindow/viewlogfile.rb +13 -0
  11. data/configuration/rwdtinker.dist +5 -8
  12. data/configuration/{rwdweliza-0.04.dist → rwdweliza.dist} +14 -12
  13. data/configuration/tinkerwin2variables.dist +13 -7
  14. data/gui/tinkerbackwindows/superant.com.slideshow/10appletbegin.rwd +4 -0
  15. data/gui/tinkerbackwindows/superant.com.slideshow/11viewnamedata.rwd +19 -0
  16. data/gui/tinkerbackwindows/superant.com.slideshow/13listnamerecordfiles.rwd +21 -0
  17. data/gui/tinkerbackwindows/superant.com.slideshow/16editrecord.rwd +39 -0
  18. data/gui/tinkerbackwindows/superant.com.slideshow/17viewvcardrecord.rwd +32 -0
  19. data/gui/tinkerbackwindows/superant.com.slideshow/18contactutilities.rwd +34 -0
  20. data/gui/tinkerbackwindows/superant.com.slideshow/81jumplinkcommands.rwd +17 -0
  21. data/gui/tinkerbackwindows/{superant.com.rwdschedulebackwindow/zvbackend.rwd → superant.com.slideshow/9end.rwd} +6 -6
  22. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdlogfile.rwd +20 -0
  23. data/init.rb +59 -163
  24. data/installed/elizadata01.inf +6 -0
  25. data/installed/{rwdweliza-0.04.inf → rwdweliza.inf} +3 -8
  26. data/lang/en/rwdcore/en.po +166 -0
  27. data/lang/es/rwdcore/es.po +172 -0
  28. data/lang/fr/rwdcore/fr.po +166 -0
  29. data/lang/hi/rwdcore/hi.po +170 -0
  30. data/lang/ja/rwdcore/ja.po +168 -0
  31. data/lang/nl/rwdcore/nl.po +166 -0
  32. data/lib/linkparser.Readme +69 -0
  33. data/lib/linkparser.rb +1 -1
  34. data/lib/linkparser/connection.rb +1 -1
  35. data/lib/linkparser/connector.rb +1 -1
  36. data/lib/linkparser/definition.rb +1 -1
  37. data/lib/linkparser/dictionary.rb +1 -1
  38. data/lib/linkparser/linkage.rb +1 -1
  39. data/lib/rconftool.rb +13 -6
  40. data/lib/rwd/net.rb +15 -4
  41. data/lib/rwd/ruby.rb +1 -1
  42. data/lib/rwd/rwd.rb +103 -620
  43. data/lib/rwdthemes/default.rwd +317 -0
  44. data/lib/rwdthemes/pda.rwd +72 -0
  45. data/lib/rwdthemes/windowslike.rwd +171 -0
  46. data/lib/rwdtinker/rwdcodedir.rb +56 -0
  47. data/lib/rwdtinker/rwdguidir.rb +57 -0
  48. data/lib/rwdtinker/rwdlangdir.rb +60 -0
  49. data/lib/rwdtinker/rwdtinkertools.rb +25 -0
  50. data/rwd_files/HowTo_Eliza.txt +3 -0
  51. data/rwd_files/HowTo_Tinker.txt +37 -7
  52. data/rwd_files/Tinkerhelptexthash.txt +81 -0
  53. data/rwd_files/log/rwdtinker.log +2 -0
  54. data/rwdconfig.dist +14 -13
  55. data/tests/makedist-rwdweliza.rb +2 -2
  56. data/tests/makedist.rb +2 -2
  57. data/zips/rwdwcalc-0.63.zip +0 -0
  58. data/zips/rwdwfoldeditor-0.06.zip +0 -0
  59. data/zips/rwdwmovies-0.98.zip +0 -0
  60. data/zips/rwdwruby-1.08.zip +0 -0
  61. data/zips/{rwdwschedule-1.04.zip → rwdwschedule-1.05.zip} +0 -0
  62. data/zips/tinkerbellw-0.03.zip +0 -0
  63. data/zips/wrubyslippers-1.08.zip +0 -0
  64. metadata +39 -29
  65. data/code/01rwdcore/04helptextend.rb +0 -6
  66. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +0 -61
  67. data/code/superant.com.words/runrwdwordsversion.rb +0 -14
  68. data/configuration/language.dist +0 -8
  69. data/configuration/rwdapplicationidentity.dist +0 -3
  70. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/1appname.rwd +0 -5
  71. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/20downloadftp.rwd +0 -45
  72. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/67viewconfiguration.rwd +0 -29
  73. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/70rwddiagnostics.rwd +0 -16
  74. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/m01menubegin.rwd +0 -18
  75. data/lang/en/rwdcore/languagefile.rb +0 -58
  76. data/lang/es/rwdcore/languagefile-es.rb +0 -62
  77. data/lang/fr/rwdcore/languagefile.rb +0 -64
  78. data/lang/jp/rwdcore/languagefile.rb +0 -72
  79. data/lang/nl/rwdcore/languagefile.rb +0 -75
  80. data/rwd_files/COPYRIGHT +0 -339
  81. data/zips/rwdwaddresses-1.05.zip +0 -0
  82. data/zips/rwdwcalc-0.61.zip +0 -0
  83. data/zips/rwdwgutenberg-0.09.zip +0 -0
  84. data/zips/rwdwshell-1.04.zip +0 -0
  85. data/zips/wrubyslippers-1.06.zip +0 -0
@@ -0,0 +1,13 @@
1
+ def rwdtinkerrunviewlog
2
+ require 'lib/rwdtinker/rwdtinkertools'
3
+
4
+ if @a_rwdtinkerlognumber == nil
5
+ @a_rwdtinkerlognumber = 11
6
+ @returnlogdisplay = RwdtinkerTools.tail("rwd_files/log/rwdtinker.log",@a_rwdtinkerlognumber.to_i)
7
+
8
+ else
9
+ @returnlogdisplay = RwdtinkerTools.tail("rwd_files/log/rwdtinker.log",@a_rwdtinkerlognumber.to_i)
10
+
11
+ end
12
+ end
13
+
@@ -1,4 +1,4 @@
1
- ##VERSION:1.76
1
+ ##VERSION: (1.82)
2
2
  ConfigurationDir = "configuration" # for use in program - init.rb has this value without using this constant
3
3
  CodeName = "rwdtinker"
4
4
  CodeNameFile = CodeName + ".rb"
@@ -7,12 +7,9 @@ LangDir = "lang"
7
7
  CodeDir = "code"
8
8
  GuiDir = "gui"
9
9
  $help_topic = "general_help"
10
- $helptopicsarray = [ "general_help","network_help"]
11
- $prevouswindow ="main"
12
- $rwdcontrolports =["13713","13714","13715","13716","13717","13718"] # remote control code not actived 2007
10
+ $prevouswindow ="main"
11
+ $rwdcontrolports =["13713","13714","13715","13716"] # remote control code not actived 2007
13
12
  $port = 7705
14
- $rwdjumplink = ["helpscreen","tinkerbackwindow","returntomain","opendocuments","editconfiguration"]
15
- Browser_Exe = 'mozilla '
16
- $tinkerdocumentsarray +=["HowTo_Tinker.txt","rwdapplications.html","RubyWebDialogs.html"]
17
- RwdTinkerVersion = "1.76"
13
+ ##NAME: (RwdTinkerVersion):(1.82)
14
+ RwdTinkerVersion = "1.82"
18
15
 
@@ -1,26 +1,28 @@
1
- ##VERSION:0.04
2
- ##NAME:$fortunedelay:0
1
+ ##VERSION: (0.05)
2
+ ##NAME: ($fortunedelay):(0.05)
3
3
  $fortunedelay= 15
4
- ##NAME:$testharnessarray:0
4
+ ##NAME: ($testharnessarray):(0.05)
5
5
  $testharnessarray += ["rwdeliza_all_tests"]
6
- ##NAME:$tinkerhelpaboutarray:0
6
+ ##NAME: ($tinkerhelpaboutarray):(0.05)
7
7
  $tinkerhelpaboutarray += ["RwdEliza"]
8
- ##NAME:$tinkerdocumentsarray:0
8
+ ##NAME: ($tinkerdocumentsarray):(0.05)
9
9
  $tinkerdocumentsarray += ["HowTo_Eliza.txt"]
10
- ##NAME:$rwdelizaresponse_directory:0
10
+ ##NAME: ($rwdelizaresponse_directory):(0.05)
11
11
  $rwdelizaresponse_directory = "responses"
12
- ##NAME:$rwdelizadata_directory:0
12
+ ##NAME: ($rwdelizadata_directory):(0.05)
13
13
  $rwdelizadata_directory = "ElizaData"
14
- ##NAME:$extras_directory:0
14
+ ##NAME: ($extras_directory):(0.05)
15
15
  $extras_directory = "lib"
16
- ##NAME:FortuneCommand:0
16
+ ##NAME: (FortuneCommand):(0.05)
17
17
  FortuneCommand="/usr/games/fortune"
18
18
  JumpLink.update(:RwdElizaWindow=>"runrwdelizawindow", :RwdWordsMainWindow=>"runrwdwordsbackwindow", :RwdThesaurus=> "runrwdthesaurus")
19
19
  $rwdjumplink +=["RwdElizaWindow","RwdWordsMainWindow", "RwdThesaurus"]
20
- ##NAME:RwdElizaName:0
20
+ ##NAME: (RwdElizaName):(0.05)
21
21
  RwdElizaName="rwdweliza"
22
- ##NAME:RwdElizaVersion:0
23
- RwdElizaVersion = "0.04"
22
+ ##NAME: (DeleteElizaConfig):(0.05)
23
+ DeleteElizaConfig = true
24
+ ##NAME: (RwdElizaVersion):(0.05)
25
+ RwdElizaVersion = "0.05"
24
26
 
25
27
 
26
28
 
@@ -1,17 +1,23 @@
1
- ##VERSION:1.69
1
+ ##VERSION: (1.82)
2
2
  TinkerWin2ConfigurationFileName = "tinkerwin2variables.cnf" # this file name - do not change
3
- ##NAME:$zipslocation:0
3
+ ##NAME: ($zipslocation):(1.78)
4
4
  $zipslocation = "zips" # location of applets to add
5
- $zipsarray = [""] ; $zipsarraylocal = [""]
6
- ##NAME:$xpcommand:0
5
+ $zipsarray = [""]
6
+ $zipsarraylocal = [""]
7
+ ##NAME: ($xpcommand):(1.78)
7
8
  $xpcommand = " " # Linux machines
8
9
  # $xpcommand = "cmd /C " # XP machines with cmd shell
9
- ##NAME:$gemdirectory_withgemfiles:0
10
+ ##NAME: ($gemdirectory_withgemfiles):(1.78)
10
11
  $gemdirectory_withgemfiles = "/var/lib/gems/1.8/gems"
11
12
  # $gemdirectory_withgemfiles = "c:\\ruby\\lib\\ruby\\gems\\1.8\\gems" # XP machine
12
- ##NAME:$geminstalled_directory:0
13
+ ##NAME: ($geminstalled_directory):(1.78)
13
14
  # $geminstalled_directory = "/ruby/lib/ruby/gems/1.8/gems" # XP machine
14
15
  $geminstalled_directory = "/var/lib/gems/1.8/gems" # Debian Linux
15
16
 
16
- RwdTinkerWin2Version = "0.8"
17
+ $rwdapplicationidentity = "rwdtinker main application"
17
18
 
19
+ RwdTinkerWin2Version = "1.81"
20
+ Browser_Exe = 'mozilla '
21
+ #language selection file
22
+ ##NAME: ($langarray):(1.82)
23
+ $langarray = [ "en","ja", "nl","es", "fr","hi"]
@@ -0,0 +1,4 @@
1
+ $rwdguivar=
2
+ "<application>
3
+ <window name=\"rwdaddresseswindow\" title=\"RwdAddresses RwdTinker\">
4
+ <tabs>"
@@ -0,0 +1,19 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"Viewnamedata\" caption=\"View Contact\">
4
+
5
+ <table>
6
+ <row> <p align=\"right\">Contact Name:</p> <text name=\"a_viewnamedata\"/> </row>
7
+
8
+ </table>
9
+
10
+ <horizontal>
11
+ <button caption=\"Open\" action=\"viewnamedata\"/>
12
+ <button caption=\"View Photo\" action=\"viewcontactphoto\"/>
13
+ <button caption=\"Help\" action=\"runhelpwindowrwdaddresses\"/>
14
+
15
+ </horizontal>
16
+
17
+ "
18
+
19
+
@@ -0,0 +1,21 @@
1
+ $rwdguivar=
2
+ "
3
+ <table>
4
+
5
+
6
+
7
+ <p>%viewnamedatadisplay%</p>
8
+ </table>
9
+ <table>
10
+ <image src=\"contacttmp.jpg\"></image>
11
+ </table>
12
+ <table>
13
+ <horizontal>
14
+ <button caption=\"List Contacts\" action=\"listnamerecordfiles\"/>
15
+ </horizontal>
16
+ <p>%%listnamerecordfilesresult%%</p>
17
+ </table>
18
+ </tab>"
19
+
20
+
21
+
@@ -0,0 +1,39 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"editnamerecordfile\" caption=\"Edit Contact\">
4
+ <table>
5
+ <row> <p> </row>
6
+ <row> <p align=\"right\">You can create a new record here or edit one</row>
7
+ <row> <p> </row>
8
+ <horizontal>
9
+ <button caption=\"Fill Record\" action=\"loadnamerecord\"/>
10
+ <button caption=\"Save Changes\" action=\"createnewnamerecord\"/>
11
+ <button caption=\"Clear\" action=\"clearnamescreendisplay\"/>
12
+ <button caption=\"Help\" action=\"runhelpwindowrwdaddresses\"/>
13
+
14
+
15
+
16
+
17
+ </horizontal>
18
+ <table>
19
+ <row> <p align=\"right\">FileName:</p> <text size=50 name=\"a_filename\"/> </row>
20
+ <row> <p align=\"right\">Contact Name:</p> <text size=70 name=\"a_name\"/> </row>
21
+ <row> <p align=\"right\">Address:</p> <text size=70 name=\"a_address\"/> </row>
22
+ <row> <p align=\"right\">CityStateZip:</p> <text size=70 name=\"a_citystatezip\"/> </row>
23
+ <row> <p align=\"right\">Phone:</p> <text size=70 name=\"a_phone\"/> </row>
24
+ <row> <p align=\"right\">Email:</p> <text size=70 name=\"a_email\"/> </row>
25
+ <row> <p align=\"right\">Comment1:</p> <text size=70 name=\"a_comment1\"/> </row>
26
+ <row> <p align=\"right\">Comment2:</p> <text size=70 name=\"a_comment2\"/> </row>
27
+ <row> <p align=\"right\">Comment3:</p> <text size=70 name=\"a_comment3\"/> </row>
28
+
29
+ </table>
30
+ <horizontal>
31
+ <button caption=\"Export vCard\" action=\"savevcardrecord\"/>
32
+
33
+
34
+ </horizontal>
35
+ <p>%extranamedatadisplay%</p>
36
+ <p>
37
+ <p>%createnewnamerecorddisplay%</p>
38
+ </tab>"
39
+
@@ -0,0 +1,32 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"Viewvcardrecord\" caption=\"View vCard Record\">
4
+
5
+ <table>
6
+ <row> <p align=\"right\">Contact Name:</p> <text name=\"a_viewvcarddata\"/> </row>
7
+
8
+ </table>
9
+
10
+ <horizontal>
11
+ <button caption=\"Open\" action=\"viewvcarddata\"/>
12
+ <button caption=\"Help\" action=\"runhelpwindowrwdaddresses\"/>
13
+
14
+ </horizontal>
15
+
16
+
17
+ <table>
18
+
19
+
20
+ <p>%viewvcarddatadisplay%</p>
21
+
22
+
23
+ </table>
24
+ <horizontal>
25
+ <button caption=\"List vCard Records\" action=\"listvcardrecordfiles\"/>
26
+ </horizontal>
27
+ <p>%%listvcardrecordfilesresult%%</p>
28
+
29
+ </tab>"
30
+
31
+
32
+
@@ -0,0 +1,34 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"contactutilitiesrwdaddresses\" caption=\"Contact Utilities\">
4
+
5
+ <table>
6
+ <row> <p align=\"right\">Contact Name:</p> <text name=\"a_viewnamedata\"/> </row>
7
+ <row> <p align=\"right\">New Name:</p> <text name=\"a_changenamedata\"/> </row>
8
+
9
+ </table>
10
+
11
+ <horizontal>
12
+ <button caption=\"Rename Record\" action=\"changenamedata\"/>
13
+ <button caption=\"Delete Record\" action=\"deletecontactrecord\"/>
14
+ </horizontal>
15
+ <table>
16
+
17
+ <row> <p align=\"right\">Photo Name:</p> <text name=\"a_tmpphotoname\"/> </row>
18
+ </table>
19
+
20
+ <horizontal>
21
+ <button caption=\"Attach Photo\" action=\"attachtmpcontactphoto\"/>
22
+ <button caption=\"Help\" action=\"runhelpwindowrwdaddresses\"/>
23
+ </horizontal>
24
+
25
+ <horizontal>
26
+ <button caption=\"List Contacts\" action=\"listnamerecordfiles\"/>
27
+
28
+
29
+ <button caption=\"List Photos\" action=\"viewtmpcontactphoto\"/>
30
+ </horizontal>
31
+
32
+ <p>%%listnamerecordfilesresult%%</p>
33
+ <p>%%listphotosfromtmp%%</p>
34
+ </tab>"
@@ -0,0 +1,17 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=selectiontab caption=#{Message[:selection_tab]}>
4
+ <horizontal>
5
+ <button caption=#{Message[:showjump_links]} action=\"showjumplinkoptions\"/>
6
+
7
+ </horizontal>
8
+ <table>
9
+ <select name=\"a_jumplinkinput\"> %%jumplinkoptions%% </select>
10
+
11
+ </table>
12
+
13
+ <horizontal>
14
+ <button caption=#{Message[:jumptoapplication_location]} action=\"runjumplinkcommand\"/>
15
+ </horizontal>
16
+ </tab>
17
+ "
@@ -1,6 +1,6 @@
1
- $rwdguivar=
2
- "
3
- </tabs>
4
- </window>"
5
-
6
-
1
+ $rwdguivar=
2
+ "
3
+ </tabs>
4
+ </window>"
5
+
6
+
@@ -0,0 +1,20 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"rwdlogfiletab\" caption=\"RWD Log Files\">
4
+ <table>
5
+ <horizontal>
6
+
7
+
8
+ <p align=\"left\">Number of lines to display</p> <text size=11 name=\"a_rwdtinkerlognumber\"/>
9
+
10
+ <button caption=#{Message[:viewlogger_information]} action=\"rwdtinkerrunviewlog\"/>
11
+ </horizontal>
12
+
13
+ </table>
14
+
15
+ <p>%returnlogdisplay%</p>
16
+
17
+ </tab>"
18
+
19
+
20
+
data/init.rb CHANGED
@@ -21,44 +21,18 @@
21
21
  #* at "smalllinux@gmail.com".
22
22
  #***********************************************************************/
23
23
 
24
+ require 'logger'
25
+
26
+ $rwdtinkerlog = Logger.new( 'rwd_files/log/rwdtinker.log', 'weekly' )
27
+ $rwdtinkerlog.level = Logger::INFO
28
+
24
29
  require "lib/rwd/rwd"
25
30
  require 'fileutils'
26
31
  require 'lib/rconftool'
27
32
 
28
33
  $progdir = File::expand_path( File.dirname(__FILE__))
29
34
 
30
- $tempdoc = " "
31
-
32
- def findfiles(d)
33
- a = Array.new(Dir[d].entries.sort)
34
- #loop through and get the files names
35
- a.each do |x|
36
- #adjust the filters to the files you want to see...
37
- if(!test(?d,x))
38
- # only rwd files
39
- if x =~ /rb|rwd|txt/
40
- fileA=File.open("#{x}","r") #opens the file thats in fileName as read only
41
- $tempdoc+=fileA.read #reads the file into the doc string
42
- fileA.close
43
- end
44
- end
45
- end
46
- end
47
- def loadguifile(d)
48
- a = Array.new(Dir[d].entries.sort)
49
- #loop through and get the files names
50
- a.each do |x|
51
- #adjust the filters to the files you want to see...
52
- if(!test(?d,x))
53
- # only rwd files
54
- if x =~ /rb|rwd|txt/
55
-
56
- load x #opens the file thats in fileName and reads it
57
- $tempdoc += $rwdguivar # adds the file into the doc string
58
- end
59
- end
60
- end
61
- end
35
+ tempdoc = " "
62
36
 
63
37
  # integrate the new configuration files
64
38
  MAINconfignew = "rwdconfig.cnf"
@@ -94,148 +68,70 @@ Rconftool::install(configdist,confignew) #integrates new file with old
94
68
 
95
69
  Dir.chdir($progdir) # change back to top program directory
96
70
 
71
+
97
72
  # build the English Language hash file from the parts
98
- languagehashvariable = 'Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Message not found: #{kk.inspect}."; hh[kk] }
99
- langmessage = {' + "\n"
100
- startlangdir = File.join(LangDir,"en")
101
- #get a list of the files and subdirectories on the starting directory only
102
- alanghash = Array.new(Dir[startlangdir].entries.sort)
103
- #loop through the list, ignore the files and add all new directories found
104
- alanghash.each do |x|
105
- #if a directory...
106
- if(test(?d,x))
107
- # add to the original list of directories
108
- @@tmproot = x + "/**"
109
- #adds the new ones to the array
110
- blanghash = Dir[@@tmproot].entries.sort
111
- blanghash.each do |x|
112
- if(test(?d,x))
113
- alanghash.push(x) #appends to the end of the array...
114
- end
115
- end
116
- end
117
- end
118
- alanghash.each do |x|
119
- #if it is a file...
120
- if(!test(?d,x))
121
- alanghash.delete(x)
122
- else #it is a directory...
123
- findfiles(x + "/**")
124
- end
73
+ Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Message not found: #{kk.inspect}."; hh[kk] }
74
+ langmessage = { :clear => "Clear", :rwdtinker => "Rwdtinker" } ; langmessage.each { |kk, vv| Message[kk] = vv }
75
+
76
+ def msgid(programkey)
77
+ $programkey = programkey
125
78
  end
126
-
79
+
80
+ def msgstr(programmsg)
81
+ if programmsg == ""
82
+ $rwdtinkerlog.info "msgstr: no translation for #{$programkey}"
83
+ else
84
+ Message.update( $programkey.to_sym => programmsg )
85
+ end
86
+ end
87
+
88
+ require 'lib/rwdtinker/rwdlangdir'
89
+
90
+ tempdoc = " "
91
+ #go get all the po language file files in english
92
+ tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,"en")
127
93
 
128
94
  #writes the contents of doc into the languagehashvariable
129
- languagehashvariable = languagehashvariable + $tempdoc + "} ; langmessage.each { |kk, vv| Message[kk] = vv }"
95
+ languagehashvariable = tempdoc
130
96
 
131
97
  # END of en Lang building
132
- $tempdoc = " "
98
+ tempdoc = " "
133
99
  Dir.chdir($progdir) # change back to top program directory
134
100
 
135
101
  # build the local Language hash file from the parts
136
- startlangdir = File.join(LangDir,$lang)
137
- #get a list of the files and subdirectories on the starting directory only
138
- alanghash = Array.new(Dir[startlangdir].entries.sort)
139
- #loop through the list, ignore the files and add all new directories found
140
- alanghash.each do |x|
141
- #if a directory...
142
- if(test(?d,x))
143
- # add to the original list of directories
144
- @@tmproot = x + "/**"
145
- #adds the new ones to the array
146
- blanghash = Dir[@@tmproot].entries.sort
147
- blanghash.each do |x|
148
- if(test(?d,x))
149
- alanghash.push(x) #appends to the end of the array...
150
- end
151
- end
152
- end
153
- end
154
- alanghash.each do |x|
155
- #if it is a file...
156
- if(!test(?d,x))
157
- alanghash.delete(x)
158
- else #it is a directory...
159
- findfiles(x + "/**")
160
- end
161
- end
162
-
163
-
164
- #writes the contents of doc into the variable
165
- languagehashvariable = languagehashvariable + " ; Message.update(" + $tempdoc + ' :rwdtinker => "Rwdtinker" ) '
166
-
167
-
168
- $tempdoc = " "
169
-
170
- Dir.chdir($progdir) # change back to top program directory
102
+
103
+ $lang = $langarray[0] # pick the language of choice
104
+
105
+ # Go get all the po files for the language of choice
106
+ tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,$lang)
107
+ # the contents of doc into the variable
108
+ languagehashvariable = languagehashvariable + tempdoc
171
109
 
172
- temp = eval( languagehashvariable )
110
+ Dir.chdir($progdir) # change back to top program directory
111
+
112
+ # lets read those po files, first english then the chosen language
113
+ temp = eval( languagehashvariable )
173
114
 
174
- $tempdoc = " "
115
+
175
116
 
176
117
  # build the actual program from the code parts
177
- #get a list of the files and subdirectories on the starting directory only
178
- a = Array.new(Dir[CodeDir].entries.sort)
179
- #loop through the list, ignore the files and add all new directories found
180
- a.each do |x|
181
- #if a directory...
182
- if(test(?d,x))
183
- # add to the original list of directories
184
- @@root = x + "/**"
185
- #adds the new ones to the array
186
- b = Dir[@@root].entries.sort
187
- b.each do |x|
188
- if(test(?d,x))
189
- a.push(x) #appends to the end of the array...
190
- end
191
- end
192
- end
193
- end
194
- a.each do |x|
195
- #if it is a file...
196
- if(!test(?d,x))
197
- a.delete(x)
198
- else #it is a directory...
199
- findfiles(x + "/**")
200
- end
201
- end
202
-
118
+ require 'lib/rwdtinker/rwdcodedir'
119
+
120
+ tempdoc = RwdtinkerTools.findprogramfiles(CodeDir)
203
121
 
204
122
  # load the program file
205
- tempcoderesult = eval( $tempdoc )
123
+
124
+ tempcoderesult = eval( tempdoc )
206
125
 
207
126
  # build the actual GUI from the gui parts
208
- $tempdoc = " "
209
- #get a list of the files and subdirectories on the starting directory only
210
- a = Array.new(Dir[GuiDir].entries.sort)
211
- #loop through the list, ignore the files and add all new directories found
212
- a.each do |x|
213
- #if a directory...
214
- if(test(?d,x))
215
- #use this new dir find to add to the original list of directories
216
- @@root = x + "/**"
217
- #adds the new ones to the array
218
- b = Dir[@@root].entries.sort
219
- b.each do |x|
220
- if(test(?d,x))
221
- a.push(x) #appends to the end of the array...
222
- end
223
- end
224
- end
225
- end
226
- a.each do |x|
227
- #if it is a file...
228
- if(!test(?d,x))
229
- a.delete(x)
230
-
231
- else #it is a directory...
232
- loadguifile(x + "/**")
233
- end
234
- end
127
+ require 'lib/rwdtinker/rwdguidir'
128
+
129
+ tempdoc = RwdtinkerTools.findguifiles(GuiDir)
130
+
235
131
 
236
132
  # gui variable is done
237
133
  guiRWD = ""
238
- $rwd_gui_tinker = $tempdoc
134
+ $rwd_gui_tinker = tempdoc
239
135
  require 'socket' # Network stuff
240
136
  host = "127.0.0.1"
241
137
  port = $port
@@ -250,27 +146,27 @@ Rconftool::install(configdist,confignew) #integrates new file with old
250
146
  $port = port
251
147
  # Rescue the "Address in use" error
252
148
  rescue Errno::EADDRINUSE
253
- puts "RWD Startup: Port #{port} on host #{host} is already in use."
149
+ $rwdtinkerlog.warn "RWD Startup: Port #{port} on host #{host} is already in use."
254
150
  port=port +1
255
- puts "trying port: #{port}"
151
+ $rwdtinkerlog.warn "trying port: #{port}"
256
152
  # Rescue the "Address not available' error
257
153
  rescue Errno::EADDRNOTAVAIL
258
- puts "RWD Startup: Address #{host} is not available to bind."
154
+ $rwdtinkerlog.warn "RWD Startup: Address #{host} is not available to bind."
259
155
  port =port + 1
260
- puts "trying port: #{port}"
156
+ $rwdtinkerlog.warn "trying port: #{port}"
261
157
  # Rescue "permission denied errors
262
158
  rescue Errno::EACCES
263
- puts "RWD Startup: Access denied when binding interface addresses. ?"
159
+ $rwdtinkerlog.warn "RWD Startup: Access denied when binding interface addresses. ?"
264
160
  port =port + 1
265
- puts "trying port: #{port}"
161
+ $rwdtinkerlog.warn "trying port: #{port}"
266
162
  # Rescue all other errors
267
163
  rescue
268
- puts "RWD Startup: An error occured."
164
+ $rwdtinkerlog.warn "RWD Startup: An error occured."
269
165
  port =port + 1
270
- puts "trying port: #{port}"
166
+ $rwdtinkerlog.warn "trying port: #{port}"
271
167
  # Rescue all other errors
272
168
  end
273
-
169
+ $port = port
274
170
  end
275
171
 
276
172