1 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
9 class DataBaseManagement
12 cd.each_feature_name {|f|
13 ft = cd.get_feature(f)
25 class DataBaseFileManagement
27 # from specs/char-atr.ja.txt
54 ancient-char-of-shinjigen-1
56 original-char-of-shinjigen-1
58 vulgar-char-of-shinjigen-1
60 variant-of-shinjigen-1
66 # @opt = {:noop=>true, :verbose=>true}
67 @opt = {:verbose=>true}
70 def move_obsolete_files
71 #fpath = Config.instance.db_dir.path+"system-char-id"
72 fpath = Config.instance.db_dir.path+"character/feature"
74 Dir.chdir(fpath.to_s) {
75 opath = "obsolete".path
76 opath.mkdir unless opath.directory?
78 OBSOLETE_FEATURES.each {|attr|
81 f = attr.path.escape.escape_win_filename
82 FileUtils.mv(f.to_s, opath.to_s, @opt) if f.exist?
83 f = (f.to_s+".txt").path
84 FileUtils.mv(f.to_s, opath.to_s, @opt) if f.exist?
90 path = Config.instance.db_dir.path
92 nfpath = path+"character/feature"
93 FileUtils.mkdir_p(nfpath.to_s, @opt) unless nfpath.directory?
95 fpath = path+"system-char-id"
98 FileUtils.mv((fpath+f).to_s, nfpath.to_s, @opt)
101 ncpath = path+"character/by_feature"
102 FileUtils.mkdir_p(ncpath.to_s, @opt) unless ncpath.directory?
106 next if f.to_s == "character"
108 next unless d.directory?
109 ff = d + "system-char-id"
110 FileUtils.mv(ff.to_s, (ncpath+f).to_s, @opt) if ff.exist?