comipoli を gjs 化するので python3 の zipfile が使えない。
ということで unzip コマンドを使う方法に切り替えるのだが
展開する内部ファイル名にブラケット [, ] があると展開できないと気が付いた。
検索するとアスタリスクが駄目なことは皆気がついているようだ、他にもあるかな?
file-roller の GPL ソースを見るのが一番速い。
file-roller/fr-command-zip.c at master ? GNOME/file-roller ? GitHub
[]*?!^-\
こんなにあった、てか記号全部ではないのね。
駄目文字の前にバックスラッシュを付けるだけだし変換は簡単だね。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | var ComipoliArchive = class ComipoliArchive { // etc... _zipEscape(str) { const ESCAPE = "[]*?!^-\\" ; let res = "" ; for ( let s of str) { if (ESCAPE.includes(s)) res += "\\" ; res += s; } return res; } getItem(num) { let cmdArray = null ; let pixbuf = null ; switch ( this .status) { case 1: cmdArray = [ "unrar" , "p" , "-inul" , "-@" , "--" , this .path, this .namelist[num]]; break ; case 2: cmdArray = [ "7za" , "x" , "-so" , this .path, this .namelist[num]]; break ; default : //cmdArray = ["unzip", "-pj", this.path, this.namelist[num]]; cmdArray = [ "unzip" , "-pj" , this .path, this ._zipEscape( this .namelist[num])]; } let sp = Gio.Subprocess. new (cmdArray, Gio.SubprocessFlags.STDOUT_PIPE); let stream = sp.get_stdout_pipe(); try { pixbuf = GdkPixbuf.Pixbuf.new_from_stream(stream, null ); } catch (e) { print ( "Error: " + this .namelist[num] + "\n" + e); } stream.close( null ); return pixbuf; } } |
展開できた。
しかし cairo 描写に書き換えたら 3D で動く毎に draw シグナルが…
これでは clutter_actor_save_easing_state が使えないや。