Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ykoba
ninix-aya
ninix_dll-patch.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ninix_dll-patch.diff of Package ninix-aya
--- ./lib/ninix/dll/aya.py.orig 2013-04-04 22:04:39.000000000 +0900 +++ ./lib/ninix/dll/aya.py 2018-11-18 03:30:27.271445424 +0900 @@ -131,7 +131,7 @@ dic_files = filelist for filename in dic_files: if filename.lower().endswith('_shiori3.dic'): # XXX - with open(filename) as f: + with open(filename, 'r') as f: for line in f: try: ## FIXME line = unicode(line, 'Shift_JIS').encode('EUC-JP', @@ -3209,7 +3209,7 @@ def load_database(self, aya): ## FIXME: charset try: - with open(aya.dbpath) as f: + with open(aya.dbpath, 'r') as f: line = f.readline() if not line.startswith('# Format: v1.0') and \ not line.startswith('# Format: v1.1'): @@ -3570,7 +3570,7 @@ print USAGE else: path = os.path.join(os.curdir, sys.argv[2]) - with open(path) as inputf: + with open(path, 'r') as inputf: path = os.path.join(os.curdir, sys.argv[3]) with open(path, 'w') as outputf: while 1: --- ./lib/ninix/dll/aya5.py.orig 2013-04-04 22:04:39.000000000 +0900 +++ ./lib/ninix/dll/aya5.py 2018-11-19 11:25:58.910127242 +0900 @@ -122,7 +122,7 @@ dic_files = filelist for filename in dic_files: if filename.lower().endswith('_shiori3.dic'): # XXX - with open(filename) as f: + with open(filename, 'r') as f: for line in f: try: line = unicode(line, 'Shift_JIS') # XXX @@ -1685,6 +1685,8 @@ def evaluate_condition(self, namespace, condition): result = 0 + if condition[0] == self.__TYPE_INT: + return 1 if int(condition[1]) else 0 if condition[1] is None: return 1 left = condition[1][0] @@ -1694,8 +1696,8 @@ if left is None: # '!' left_result = 1 else: - left_result = self.evaluate(namespace, [left], -1, 1, 0) ## FIXME - right_result = self.evaluate(namespace, [right], -1, 1, 0) ## FIXME + left_result = self.evaluate(namespace, [left], -1, 1, 0, 1) ## FIXME + right_result = self.evaluate(namespace, [right], -1, 1, 0, 1) ## FIXME if ope[1] == '==': result = (left_result == right_result) elif ope[1] == '!=': @@ -1717,12 +1719,36 @@ else: result = 0 elif ope[1] == '<': + if isinstance(right_result, (unicode, str)) != isinstance(left_result, (unicode, str)): + try: + left_result = float(left_result) + right_result = float(right_result) + except: + return 0 # XXX result = left_result < right_result elif ope[1] == '>': + if isinstance(right_result, (unicode, str)) != isinstance(left_result, (unicode, str)): + try: + left_result = float(left_result) + right_result = float(right_result) + except: + return 0 # XXX result = left_result > right_result elif ope[1] == '<=': + if isinstance(right_result, (unicode, str)) != isinstance(left_result, (unicode, str)): + try: + left_result = float(left_result) + right_result = float(right_result) + except: + return 0 # XXX result = left_result <= right_result elif ope[1] == '>=': + if isinstance(right_result, (unicode, str)) != isinstance(left_result, (unicode, str)): + try: + left_result = float(left_result) + right_result = float(right_result) + except: + return 0 # XXX result = left_result >= right_result elif ope[1] == '||': result = left_result or right_result @@ -2051,6 +2077,7 @@ self.saori_value = {} self.saori_protocol = '' self.errno = 0 + self.re_result = [] self.functions = { 'ACOS': [self.ACOS, [None], [1], None], 'ANY': [], @@ -2112,7 +2139,7 @@ 'RAND': [self.RAND, [None], [0, 1], None], 'RE_GETLEN': [], 'RE_GETPOS': [], - 'RE_GETSTR': [], + 'RE_GETSTR': [self.RE_GETSTR, [None], [0], None], 'RE_GREP': [], 'RE_MATCH': [], 'RE_REPLACE': [], @@ -2728,7 +2755,7 @@ pass def RE_GETSTR(self, namespace, argv): - pass + return self.re_result def RE_GREP(self, namespace, argv): pass @@ -2745,6 +2772,7 @@ def RE_SPLIT(self, namespace, argv): line = unicode(argv[0]) result = line.split(unicode(argv[1])) + self.re_result = line.scan(unicode(argv[1])) return result ## FIXME def REPLACE(self, namespace, argv): --- ./lib/ninix/dll/gomi.py.orig 2013-04-04 22:04:39.000000000 +0900 +++ ./lib/ninix/dll/gomi.py 2018-11-13 14:37:45.304046749 +0900 @@ -61,7 +61,8 @@ for (path, dirs, files) in os.walk(dir_name): for file in files: file_count += 1 - dir_size += os.path.getsize(os.path.join(path, file)) + if os.path.isfile(os.path.join(path, file)): + dir_size += os.path.getsize(os.path.join(path, file)) return (file_count, dir_size) def empty_trash(self, path): --- ./lib/ninix/dll/mciaudio.py.orig 2013-04-04 22:04:39.000000000 +0900 +++ ./lib/ninix/dll/mciaudio.py 2018-12-22 07:18:53.312221571 +0900 @@ -17,11 +17,12 @@ import logging try: - ##import pygst - ##pygst.require('0.10') # This breaks sys.path. :-( - import gst + import gi + gi.require_version('Gst', '1.0') ## Gstreamer 1.0 + from gi.repository import Gst + Gst.init(None) except: - gst = None + Gst = None from ninix.home import get_normalized_path from ninix.dll import SAORI @@ -31,8 +32,8 @@ def __init__(self): SAORI.__init__(self) - self.player = gst.element_factory_make('playbin', 'player') - fakesink = gst.element_factory_make('fakesink', 'fakesink') + self.player = Gst.ElementFactory.make('playbin', 'player') + fakesink = Gst.ElementFactory.make('fakesink', 'fakesink') self.player.set_property('video-sink', fakesink) bus = self.player.get_bus() bus.add_signal_watch() @@ -44,10 +45,10 @@ self.__sakura = sakura def check_import(self): - return 1 if self.__sakura is not None and gst is not None else 0 + return 1 if self.__sakura is not None and Gst is not None else 0 def finalize(self): - self.player.set_state(gst.STATE_NULL) + self.player.set_state(Gst.State.NULL) self.player = None self.filepath = None return 1 @@ -57,21 +58,21 @@ if argc == 1: assert self.player is not None if argv[0] == 'stop': - self.player.set_state(gst.STATE_NULL) + self.player.set_state(Gst.State.NULL) elif argv[0] == 'play': - if self.player.get_state(timeout=gst.SECOND)[1] == gst.STATE_PAUSED: - self.player.set_state(gst.STATE_PLAYING) + if self.player.get_state(timeout=Gst.SECOND)[1] == Gst.State.PAUSED: + self.player.set_state(Gst.State.PLAYING) return self.RESPONSE[204] - elif self.player.get_state(timeout=gst.SECOND)[1]== gst.STATE_PLAYING: - self.player.set_state(gst.STATE_PAUSED) + elif self.player.get_state(timeout=Gst.SECOND)[1] == Gst.State.PLAYING: + self.player.set_state(Gst.State.PAUSED) return self.RESPONSE[204] if self.filepath is not None and os.path.isfile(self.filepath): self.player.set_property( 'uri', 'file://' + urllib.quote(self.filepath)) - self.player.set_state(gst.STATE_PLAYING) + self.player.set_state(Gst.State.PLAYING) elif argc == 2: if argv[0] == 'load': - self.player.set_state(gst.STATE_NULL) + self.player.set_state(Gst.State.NULL) filename = get_normalized_path(argv[1]) if os.path.isabs(filename): return self.RESPONSE[400] @@ -81,10 +82,12 @@ return self.RESPONSE[204] def on_message(self, bus, message): + if message is None: # XXX: workaround for Gst Version < 0.11 + return t = message.type - if t == gst.MESSAGE_EOS: - self.player.set_state(gst.STATE_NULL) - elif t == gst.MESSAGE_ERROR: - self.player.set_state(gst.STATE_NULL) + if t == Gst.MessageType.EOS: + self.player.set_state(Gst.State.NULL) + elif t == Gst.MessageType.ERROR: + self.player.set_state(Gst.State.NULL) err, debug = message.parse_error() logging.error('Error: {0}, {1}'.format(err, debug)) --- ./lib/ninix/dll/mciaudior.py.orig 2013-04-04 22:04:39.000000000 +0900 +++ ./lib/ninix/dll/mciaudior.py 2018-12-22 07:23:35.438722516 +0900 @@ -17,11 +17,12 @@ import logging try: - ##import pygst - ##pygst.require('0.10') # This breaks sys.path. :-( - import gst + import gi + gi.require_version('Gst', '1.0') ## Gstreamer 1.0 + from gi.repository import Gst + Gst.init(None) except: - gst = None + Gst = None from ninix.home import get_normalized_path from ninix.dll import SAORI @@ -31,8 +32,8 @@ def __init__(self): SAORI.__init__(self) - self.player = gst.element_factory_make('playbin', 'player') - fakesink = gst.element_factory_make('fakesink', 'fakesink') + self.player = Gst.ElementFactory.make('playbin', 'player') + fakesink = Gst.ElementFactory.make('fakesink', 'fakesink') self.player.set_property('video-sink', fakesink) bus = self.player.get_bus() bus.add_signal_watch() @@ -41,10 +42,10 @@ self.loop = False def check_import(self): - return 1 if gst is not None else 0 + return 1 if Gst is not None else 0 def finalize(self): - self.player.set_state(gst.STATE_NULL) + self.player.set_state(Gst.State.NULL) self.player = None self.filepath = None return 1 @@ -54,35 +55,37 @@ if argc == 1: assert self.player is not None if argv[0] == 'stop': - self.player.set_state(gst.STATE_NULL) + self.player.set_state(Gst.State.NULL) elif argv[0] in ['play', 'loop']: if argv[0] == 'loop': self.loop = True - if self.player.get_state(timeout=gst.SECOND)[1] == gst.STATE_PAUSED: - self.player.set_state(gst.STATE_PLAYING) + if self.player.get_state(timeout=Gst.SECOND)[1] == Gst.State.PAUSED: + self.player.set_state(Gst.State.PLAYING) return self.RESPONSE[204] - elif self.player.get_state(timeout=gst.SECOND)[1]== gst.STATE_PLAYING: - self.player.set_state(gst.STATE_PAUSED) + elif self.player.get_state(timeout=Gst.SECOND)[1] == Gst.State.PLAYING: + self.player.set_state(Gst.State.PAUSED) return self.RESPONSE[204] if self.filepath is not None and os.path.isfile(self.filepath): self.player.set_property( 'uri', 'file://' + urllib.quote(self.filepath)) - self.player.set_state(gst.STATE_PLAYING) + self.player.set_state(Gst.State.PLAYING) elif argc == 2: if argv[0] == 'load': - self.player.set_state(gst.STATE_NULL) + self.player.set_state(Gst.State.NULL) filename = get_normalized_path(argv[1]) self.filepath = os.path.join(self.dir, filename) return self.RESPONSE[204] def on_message(self, bus, message): + if message is None: # XXX: workaround for Gst Version < 0.11 + return t = message.type - if t == gst.MESSAGE_EOS: - self.player.set_state(gst.STATE_NULL) + if t == Gst.MessageType.EOS: + self.player.set_state(Gst.State.NULL) if self.loop: - self.player.set_state(gst.STATE_PLAYING) - elif t == gst.MESSAGE_ERROR: - self.player.set_state(gst.STATE_NULL) + self.player.set_state(Gst.State.PLAYING) + elif t == Gst.MessageType.ERROR: + self.player.set_state(Gst.State.NULL) err, debug = message.parse_error() logging.error('Error: {0}, {1}'.format(err, debug)) self.loop = False --- ./lib/ninix/dll/misaka.py.orig 2013-04-04 22:04:39.000000000 +0900 +++ ./lib/ninix/dll/misaka.py 2018-11-18 03:58:56.636323819 +0900 @@ -1038,7 +1038,7 @@ for filename in filelist: path = os.path.join(self.misaka_dir, filename) try: - f = open(path) + f = open(path, 'r') except IOError: logging.debug('cannot read {0}'.format(filename)) continue @@ -1057,7 +1057,7 @@ for filename in filelist: path = os.path.join(self.misaka_dir, filename) try: - f = open(path) + f = open(path, 'r') except IOError: logging.debug('cannot read {0}'.format(filename)) continue --- ./lib/ninix/dll/satori.py.orig 2013-04-04 22:04:39.000000000 +0900 +++ ./lib/ninix/dll/satori.py 2018-11-18 03:33:53.906723378 +0900 @@ -109,7 +109,7 @@ def read_tab_file(path, encrypted=0): lineno = 0 buf = [] - with open(path) as f: + with open(path, 'r') as f: for line in f: lineno += 1 if line.endswith('\r\n'): @@ -184,7 +184,7 @@ self.is_anchor = 1 else: self.is_anchor = 0 - with open(path) as f: + with open(path, 'r') as f: self.read_file(f, path, encrypted) if self.is_anchor: self.anchor_filter = Filter(self.anchor_list)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor