1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.6.4.1'

This commit is contained in:
gnosygnu
2016-06-26 01:10:38 -04:00
parent 8afc115176
commit b3c2d3bb5f
108 changed files with 1813 additions and 873 deletions

View File

@@ -18,11 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.wikis.domains; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*;
import org.junit.*;
public class Xow_abrv_xo__tst {
@Before public void init() {fxt.Clear();} private final Xow_abrv_xo__fxt fxt = new Xow_abrv_xo__fxt();
@Before public void init() {fxt.Clear();} private final Xow_abrv_xo__fxt fxt = new Xow_abrv_xo__fxt();
@Test public void Basic() {
fxt.Test("en.wikipedia.org" , "en.w"); // multi.enwiki
fxt.Test("fr.wiktionary.org" , "fr.d"); // multi.frwiktionary
fxt.Test("commons.wikimedia.org" , "c"); // important.unique.commons
fxt.Test("species.wikimedia.org" , "species"); // important.unique.species
fxt.Test("www.wikidata.org" , "wd"); // important.unique.wikidata
fxt.Test("home" , "home"); // important.unique.xowa
fxt.Test("meta.wikimedia.org" , "meta"); // wikimedia.unique

View File

@@ -39,7 +39,7 @@ public class Xow_domain_tid_ {
, Int__other = 18
, Int___len = 19
;
public static final String // SERIALIZED:xowa.gfs
public static final String // SERIALIZED:xowa.gfs
Str__wikipedia = "wikipedia"
, Str__wiktionary = "wiktionary"
, Str__wikisource = "wikisource"
@@ -59,7 +59,7 @@ public class Xow_domain_tid_ {
, Str__home = "home"
, Str__other = "other"
;
public static final byte[]
public static final byte[]
Bry__wikipedia = Bry_.new_a7(Str__wikipedia)
, Bry__wiktionary = Bry_.new_a7(Str__wiktionary)
, Bry__wikisource = Bry_.new_a7(Str__wikisource)
@@ -79,10 +79,10 @@ public class Xow_domain_tid_ {
, Bry__home = Bry_.new_a7(Str__home)
, Bry__other = Bry_.new_a7(Str__other)
;
private static final Xow_domain_tid[] ary = new Xow_domain_tid[Int___len];
private static final Hash_adp_bry type_regy = Hash_adp_bry.ci_a7(); // LOC:must go before new_()
private static final Hash_adp_bry abrv_regy = Hash_adp_bry.cs(); // LOC:must go before new_()
public static final Xow_domain_tid
private static final Xow_domain_tid[] ary = new Xow_domain_tid[Int___len];
private static final Hash_adp_bry type_regy = Hash_adp_bry.ci_a7(); // LOC:must go before new_()
private static final Hash_adp_bry abrv_regy = Hash_adp_bry.cs(); // LOC:must go before new_()
public static final Xow_domain_tid
Itm__wikipedia = new_(Bool_.Y , Xow_domain_type_src_.Int__wmf , Int__wikipedia , Bry__wikipedia , "w" , ".wikipedia.org")
, Itm__wiktionary = new_(Bool_.Y , Xow_domain_type_src_.Int__wmf , Int__wiktionary , Bry__wiktionary , "d" , ".wiktionary.org")
, Itm__wikisource = new_(Bool_.Y , Xow_domain_type_src_.Int__wmf , Int__wikisource , Bry__wikisource , "s" , ".wikisource.org")
@@ -92,7 +92,7 @@ public class Xow_domain_tid_ {
, Itm__wikiversity = new_(Bool_.Y , Xow_domain_type_src_.Int__wmf , Int__wikiversity , Bry__wikiversity , "u" , ".wikiversity.org")
, Itm__wikinews = new_(Bool_.Y , Xow_domain_type_src_.Int__wmf , Int__wikinews , Bry__wikinews , "n" , ".wikinews.org")
, Itm__wikimedia = new_(Bool_.Y , Xow_domain_type_src_.Int__wmf , Int__wikimedia , Bry__wikimedia , "m" , ".wikimedia.org")
, Itm__species = new_(Bool_.Y , Xow_domain_type_src_.Int__wmf , Int__species , Bry__species , "species" , Xow_domain_itm_.Str__species)
, Itm__species = new_(Bool_.N , Xow_domain_type_src_.Int__wmf , Int__species , Bry__species , "species" , Xow_domain_itm_.Str__species)
, Itm__commons = new_(Bool_.N , Xow_domain_type_src_.Int__wmf , Int__commons , Bry__commons , "c" , Xow_domain_itm_.Str__commons)
, Itm__wikidata = new_(Bool_.N , Xow_domain_type_src_.Int__wmf , Int__wikidata , Bry__wikidata , "wd" , Xow_domain_itm_.Str__wikidata)
, Itm__mediawiki = new_(Bool_.N , Xow_domain_type_src_.Int__wmf , Int__mediawiki , Bry__mediawiki , "mw" , Xow_domain_itm_.Str__mediawiki)

View File

@@ -21,15 +21,15 @@ public class Xowe_page_mgr {
private final Xowe_wiki wiki;
public Xowe_page_mgr(Xowe_wiki wiki) {this.wiki = wiki;}
public Xoae_page Load_page(Xoa_url url, Xoa_ttl ttl, Xog_tab_itm tab) {
Xoa_app_.Usr_dlg().Log_many("", "", "page.load: url=~{0}", url.To_str());
Wait_for_popups();
Xoa_app_.Usr_dlg().Log_many("", "", "page.load: url=~{0}", url.To_str());
Wait_for_popups(wiki.App());
Xowe_wiki_.Rls_mem_if_needed(wiki);
// load page meta; wait_for_popups
Xoae_page page = wiki.Data_mgr().Load_page_and_parse(url, ttl, wiki.Lang(), tab, false);
boolean hdump_exists = page.Revision_data().Html_db_id() != -1 && wiki.Appe().Api_root().Wiki().Hdump().Read_preferred();
page.Html_data().Hdump_exists_(hdump_exists);
Wait_for_popups();
Wait_for_popups(wiki.App());
// load page text
boolean parse = true;
@@ -41,7 +41,8 @@ public class Xowe_page_mgr {
wiki.Parser_mgr().Parse(page, false);
return page;
}
private static void Wait_for_popups() {// HACK: wait for popups to finish, else thread errors due to popups and loader mutating cached items
private static void Wait_for_popups(Xoa_app app) {// HACK: wait for popups to finish, else thread errors due to popups and loader mutating cached items
if (app.Mode().Tid_is_http()) return;
int wait_count = 0;
while (gplx.xowa.htmls.modules.popups.Xow_popup_mgr.Running() && ++wait_count < 100)
gplx.core.threads.Thread_adp_.Sleep(10);

View File

@@ -20,11 +20,10 @@ import gplx.xowa.wikis.nss.*; import gplx.xowa.parsers.lnkis.*;
public class Xopg_lnki_list {
private final List_adp list = List_adp_.New();
private int lnki_idx;
public Xopg_lnki_list(boolean ttl_is_module) { // never redlink in Module ns; particularly since Lua has multi-line comments for [[ ]]
this.disabled = ttl_is_module;
public Xopg_lnki_list() {
this.Clear();
}
public boolean Disabled() {return disabled;} private final boolean disabled;
public boolean Disabled() {return disabled;} private boolean disabled; public Xopg_lnki_list Disabled_(boolean v) {this.disabled = v; return this;}
public int Len() {return list.Len();}
public Xopg_lnki_itm Get_at(int i) {return (Xopg_lnki_itm)list.Get_at(i);}
public void Add_direct(Xopg_lnki_itm lnki) {list.Add(lnki);} // add lnki directly to list without changing html_uid; needed for hdumps which call "Fill_page" to transfer from Xoh_page to Xoae_page