navilocal 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/application/models/settings.rb +1 -1
- data/application/ui/navi/main_runner.rb +0 -2
- data/application/ui/navi/navi_install.rb +34 -23
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bcf59a597cb852b806c79df3c602297018d306d1b977909c4059bd551507095
|
4
|
+
data.tar.gz: d8373fdb539bb5d9413ffd8be1aed18fcd4159c6ca8585d0e0684599cf07b3d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88b31f39f535dcda3fa9cce6106492a59e67abdbe281dd817893bf00e0201d3df3931e685c7b86c7b07061eacc5148b1004afb6ba3563e6f74b8c736093876c2
|
7
|
+
data.tar.gz: af952607c446527216c8d3699293d7fea8642eab20db784dd321683661b21267017c1abdf4e8ad34ae3cb672010f2edad46d570da09ec76dbc5eaa07bb3eaa3b
|
@@ -3,7 +3,7 @@ require 'json'
|
|
3
3
|
|
4
4
|
module NaviClientInstaller
|
5
5
|
class Settings
|
6
|
-
PROPERTIES = [:provider, :username, :password, :agreement, :location, :creation_datetime, :last_modified, :download_path, :install, :hash, :client_log_file, :
|
6
|
+
PROPERTIES = [:provider, :username, :password, :agreement, :location, :creation_datetime, :last_modified, :download_path, :install, :hash, :client_log_file, :common_words_file, :wikipedia_topic_file, :ai_log_file].freeze
|
7
7
|
|
8
8
|
PRIORITIES = ['high', 'medium', 'normal', 'low'].freeze
|
9
9
|
|
@@ -57,7 +57,8 @@ module NaviClientInstaller
|
|
57
57
|
@settings.download_path = File.join(@settings.location, 'downloads', '')
|
58
58
|
@settings.client_log_file = File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE, 'logs', 'client.log')
|
59
59
|
@settings.ai_log_file = File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE, 'logs', 'ai.log')
|
60
|
-
@settings.
|
60
|
+
@settings.common_words_file = File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE, 'common-words')
|
61
|
+
@settings.wikipedia_topic_file = File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE, 'wikipedia-titles')
|
61
62
|
@settings.save_settings
|
62
63
|
prev_btn.set_opacity 0
|
63
64
|
prev_btn.set_sensitive false
|
@@ -71,8 +72,10 @@ module NaviClientInstaller
|
|
71
72
|
Thread.new do
|
72
73
|
read_logs
|
73
74
|
configure_ai
|
74
|
-
|
75
|
-
|
75
|
+
download_wiki_topics
|
76
|
+
download_wiki_common_words
|
77
|
+
# install_mitie
|
78
|
+
# download_wiki_models
|
76
79
|
finalize
|
77
80
|
end
|
78
81
|
|
@@ -106,41 +109,48 @@ module NaviClientInstaller
|
|
106
109
|
end
|
107
110
|
|
108
111
|
|
109
|
-
def
|
110
|
-
@text_display.set_text "
|
112
|
+
def download_wiki_topics
|
113
|
+
@text_display.set_text "Downloading wikipedia titles.."
|
111
114
|
@limit_progress = @progress_indicator.fraction + @fraction
|
112
|
-
|
113
|
-
@log_display.buffer.insert_markup(@iter_log, "Installing mitie...\n")
|
114
|
-
%x(brew install mitie 2>&1 | tee #{@log_storage})
|
115
|
-
# sleep 3
|
116
|
-
append_logs
|
115
|
+
@log_display.buffer.insert_markup(@iter_log, "Downloading wikipedia titles..\n")
|
117
116
|
|
118
|
-
|
117
|
+
wiki_storage = File.expand_path File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE,'wikipedia-titles')
|
119
118
|
|
119
|
+
unless File.file?(wiki_storage)
|
120
|
+
download_url = "https://s3.amazonaws.com/locallockbox/wikipedia-titles.zip"
|
121
|
+
# wiki_url = "https://s3.amazonaws.com/locallockbox/WIKI-models.zip"
|
122
|
+
#
|
123
|
+
%x(rm -rf #{wiki_storage}*)
|
124
|
+
|
125
|
+
%x(curl -o #{wiki_storage}.zip #{download_url} 2>&1 | tee #{@log_storage})
|
126
|
+
%x(unzip -a #{wiki_storage}.zip -d #{NaviClientInstaller::Settings::DEFAULT_STORAGE} 2>&1 | tee #{@log_storage})
|
127
|
+
%x(rm -rf #{wiki_storage}.zip 2>&1 | tee #{@log_storage})
|
120
128
|
else
|
121
|
-
@log_display.buffer.insert_markup(@iter_log, "
|
129
|
+
@log_display.buffer.insert_markup(@iter_log, "Wikipedia titles already downloaded.\n")
|
122
130
|
end
|
131
|
+
|
123
132
|
@progress_indicator.fraction = @limit_progress
|
133
|
+
|
124
134
|
end
|
125
135
|
|
126
|
-
def
|
127
|
-
@text_display.set_text "Downloading
|
136
|
+
def download_wiki_common_words
|
137
|
+
@text_display.set_text "Downloading common words.."
|
128
138
|
@limit_progress = @progress_indicator.fraction + @fraction
|
129
|
-
@log_display.buffer.insert_markup(@iter_log, "Downloading
|
139
|
+
@log_display.buffer.insert_markup(@iter_log, "Downloading common words..\n")
|
130
140
|
|
131
|
-
|
141
|
+
common_storage = File.expand_path File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE,'common-words')
|
132
142
|
|
133
|
-
unless File.
|
134
|
-
|
143
|
+
unless File.file?(common_storage)
|
144
|
+
download_url = "https://s3.amazonaws.com/locallockbox/common-words.zip"
|
135
145
|
# wiki_url = "https://s3.amazonaws.com/locallockbox/WIKI-models.zip"
|
136
146
|
#
|
137
|
-
%x(rm -rf #{
|
147
|
+
%x(rm -rf #{common_storage}*)
|
138
148
|
|
139
|
-
%x(curl -o #{
|
140
|
-
%x(unzip -a #{
|
141
|
-
%x(rm -rf #{
|
149
|
+
%x(curl -o #{common_storage}.zip #{download_url} 2>&1 | tee #{@log_storage})
|
150
|
+
%x(unzip -a #{common_storage}.zip -d #{NaviClientInstaller::Settings::DEFAULT_STORAGE} 2>&1 | tee #{@log_storage})
|
151
|
+
%x(rm -rf #{common_storage}.zip 2>&1 | tee #{@log_storage})
|
142
152
|
else
|
143
|
-
@log_display.buffer.insert_markup(@iter_log, "
|
153
|
+
@log_display.buffer.insert_markup(@iter_log, "Wikipedia titles already downloaded.\n")
|
144
154
|
end
|
145
155
|
|
146
156
|
|
@@ -195,6 +205,7 @@ module NaviClientInstaller
|
|
195
205
|
|
196
206
|
def finalize
|
197
207
|
setup_navi_path
|
208
|
+
%x(rm -rf #{@log_storage}*) if File.file? @log_storage
|
198
209
|
@next.set_sensitive true
|
199
210
|
@next.set_label "Finish"
|
200
211
|
@install = true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: navilocal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Msanjib
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: navi_client
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.4.
|
47
|
+
version: 1.4.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.4.
|
54
|
+
version: 1.4.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: httparty
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|