mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.1'
This commit is contained in:
@@ -34,12 +34,12 @@ abstract class Xoi_cmd_base implements Gfo_thread_cmd {
|
||||
// install_mgr.App().Gui_wtr().Log_many(GRP_KEY, "import.end", "import.end ~{0} ~{1} ~{2}", wiki_key, wiki_date, dump_type);
|
||||
return true;
|
||||
}
|
||||
public GfoInvkAble Owner() {return owner;} public Xoi_cmd_base Owner_(GfoInvkAble v) {owner = v; return this;} GfoInvkAble owner;
|
||||
public Gfo_invk Owner() {return owner;} public Xoi_cmd_base Owner_(Gfo_invk v) {owner = v; return this;} Gfo_invk owner;
|
||||
public Gfo_thread_cmd Async_next_cmd() {return next_cmd;} public void Async_next_cmd_(Gfo_thread_cmd v) {next_cmd = v;} Gfo_thread_cmd next_cmd;
|
||||
public void Async_run() {
|
||||
running = true;
|
||||
// install_mgr.App().Gui_wtr().Log_many(GRP_KEY, "import.bgn", "import.bgn ~{0} ~{1} ~{2}", wiki_key, wiki_date, dump_type);
|
||||
Thread_adp_.invk_(this.Async_key(), this, Invk_process_async).Start();
|
||||
Thread_adp_.Start_by_key(this.Async_key(), this, Invk_process_async);
|
||||
}
|
||||
public boolean Async_running() {return running;} private boolean running;
|
||||
public void Process_async() {
|
||||
@@ -66,7 +66,7 @@ abstract class Xoi_cmd_base implements Gfo_thread_cmd {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_process_async)) Process_async();
|
||||
else if (ctx.Match(k, Invk_owner)) return owner;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} private static final String Invk_process_async = "run_async", Invk_owner = "owner";
|
||||
}
|
||||
@@ -103,7 +103,7 @@ class Xoi_cmd_search2_build extends Xoi_cmd_base {
|
||||
@Override public void Process_async_init(Xoae_app app, Xowe_wiki wiki, Xob_bldr bldr) {
|
||||
if (app.Setup_mgr().Dump_mgr().Wiki_storage_type_is_sql()) {
|
||||
wiki.Db_mgr_as_sql().Category_version_update(false);
|
||||
gplx.xowa.addons.apps.searchs.bldrs.Srch_bldr_mgr_.Setup(wiki);
|
||||
gplx.xowa.addons.wikis.searchs.bldrs.Srch_bldr_mgr_.Setup(wiki);
|
||||
}
|
||||
}
|
||||
@Override public void Process_async_done(Xoae_app app, Xowe_wiki wiki, Xob_bldr bldr) {
|
||||
|
||||
@@ -16,9 +16,9 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.bldrs.installs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
|
||||
import gplx.gfui.*;
|
||||
import gplx.gfui.*; import gplx.gfui.kits.core.*;
|
||||
import gplx.core.threads.*;
|
||||
class Xoi_cmd_imageMagick_download extends Gfo_thread_cmd_download implements Gfo_thread_cmd {// private static final byte[] Bry_windows_zip = Bry_.new_a7("-windows.zip");
|
||||
class Xoi_cmd_imageMagick_download extends Gfo_thread_cmd_download implements Gfo_thread_cmd {// private static final byte[] Bry_windows_zip = Bry_.new_a7("-windows.zip");
|
||||
// static final String Src_imageMagick = "ftp://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/binaries/";
|
||||
public Xoi_cmd_imageMagick_download(Gfo_usr_dlg usr_dlg, Gfui_kit kit, Io_url trg) {this.Ctor(usr_dlg, kit); this.trg = trg;} Io_url trg;
|
||||
@Override public byte Async_init() { // <a href="ImageMagick-6.8.1-9-Q16-x86-windows.zip">
|
||||
|
||||
@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.bldrs.installs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
|
||||
import gplx.core.brys.fmtrs.*; import gplx.core.threads.*;
|
||||
public class Xoi_cmd_mgr implements GfoInvkAble {
|
||||
List_adp cmds = List_adp_.new_();
|
||||
public class Xoi_cmd_mgr implements Gfo_invk {
|
||||
List_adp cmds = List_adp_.New();
|
||||
public Xoi_cmd_mgr(Xoi_setup_mgr install_mgr) {this.app = install_mgr.App(); this.install_mgr = install_mgr;} private Xoae_app app; Xoi_setup_mgr install_mgr;
|
||||
public Xoae_app App() {return app;}
|
||||
public void Canceled_y_() {canceled = true;} private boolean canceled = false;
|
||||
@@ -47,7 +47,7 @@ public class Xoi_cmd_mgr implements GfoInvkAble {
|
||||
else
|
||||
this.Working_(Bool_.N);
|
||||
}
|
||||
private void Run_async(Gfo_thread_cmd cmd) {Thread_adp_.invk_msg_(cmd.Async_key(), this, GfoMsg_.new_cast_(Invk_process_async).Add("v", cmd)).Start();}
|
||||
private void Run_async(Gfo_thread_cmd cmd) {Thread_adp_.Start_by_val(cmd.Async_key(), this, Invk_process_async, cmd);}
|
||||
private void Cmds_run() {
|
||||
if (working) {
|
||||
app.Gui_mgr().Kit().Ask_ok("", "", "An import is in progress. Please wait for it to complete. If you want to do multiple imports at once, see Dashboard/Import/Offline."); // HOME
|
||||
@@ -142,7 +142,7 @@ public class Xoi_cmd_mgr implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_dump_add_many)) return Dump_add_many(m);
|
||||
else if (ctx.Match(k, Invk_cmd_add)) return Cmd_add(m);
|
||||
else if (ctx.Match(k, Invk_run)) Cmds_run();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} private static final String Invk_process_async = "process_async", Invk_dump_add_many = "dump_add_many", Invk_run = "run", Invk_cmd_add = "cmd_add";
|
||||
static final String GRP_KEY = "xowa.install_mgr.cmd_mgr";
|
||||
|
||||
@@ -31,12 +31,12 @@ class Xoi_cmd_wiki_import implements Gfo_thread_cmd {
|
||||
install_mgr.App().Usr_dlg().Log_many(GRP_KEY, "import.end", "import.end ~{0} ~{1} ~{2}", wiki_key, wiki_date, dump_type);
|
||||
return true;
|
||||
}
|
||||
public GfoInvkAble Owner() {return owner;} public Xoi_cmd_wiki_import Owner_(GfoInvkAble v) {owner = v; return this;} GfoInvkAble owner;
|
||||
public Gfo_invk Owner() {return owner;} public Xoi_cmd_wiki_import Owner_(Gfo_invk v) {owner = v; return this;} Gfo_invk owner;
|
||||
public Gfo_thread_cmd Async_next_cmd() {return next_cmd;} public void Async_next_cmd_(Gfo_thread_cmd v) {next_cmd = v;} Gfo_thread_cmd next_cmd;
|
||||
public void Async_run() {
|
||||
running = true;
|
||||
install_mgr.App().Usr_dlg().Log_many(GRP_KEY, "import.bgn", "import.bgn ~{0} ~{1} ~{2}", wiki_key, wiki_date, dump_type);
|
||||
Thread_adp_.invk_(this.Async_key(), this, Invk_process_async).Start();
|
||||
Thread_adp_.Start_by_key(this.Async_key(), this, Invk_process_async);
|
||||
}
|
||||
public boolean Async_running() {
|
||||
return running;
|
||||
@@ -64,8 +64,8 @@ class Xoi_cmd_wiki_import implements Gfo_thread_cmd {
|
||||
bldr.Cmd_mgr().Add_cmd(wiki, Xob_cmd_keys.Key_text_cat_core);
|
||||
bldr.Cmd_mgr().Add_cmd(wiki, Xob_cmd_keys.Key_text_cat_link);
|
||||
}
|
||||
if (wiki.Appe().Setup_mgr().Dump_mgr().Search_version() == gplx.xowa.addons.apps.searchs.specials.Srch_special_page.Version_2)
|
||||
gplx.xowa.addons.apps.searchs.bldrs.Srch_bldr_mgr_.Setup(wiki);
|
||||
if (wiki.Appe().Setup_mgr().Dump_mgr().Search_version() == gplx.xowa.addons.wikis.searchs.specials.Srch_special_page.Version_2)
|
||||
gplx.xowa.addons.wikis.searchs.bldrs.Srch_bldr_mgr_.Setup(wiki);
|
||||
bldr.Cmd_mgr().Add_cmd(wiki, Xob_cmd_keys.Key_text_term);
|
||||
}
|
||||
private void Process_async() {
|
||||
@@ -110,7 +110,7 @@ class Xoi_cmd_wiki_import implements Gfo_thread_cmd {
|
||||
if (ctx.Match(k, Invk_process_async)) Process_async();
|
||||
else if (ctx.Match(k, Invk_owner)) return owner;
|
||||
else if (ctx.Match(k, Invk_open_wiki)) Open_wiki(wiki_key);
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} private static final String Invk_process_async = "run_async", Invk_owner = "owner", Invk_open_wiki = "open_wiki";
|
||||
static final String GRP_KEY = "xowa.thread.op.build";
|
||||
|
||||
@@ -23,12 +23,12 @@ import gplx.xowa.wikis.domains.*;
|
||||
import gplx.xowa.bldrs.wms.*; import gplx.xowa.bldrs.wms.dumps.*;
|
||||
public class Xoi_cmd_wiki_tst {
|
||||
@Test public void Run() { // MAINT
|
||||
Bld_import_list(Xow_domain_regy.All);
|
||||
// Bld_import_list(Xow_domain_regy.All);
|
||||
// Bld_cfg_files(Xow_domain_regy.All); // NOTE: remember to carry over the wikisource / page / index commands from the existing xowa_build_cfg.gfs; also, only run the xowa_build_cfg.gfs once; DATE:2013-10-15; last run: DATE:2014-09-09
|
||||
}
|
||||
public void Bld_import_list(String... ary) {
|
||||
int ary_len = ary.length;
|
||||
Bry_bfr bfr = Bry_bfr.reset_(255);
|
||||
Bry_bfr bfr = Bry_bfr_.Reset(255);
|
||||
Wmf_latest_parser parser = new Wmf_latest_parser();
|
||||
Bfr_arg__time time_fmtr = new Bfr_arg__time();
|
||||
for (int i = 0; i < ary_len; i++)
|
||||
@@ -55,7 +55,7 @@ public class Xoi_cmd_wiki_tst {
|
||||
byte[] pages_articles_key = Bry_.new_a7(wmf_key + "-latest-pages-articles.xml.bz2");
|
||||
Wmf_latest_itm latest_itm = parser.Get_by(pages_articles_key);
|
||||
if (latest_itm == null) {Tfds.Dbg("missing|" + domain_str + "|" + url); return;} // NOTE: commonswiki missing entry for commonswiki-latest-pages-articles.xml.bz2 DATE:2016-05-01
|
||||
Tfds.Dbg("pass|" + url);
|
||||
Tfds.Dbg("pass|" + domain_str + "|" + url);
|
||||
bfr.Add(domain_bry).Add_byte_pipe();
|
||||
bfr.Add_str_u8(dump_file.File_url()).Add_byte_pipe();
|
||||
bfr.Add(Xow_domain_tid_.Get_type_as_bry(domain_itm.Domain_type_id())).Add_byte_pipe();
|
||||
@@ -108,7 +108,7 @@ public class Xoi_cmd_wiki_tst {
|
||||
}
|
||||
*/
|
||||
public void Bld_cfg_files(String... ary) {
|
||||
Bry_bfr bfr = Bry_bfr.reset_(255);
|
||||
Bry_bfr bfr = Bry_bfr_.Reset(255);
|
||||
gplx.xowa.bldrs.wiki_cfgs.Xoi_wiki_props_api api = new gplx.xowa.bldrs.wiki_cfgs.Xoi_wiki_props_api();
|
||||
gplx.xowa.bldrs.wiki_cfgs.Xoi_wiki_props_wiki wiki = new gplx.xowa.bldrs.wiki_cfgs.Xoi_wiki_props_wiki();
|
||||
int ary_len = ary.length;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.bldrs.installs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
|
||||
import gplx.gfui.*;
|
||||
import gplx.gfui.*; import gplx.gfui.kits.core.*;
|
||||
import gplx.core.threads.*;
|
||||
class Xoi_cmd_wiki_unzip extends Gfo_thread_cmd_unzip implements Gfo_thread_cmd { public static final String KEY_dump = "wiki.unzip";
|
||||
public Xoi_cmd_wiki_unzip(Xoi_setup_mgr install_mgr, String wiki_key, String dump_date, String dump_type) {this.install_mgr = install_mgr; this.Owner_(install_mgr); this.wiki_key = wiki_key; this.dump_date = dump_date; this.dump_type = dump_type;} private Xoi_setup_mgr install_mgr; String wiki_key, dump_date, dump_type;
|
||||
|
||||
@@ -20,7 +20,7 @@ import gplx.core.threads.*;
|
||||
import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.cmds.utils.*;
|
||||
class Xoi_cmd_wiki_zip implements Gfo_thread_cmd {
|
||||
public Xoi_cmd_wiki_zip(Xoi_setup_mgr install_mgr, String wiki_key, String wiki_date, String dump_type) {this.install_mgr = install_mgr; this.Owner_(install_mgr); this.wiki_key = wiki_key; this.wiki_date = wiki_date; this.dump_type = dump_type;} private Xoi_setup_mgr install_mgr; String wiki_key, wiki_date, dump_type;
|
||||
public static final String KEY = "wiki.zip";
|
||||
public static final String KEY = "wiki.zip";
|
||||
public void Cmd_ctor() {}
|
||||
public String Async_key() {return KEY;}
|
||||
public int Async_sleep_interval() {return Gfo_thread_cmd_.Async_sleep_interval_1_second;}
|
||||
@@ -33,12 +33,12 @@ class Xoi_cmd_wiki_zip implements Gfo_thread_cmd {
|
||||
install_mgr.App().Usr_dlg().Prog_many(GRP_KEY, "zip.done", "zip done");
|
||||
return true;
|
||||
}
|
||||
public GfoInvkAble Owner() {return owner;} public Xoi_cmd_wiki_zip Owner_(GfoInvkAble v) {owner = v; return this;} GfoInvkAble owner;
|
||||
public Gfo_invk Owner() {return owner;} public Xoi_cmd_wiki_zip Owner_(Gfo_invk v) {owner = v; return this;} Gfo_invk owner;
|
||||
public Gfo_thread_cmd Async_next_cmd() {return next_cmd;} public void Async_next_cmd_(Gfo_thread_cmd v) {next_cmd = v;} Gfo_thread_cmd next_cmd;
|
||||
public void Async_run() {
|
||||
running = true;
|
||||
install_mgr.App().Usr_dlg().Log_many(GRP_KEY, "zip.bgn", "zip.bgn ~{0}", wiki_key);
|
||||
Thread_adp_.invk_(this.Async_key(), this, Invk_process_async).Start();
|
||||
Thread_adp_.Start_by_key(this.Async_key(), this, Invk_process_async);
|
||||
}
|
||||
public boolean Async_running() {
|
||||
return running;
|
||||
@@ -62,8 +62,8 @@ class Xoi_cmd_wiki_zip implements Gfo_thread_cmd {
|
||||
else if (ctx.Match(k, Invk_owner)) return owner;
|
||||
else if (ctx.Match(k, Invk_delete_dirs_page_)) delete_dirs_page = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Invk_notify_done_)) notify_done = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} private static final String Invk_process_async = "run_async", Invk_owner = "owner", Invk_delete_dirs_page_ = "delete_dirs_page_", Invk_notify_done_ = "notify_done_";
|
||||
private static final String GRP_KEY = "xowa.thread.op.wiki.zip";
|
||||
private static final String GRP_KEY = "xowa.thread.op.wiki.zip";
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.bldrs.installs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.core.ios.*; import gplx.core.ios.streams.*;
|
||||
import gplx.xowa.bldrs.wms.dumps.*;
|
||||
public class Xoi_dump_mgr implements GfoInvkAble {
|
||||
public class Xoi_dump_mgr implements Gfo_invk {
|
||||
public String[] Server_urls() {return server_urls;} private String[] server_urls = String_.Ary(Xowm_dump_file_.Server_wmf_https, Xowm_dump_file_.Server_your_org, Xowm_dump_file_.Server_c3sl, Xowm_dump_file_.Server_masaryk);
|
||||
public String[] Custom_cmds() {return custom_cmds;} private String[] custom_cmds = String_.Ary(Xoi_cmd_wiki_download.Key_wiki_download, Xoi_cmd_wiki_import.KEY);
|
||||
public byte Data_storage_format() {return data_storage_format;} public Xoi_dump_mgr Data_storage_format_(byte v) {data_storage_format = v; return this;} private byte data_storage_format = gplx.core.ios.Io_stream_.Tid_gzip;
|
||||
public byte Data_storage_format() {return data_storage_format;} public Xoi_dump_mgr Data_storage_format_(byte v) {data_storage_format = v; return this;} private byte data_storage_format = gplx.core.ios.streams.Io_stream_.Tid_gzip;
|
||||
public long Db_text_max() {return db_text_max;} private long db_text_max = (long)3000 * Io_mgr.Len_mb;
|
||||
public long Db_categorylinks_max() {return db_categorylinks_max;} private long db_categorylinks_max = (long)3600 * Io_mgr.Len_mb;
|
||||
public long Db_wikidata_max() {return db_wikidata_max;} private long db_wikidata_max = (long)3600 * Io_mgr.Len_mb;
|
||||
@@ -31,7 +31,7 @@ public class Xoi_dump_mgr implements GfoInvkAble {
|
||||
public boolean Css_wiki_update() {return css_wiki_update;} private boolean css_wiki_update = true;
|
||||
public boolean Css_commons_download() {return css_commons_download;} private boolean css_commons_download = true; // changed from false to true; DATE:2014-10-19
|
||||
public boolean Delete_xml_file() {return delete_xml_file;} private boolean delete_xml_file = true;
|
||||
public byte Search_version() {return search_version;} private byte search_version = gplx.xowa.addons.apps.searchs.specials.Srch_special_page.Version_2;
|
||||
public byte Search_version() {return search_version;} private byte search_version = gplx.xowa.addons.wikis.searchs.specials.Srch_special_page.Version_2;
|
||||
public boolean Import_bz2_by_stdout() {return import_bz2_by_stdout;} private boolean import_bz2_by_stdout = true;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_server_urls)) return String_.Concat_with_str(",\n", server_urls);
|
||||
@@ -63,7 +63,7 @@ public class Xoi_dump_mgr implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_search_version_list)) return Options_search_version_list;
|
||||
else if (ctx.Match(k, Invk_import_bz2_by_stdout)) return Yn.To_str(import_bz2_by_stdout);
|
||||
else if (ctx.Match(k, Invk_import_bz2_by_stdout_)) import_bz2_by_stdout = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_server_urls = "server_urls", Invk_server_urls_ = "server_urls_", Invk_custom_cmds = "custom_cmds", Invk_custom_cmds_ = "custom_cmds_"
|
||||
|
||||
@@ -20,7 +20,7 @@ public class Xoi_mirror_parser {
|
||||
public String[] Parse(String raw_str) {
|
||||
if (String_.Len_eq_0(raw_str)) return String_.Ary_empty;
|
||||
byte[] raw = Bry_.new_u8(raw_str);
|
||||
List_adp rv = List_adp_.new_();
|
||||
List_adp rv = List_adp_.New();
|
||||
int pos = 0;
|
||||
while (true) {
|
||||
int bgn = Bry_find_.Find_fwd(raw, CONST_href_bgn, pos); if (bgn == Bry_find_.Not_found) break;
|
||||
@@ -35,7 +35,7 @@ public class Xoi_mirror_parser {
|
||||
rv.Add(String_.new_u8(date));
|
||||
}
|
||||
return rv.To_str_ary();
|
||||
} static final byte[] CONST_href_bgn = Bry_.new_a7("<a href=\""), CONST_href_end = Bry_.new_a7("\""), CONST_date_parent_dir = Bry_.new_a7("../");
|
||||
} static final byte[] CONST_href_bgn = Bry_.new_a7("<a href=\""), CONST_href_end = Bry_.new_a7("\""), CONST_date_parent_dir = Bry_.new_a7("../");
|
||||
public static String Find_last_lte(String[] ary, String comp) { // assuming sorted ary, find last entry that is lte comp
|
||||
int len = ary.length;
|
||||
for (int i = len - 1; i > -1; i--) {
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.bldrs.installs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
|
||||
import gplx.gfui.*; import gplx.xowa.bldrs.setups.addons.*;
|
||||
import gplx.xowa.bldrs.setups.maints.*;
|
||||
public class Xoi_setup_mgr implements GfoInvkAble {
|
||||
public class Xoi_setup_mgr implements Gfo_invk {
|
||||
public Xoi_setup_mgr(Xoae_app app) {
|
||||
this.app = app;
|
||||
cmd_mgr = new Xoi_cmd_mgr(this);
|
||||
@@ -37,7 +37,7 @@ public class Xoi_setup_mgr implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_dumps)) return dump_mgr;
|
||||
else if (ctx.Match(k, Invk_addons)) return addon_mgr;
|
||||
else if (ctx.Match(k, Invk_maint)) return maint_mgr;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
static final String Invk_cmds = "cmds", Invk_dumps = "dumps", Invk_addons = "addons", Invk_maint = "maint";
|
||||
static final String GRP_KEY = "xowa.setup";
|
||||
|
||||
Reference in New Issue
Block a user