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

v2.11.1.1

This commit is contained in:
gnosygnu
2015-11-01 20:50:05 -05:00
parent 4f43f51b18
commit b990ec409f
858 changed files with 6758 additions and 4187 deletions

View File

@@ -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.setups.addons; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.setups.*;
import gplx.ios.*;
import gplx.core.ios.*;
import gplx.xowa.apps.fsys.*;
public class Xoi_firefox_installer implements GfoInvkAble {
private Io_url src_xpi, trg_xpi;

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.bldrs.setups.addons; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.setups.*;
import org.junit.*;
import gplx.ios.*;
import gplx.core.ios.*;
public class Xoi_firefox_installer_tst {
private Xoi_firefox_pref_fxt fxt = new Xoi_firefox_pref_fxt();
@Test public void Pref_update() {

View File

@@ -21,7 +21,7 @@ public class Wmf_dump_list_parser {
Ordered_hash itms = Ordered_hash_.New_bry();
int pos = 0;
while (true) {
int a_pos = Bry_find_.Find_fwd(src, Find_anchor, pos); if (a_pos == Bry_.NotFound) break; // no more anchors found
int a_pos = Bry_find_.Find_fwd(src, Find_anchor, pos); if (a_pos == Bry_find_.Not_found) break; // no more anchors found
pos = a_pos + Find_anchor.length;
try {
Wmf_dump_itm itm = new Wmf_dump_itm();
@@ -35,31 +35,31 @@ public class Wmf_dump_list_parser {
return (Wmf_dump_itm[])itms.To_ary(Wmf_dump_itm.class);
}
private boolean Parse_href(Wmf_dump_itm itm, byte[] src, int a_pos) { // EX: http://dumps.wikimedia.org/enwiki/20130807
int href_pos = Bry_find_.Find_fwd(src, Find_href, a_pos); if (href_pos == Bry_.NotFound) return false; // no <li>; something bad happened
int href_pos = Bry_find_.Find_fwd(src, Find_href, a_pos); if (href_pos == Bry_find_.Not_found) return false; // no <li>; something bad happened
int href_bgn_pos = Bry_find_.Find_fwd(src, Byte_ascii.Quote, href_pos + Find_href.length);
int href_end_pos = Bry_find_.Find_fwd(src, Byte_ascii.Quote, href_bgn_pos + 1); if (href_end_pos == Bry_.NotFound) return false;
int href_end_pos = Bry_find_.Find_fwd(src, Byte_ascii.Quote, href_bgn_pos + 1); if (href_end_pos == Bry_find_.Not_found) return false;
byte[] href_bry = Bry_.Mid(src, href_bgn_pos + 1, href_end_pos);
int date_end = href_bry.length;
int date_bgn = Bry_find_.Find_bwd(href_bry, Byte_ascii.Slash); if (date_bgn == Bry_.NotFound) return false;
int date_bgn = Bry_find_.Find_bwd(href_bry, Byte_ascii.Slash); if (date_bgn == Bry_find_.Not_found) return false;
byte[] date_bry = Bry_.Mid(href_bry, date_bgn + 1, date_end);
DateAdp date = DateAdp_.parse_fmt(String_.new_a7(date_bry), "yyyyMMdd");
itm.Dump_date_(date);
int abrv_end = date_bgn;
int abrv_bgn = Bry_find_.Find_bwd(href_bry, Byte_ascii.Slash, abrv_end); if (abrv_bgn == Bry_.NotFound) abrv_bgn = -1; // "enwiki/20130708"
int abrv_bgn = Bry_find_.Find_bwd(href_bry, Byte_ascii.Slash, abrv_end); if (abrv_bgn == Bry_find_.Not_found) abrv_bgn = -1; // "enwiki/20130708"
byte[] abrv_bry = Bry_.Mid(href_bry, abrv_bgn + 1, abrv_end);
itm.Wiki_abrv_(Bry_.Replace(abrv_bry, Byte_ascii.Underline, Byte_ascii.Dash));
return true;
}
private DateAdp Parse_status_time(byte[] src, int a_pos) {
int li_pos = Bry_find_.Find_bwd(src, Find_li, a_pos); if (li_pos == Bry_.NotFound) return null;
int bgn = Bry_find_.Find_fwd(src, Byte_ascii.Gt, li_pos + Find_li.length); if (bgn == Bry_.NotFound) return null;
int li_pos = Bry_find_.Find_bwd(src, Find_li, a_pos); if (li_pos == Bry_find_.Not_found) return null;
int bgn = Bry_find_.Find_fwd(src, Byte_ascii.Gt, li_pos + Find_li.length); if (bgn == Bry_find_.Not_found) return null;
byte[] rv_bry = Bry_.Mid(src, bgn + 1, a_pos);
return DateAdp_.parse_fmt(String_.Trim(String_.new_a7(rv_bry)), "yyyy-MM-dd HH:mm:ss");
}
private byte[] Parse_status_msg(byte[] src, int a_pos) {
int span_pos = Bry_find_.Find_fwd(src, Find_span_bgn, a_pos); if (span_pos == Bry_.NotFound) return null;
int bgn = Bry_find_.Find_fwd(src, Byte_ascii.Gt, span_pos + Find_span_bgn.length); if (bgn == Bry_.NotFound) return null;
int end = Bry_find_.Find_fwd(src, Find_span_end, bgn); if (end == Bry_.NotFound) return null;
int span_pos = Bry_find_.Find_fwd(src, Find_span_bgn, a_pos); if (span_pos == Bry_find_.Not_found) return null;
int bgn = Bry_find_.Find_fwd(src, Byte_ascii.Gt, span_pos + Find_span_bgn.length); if (bgn == Bry_find_.Not_found) return null;
int end = Bry_find_.Find_fwd(src, Find_span_end, bgn); if (end == Bry_find_.Not_found) return null;
return Bry_.Mid(src, bgn + 1, end);
}
private static byte[]

View File

@@ -61,7 +61,7 @@ public class Wmf_dump_list_parser_tst {
// if (Bry_.Eq(abrv, Bry_.new_a7("testwikidatawiki"))) continue;
// byte[] domain_bry = Xow_abrv_wm_.Parse_to_domain_bry(abrv);
// if (domain_bry == null) continue; // not a standard WMF wiki; ignore
// if (Bry_find_.Find_fwd(domain_bry, Bry_.new_a7("wikimania")) != Bry_.NotFound) continue;
// if (Bry_find_.Find_fwd(domain_bry, Bry_.new_a7("wikimania")) != Bry_find_.Not_found) continue;
// if (excluded_domains.Has(domain_bry)) continue;
// Xow_domain_itm domain_itm = Xow_domain_itm_.parse(domain_bry);
// byte[] tid_name = Xto_display_name(Xow_domain_tid_.Get_type_as_bry(domain_itm.Domain_type_id()));

View File

@@ -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.setups.maints; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.setups.*;
import gplx.core.btries.*; import gplx.ios.*;
import gplx.core.btries.*; import gplx.core.ios.*;
public class Wmf_latest_parser {
private Ordered_hash hash = Ordered_hash_.New_bry();
public int Count() {return hash.Count();}

View File

@@ -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.setups.maints; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.setups.*;
import org.junit.*; import gplx.ios.*;
import org.junit.*; import gplx.core.ios.*;
public class Wmf_latest_parser_tst {
@Before public void init() {fxt.Clear();} private Wmf_latest_parser_fxt fxt = new Wmf_latest_parser_fxt();
@Test public void Parse() {

View File

@@ -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.setups.maints; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.setups.*;
import gplx.ios.*;
import gplx.core.ios.*;
import gplx.xowa.wikis.domains.*;
import gplx.xowa.files.downloads.*;
public class Xoa_maint_mgr implements GfoInvkAble {

View File

@@ -27,7 +27,7 @@ class Upgrader_v00_02_01 {
usr_dlg.Note_many(GRP_KEY, "siteinfo.bgn", "siteinfo.bgn for ~{0}", siteinfo_url.Raw());
String siteinfo_str = Io_mgr.Instance.LoadFilStr_args(siteinfo_url).MissingIgnored_(true).Exec(); if (String_.Len_eq_0(siteinfo_str)) throw Err_.new_wo_type("could not find siteinfo.xml", "url", siteinfo_url.Raw());
usr_dlg.Note_many(GRP_KEY, "siteinfo.parse", "parsing siteinfo");
gplx.xowa.bldrs.xmls.Xob_siteinfo_parser.Siteinfo_parse(wiki, usr_dlg, siteinfo_str); // NOTE: this also resets the namespaces on the wiki; not necessary, but is benign
gplx.xowa.bldrs.cmds.texts.xmls.Xob_siteinfo_parser_.Parse(Bry_.new_u8(siteinfo_str), wiki); // NOTE: this also resets the namespaces on the wiki; not necessary, but is benign
usr_dlg.Note_many(GRP_KEY, "siteinfo.save", "saving siteinfo");
byte[] wiki_core_bry = wiki.Cfg_wiki_core().Build_gfs();
Io_mgr.Instance.SaveFilBry(wiki.Tdb_fsys_mgr().Cfg_wiki_core_fil(), wiki_core_bry);