navilocal 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1d414157c1ba844642c5fa5fa57f71e0178a213f42f5c0a1b793d7182761f7e
4
- data.tar.gz: cc3ec0775db2a854e634e0e241634d62d8b7bd3b0a97d0fb85f2e62459f1a29d
3
+ metadata.gz: 5bcf59a597cb852b806c79df3c602297018d306d1b977909c4059bd551507095
4
+ data.tar.gz: d8373fdb539bb5d9413ffd8be1aed18fcd4159c6ca8585d0e0684599cf07b3d5
5
5
  SHA512:
6
- metadata.gz: 24c88c04b34e71ede3c766030a3bad7fbbfc2338b73b6d6c6bfaba7d80549908b3b12adcf5b129c2a22447c21afb4b42a2a9e3271f4659fb4646382b764b50c3
7
- data.tar.gz: bed76f2a0d23071ab8b3929f650a25d0ac895fd7a266cfd4e3e24b3b0f332891ac027288aeb58c3167a57a36fff7c1b4b42d4f822f57e6e3f56735f2df09423b
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, :training_data_file, :ai_log_file].freeze
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
 
@@ -185,8 +185,6 @@ module NaviClientInstaller
185
185
  @imap.disconnect
186
186
 
187
187
  rescue => e
188
- @imap&.logout
189
- @imap&.disconnect
190
188
  @logger.debug "#{e.message}"
191
189
  end
192
190
 
@@ -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.training_data_file = File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE, 'WIKI-models', '')
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
- install_mitie
75
- download_wiki_models
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 install_mitie()
110
- @text_display.set_text "Installing mitie..."
112
+ def download_wiki_topics
113
+ @text_display.set_text "Downloading wikipedia titles.."
111
114
  @limit_progress = @progress_indicator.fraction + @fraction
112
- if %x(uname).gsub(/\s+/, "") == 'Darwin'
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
- @log_display.buffer.insert_markup(@iter_log, "Finished Updating Home brew...\n")
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, "Mitie not installed. Install it manually...\n")
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 download_wiki_models
127
- @text_display.set_text "Downloading wiki models.."
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 wiki models\n")
139
+ @log_display.buffer.insert_markup(@iter_log, "Downloading common words..\n")
130
140
 
131
- models_storage = File.expand_path File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE,'WIKI-models')
141
+ common_storage = File.expand_path File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE,'common-words')
132
142
 
133
- unless File.directory?(models_storage)
134
- wiki_url = "https://s3.amazonaws.com/locallockbox/naviaiDarwin.zip"
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 #{models_storage}*)
147
+ %x(rm -rf #{common_storage}*)
138
148
 
139
- %x(curl -o #{models_storage}.zip #{wiki_url} 2>&1 | tee #{@log_storage})
140
- %x(unzip -a #{models_storage}.zip -d #{NaviClientInstaller::Settings::DEFAULT_STORAGE} 2>&1 | tee #{@log_storage})
141
- %x(rm -rf #{models_storage}.zip 2>&1 | tee #{@log_storage})
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, "Wiki models already downloaded.\n")
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.7
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.0
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.0
54
+ version: 1.4.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httparty
57
57
  requirement: !ruby/object:Gem::Requirement