tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-03-14 00:45:33 +03:00
parent 5608a1c3f2
commit b95aeb0b24
4 changed files with 39 additions and 16 deletions

View File

@ -287,6 +287,8 @@ fi
# build cache... # build cache...
if [ -z $SKIP_CACHE ] ; then if [ -z $SKIP_CACHE ] ; then
# a little tweak to make build cache work...
export PYTHONIOENCODING=UTF-8
#if [ -z $TOTAL ] ; then #if [ -z $TOTAL ] ; then
# export TOTAL=`find . -path '*hi-res (RAW)/*.jpg' | wc -l` # export TOTAL=`find . -path '*hi-res (RAW)/*.jpg' | wc -l`
#fi #fi

View File

@ -287,6 +287,8 @@ fi
# build cache... # build cache...
if [ -z $SKIP_CACHE ] ; then if [ -z $SKIP_CACHE ] ; then
# a little tweak to make build cache work...
export PYTHONIOENCODING=UTF-8
#if [ -z $TOTAL ] ; then #if [ -z $TOTAL ] ; then
# export TOTAL=`find . -path '*hi-res (RAW)/*.jpg' | wc -l` # export TOTAL=`find . -path '*hi-res (RAW)/*.jpg' | wc -l`
#fi #fi

View File

@ -110,9 +110,9 @@ requirejs([
'b') 'b')
// XXX Q: should we show only one if multiple lines are in sequence??? // XXX Q: should we show only one if multiple lines are in sequence???
make('---') make('---')
make('---') //make('---')
// XXX not yet visible... // XXX not yet visible...
make('...') //make('...')
make('e') make('e')
// embeded browser... // embeded browser...
make(browser.Browser(function(make){ make(browser.Browser(function(make){
@ -125,6 +125,7 @@ requirejs([
make('moo', {disabled: true}), make('moo', {disabled: true}),
2, 2,
]) ])
make('in between...')
// nested browser... // nested browser...
make.nest('B', make.nest('B',
browser.Browser(function(make){ browser.Browser(function(make){

View File

@ -340,6 +340,13 @@ var BaseBrowserPrototype = {
}, },
get length(){
return this.map({skipNested: true}).length
+ this.nested()
.reduce(function(res, e){
return res + e.sublist.length }, 0) },
// Item list constructor... // Item list constructor...
// //
// .__list__(make, options) // .__list__(make, options)
@ -727,7 +734,7 @@ var BaseBrowserPrototype = {
// //
// XXX add path support... // XXX add path support...
// XXX add literal item support (???) // XXX add literal item support (???)
get: function(key){ get: function(key, _){
key = key == null ? 0 : key key = key == null ? 0 : key
// index... // index...
@ -738,30 +745,41 @@ var BaseBrowserPrototype = {
.map(function(e, i){ .map(function(e, i){
return [e, i] }) return [e, i] })
.compact() .compact()
var i = 0
var offset = 0
do { do {
// direct match... // direct match...
if(sublists.length == 0 || key < sublists[0][1]){ if(sublists.length == 0 || key - offset < sublists[0][1]){
return items[key] return items[key - i]
} }
// query the sublist... // query the sublist...
var list = sublists.shift() var [sublist, i] = sublists.shift()
console.log('>>>>', key - list[1])
var res = list[0].value instanceof Browser ? // inlined...
list[0].value.get(key - list[1]) if(sublist.value instanceof Browser){
// XXX also get header.... var res = sublist.value.get(key - i, true)
: list[0].sublist instanceof Browser ?
list[0].sublist.get(key - list[1]) // nested...
: list[0].sublist[key - list[1]] } else {
var res = key - i == 1 ?
sublist
: sublist.sublist instanceof Browser ?
sublist.sublist.get(key - i - offset, true)
: sublist.sublist[key - i - offset]
// account for the header...
offset += 1
}
if(res !== undefined){ if(res !== undefined){
return res return res
} }
items = items.slice(list[1] + 1) offset = offset + (sublist.sublist || sublist.value).length
key = key - list[key] - 1
} while(items.length > 0) // XXX not sure about this...
} while(items.length > key - (i + offset))
return undefined return undefined