MCPcopy Create free account
hub / github.com/EasyIME/PIME / get

Method get

python/input_methods/chewing/config_tool.py:179–193  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

177
178 @tornado.web.authenticated
179 def get(self): # download user phrase file
180 user_phrase_file = os.path.join(config_dir, "chewing.sqlite3")
181 if not os.path.exists(user_phrase_file):
182 raise HTTPError(404)
183 self.set_header("Content-Type", "application/force-download")
184 self.set_header("Content-Disposition", "attachment; filename=chewing.sqlite3")
185 with open(user_phrase_file, "rb") as f:
186 try:
187 self.write(f.read())
188 f.close()
189 self.finish()
190 return
191 except:
192 raise HTTPError(404)
193 raise HTTPError(500)
194
195 @tornado.web.authenticated
196 def post(self): # upload file

Callers

nothing calls this directly

Calls 6

HTTPErrorClass · 0.85
joinMethod · 0.80
set_headerMethod · 0.80
writeMethod · 0.45
closeMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected