Commit c96e4c4e authored by Peter Xin's avatar Peter Xin

adjustment

parent 25cfc5d9
...@@ -5,4 +5,3 @@ ygopro-images/* ...@@ -5,4 +5,3 @@ ygopro-images/*
ygopro-images-raw/*.jpg ygopro-images-raw/*.jpg
*.mse-set *.mse-set
*.log *.log
Authorize.rb
\ No newline at end of file
# Check the command is legal or not
require 'json'
require 'digest/md5'
require File.dirname(__FILE__) + "/Log.rb"
module Authorize
module_function
@@command_password = "7c7cc75c2822cb592e7783d9b92825ac"
def md5(source)
Digest::MD5.hexdigest source
end
def md5_file(source)
begin
content = File.open(source) {|f| f.read}
self.md5 content
rescue Exception => e
Log.logger.error e.inspect
nil
end
end
def get_command(text)
begin
json = JSON.parse text
return 401 if json['password'].nil?
pw = Authorize.md5('password')
return 403 if @@command_password != pw
return json['content']
rescue Exception => e
return 400
end
end
def change_password(password)
@@command_password = Aunthorize.md5(password)
end
end
\ No newline at end of file
...@@ -8,10 +8,12 @@ def unit_test1 ...@@ -8,10 +8,12 @@ def unit_test1
end end
def unit_test2 def unit_test2
# remember to delete files under mse-sets\ first.
# That will be added later
require './Sqlite.rb' require './Sqlite.rb'
Global.language = 'cn' Global.language = 'jp'
data = Sqlite.split Sqlite.load data = Sqlite.split Sqlite.load
data = [data[10]] data = [data[12]]
require './MSETranslator.rb' require './MSETranslator.rb'
MSETranslator.generate_mse_all(data) MSETranslator.generate_mse_all(data)
end end
...@@ -21,4 +23,5 @@ def unit_test3 ...@@ -21,4 +23,5 @@ def unit_test3
MSETranslator.export_mse_all MSETranslator.export_mse_all
end end
unit_test2
unit_test3 unit_test3
\ No newline at end of file
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment