@@ -128,7 +128,6 @@ function startGUI() {
128128 // output("Starting carlo GUI - press Control-C to quit")
129129 // const carlo = require("./aminosee-carlo").run( generateTheArgs() )
130130 output ( "start gui." )
131- // server.start( generateTheArgs() )
132131 // destroyKeyboardUI()
133132 // return carlo
134133}
@@ -138,6 +137,7 @@ function generateTheArgs() {
138137 log ( `webroot: ${ webroot } ${ url } ` )
139138 let theArgs = {
140139 verbose : verbose ,
140+ path : webroot ,
141141 webroot : webroot ,
142142 outputPath : path . join ( webroot , netFoldername ) ,
143143 openHtml : false ,
@@ -161,7 +161,7 @@ function generateTheArgs() {
161161 logip : true ,
162162 webroot : webroot ,
163163 openHtml : cliInstance . openHtml ,
164- https : true ,
164+ https : false ,
165165 background : cliInstance . background ,
166166 currentURL : cliInstance . currentURL
167167 }
@@ -174,7 +174,7 @@ function populateArgs(procArgv) { // returns args
174174 const options = {
175175 boolean : [ "artistic" , "brute" , "clear" , "chrome" , "devmode" , "debug" , "demo" , "dnabg" , "explorer" , "file" , "force" , "fullscreen" , "firefox" , "gui" , "html" , "image" , "keyboard" , "list" , "progress" , "quiet" , "reg" , "recycle" , "redraw" , "slow" , "serve" , "safari" , "test" , "updates" , "verbose" , "view" ] ,
176176 string : [ "url" , "output" , "triplet" , "peptide" , "ratio" ] ,
177- alias : { a : "artistic" , b : "dnabg" , c : "codons" , d : "devmode" , f : "force" , finder : "explorer" , h : "help" , k : "keyboard" , m : "magnitude" , o : "output" , p : "peptide" , i : "image" , t : "triplet" , u : "updates" , q : "quiet" , r : "reg " , w : "width" , v : "verbose" , x : "explorer" , v : "verbose" , view : "html" } ,
177+ alias : { a : "artistic" , b : "dnabg" , c : "codons" , d : "devmode" , f : "force" , finder : "explorer" , h : "help" , k : "keyboard" , m : "magnitude" , o : "output" , p : "peptide" , i : "image" , t : "triplet" , u : "updates" , q : "quiet" , r : "ratio " , w : "width" , v : "verbose" , x : "explorer" , v : "verbose" , view : "html" } ,
178178 default : { brute : false , debug : false , keyboard : false , progress : true , redraw : true , updates : true , stop : false , serve : false , fullscreen : false , html : true , image : false , index : false , clear : false , explorer : false , quiet : false , gui : false } ,
179179 stopEarly : false
180180 } // NUMERIC INPUTS: codons, magnitude, width, maxpix
@@ -298,7 +298,6 @@ function pushCli(cs) {
298298 // do stuff aside from creating any changes. eg if you just run "aminosee" by itself.
299299 // for each render batch sent through newJob, here is where "this" be instantiated once per newJob
300300 // for each DNA file, run setupRender
301- // server.setArgs( args )
302301 isShuttingDown = false
303302 streamLineNr = 0
304303 loopCounter = 0
@@ -324,7 +323,6 @@ function pushCli(cs) {
324323 this . done = 0
325324 this . devmode = false // kills the auto opening of reports etc
326325 this . quiet = false
327- verbose = false // not recommended. will slow down due to console.
328326 this . force = false // this.force overwrite existing PNG and HTML reports
329327 this . artistic = false // for Charlie
330328 this . dnabg = false // firehose your screen with DNA!
@@ -464,6 +462,7 @@ function pushCli(cs) {
464462 output ( "💩 debug mode ENABLED 💩" )
465463 } else {
466464 debug = false
465+ log ( "💩 debug mode DISABLED 💩" )
467466 }
468467
469468 if ( args . url ) {
@@ -660,8 +659,8 @@ function pushCli(cs) {
660659 }
661660
662661 if ( args . verbose || args . v ) {
663- output ( "verbose enabled. AminoSee version: " + version )
664- bugtxt ( `os.platform(): ${ os . platform ( ) } ${ process . cwd ( ) } ` )
662+ output ( "verbose output enabled. AminoSee version: " + version )
663+ log ( `os.platform(): ${ os . platform ( ) } ${ process . cwd ( ) } ` )
665664 verbose = true
666665 termDisplayHeight -= 2
667666 } else {
@@ -898,36 +897,32 @@ function pushCli(cs) {
898897
899898 // output(`webserverEnabled: ${webserverEnabled}`)
900899 if ( webserverEnabled === true ) {
901- output ( `Starting webserver` )
902900 let theargs = generateTheArgs ( )
903- bugtxt ( theargs )
904901 server . stop ( ) // kludge? maybe remove later
905902 url = projectprefs . aminosee . url
906903 output ( )
907904 this . setupKeyboardUI ( )
908905 autoStartGui = false
909906 // output(`Server running at: ${ chalk.underline( url ) } to stop use: aminosee --stop `)
910- server . setArgs ( theargs )
907+ // server.setArgs(theargs)
908+
909+ server . setArgs ( theargs )
910+
911911 // server()
912912 // this.currentURL = server.foregroundserver()
913913 // this.currentURL = this.generateURL()
914- // this.currentURL = server.start( theargs )
915914
916- // server.start(theargs)
917915 // output( theargs )
918916 // output(`starting server in a tick`)
919917 // runcb( () => {
920- log ( `starting server now` )
918+ output ( theargs )
919+ output ( args )
920+ output ( `Starting webserver...` )
921921 try {
922- // server( theargs )
923- server . start ( this . currentURL )
924-
922+ server . start ( )
925923 } catch ( err ) {
926- output ( `error starting server: ${ fixedWidth ( tx / 2 , err ) } ` )
924+ output ( `error starting server: ${ err } ` )
927925 }
928- // webserverEnabled = false
929- // })
930-
931926
932927 } else {
933928 log ( "Not starting server" )
@@ -1205,8 +1200,7 @@ function pushCli(cs) {
12051200 }
12061201 if ( debug === true && this . quiet == false ) {
12071202 // console.log( histogramJson )
1208- // output( beautify( histogramJson, null, 2, 100) )
1209-
1203+ output ( beautify ( histogramJson , null , 2 , 100 ) )
12101204 }
12111205 aminosee_json = histogramJson
12121206 return histogramJson
@@ -1457,7 +1451,6 @@ function pushCli(cs) {
14571451
14581452 // pushCli('--serve');
14591453 // output( server.foregroundserver() )
1460- // server.start( generateTheArgs() )
14611454 autoStartGui = false
14621455
14631456 } else {
@@ -1917,6 +1910,7 @@ function pushCli(cs) {
19171910
19181911
19191912 this . setIsDiskBusy ( false )
1913+ output ( `debug: was inside preRenderReset ${ status } ` )
19201914 killAllTimers ( )
19211915 try {
19221916 remain = this . args . _ . length
@@ -2046,7 +2040,6 @@ function pushCli(cs) {
20462040 diskStorm ( cb ) {
20472041 log ( "WE BE STORMIN" )
20482042 if ( brute === false ) { runcb ( cb ) ; return false }
2049- // killAllTimers()
20502043 output ( "LIKE NORMAN" )
20512044
20522045 for ( let p = 1 ; p < this . pepTable . length ; p ++ ) { // standard peptide loop
@@ -2675,7 +2668,8 @@ function pushCli(cs) {
26752668 }
26762669
26772670 saveHTML ( cb ) {
2678- status = ""
2671+ mode ( "Saving HTML" )
2672+ // status = ""
26792673 if ( this . isHilbertPossible === false ) { status += "Hilbert not possible. " ; this . report = false }
26802674 if ( this . report === false ) { status += "Report is disabled. " ; this . report = false }
26812675 if ( this . test ) { status += "Test. " ; this . report = false }
@@ -2689,13 +2683,12 @@ function pushCli(cs) {
26892683 // cb()
26902684 // return false
26912685 // }
2692- mode ( "Saving HTML" )
2686+
26932687
26942688 // this.pepTable.sort( this.compareHistocount )
26952689 let histogramJson = this . getRenderObject ( )
26962690 let histogramFile = this . generateFilenameHistogram ( )
2697- bugtxt ( `globalVariablesDoSuck: ${ this . usersPeptide } ` )
2698- // output( beautify( histogramJson , null, 2, 100) )
2691+ bugtxt ( beautify ( histogramJson , null , 2 , 100 ) )
26992692
27002693 let hypertext
27012694 if ( this . test === true ) {
@@ -2716,14 +2709,22 @@ function pushCli(cs) {
27162709 }
27172710
27182711 if ( this . dimension > defaultPreviewDimension ) {
2719- this . fileWrite ( path . resolve ( this . outputPath , this . shortnameGenome , "highres.html" ) , hypertext )
2712+ if ( this . reg ) {
2713+ this . fileWrite ( path . resolve ( this . outputPath , this . shortnameGenome , "highres-regmarks.html" ) , hypertext )
2714+ } else {
2715+ this . fileWrite ( path . resolve ( this . outputPath , this . shortnameGenome , "highres.html" ) , hypertext )
2716+ }
27202717 log ( blueWhite ( `Writing high resolution report for the directory ${ this . shortnameGenome } ` ) )
27212718 } else if ( this . dimension = defaultPreviewDimension ) {
27222719 this . index = true
27232720 }
27242721
27252722 if ( this . index || ! ishighres ) { // if it wont make the users computer explode... set it as index page!
2726- this . fileWrite ( path . resolve ( this . outputPath , this . shortnameGenome , "index.html" ) , hypertext )
2723+ if ( this . reg ) {
2724+ this . fileWrite ( path . resolve ( this . outputPath , this . shortnameGenome , "regmarks.html" ) , hypertext )
2725+ } else {
2726+ this . fileWrite ( path . resolve ( this . outputPath , this . shortnameGenome , "index.html" ) , hypertext )
2727+ }
27272728 log ( blueWhite ( `Writing default report for the directory ${ this . shortnameGenome } ` ) )
27282729 }
27292730
@@ -3057,7 +3058,7 @@ function pushCli(cs) {
30573058 mode ( "quit " + reason )
30583059 if ( typeof code == "undefined" ) { code = 0 } // dont terminate with 0
30593060 log ( `Received quit(${ code } ) ${ reason } ` )
3060- killAllTimers ( )
3061+ // killAllTimers()
30613062 destroyKeyboardUI ( )
30623063 if ( renderLock === true ) {
30633064 output ( "halting render" ) // maybe this happens during graceful shutdown
@@ -4787,15 +4788,15 @@ function pushCli(cs) {
47874788
47884789
47894790 function bugtxt ( txt ) { // full debug output
4790- // if (debug === true ) {
4791- // bugout(txt)
4792- // }
4791+ if ( debug ) {
4792+ bugout ( txt )
4793+ }
47934794 }
47944795 function output ( txt ) {
47954796 cpuhit ++
47964797 if ( typeof txt === "undefined" || typeof cliInstance === "undefined" ) { console . log ( ) ; return ; }
47974798
4798- wTitle ( `${ txt } ` ) // put it on the terminal windowbar or in tmux
4799+ wTitle ( `${ removeNonAscii ( txt ) } ` ) // put it on the terminal windowbar or in tmux
47994800
48004801 if ( cliInstance . quiet === true ) {
48014802 redoline ( txt )
@@ -4830,7 +4831,7 @@ function pushCli(cs) {
48304831 // return
48314832 if ( debug === true || verbose ) {
48324833 bugout ( txt )
4833- } else if ( verbose ) {
4834+ } else if ( verbose ) {
48344835 console . log ( txt )
48354836 } else {
48364837 redoline ( txt )
@@ -4849,9 +4850,7 @@ function pushCli(cs) {
48494850 term . windowTitle ( txt )
48504851 }
48514852 function bugout ( txt ) {
4852-
4853- console . log ( `${ helixEmoji } : ${ cpuhit } ${ maxWidth ( 16 , status ) } ${ cliInstance . usersPeptide } ${ remain } ${ txt } ` )
4854-
4853+ console . log ( `${ helixEmoji } : ${ cpuhit } ${ status } ${ cliInstance . usersPeptide } ${ remain } ${ txt } ` )
48554854 }
48564855 function deleteFile ( file ) {
48574856 let ret = false
@@ -5336,7 +5335,7 @@ function pushCli(cs) {
53365335 } else {
53375336 // if (debounce(25) === true) {
53385337 term . eraseLine ( )
5339- console . log ( maxWidth ( tx / 2 , txt ) )
5338+ console . log ( maxWidth ( tx / 2 , removeNonAscii ( txt ) ) )
53405339 term . eraseLine ( )
53415340 term . column ( 0 )
53425341 term . up ( 1 )
@@ -5723,7 +5722,6 @@ function pushCli(cs) {
57235722 // this.pollForStream();
57245723 // },
57255724 // function( cb ) {
5726- // server.start( this.args );
57275725 // this.mkRenderFolders();
57285726 // // symlinkGUI(cb);
57295727 // }
@@ -5754,7 +5752,7 @@ function pushCli(cs) {
57545752
57555753 // let this.radMargin = cliInstance.termMarginLeft
57565754 this . radMargin = 16
5757- output ( " " )
5755+ output ( `tx: ${ tx } ` )
57585756 // term.right( this.radMargin )
57595757 terminalRGB ( helixEmoji + chalk . rgb ( 255 , 32 , 32 ) . bgBlack ( arr [ 0 ] ) , 12 , 34 , 56 )
57605758 term . eraseLine ( )
@@ -5786,10 +5784,6 @@ function pushCli(cs) {
57865784 terminalRGB ( `${ prettyDate ( new Date ( ) ) } v${ version } ${ arr [ 6 ] } ` , 220 , 120 , 70 ) ; term . right ( this . radMargin ) ; term . eraseLine ( )
57875785 terminalRGB ( arr [ 7 ] , 220 , 80 , 80 ) ; term . right ( this . radMargin ) ; term . eraseLine ( )
57885786 terminalRGB ( arr [ 8 ] , 255 , 32 , 32 ) ; term . eraseLine ( )
5789-
5790-
5791-
5792-
57935787 }
57945788
57955789 }
0 commit comments