• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Ruby GTK3移行後のメインリポジトリ


Commit MetaInfo

Revisiónf77cbf30c83925083b08a7f3054cae4690e8cf1e (tree)
Tiempo2015-04-07 23:36:01
AutorShyouzou Sugitani <shy@user...>
CommiterShyouzou Sugitani

Log Message

assorted fixes(5)

Cambiar Resumen

Diferencia incremental

--- a/lib/ninix/home.rb
+++ b/lib/ninix/home.rb
@@ -76,7 +76,7 @@ module Home
7676 if ['.rb'].include?(ext)
7777 name = basename
7878 end
79- if !name.empty? and not table.include?(name)
79+ if name and not table.include?(name)
8080 shiori = shiori_lib.request(['', name])
8181 if shiori
8282 table[name] = shiori
@@ -122,7 +122,7 @@ module Home
122122 }
123123 # SHIORI compatible modules
124124 for name, shiori in shiori_table.each_entry
125- score = int(shiori.find(ghost_dir, shiori_dll))
125+ score = shiori.find(ghost_dir, shiori_dll).to_i
126126 if score > candidate['score']
127127 candidate['name'] = name
128128 candidate['score'] = score
--- a/lib/ninix/sakura.rb
+++ b/lib/ninix/sakura.rb
@@ -155,16 +155,20 @@ module Sakura
155155 @parent = parent
156156 end
157157
158- def handle_request(event_type, event, *arglist, **argdict)
158+ def handle_request(event_type, event, *arglist)
159159 #assert ['GET', 'NOTIFY'].include?(event_type)
160160 handlers = {
161161 'lock_repaint' => "get_lock_repaint"
162162 }
163163 if not handlers.include?(event)
164- result = @parent.handle_request(
165- event_type, event, *arglist, **argdict)
164+ if Sakura.method_defined?(event)
165+ result = method(event).call(*arglist)
166+ else
167+ result = @parent.handle_request(
168+ event_type, event, *arglist)
169+ end
166170 else
167- result = method(handlers[event]).call(*arglist, **argdict)
171+ result = method(handlers[event]).call(*arglist)
168172 end
169173 if event_type == 'GET'
170174 return result
--- a/lib/ninix_main.rb
+++ b/lib/ninix_main.rb
@@ -634,15 +634,15 @@ module Ninix_Main
634634 end
635635
636636 def create_menuitem(data)
637- return self.request_parent('GET', 'create_menuitem', @key, data)
637+ return @parent.handle_request('GET', 'create_menuitem', @key, data)
638638 end
639639
640640 def delete_by_myself
641- self.request_parent('NOTIFY', 'delete_ghost', @key)
641+ @parent.handle_request('NOTIFY', 'delete_ghost', @key)
642642 end
643643
644644 def create_instance(data)
645- return self.request_parent('GET', 'create_ghost', data)
645+ return @parent.handle_request('GET', 'create_ghost', data)
646646 end
647647 end
648648
@@ -805,13 +805,13 @@ module Ninix_Main
805805 if target_dirs
806806 if filetype == 'ghost'
807807 add_sakura(target_dirs[0])
808- Sakura.ReadmeDialog().show(
808+ Sakura::ReadmeDialog.new.show(
809809 target_dirs[0],
810810 File.join(Home.get_ninix_home(),
811811 'ghost', target_dirs[0]))
812812 if target_dirs[1]
813813 add_balloon(target_dirs[1])
814- Sakura.ReadmeDialog().show(
814+ Sakura::ReadmeDialog.new.show(
815815 target_dirs[1],
816816 File.join(Home.get_ninix_home(),
817817 'balloon', target_dirs[1]))
@@ -820,7 +820,7 @@ module Ninix_Main
820820 add_sakura(target_dirs) # XXX: reload
821821 elsif filetype == 'balloon'
822822 add_balloon(target_dirs)
823- Sakura.ReadmeDialog().show(
823+ Sakura::ReadmeDialog.new.show(
824824 target_dirs,
825825 File.join(Home.get_ninix_home(),
826826 'balloon', target_dirs))
@@ -1495,14 +1495,14 @@ module Ninix_Main
14951495
14961496 def add_sakura(ghost_dir)
14971497 if @ghosts.include?(ghost_dir)
1498- exists = 1
1498+ exists = true
14991499 #logging.warning('INSTALLED GHOST CHANGED: {0}'.format(ghost_dir))
15001500 else
1501- exists = 0
1501+ exists = false
15021502 #logging.info('NEW GHOST INSTALLED: {0}'.format(ghost_dir))
15031503 end
15041504 ghost_conf = Home.search_ghosts([ghost_dir])
1505- if ghost_conf
1505+ if not ghost_conf.empty?
15061506 if exists
15071507 sakura = @ghosts[ghost_dir].instance
15081508 if sakura.is_running() # restart if working
@@ -1541,14 +1541,14 @@ module Ninix_Main
15411541
15421542 def add_balloon(balloon_dir)
15431543 if @balloons.include?(balloon_dir)
1544- exists = 1
1544+ exists = true
15451545 #logging.warning('INSTALLED BALLOON CHANGED: {0}'.format(balloon_dir))
15461546 else
1547- exists = 0
1547+ exists = false
15481548 #logging.info('NEW BALLOON INSTALLED: {0}'.format(balloon_dir))
15491549 end
15501550 balloon_conf = Home.search_balloons([balloon_dir])
1551- if balloon_conf
1551+ if not balloon_conf.empty?
15521552 if exists
15531553 @balloons[balloon_dir].baseinfo = balloon_conf[balloon_dir]
15541554 else
@@ -1656,7 +1656,7 @@ module Ninix_Main
16561656 key = key.strip()
16571657 if key == 'time'
16581658 begin
1659- ghost_time = int(value.strip())
1659+ ghost_time = value.strip().to_i
16601660 rescue # except:
16611661 #pass
16621662 end