+Sun August 27 2006 Shyouzou Sugitani <shy@users.sourceforge.jp>
+ * バージョン3.8.9リリース.
+
+Sat August 26 2006 Shyouzou Sugitani <shy@users.sourceforge.jp>
+ * lib/ninix/script.py, lib/ninix/sakura.py, lib/ninix/balloon.py:
+ 下線と字消し線のフォントタグ(\f[underline,], \f[strike,])を実装.
+ * lib/ninix/script.py: 括弧の無い(\p0のような)\pタグに対応.
+ * sys.exit()を"raise SystemExit"で置き換えた.
+
Tue July 18 2006 Shyouzou Sugitani <shy@users.sourceforge.jp>
* バージョン3.8.8リリース.
Mon July 17 2006 Shyouzou Sugitani <shy@users.sourceforge.jp>
* lib/ninix/balloon.py: SSTPの送信元表示のフォントサイズ計算を修正.
* lib/ninix/script.py, lib/ninix/sakura.py, lib/ninix/balloon.py:
- 上付きと下付きのフォントタグ(\f[sup,true], \f[sub,true])を実装.
+ 上付きと下付きのフォントタグ(\f[sup,], \f[sub,])を実装.
Sun June 11 2006 Shyouzou Sugitani <shy@users.sourceforge.jp>
* バージョン3.8.7リリース.
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
-# $Id: ninix-install.py,v 1.39 2006/02/02 14:06:31 shy Exp $
+# $Id: ninix-install.py,v 1.40 2006/08/26 16:01:17 shy Exp $
#
# env.var: NINIX_HOME, NINIX_USER, NINIX_ARCHIVE, TMPDIR
'''
def usage():
- sys.stderr.write(USAGE % PROGRAM_NAME)
- sys.exit(1)
+ raise SystemExit, USAGE % PROGRAM_NAME
class InstallError(Exception):
except EOFError:
answer = None
except KeyboardInterrupt:
- sys.exit(1)
+ raise SystemExit
if not answer:
return 0
return answer.lower().startswith('y')
except EOFError:
answer = None
except KeyboardInterrupt:
- sys.exit(1)
+ raise SystemExit
if not answer:
return 0
return answer.lower().startswith('y')
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
-# $Id: ninix-update.py,v 1.16 2005/09/26 04:18:33 shy Exp $
+# $Id: ninix-update.py,v 1.17 2006/08/26 16:01:17 shy Exp $
#
import getopt
'''
def usage():
- sys.stderr.write(USAGE % os.path.basename(PROGRAM_NAME))
- sys.exit(1)
+ raise SystemExit, USAGE % os.path.basename(PROGRAM_NAME)
def main():
try:
sys.stderr.write('Searching ghosts...\n')
config = ninix.home.load_config()
if config is None:
- sys.stderr.write('Error: ninix home not found\n')
- sys.exit(1)
+ raise SystemExit, 'Error: ninix home not found\n'
ghosts, shells, balloons, plugins, nekoninni, katochan, kinoko = config
found = 0
default_path = os.path.join(sys.path[0], 'ninix', 'dll')
def update_ghost(homeurl, ghostdir, quiet):
if not os.path.exists(os.path.expanduser(ghostdir)):
- sys.stderr.write('Error: %s not found\n' % ghostdir)
- sys.exit(1)
+ raise SystemExit, 'Error: %s not found\n' % ghostdir
updateman = ninix.update.NetworkUpdate(None)
updateman.start(homeurl, ghostdir, timeout=60)
while 1:
cr.paint_with_alpha(self.__alpha_channel)
def set_markup(self, index, text):
- sup_ = 0 # XXX
- sub_ = 0 # XXX
+ tags_ = ('sup', 'sub', 's', 'u')
+ count_ = {}
+ for tag_ in tags_:
+ count_[tag_] = 0
markup_list = []
for sl, sn, tag in self.meta_buffer:
if sl == index:
markup_list.sort()
markup_list.reverse()
for sn, tag in markup_list:
- # XXX
- if tag == '<sup>':
- sup_ += 1
- if tag == '</sup>':
- sup_ -= 1
- if tag == '<sub>':
- sub_ += 1
- if tag == '</sub>':
- sub_ -= 1
text = ''.join((text[:sn], tag, text[sn:]))
- if sup_ > 0:
- for x in range(sup_):
- text = ''.join((text, '</sup>'))
- if sup_ < 0:
- for x in range(-sup_):
- text = ''.join(('<sup>', text))
- if sub_ > 0:
- for x in range(sub_):
- text = ''.join((text, '</sub>'))
- if sub_ < 0:
- for x in range(-sub_):
- text = ''.join(('<sub>', text))
+ if tag[1] == '/':
+ tag_ = tag[2:-1]
+ assert tag_ in tags_
+ count_[tag_] -= 1
+ if count_[tag_] < 0:
+ text = ''.join(('<', tag_, '>', text))
+ count_[tag_] += 1
+ else:
+ tag_ = tag[1:-1]
+ assert tag_ in tags_
+ count_[tag_] += 1
+ if count_[tag_] > 0:
+ text = ''.join((text, '</', tag_, '>'))
+ count_[tag_] -= 1
return text
def redraw(self, darea=None, event=None):
elif c == '"':
position = line.find('"', i + 1)
if position < 0: ## FIXME
- sys.exit(1)
+ raise SystemExit
i = position
self.tokens.append(line[token_startpoint:position + 1])
token_startpoint = position + 1
elif c == "'":
position = line.find("'", i + 1)
if position < 0: ## FIXME
- sys.exit(1)
+ raise SystemExit
i = position
self.tokens.append(line[token_startpoint:position + 1])
token_startpoint = position + 1
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
-# $Id: kawari.py,v 1.30 2005/10/06 02:59:13 shy Exp $
+# $Id: kawari.py,v 1.31 2006/08/26 16:01:18 shy Exp $
#
import __builtin__
try:
options, argv = getopt.getopt(sys.argv[1:], 'd:', ['debug='])
except getopt.error, e:
- sys.stderr.write(''.join((str(e), '\n')))
- sys.exit(1)
+ raise SystemExit, ''.join((str(e), '\n'))
if argv:
kawari_dir = argv[0]
else:
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
-# $Id: home.py,v 1.31 2006/02/02 14:06:31 shy Exp $
+# $Id: home.py,v 1.32 2006/08/26 16:01:18 shy Exp $
#
import os
pass
config = load_config()
if config is None:
- sys.stderr.write('Home directory not found.\n')
- sys.exit(1)
+ raise SystemExit, 'Home directory not found.\n'
ghosts, shells, balloons, plugins, nekoninni, katochan, kinoko = config ## FIXME
# ghosts
for desc, shiori_dir, use_makoto, surface_set, balloon, prefix, shiori_dll, shiori_name in ghosts: ## FIXME
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
-# $Id: main.py,v 1.135 2006/03/25 08:07:09 shy Exp $
+# $Id: main.py,v 1.136 2006/08/26 16:01:18 shy Exp $
#
import getopt
'''
def usage():
- sys.stderr.write(USAGE)
- sys.exit(1)
+ raise SystemExit, USAGE
def _traceback(exception_type, value, tb):
response_id = 1
else: # close button
break
dialog.destroy()
- sys.exit(1)
+ raise SystemExit
if 'DISPLAY' in os.environ:
if 'gtk' in sys.modules:
sys.stderr = os.fdopen(sys.stderr.fileno(), 'w')
# check if X is running
if 'DISPLAY' not in os.environ:
- sys.stderr.write('Error: cannot open display (abort)\n')
- sys.exit(1)
+ raise SystemExit, 'Error: cannot open display (abort)\n'
# parse command line arguments
try:
options, rest = getopt.getopt(sys.argv[1:], 'H:U:R:ph',
ninix.home.NINIX_USER = user_dir
config = ninix.home.load_config()
if config is None:
- sys.stderr.write('Home directory not found (abort)\n')
- sys.exit(1)
+ raise SystemExit, 'Home directory not found (abort)\n'
# aquire Inter Process Mutex (not Global Mutex)
lockfile = open(os.path.join(ninix.home.get_ninix_home(), '.lock'), 'w')
try:
fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
except:
- print 'ninix-aya is already running'
- sys.exit(1)
+ raise SystemExit, 'ninix-aya is already running'
# check if at least one set of ghost, surface, and balloon
ghosts, shells, balloons, plugins, nekoninni, katochan, kinoko = config ## FIXME
if not ghosts:
- sys.stderr.write('Error: no ghost found\n')
- sys.exit(1)
+ raise SystemExit, 'Error: no ghost found\n'
elif not shells and \
not filter(lambda ghost: ghost[3], ghosts):
- sys.stderr.write('Error: no shell found\n')
- sys.exit(1)
+ raise SystemExit, 'Error: no shell found\n'
elif not balloons:
- sys.stderr.write('Error: no balloon found\n')
- sys.exit(1)
+ raise SystemExit, 'Error: no balloon found\n'
for desc, shiori_dir, use_makoto, surface_set, balloon, prefix, shiori_dll, shiori_name in ghosts:
print 'ghost:', desc.get('name', '<none>').encode('utf-8', 'ignore')
for name, surface_dir, surface_desc, surface_alias, surface in \
try:
os.execve(argv[0], argv, environ)
except OSError:
- sys.stderr.write('Error: %s failed (abort)\n' % argv[0])
- os._exit(1)
+ raise SystemExit, 'Error: %s failed (abort)\n' % argv[0]
self.plugin_pids.append(pid)
def open_ghost_manager(self):
try:
codecs.lookup(encoding)
except:
- sys.stderr.write('Unsupported encoding %s' % repr(encoding))
- sys.exit(-1)
+ raise SystemExit, 'Unsupported encoding %s' % repr(encoding)
nest = 0
new_entry = {}
set_id = None
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
-# $Id: sakura.py,v 1.149 2006/07/18 13:54:33 shy Exp $
+# $Id: sakura.py,v 1.150 2006/08/26 16:01:18 shy Exp $
#
import os
self.balloon.append_meta(self.script_side, '<sub>')
else:
self.balloon.append_meta(self.script_side, '</sub>')
+ elif args[0] == 'strike':
+ assert len(args) == 2
+ if args[1] in ['true', '1', 1]:
+ self.balloon.append_meta(self.script_side, '<s>')
+ else:
+ self.balloon.append_meta(self.script_side, '</s>')
+ elif args[0] == 'underline':
+ assert len(args) == 2
+ if args[1] in ['true', '1', 1]:
+ self.balloon.append_meta(self.script_side, '<u>')
+ else:
+ self.balloon.append_meta(self.script_side, '</u>')
else:
pass ## FIXME
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
-# $Id: script.py,v 1.15 2006/07/18 13:54:33 shy Exp $
+# $Id: script.py,v 1.16 2006/08/26 16:01:18 shy Exp $
#
import re
self.script.append((SCRIPT_TAG, lexeme, argument))
elif lexeme.startswith('\\s') or \
lexeme.startswith('\\b') or \
+ lexeme.startswith('\\p') or \
lexeme.startswith('\\w'):
num = lexeme[2]
if lexeme.startswith('\\s') and scope == 1:
import os
import re
-import sys
import urlparse
import random
# check if necessary surfaces have been loaded
for key in ['0', '10']:
if key not in pixbufs:
- sys.stderr.write('cannot load surface #%s (abort)\n' % key)
- sys.exit(1)
+ raise SystemExit, 'cannot load surface #%s (abort)\n' % key
self.__pixbufs = pixbufs
# arrange surface configurations
region = {}
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
-# $Id: update.py,v 1.14 2005/09/07 05:17:46 shy Exp $
+# $Id: update.py,v 1.15 2006/08/26 16:01:18 shy Exp $
#
import urlparse
def test():
import sys
if len(sys.argv) != 3:
- sys.stderr.write('Usage: update.py homeurl ghostdir\n')
- sys.exit(1)
+ raise SystemExit, 'Usage: update.py homeurl ghostdir\n'
update = NetworkUpdate(None)
update.start(sys.argv[1], sys.argv[2], timeout=60)
while 1:
# PURPOSE. See the GNU General Public License for more details.
#
-NUMBER = '3.8.8'
+NUMBER = '3.8.9'
CODENAME = 'hacking run'
VERSION = '%s (%s)' % (NUMBER, CODENAME)