shell.c 368 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175
  1. /* Generated by Cython 0.20.1 on Sun Mar 16 22:58:15 2014 */
  2. #define PY_SSIZE_T_CLEAN
  3. #ifndef CYTHON_USE_PYLONG_INTERNALS
  4. #ifdef PYLONG_BITS_IN_DIGIT
  5. #define CYTHON_USE_PYLONG_INTERNALS 0
  6. #else
  7. #include "pyconfig.h"
  8. #ifdef PYLONG_BITS_IN_DIGIT
  9. #define CYTHON_USE_PYLONG_INTERNALS 1
  10. #else
  11. #define CYTHON_USE_PYLONG_INTERNALS 0
  12. #endif
  13. #endif
  14. #endif
  15. #include "Python.h"
  16. #ifndef Py_PYTHON_H
  17. #error Python headers needed to compile C extensions, please install development version of Python.
  18. #elif PY_VERSION_HEX < 0x02040000
  19. #error Cython requires Python 2.4+.
  20. #else
  21. #define CYTHON_ABI "0_20_1"
  22. #include <stddef.h> /* For offsetof */
  23. #ifndef offsetof
  24. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  25. #endif
  26. #if !defined(WIN32) && !defined(MS_WINDOWS)
  27. #ifndef __stdcall
  28. #define __stdcall
  29. #endif
  30. #ifndef __cdecl
  31. #define __cdecl
  32. #endif
  33. #ifndef __fastcall
  34. #define __fastcall
  35. #endif
  36. #endif
  37. #ifndef DL_IMPORT
  38. #define DL_IMPORT(t) t
  39. #endif
  40. #ifndef DL_EXPORT
  41. #define DL_EXPORT(t) t
  42. #endif
  43. #ifndef PY_LONG_LONG
  44. #define PY_LONG_LONG LONG_LONG
  45. #endif
  46. #ifndef Py_HUGE_VAL
  47. #define Py_HUGE_VAL HUGE_VAL
  48. #endif
  49. #ifdef PYPY_VERSION
  50. #define CYTHON_COMPILING_IN_PYPY 1
  51. #define CYTHON_COMPILING_IN_CPYTHON 0
  52. #else
  53. #define CYTHON_COMPILING_IN_PYPY 0
  54. #define CYTHON_COMPILING_IN_CPYTHON 1
  55. #endif
  56. #if CYTHON_COMPILING_IN_PYPY
  57. #define Py_OptimizeFlag 0
  58. #endif
  59. #if PY_VERSION_HEX < 0x02050000
  60. typedef int Py_ssize_t;
  61. #define PY_SSIZE_T_MAX INT_MAX
  62. #define PY_SSIZE_T_MIN INT_MIN
  63. #define PY_FORMAT_SIZE_T ""
  64. #define CYTHON_FORMAT_SSIZE_T ""
  65. #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  66. #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o)
  67. #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
  68. (PyErr_Format(PyExc_TypeError, \
  69. "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
  70. (PyObject*)0))
  71. #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
  72. !PyComplex_Check(o))
  73. #define PyIndex_Check __Pyx_PyIndex_Check
  74. #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  75. #define __PYX_BUILD_PY_SSIZE_T "i"
  76. #else
  77. #define __PYX_BUILD_PY_SSIZE_T "n"
  78. #define CYTHON_FORMAT_SSIZE_T "z"
  79. #define __Pyx_PyIndex_Check PyIndex_Check
  80. #endif
  81. #if PY_VERSION_HEX < 0x02060000
  82. #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  83. #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
  84. #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
  85. #define PyVarObject_HEAD_INIT(type, size) \
  86. PyObject_HEAD_INIT(type) size,
  87. #define PyType_Modified(t)
  88. typedef struct {
  89. void *buf;
  90. PyObject *obj;
  91. Py_ssize_t len;
  92. Py_ssize_t itemsize;
  93. int readonly;
  94. int ndim;
  95. char *format;
  96. Py_ssize_t *shape;
  97. Py_ssize_t *strides;
  98. Py_ssize_t *suboffsets;
  99. void *internal;
  100. } Py_buffer;
  101. #define PyBUF_SIMPLE 0
  102. #define PyBUF_WRITABLE 0x0001
  103. #define PyBUF_FORMAT 0x0004
  104. #define PyBUF_ND 0x0008
  105. #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  106. #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  107. #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  108. #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  109. #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  110. #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  111. #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  112. typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  113. typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
  114. #endif
  115. #if PY_MAJOR_VERSION < 3
  116. #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  117. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  118. PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  119. #define __Pyx_DefaultClassType PyClass_Type
  120. #else
  121. #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  122. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  123. PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  124. #define __Pyx_DefaultClassType PyType_Type
  125. #endif
  126. #if PY_VERSION_HEX < 0x02060000
  127. #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
  128. #endif
  129. #if PY_MAJOR_VERSION >= 3
  130. #define Py_TPFLAGS_CHECKTYPES 0
  131. #define Py_TPFLAGS_HAVE_INDEX 0
  132. #endif
  133. #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  134. #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  135. #endif
  136. #if PY_VERSION_HEX < 0x02060000
  137. #define Py_TPFLAGS_HAVE_VERSION_TAG 0
  138. #endif
  139. #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
  140. #define Py_TPFLAGS_IS_ABSTRACT 0
  141. #endif
  142. #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  143. #define Py_TPFLAGS_HAVE_FINALIZE 0
  144. #endif
  145. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  146. #define CYTHON_PEP393_ENABLED 1
  147. #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
  148. 0 : _PyUnicode_Ready((PyObject *)(op)))
  149. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  150. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  151. #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
  152. #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
  153. #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
  154. #else
  155. #define CYTHON_PEP393_ENABLED 0
  156. #define __Pyx_PyUnicode_READY(op) (0)
  157. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  158. #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  159. #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
  160. #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
  161. #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  162. #endif
  163. #if CYTHON_COMPILING_IN_PYPY
  164. #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
  165. #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
  166. #else
  167. #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
  168. #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
  169. PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  170. #endif
  171. #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
  172. #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  173. #if PY_MAJOR_VERSION >= 3
  174. #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
  175. #else
  176. #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
  177. #endif
  178. #if PY_MAJOR_VERSION >= 3
  179. #define PyBaseString_Type PyUnicode_Type
  180. #define PyStringObject PyUnicodeObject
  181. #define PyString_Type PyUnicode_Type
  182. #define PyString_Check PyUnicode_Check
  183. #define PyString_CheckExact PyUnicode_CheckExact
  184. #endif
  185. #if PY_VERSION_HEX < 0x02060000
  186. #define PyBytesObject PyStringObject
  187. #define PyBytes_Type PyString_Type
  188. #define PyBytes_Check PyString_Check
  189. #define PyBytes_CheckExact PyString_CheckExact
  190. #define PyBytes_FromString PyString_FromString
  191. #define PyBytes_FromStringAndSize PyString_FromStringAndSize
  192. #define PyBytes_FromFormat PyString_FromFormat
  193. #define PyBytes_DecodeEscape PyString_DecodeEscape
  194. #define PyBytes_AsString PyString_AsString
  195. #define PyBytes_AsStringAndSize PyString_AsStringAndSize
  196. #define PyBytes_Size PyString_Size
  197. #define PyBytes_AS_STRING PyString_AS_STRING
  198. #define PyBytes_GET_SIZE PyString_GET_SIZE
  199. #define PyBytes_Repr PyString_Repr
  200. #define PyBytes_Concat PyString_Concat
  201. #define PyBytes_ConcatAndDel PyString_ConcatAndDel
  202. #endif
  203. #if PY_MAJOR_VERSION >= 3
  204. #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  205. #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  206. #else
  207. #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
  208. PyString_Check(obj) || PyUnicode_Check(obj))
  209. #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  210. #endif
  211. #if PY_VERSION_HEX < 0x02060000
  212. #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
  213. #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
  214. #endif
  215. #ifndef PySet_CheckExact
  216. #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
  217. #endif
  218. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  219. #if PY_MAJOR_VERSION >= 3
  220. #define PyIntObject PyLongObject
  221. #define PyInt_Type PyLong_Type
  222. #define PyInt_Check(op) PyLong_Check(op)
  223. #define PyInt_CheckExact(op) PyLong_CheckExact(op)
  224. #define PyInt_FromString PyLong_FromString
  225. #define PyInt_FromUnicode PyLong_FromUnicode
  226. #define PyInt_FromLong PyLong_FromLong
  227. #define PyInt_FromSize_t PyLong_FromSize_t
  228. #define PyInt_FromSsize_t PyLong_FromSsize_t
  229. #define PyInt_AsLong PyLong_AsLong
  230. #define PyInt_AS_LONG PyLong_AS_LONG
  231. #define PyInt_AsSsize_t PyLong_AsSsize_t
  232. #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
  233. #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  234. #define PyNumber_Int PyNumber_Long
  235. #endif
  236. #if PY_MAJOR_VERSION >= 3
  237. #define PyBoolObject PyLongObject
  238. #endif
  239. #if PY_VERSION_HEX < 0x030200A4
  240. typedef long Py_hash_t;
  241. #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  242. #define __Pyx_PyInt_AsHash_t PyInt_AsLong
  243. #else
  244. #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  245. #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
  246. #endif
  247. #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  248. #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  249. #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  250. #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
  251. #else
  252. #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
  253. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
  254. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
  255. (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  256. #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
  257. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  258. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
  259. (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  260. #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
  261. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  262. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
  263. (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
  264. #endif
  265. #if PY_MAJOR_VERSION >= 3
  266. #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
  267. #endif
  268. #if PY_VERSION_HEX < 0x02050000
  269. #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
  270. #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  271. #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
  272. #else
  273. #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
  274. #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  275. #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
  276. #endif
  277. #if PY_VERSION_HEX < 0x02050000
  278. #define __Pyx_NAMESTR(n) ((char *)(n))
  279. #define __Pyx_DOCSTR(n) ((char *)(n))
  280. #else
  281. #define __Pyx_NAMESTR(n) (n)
  282. #define __Pyx_DOCSTR(n) (n)
  283. #endif
  284. #ifndef CYTHON_INLINE
  285. #if defined(__GNUC__)
  286. #define CYTHON_INLINE __inline__
  287. #elif defined(_MSC_VER)
  288. #define CYTHON_INLINE __inline
  289. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  290. #define CYTHON_INLINE inline
  291. #else
  292. #define CYTHON_INLINE
  293. #endif
  294. #endif
  295. #ifndef CYTHON_RESTRICT
  296. #if defined(__GNUC__)
  297. #define CYTHON_RESTRICT __restrict__
  298. #elif defined(_MSC_VER) && _MSC_VER >= 1400
  299. #define CYTHON_RESTRICT __restrict
  300. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  301. #define CYTHON_RESTRICT restrict
  302. #else
  303. #define CYTHON_RESTRICT
  304. #endif
  305. #endif
  306. #ifdef NAN
  307. #define __PYX_NAN() ((float) NAN)
  308. #else
  309. static CYTHON_INLINE float __PYX_NAN() {
  310. /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
  311. a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
  312. a quiet NaN. */
  313. float value;
  314. memset(&value, 0xFF, sizeof(value));
  315. return value;
  316. }
  317. #endif
  318. #if PY_MAJOR_VERSION >= 3
  319. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  320. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  321. #else
  322. #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
  323. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
  324. #endif
  325. #ifndef __PYX_EXTERN_C
  326. #ifdef __cplusplus
  327. #define __PYX_EXTERN_C extern "C"
  328. #else
  329. #define __PYX_EXTERN_C extern
  330. #endif
  331. #endif
  332. #if defined(WIN32) || defined(MS_WINDOWS)
  333. #define _USE_MATH_DEFINES
  334. #endif
  335. #include <math.h>
  336. #define __PYX_HAVE__lib__Naked__toolshed__c__shell
  337. #define __PYX_HAVE_API__lib__Naked__toolshed__c__shell
  338. #ifdef _OPENMP
  339. #include <omp.h>
  340. #endif /* _OPENMP */
  341. #ifdef PYREX_WITHOUT_ASSERTIONS
  342. #define CYTHON_WITHOUT_ASSERTIONS
  343. #endif
  344. #ifndef CYTHON_UNUSED
  345. # if defined(__GNUC__)
  346. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  347. # define CYTHON_UNUSED __attribute__ ((__unused__))
  348. # else
  349. # define CYTHON_UNUSED
  350. # endif
  351. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  352. # define CYTHON_UNUSED __attribute__ ((__unused__))
  353. # else
  354. # define CYTHON_UNUSED
  355. # endif
  356. #endif
  357. typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
  358. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
  359. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  360. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
  361. #define __PYX_DEFAULT_STRING_ENCODING ""
  362. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  363. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  364. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
  365. (sizeof(type) < sizeof(Py_ssize_t)) || \
  366. (sizeof(type) > sizeof(Py_ssize_t) && \
  367. likely(v < (type)PY_SSIZE_T_MAX || \
  368. v == (type)PY_SSIZE_T_MAX) && \
  369. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
  370. v == (type)PY_SSIZE_T_MIN))) || \
  371. (sizeof(type) == sizeof(Py_ssize_t) && \
  372. (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
  373. v == (type)PY_SSIZE_T_MAX))) )
  374. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
  375. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  376. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  377. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  378. #define __Pyx_PyBytes_FromString PyBytes_FromString
  379. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  380. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
  381. #if PY_MAJOR_VERSION < 3
  382. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  383. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  384. #else
  385. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  386. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  387. #endif
  388. #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  389. #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  390. #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s)
  391. #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
  392. #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s)
  393. #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s)
  394. #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
  395. #if PY_MAJOR_VERSION < 3
  396. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
  397. {
  398. const Py_UNICODE *u_end = u;
  399. while (*u_end++) ;
  400. return u_end - u - 1;
  401. }
  402. #else
  403. #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
  404. #endif
  405. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  406. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  407. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  408. #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
  409. #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
  410. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  411. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
  412. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  413. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  414. #if CYTHON_COMPILING_IN_CPYTHON
  415. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  416. #else
  417. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  418. #endif
  419. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  420. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  421. static int __Pyx_sys_getdefaultencoding_not_ascii;
  422. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  423. PyObject* sys = NULL;
  424. PyObject* default_encoding = NULL;
  425. PyObject* ascii_chars_u = NULL;
  426. PyObject* ascii_chars_b = NULL;
  427. sys = PyImport_ImportModule("sys");
  428. if (sys == NULL) goto bad;
  429. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  430. if (default_encoding == NULL) goto bad;
  431. if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
  432. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  433. } else {
  434. const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
  435. char ascii_chars[128];
  436. int c;
  437. for (c = 0; c < 128; c++) {
  438. ascii_chars[c] = c;
  439. }
  440. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  441. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  442. if (ascii_chars_u == NULL) goto bad;
  443. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  444. if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  445. PyErr_Format(
  446. PyExc_ValueError,
  447. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  448. default_encoding_c);
  449. goto bad;
  450. }
  451. }
  452. Py_XDECREF(sys);
  453. Py_XDECREF(default_encoding);
  454. Py_XDECREF(ascii_chars_u);
  455. Py_XDECREF(ascii_chars_b);
  456. return 0;
  457. bad:
  458. Py_XDECREF(sys);
  459. Py_XDECREF(default_encoding);
  460. Py_XDECREF(ascii_chars_u);
  461. Py_XDECREF(ascii_chars_b);
  462. return -1;
  463. }
  464. #endif
  465. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  466. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  467. #else
  468. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  469. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  470. static char* __PYX_DEFAULT_STRING_ENCODING;
  471. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  472. PyObject* sys = NULL;
  473. PyObject* default_encoding = NULL;
  474. char* default_encoding_c;
  475. sys = PyImport_ImportModule("sys");
  476. if (sys == NULL) goto bad;
  477. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  478. if (default_encoding == NULL) goto bad;
  479. default_encoding_c = PyBytes_AS_STRING(default_encoding);
  480. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
  481. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  482. Py_DECREF(sys);
  483. Py_DECREF(default_encoding);
  484. return 0;
  485. bad:
  486. Py_XDECREF(sys);
  487. Py_XDECREF(default_encoding);
  488. return -1;
  489. }
  490. #endif
  491. #endif
  492. #ifdef __GNUC__
  493. /* Test for GCC > 2.95 */
  494. #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
  495. #define likely(x) __builtin_expect(!!(x), 1)
  496. #define unlikely(x) __builtin_expect(!!(x), 0)
  497. #else /* __GNUC__ > 2 ... */
  498. #define likely(x) (x)
  499. #define unlikely(x) (x)
  500. #endif /* __GNUC__ > 2 ... */
  501. #else /* __GNUC__ */
  502. #define likely(x) (x)
  503. #define unlikely(x) (x)
  504. #endif /* __GNUC__ */
  505. static PyObject *__pyx_m;
  506. static PyObject *__pyx_d;
  507. static PyObject *__pyx_b;
  508. static PyObject *__pyx_empty_tuple;
  509. static PyObject *__pyx_empty_bytes;
  510. static int __pyx_lineno;
  511. static int __pyx_clineno = 0;
  512. static const char * __pyx_cfilenm= __FILE__;
  513. static const char *__pyx_filename;
  514. static const char *__pyx_f[] = {
  515. "shell.pyx",
  516. };
  517. /*--- Type declarations ---*/
  518. #ifndef CYTHON_REFNANNY
  519. #define CYTHON_REFNANNY 0
  520. #endif
  521. #if CYTHON_REFNANNY
  522. typedef struct {
  523. void (*INCREF)(void*, PyObject*, int);
  524. void (*DECREF)(void*, PyObject*, int);
  525. void (*GOTREF)(void*, PyObject*, int);
  526. void (*GIVEREF)(void*, PyObject*, int);
  527. void* (*SetupContext)(const char*, int, const char*);
  528. void (*FinishContext)(void**);
  529. } __Pyx_RefNannyAPIStruct;
  530. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  531. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  532. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  533. #ifdef WITH_THREAD
  534. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  535. if (acquire_gil) { \
  536. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
  537. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  538. PyGILState_Release(__pyx_gilstate_save); \
  539. } else { \
  540. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  541. }
  542. #else
  543. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  544. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  545. #endif
  546. #define __Pyx_RefNannyFinishContext() \
  547. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  548. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  549. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  550. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  551. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  552. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  553. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  554. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  555. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  556. #else
  557. #define __Pyx_RefNannyDeclarations
  558. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  559. #define __Pyx_RefNannyFinishContext()
  560. #define __Pyx_INCREF(r) Py_INCREF(r)
  561. #define __Pyx_DECREF(r) Py_DECREF(r)
  562. #define __Pyx_GOTREF(r)
  563. #define __Pyx_GIVEREF(r)
  564. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  565. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  566. #define __Pyx_XGOTREF(r)
  567. #define __Pyx_XGIVEREF(r)
  568. #endif /* CYTHON_REFNANNY */
  569. #define __Pyx_XDECREF_SET(r, v) do { \
  570. PyObject *tmp = (PyObject *) r; \
  571. r = v; __Pyx_XDECREF(tmp); \
  572. } while (0)
  573. #define __Pyx_DECREF_SET(r, v) do { \
  574. PyObject *tmp = (PyObject *) r; \
  575. r = v; __Pyx_DECREF(tmp); \
  576. } while (0)
  577. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  578. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  579. #if CYTHON_COMPILING_IN_CPYTHON
  580. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  581. PyTypeObject* tp = Py_TYPE(obj);
  582. if (likely(tp->tp_getattro))
  583. return tp->tp_getattro(obj, attr_name);
  584. #if PY_MAJOR_VERSION < 3
  585. if (likely(tp->tp_getattr))
  586. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  587. #endif
  588. return PyObject_GetAttr(obj, attr_name);
  589. }
  590. #else
  591. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  592. #endif
  593. static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
  594. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
  595. #if CYTHON_COMPILING_IN_CPYTHON
  596. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
  597. #else
  598. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  599. #endif
  600. static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  601. static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
  602. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  603. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
  604. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  605. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
  606. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
  607. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
  608. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
  609. const char* function_name); /*proto*/
  610. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  611. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
  612. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/
  613. #if CYTHON_COMPILING_IN_CPYTHON
  614. #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
  615. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
  616. PyTypeObject* tp = Py_TYPE(obj);
  617. if (likely(tp->tp_setattro))
  618. return tp->tp_setattro(obj, attr_name, value);
  619. #if PY_MAJOR_VERSION < 3
  620. if (likely(tp->tp_setattr))
  621. return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
  622. #endif
  623. return PyObject_SetAttr(obj, attr_name, value);
  624. }
  625. #else
  626. #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
  627. #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
  628. #endif
  629. static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
  630. static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
  631. int result = PySequence_Contains(seq, item);
  632. return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
  633. }
  634. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
  635. #define __Pyx_CyFunction_USED 1
  636. #include <structmember.h>
  637. #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
  638. #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
  639. #define __Pyx_CYFUNCTION_CCLASS 0x04
  640. #define __Pyx_CyFunction_GetClosure(f) \
  641. (((__pyx_CyFunctionObject *) (f))->func_closure)
  642. #define __Pyx_CyFunction_GetClassObj(f) \
  643. (((__pyx_CyFunctionObject *) (f))->func_classobj)
  644. #define __Pyx_CyFunction_Defaults(type, f) \
  645. ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
  646. #define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
  647. ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
  648. typedef struct {
  649. PyCFunctionObject func;
  650. PyObject *func_dict;
  651. PyObject *func_weakreflist;
  652. PyObject *func_name;
  653. PyObject *func_qualname;
  654. PyObject *func_doc;
  655. PyObject *func_globals;
  656. PyObject *func_code;
  657. PyObject *func_closure;
  658. PyObject *func_classobj; /* No-args super() class cell */
  659. void *defaults;
  660. int defaults_pyobjects;
  661. int flags;
  662. PyObject *defaults_tuple; /* Const defaults tuple */
  663. PyObject *defaults_kwdict; /* Const kwonly defaults dict */
  664. PyObject *(*defaults_getter)(PyObject *);
  665. PyObject *func_annotations; /* function annotations dict */
  666. } __pyx_CyFunctionObject;
  667. static PyTypeObject *__pyx_CyFunctionType = 0;
  668. #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
  669. __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
  670. static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
  671. int flags, PyObject* qualname,
  672. PyObject *self,
  673. PyObject *module, PyObject *globals,
  674. PyObject* code);
  675. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
  676. size_t size,
  677. int pyobjects);
  678. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
  679. PyObject *tuple);
  680. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
  681. PyObject *dict);
  682. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
  683. PyObject *dict);
  684. static int __Pyx_CyFunction_init(void);
  685. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
  686. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
  687. PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/
  688. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
  689. PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/
  690. #include <string.h>
  691. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
  692. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
  693. #if PY_MAJOR_VERSION >= 3
  694. #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
  695. #else
  696. #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
  697. #endif
  698. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
  699. static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
  700. #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
  701. static PyObject* __pyx_print = 0;
  702. static PyObject* __pyx_print_kwargs = 0;
  703. #endif
  704. static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/
  705. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  706. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  707. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  708. static int __Pyx_check_binary_version(void);
  709. typedef struct {
  710. int code_line;
  711. PyCodeObject* code_object;
  712. } __Pyx_CodeObjectCacheEntry;
  713. struct __Pyx_CodeObjectCache {
  714. int count;
  715. int max_count;
  716. __Pyx_CodeObjectCacheEntry* entries;
  717. };
  718. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  719. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  720. static PyCodeObject *__pyx_find_code_object(int code_line);
  721. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  722. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  723. int py_line, const char *filename); /*proto*/
  724. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
  725. /* Module declarations from 'lib.Naked.toolshed.c.shell' */
  726. #define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.shell"
  727. int __pyx_module_is_main_lib__Naked__toolshed__c__shell = 0;
  728. /* Implementation of 'lib.Naked.toolshed.c.shell' */
  729. static PyObject *__pyx_builtin_TypeError;
  730. static PyObject *__pyx_builtin_Exception;
  731. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command); /* proto */
  732. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_2run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call); /* proto */
  733. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_4muterun(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command); /* proto */
  734. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_6execute_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */
  735. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_8run_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call); /* proto */
  736. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_10muterun_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */
  737. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_12execute_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */
  738. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_14run_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call); /* proto */
  739. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_16muterun_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */
  740. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
  741. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_2is_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name); /* proto */
  742. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_4get_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name); /* proto */
  743. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_6get_split_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name); /* proto */
  744. static char __pyx_k_e[] = "e";
  745. static char __pyx_k__4[] = "";
  746. static char __pyx_k__6[] = " ";
  747. static char __pyx_k_os[] = "os";
  748. static char __pyx_k_te[] = "te";
  749. static char __pyx_k_cpe[] = "cpe";
  750. static char __pyx_k_doc[] = "__doc__";
  751. static char __pyx_k_end[] = "end";
  752. static char __pyx_k_env[] = "env";
  753. static char __pyx_k_run[] = "run";
  754. static char __pyx_k_sys[] = "sys";
  755. static char __pyx_k_call[] = "call";
  756. static char __pyx_k_exit[] = "exit";
  757. static char __pyx_k_file[] = "file";
  758. static char __pyx_k_init[] = "__init__";
  759. static char __pyx_k_keys[] = "keys";
  760. static char __pyx_k_main[] = "__main__";
  761. static char __pyx_k_name[] = "__name__";
  762. static char __pyx_k_node[] = "node ";
  763. static char __pyx_k_ruby[] = "ruby ";
  764. static char __pyx_k_self[] = "self";
  765. static char __pyx_k_test[] = "__test__";
  766. static char __pyx_k_vars[] = "vars";
  767. static char __pyx_k_debug[] = "debug";
  768. static char __pyx_k_print[] = "print";
  769. static char __pyx_k_shell[] = "shell";
  770. static char __pyx_k_split[] = "split";
  771. static char __pyx_k_write[] = "write";
  772. static char __pyx_k_STDOUT[] = "STDOUT";
  773. static char __pyx_k_import[] = "__import__";
  774. static char __pyx_k_is_var[] = "is_var";
  775. static char __pyx_k_module[] = "__module__";
  776. static char __pyx_k_output[] = "output";
  777. static char __pyx_k_run_js[] = "run_js";
  778. static char __pyx_k_run_rb[] = "run_rb";
  779. static char __pyx_k_stderr[] = "stderr";
  780. static char __pyx_k_stdout[] = "stdout";
  781. static char __pyx_k_command[] = "command";
  782. static char __pyx_k_environ[] = "environ";
  783. static char __pyx_k_execute[] = "execute";
  784. static char __pyx_k_get_var[] = "get_var";
  785. static char __pyx_k_muterun[] = "muterun";
  786. static char __pyx_k_pathsep[] = "pathsep";
  787. static char __pyx_k_prepare[] = "__prepare__";
  788. static char __pyx_k_exitcode[] = "exitcode";
  789. static char __pyx_k_qualname[] = "__qualname__";
  790. static char __pyx_k_response[] = "response";
  791. static char __pyx_k_var_name[] = "var_name";
  792. static char __pyx_k_Exception[] = "Exception";
  793. static char __pyx_k_TypeError[] = "TypeError";
  794. static char __pyx_k_arguments[] = "arguments";
  795. static char __pyx_k_file_path[] = "file_path";
  796. static char __pyx_k_metaclass[] = "__metaclass__";
  797. static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG";
  798. static char __pyx_k_execute_js[] = "execute_js";
  799. static char __pyx_k_execute_rb[] = "execute_rb";
  800. static char __pyx_k_js_command[] = "js_command";
  801. static char __pyx_k_muterun_js[] = "muterun_js";
  802. static char __pyx_k_muterun_rb[] = "muterun_rb";
  803. static char __pyx_k_rb_command[] = "rb_command";
  804. static char __pyx_k_returncode[] = "returncode";
  805. static char __pyx_k_subprocess[] = "subprocess";
  806. static char __pyx_k_Environment[] = "Environment";
  807. static char __pyx_k_NakedObject[] = "NakedObject";
  808. static char __pyx_k_check_output[] = "check_output";
  809. static char __pyx_k_response_obj[] = "response_obj";
  810. static char __pyx_k_Naked_settings[] = "Naked.settings";
  811. static char __pyx_k_suppress_stderr[] = "suppress_stderr";
  812. static char __pyx_k_suppress_stdout[] = "suppress_stdout";
  813. static char __pyx_k_CalledProcessError[] = "CalledProcessError";
  814. static char __pyx_k_Environment___init[] = "Environment.__init__";
  815. static char __pyx_k_Environment_is_var[] = "Environment.is_var";
  816. static char __pyx_k_get_split_var_list[] = "get_split_var_list";
  817. static char __pyx_k_Environment_get_var[] = "Environment.get_var";
  818. static char __pyx_k_Naked_toolshed_types[] = "Naked.toolshed.types";
  819. static char __pyx_k_suppress_exit_status_call[] = "suppress_exit_status_call";
  820. static char __pyx_k_lib_Naked_toolshed_c_shell[] = "lib.Naked.toolshed.c.shell";
  821. static char __pyx_k_Environment_get_split_var_list[] = "Environment.get_split_var_list";
  822. static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).";
  823. static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/shell.pyx";
  824. static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).";
  825. static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).";
  826. static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).";
  827. static char __pyx_k_Naked_Framework_Error_unable_to_5[] = "Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).";
  828. static char __pyx_k_Naked_Framework_Error_unable_to_6[] = "Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).";
  829. static char __pyx_k_Naked_Framework_Error_unable_to_7[] = "Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).";
  830. static char __pyx_k_Naked_Framework_Error_unable_to_8[] = "Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).";
  831. static char __pyx_k_Naked_Framework_Error_unable_to_9[] = "Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).";
  832. static char __pyx_k_Naked_Framework_Error_unable_to_10[] = "Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).";
  833. static PyObject *__pyx_n_s_CalledProcessError;
  834. static PyObject *__pyx_n_s_DEBUG_FLAG;
  835. static PyObject *__pyx_n_s_Environment;
  836. static PyObject *__pyx_n_s_Environment___init;
  837. static PyObject *__pyx_n_s_Environment_get_split_var_list;
  838. static PyObject *__pyx_n_s_Environment_get_var;
  839. static PyObject *__pyx_n_s_Environment_is_var;
  840. static PyObject *__pyx_n_s_Exception;
  841. static PyObject *__pyx_n_s_NakedObject;
  842. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to;
  843. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_10;
  844. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2;
  845. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3;
  846. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4;
  847. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_5;
  848. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_6;
  849. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_7;
  850. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_8;
  851. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_9;
  852. static PyObject *__pyx_n_s_Naked_settings;
  853. static PyObject *__pyx_n_s_Naked_toolshed_types;
  854. static PyObject *__pyx_n_s_STDOUT;
  855. static PyObject *__pyx_n_s_TypeError;
  856. static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li;
  857. static PyObject *__pyx_kp_b__4;
  858. static PyObject *__pyx_kp_s__4;
  859. static PyObject *__pyx_kp_s__6;
  860. static PyObject *__pyx_n_s_arguments;
  861. static PyObject *__pyx_n_s_call;
  862. static PyObject *__pyx_n_s_check_output;
  863. static PyObject *__pyx_n_s_command;
  864. static PyObject *__pyx_n_s_cpe;
  865. static PyObject *__pyx_n_s_debug;
  866. static PyObject *__pyx_n_s_doc;
  867. static PyObject *__pyx_n_s_e;
  868. static PyObject *__pyx_n_s_end;
  869. static PyObject *__pyx_n_s_env;
  870. static PyObject *__pyx_n_s_environ;
  871. static PyObject *__pyx_n_s_execute;
  872. static PyObject *__pyx_n_s_execute_js;
  873. static PyObject *__pyx_n_s_execute_rb;
  874. static PyObject *__pyx_n_s_exit;
  875. static PyObject *__pyx_n_s_exitcode;
  876. static PyObject *__pyx_n_s_file;
  877. static PyObject *__pyx_n_s_file_path;
  878. static PyObject *__pyx_n_s_get_split_var_list;
  879. static PyObject *__pyx_n_s_get_var;
  880. static PyObject *__pyx_n_s_import;
  881. static PyObject *__pyx_n_s_init;
  882. static PyObject *__pyx_n_s_is_var;
  883. static PyObject *__pyx_n_s_js_command;
  884. static PyObject *__pyx_n_s_keys;
  885. static PyObject *__pyx_n_s_lib_Naked_toolshed_c_shell;
  886. static PyObject *__pyx_n_s_main;
  887. static PyObject *__pyx_n_s_metaclass;
  888. static PyObject *__pyx_n_s_module;
  889. static PyObject *__pyx_n_s_muterun;
  890. static PyObject *__pyx_n_s_muterun_js;
  891. static PyObject *__pyx_n_s_muterun_rb;
  892. static PyObject *__pyx_n_s_name;
  893. static PyObject *__pyx_kp_s_node;
  894. static PyObject *__pyx_n_s_os;
  895. static PyObject *__pyx_n_s_output;
  896. static PyObject *__pyx_n_s_pathsep;
  897. static PyObject *__pyx_n_s_prepare;
  898. static PyObject *__pyx_n_s_print;
  899. static PyObject *__pyx_n_s_qualname;
  900. static PyObject *__pyx_n_s_rb_command;
  901. static PyObject *__pyx_n_s_response;
  902. static PyObject *__pyx_n_s_response_obj;
  903. static PyObject *__pyx_n_s_returncode;
  904. static PyObject *__pyx_kp_s_ruby;
  905. static PyObject *__pyx_n_s_run;
  906. static PyObject *__pyx_n_s_run_js;
  907. static PyObject *__pyx_n_s_run_rb;
  908. static PyObject *__pyx_n_s_self;
  909. static PyObject *__pyx_n_s_shell;
  910. static PyObject *__pyx_n_s_split;
  911. static PyObject *__pyx_n_s_stderr;
  912. static PyObject *__pyx_n_s_stdout;
  913. static PyObject *__pyx_n_s_subprocess;
  914. static PyObject *__pyx_n_s_suppress_exit_status_call;
  915. static PyObject *__pyx_n_s_suppress_stderr;
  916. static PyObject *__pyx_n_s_suppress_stdout;
  917. static PyObject *__pyx_n_s_sys;
  918. static PyObject *__pyx_n_s_te;
  919. static PyObject *__pyx_n_s_test;
  920. static PyObject *__pyx_n_s_var_name;
  921. static PyObject *__pyx_n_s_vars;
  922. static PyObject *__pyx_n_s_write;
  923. static PyObject *__pyx_int_0;
  924. static PyObject *__pyx_int_1;
  925. static PyObject *__pyx_tuple_;
  926. static PyObject *__pyx_tuple__2;
  927. static PyObject *__pyx_tuple__3;
  928. static PyObject *__pyx_tuple__5;
  929. static PyObject *__pyx_tuple__7;
  930. static PyObject *__pyx_tuple__8;
  931. static PyObject *__pyx_tuple__9;
  932. static PyObject *__pyx_tuple__10;
  933. static PyObject *__pyx_tuple__11;
  934. static PyObject *__pyx_tuple__12;
  935. static PyObject *__pyx_tuple__13;
  936. static PyObject *__pyx_tuple__14;
  937. static PyObject *__pyx_tuple__15;
  938. static PyObject *__pyx_tuple__16;
  939. static PyObject *__pyx_tuple__18;
  940. static PyObject *__pyx_tuple__20;
  941. static PyObject *__pyx_tuple__22;
  942. static PyObject *__pyx_tuple__24;
  943. static PyObject *__pyx_tuple__26;
  944. static PyObject *__pyx_tuple__28;
  945. static PyObject *__pyx_tuple__30;
  946. static PyObject *__pyx_tuple__32;
  947. static PyObject *__pyx_tuple__34;
  948. static PyObject *__pyx_tuple__36;
  949. static PyObject *__pyx_tuple__38;
  950. static PyObject *__pyx_tuple__40;
  951. static PyObject *__pyx_codeobj__17;
  952. static PyObject *__pyx_codeobj__19;
  953. static PyObject *__pyx_codeobj__21;
  954. static PyObject *__pyx_codeobj__23;
  955. static PyObject *__pyx_codeobj__25;
  956. static PyObject *__pyx_codeobj__27;
  957. static PyObject *__pyx_codeobj__29;
  958. static PyObject *__pyx_codeobj__31;
  959. static PyObject *__pyx_codeobj__33;
  960. static PyObject *__pyx_codeobj__35;
  961. static PyObject *__pyx_codeobj__37;
  962. static PyObject *__pyx_codeobj__39;
  963. static PyObject *__pyx_codeobj__41;
  964. /* "lib/Naked/toolshed/c/shell.pyx":16
  965. * # returns False if exit status != 0
  966. * #------------------------------------------------------------------------------
  967. * def execute(command): # <<<<<<<<<<<<<<
  968. * try:
  969. * response = subprocess.call(command, shell=True)
  970. */
  971. /* Python wrapper */
  972. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_1execute(PyObject *__pyx_self, PyObject *__pyx_v_command); /*proto*/
  973. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_1execute = {__Pyx_NAMESTR("execute"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_1execute, METH_O, __Pyx_DOCSTR(0)};
  974. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_1execute(PyObject *__pyx_self, PyObject *__pyx_v_command) {
  975. PyObject *__pyx_r = 0;
  976. __Pyx_RefNannyDeclarations
  977. __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  978. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_execute(__pyx_self, ((PyObject *)__pyx_v_command));
  979. /* function exit code */
  980. __Pyx_RefNannyFinishContext();
  981. return __pyx_r;
  982. }
  983. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command) {
  984. PyObject *__pyx_v_response = NULL;
  985. PyObject *__pyx_v_cpe = NULL;
  986. CYTHON_UNUSED PyObject *__pyx_v_te = NULL;
  987. PyObject *__pyx_v_e = NULL;
  988. PyObject *__pyx_r = NULL;
  989. __Pyx_RefNannyDeclarations
  990. PyObject *__pyx_t_1 = NULL;
  991. PyObject *__pyx_t_2 = NULL;
  992. PyObject *__pyx_t_3 = NULL;
  993. PyObject *__pyx_t_4 = NULL;
  994. PyObject *__pyx_t_5 = NULL;
  995. PyObject *__pyx_t_6 = NULL;
  996. PyObject *__pyx_t_7 = NULL;
  997. int __pyx_t_8;
  998. int __pyx_t_9;
  999. PyObject *__pyx_t_10 = NULL;
  1000. PyObject *__pyx_t_11 = NULL;
  1001. PyObject *__pyx_t_12 = NULL;
  1002. PyObject *__pyx_t_13 = NULL;
  1003. PyObject *__pyx_t_14 = NULL;
  1004. PyObject *__pyx_t_15 = NULL;
  1005. PyObject *__pyx_t_16 = NULL;
  1006. PyObject *__pyx_t_17 = NULL;
  1007. int __pyx_lineno = 0;
  1008. const char *__pyx_filename = NULL;
  1009. int __pyx_clineno = 0;
  1010. __Pyx_RefNannySetupContext("execute", 0);
  1011. /* "lib/Naked/toolshed/c/shell.pyx":17
  1012. * #------------------------------------------------------------------------------
  1013. * def execute(command):
  1014. * try: # <<<<<<<<<<<<<<
  1015. * response = subprocess.call(command, shell=True)
  1016. * if response == 0:
  1017. */
  1018. {
  1019. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  1020. __Pyx_XGOTREF(__pyx_t_1);
  1021. __Pyx_XGOTREF(__pyx_t_2);
  1022. __Pyx_XGOTREF(__pyx_t_3);
  1023. /*try:*/ {
  1024. /* "lib/Naked/toolshed/c/shell.pyx":18
  1025. * def execute(command):
  1026. * try:
  1027. * response = subprocess.call(command, shell=True) # <<<<<<<<<<<<<<
  1028. * if response == 0:
  1029. * return True
  1030. */
  1031. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1032. __Pyx_GOTREF(__pyx_t_4);
  1033. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_call); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1034. __Pyx_GOTREF(__pyx_t_5);
  1035. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1036. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1037. __Pyx_GOTREF(__pyx_t_4);
  1038. __Pyx_INCREF(__pyx_v_command);
  1039. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_command);
  1040. __Pyx_GIVEREF(__pyx_v_command);
  1041. __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1042. __Pyx_GOTREF(__pyx_t_6);
  1043. if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shell, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1044. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1045. __Pyx_GOTREF(__pyx_t_7);
  1046. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1047. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1048. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1049. __pyx_v_response = __pyx_t_7;
  1050. __pyx_t_7 = 0;
  1051. /* "lib/Naked/toolshed/c/shell.pyx":19
  1052. * try:
  1053. * response = subprocess.call(command, shell=True)
  1054. * if response == 0: # <<<<<<<<<<<<<<
  1055. * return True
  1056. * else:
  1057. */
  1058. __pyx_t_7 = PyObject_RichCompare(__pyx_v_response, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1059. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1060. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1061. if (__pyx_t_8) {
  1062. /* "lib/Naked/toolshed/c/shell.pyx":20
  1063. * response = subprocess.call(command, shell=True)
  1064. * if response == 0:
  1065. * return True # <<<<<<<<<<<<<<
  1066. * else:
  1067. * return False
  1068. */
  1069. __Pyx_XDECREF(__pyx_r);
  1070. __Pyx_INCREF(Py_True);
  1071. __pyx_r = Py_True;
  1072. goto __pyx_L7_try_return;
  1073. }
  1074. /*else*/ {
  1075. /* "lib/Naked/toolshed/c/shell.pyx":22
  1076. * return True
  1077. * else:
  1078. * return False # <<<<<<<<<<<<<<
  1079. * except subprocess.CalledProcessError as cpe:
  1080. * try:
  1081. */
  1082. __Pyx_XDECREF(__pyx_r);
  1083. __Pyx_INCREF(Py_False);
  1084. __pyx_r = Py_False;
  1085. goto __pyx_L7_try_return;
  1086. }
  1087. }
  1088. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  1089. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  1090. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  1091. goto __pyx_L10_try_end;
  1092. __pyx_L3_error:;
  1093. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  1094. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1095. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  1096. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  1097. /* "lib/Naked/toolshed/c/shell.pyx":23
  1098. * else:
  1099. * return False
  1100. * except subprocess.CalledProcessError as cpe: # <<<<<<<<<<<<<<
  1101. * try:
  1102. * sys.stderr.write(cpe.output)
  1103. */
  1104. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1105. __Pyx_GOTREF(__pyx_t_7);
  1106. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1107. __Pyx_GOTREF(__pyx_t_6);
  1108. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1109. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_6);
  1110. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1111. if (__pyx_t_9) {
  1112. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1113. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1114. __Pyx_GOTREF(__pyx_t_6);
  1115. __Pyx_GOTREF(__pyx_t_7);
  1116. __Pyx_GOTREF(__pyx_t_4);
  1117. __Pyx_INCREF(__pyx_t_7);
  1118. __pyx_v_cpe = __pyx_t_7;
  1119. /* "lib/Naked/toolshed/c/shell.pyx":24
  1120. * return False
  1121. * except subprocess.CalledProcessError as cpe:
  1122. * try: # <<<<<<<<<<<<<<
  1123. * sys.stderr.write(cpe.output)
  1124. * except TypeError as te:
  1125. */
  1126. {
  1127. __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
  1128. __Pyx_XGOTREF(__pyx_t_10);
  1129. __Pyx_XGOTREF(__pyx_t_11);
  1130. __Pyx_XGOTREF(__pyx_t_12);
  1131. /*try:*/ {
  1132. /* "lib/Naked/toolshed/c/shell.pyx":25
  1133. * except subprocess.CalledProcessError as cpe:
  1134. * try:
  1135. * sys.stderr.write(cpe.output) # <<<<<<<<<<<<<<
  1136. * except TypeError as te:
  1137. * sys.stderr.write(str(cpe.output))
  1138. */
  1139. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
  1140. __Pyx_GOTREF(__pyx_t_5);
  1141. __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
  1142. __Pyx_GOTREF(__pyx_t_13);
  1143. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1144. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
  1145. __Pyx_GOTREF(__pyx_t_5);
  1146. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  1147. __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
  1148. __Pyx_GOTREF(__pyx_t_13);
  1149. __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
  1150. __Pyx_GOTREF(__pyx_t_14);
  1151. PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13);
  1152. __Pyx_GIVEREF(__pyx_t_13);
  1153. __pyx_t_13 = 0;
  1154. __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
  1155. __Pyx_GOTREF(__pyx_t_13);
  1156. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1157. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  1158. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  1159. }
  1160. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  1161. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  1162. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  1163. goto __pyx_L21_try_end;
  1164. __pyx_L14_error:;
  1165. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  1166. __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  1167. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  1168. /* "lib/Naked/toolshed/c/shell.pyx":26
  1169. * try:
  1170. * sys.stderr.write(cpe.output)
  1171. * except TypeError as te: # <<<<<<<<<<<<<<
  1172. * sys.stderr.write(str(cpe.output))
  1173. * except Exception as e:
  1174. */
  1175. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
  1176. if (__pyx_t_9) {
  1177. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1178. if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
  1179. __Pyx_GOTREF(__pyx_t_13);
  1180. __Pyx_GOTREF(__pyx_t_14);
  1181. __Pyx_GOTREF(__pyx_t_5);
  1182. __Pyx_INCREF(__pyx_t_14);
  1183. __pyx_v_te = __pyx_t_14;
  1184. /* "lib/Naked/toolshed/c/shell.pyx":27
  1185. * sys.stderr.write(cpe.output)
  1186. * except TypeError as te:
  1187. * sys.stderr.write(str(cpe.output)) # <<<<<<<<<<<<<<
  1188. * except Exception as e:
  1189. * if DEBUG_FLAG:
  1190. */
  1191. __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
  1192. __Pyx_GOTREF(__pyx_t_15);
  1193. __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
  1194. __Pyx_GOTREF(__pyx_t_16);
  1195. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  1196. __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
  1197. __Pyx_GOTREF(__pyx_t_15);
  1198. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  1199. __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
  1200. __Pyx_GOTREF(__pyx_t_16);
  1201. __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
  1202. __Pyx_GOTREF(__pyx_t_17);
  1203. PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16);
  1204. __Pyx_GIVEREF(__pyx_t_16);
  1205. __pyx_t_16 = 0;
  1206. __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
  1207. __Pyx_GOTREF(__pyx_t_16);
  1208. __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  1209. __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
  1210. __Pyx_GOTREF(__pyx_t_17);
  1211. PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16);
  1212. __Pyx_GIVEREF(__pyx_t_16);
  1213. __pyx_t_16 = 0;
  1214. __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
  1215. __Pyx_GOTREF(__pyx_t_16);
  1216. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  1217. __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  1218. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  1219. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  1220. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  1221. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1222. goto __pyx_L15_exception_handled;
  1223. }
  1224. goto __pyx_L16_except_error;
  1225. __pyx_L16_except_error:;
  1226. __Pyx_XGIVEREF(__pyx_t_10);
  1227. __Pyx_XGIVEREF(__pyx_t_11);
  1228. __Pyx_XGIVEREF(__pyx_t_12);
  1229. __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
  1230. goto __pyx_L5_except_error;
  1231. __pyx_L15_exception_handled:;
  1232. __Pyx_XGIVEREF(__pyx_t_10);
  1233. __Pyx_XGIVEREF(__pyx_t_11);
  1234. __Pyx_XGIVEREF(__pyx_t_12);
  1235. __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
  1236. __pyx_L21_try_end:;
  1237. }
  1238. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1239. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1240. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1241. goto __pyx_L4_exception_handled;
  1242. }
  1243. /* "lib/Naked/toolshed/c/shell.pyx":28
  1244. * except TypeError as te:
  1245. * sys.stderr.write(str(cpe.output))
  1246. * except Exception as e: # <<<<<<<<<<<<<<
  1247. * if DEBUG_FLAG:
  1248. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).")
  1249. */
  1250. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  1251. if (__pyx_t_9) {
  1252. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1253. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1254. __Pyx_GOTREF(__pyx_t_4);
  1255. __Pyx_GOTREF(__pyx_t_7);
  1256. __Pyx_GOTREF(__pyx_t_6);
  1257. __Pyx_INCREF(__pyx_t_7);
  1258. __pyx_v_e = __pyx_t_7;
  1259. /* "lib/Naked/toolshed/c/shell.pyx":29
  1260. * sys.stderr.write(str(cpe.output))
  1261. * except Exception as e:
  1262. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  1263. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).")
  1264. * raise e
  1265. */
  1266. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1267. __Pyx_GOTREF(__pyx_t_5);
  1268. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1269. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1270. if (__pyx_t_8) {
  1271. /* "lib/Naked/toolshed/c/shell.pyx":30
  1272. * except Exception as e:
  1273. * if DEBUG_FLAG:
  1274. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  1275. * raise e
  1276. *
  1277. */
  1278. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1279. __Pyx_GOTREF(__pyx_t_5);
  1280. __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1281. __Pyx_GOTREF(__pyx_t_14);
  1282. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1283. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1284. __Pyx_GOTREF(__pyx_t_5);
  1285. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  1286. __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1287. __Pyx_GOTREF(__pyx_t_14);
  1288. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1289. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  1290. goto __pyx_L26;
  1291. }
  1292. __pyx_L26:;
  1293. /* "lib/Naked/toolshed/c/shell.pyx":31
  1294. * if DEBUG_FLAG:
  1295. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).")
  1296. * raise e # <<<<<<<<<<<<<<
  1297. *
  1298. *
  1299. */
  1300. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  1301. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1302. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1303. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1304. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1305. goto __pyx_L4_exception_handled;
  1306. }
  1307. goto __pyx_L5_except_error;
  1308. __pyx_L5_except_error:;
  1309. __Pyx_XGIVEREF(__pyx_t_1);
  1310. __Pyx_XGIVEREF(__pyx_t_2);
  1311. __Pyx_XGIVEREF(__pyx_t_3);
  1312. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1313. goto __pyx_L1_error;
  1314. __pyx_L7_try_return:;
  1315. __Pyx_XGIVEREF(__pyx_t_1);
  1316. __Pyx_XGIVEREF(__pyx_t_2);
  1317. __Pyx_XGIVEREF(__pyx_t_3);
  1318. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1319. goto __pyx_L0;
  1320. __pyx_L4_exception_handled:;
  1321. __Pyx_XGIVEREF(__pyx_t_1);
  1322. __Pyx_XGIVEREF(__pyx_t_2);
  1323. __Pyx_XGIVEREF(__pyx_t_3);
  1324. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1325. __pyx_L10_try_end:;
  1326. }
  1327. /* "lib/Naked/toolshed/c/shell.pyx":16
  1328. * # returns False if exit status != 0
  1329. * #------------------------------------------------------------------------------
  1330. * def execute(command): # <<<<<<<<<<<<<<
  1331. * try:
  1332. * response = subprocess.call(command, shell=True)
  1333. */
  1334. /* function exit code */
  1335. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  1336. goto __pyx_L0;
  1337. __pyx_L1_error:;
  1338. __Pyx_XDECREF(__pyx_t_4);
  1339. __Pyx_XDECREF(__pyx_t_5);
  1340. __Pyx_XDECREF(__pyx_t_6);
  1341. __Pyx_XDECREF(__pyx_t_7);
  1342. __Pyx_XDECREF(__pyx_t_13);
  1343. __Pyx_XDECREF(__pyx_t_14);
  1344. __Pyx_XDECREF(__pyx_t_15);
  1345. __Pyx_XDECREF(__pyx_t_16);
  1346. __Pyx_XDECREF(__pyx_t_17);
  1347. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1348. __pyx_r = NULL;
  1349. __pyx_L0:;
  1350. __Pyx_XDECREF(__pyx_v_response);
  1351. __Pyx_XDECREF(__pyx_v_cpe);
  1352. __Pyx_XDECREF(__pyx_v_te);
  1353. __Pyx_XDECREF(__pyx_v_e);
  1354. __Pyx_XGIVEREF(__pyx_r);
  1355. __Pyx_RefNannyFinishContext();
  1356. return __pyx_r;
  1357. }
  1358. /* "lib/Naked/toolshed/c/shell.pyx":44
  1359. * # suppress_exit_status_call = False >> raise SystemExit with the returned status code
  1360. * #------------------------------------------------------------------------------
  1361. * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  1362. * try:
  1363. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  1364. */
  1365. /* Python wrapper */
  1366. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_3run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1367. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_3run = {__Pyx_NAMESTR("run"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_3run, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1368. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_3run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1369. PyObject *__pyx_v_command = 0;
  1370. PyObject *__pyx_v_suppress_stdout = 0;
  1371. PyObject *__pyx_v_suppress_stderr = 0;
  1372. PyObject *__pyx_v_suppress_exit_status_call = 0;
  1373. int __pyx_lineno = 0;
  1374. const char *__pyx_filename = NULL;
  1375. int __pyx_clineno = 0;
  1376. PyObject *__pyx_r = 0;
  1377. __Pyx_RefNannyDeclarations
  1378. __Pyx_RefNannySetupContext("run (wrapper)", 0);
  1379. {
  1380. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_command,&__pyx_n_s_suppress_stdout,&__pyx_n_s_suppress_stderr,&__pyx_n_s_suppress_exit_status_call,0};
  1381. PyObject* values[4] = {0,0,0,0};
  1382. values[1] = ((PyObject *)Py_False);
  1383. values[2] = ((PyObject *)Py_False);
  1384. values[3] = ((PyObject *)Py_True);
  1385. if (unlikely(__pyx_kwds)) {
  1386. Py_ssize_t kw_args;
  1387. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1388. switch (pos_args) {
  1389. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1390. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1391. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1392. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1393. case 0: break;
  1394. default: goto __pyx_L5_argtuple_error;
  1395. }
  1396. kw_args = PyDict_Size(__pyx_kwds);
  1397. switch (pos_args) {
  1398. case 0:
  1399. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_command)) != 0)) kw_args--;
  1400. else goto __pyx_L5_argtuple_error;
  1401. case 1:
  1402. if (kw_args > 0) {
  1403. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stdout);
  1404. if (value) { values[1] = value; kw_args--; }
  1405. }
  1406. case 2:
  1407. if (kw_args > 0) {
  1408. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stderr);
  1409. if (value) { values[2] = value; kw_args--; }
  1410. }
  1411. case 3:
  1412. if (kw_args > 0) {
  1413. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_exit_status_call);
  1414. if (value) { values[3] = value; kw_args--; }
  1415. }
  1416. }
  1417. if (unlikely(kw_args > 0)) {
  1418. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1419. }
  1420. } else {
  1421. switch (PyTuple_GET_SIZE(__pyx_args)) {
  1422. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1423. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1424. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1425. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1426. break;
  1427. default: goto __pyx_L5_argtuple_error;
  1428. }
  1429. }
  1430. __pyx_v_command = values[0];
  1431. __pyx_v_suppress_stdout = values[1];
  1432. __pyx_v_suppress_stderr = values[2];
  1433. __pyx_v_suppress_exit_status_call = values[3];
  1434. }
  1435. goto __pyx_L4_argument_unpacking_done;
  1436. __pyx_L5_argtuple_error:;
  1437. __Pyx_RaiseArgtupleInvalid("run", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1438. __pyx_L3_error:;
  1439. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1440. __Pyx_RefNannyFinishContext();
  1441. return NULL;
  1442. __pyx_L4_argument_unpacking_done:;
  1443. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_2run(__pyx_self, __pyx_v_command, __pyx_v_suppress_stdout, __pyx_v_suppress_stderr, __pyx_v_suppress_exit_status_call);
  1444. /* function exit code */
  1445. __Pyx_RefNannyFinishContext();
  1446. return __pyx_r;
  1447. }
  1448. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_2run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call) {
  1449. PyObject *__pyx_v_response = NULL;
  1450. PyObject *__pyx_v_cpe = NULL;
  1451. CYTHON_UNUSED PyObject *__pyx_v_te = NULL;
  1452. PyObject *__pyx_v_e = NULL;
  1453. PyObject *__pyx_r = NULL;
  1454. __Pyx_RefNannyDeclarations
  1455. PyObject *__pyx_t_1 = NULL;
  1456. PyObject *__pyx_t_2 = NULL;
  1457. PyObject *__pyx_t_3 = NULL;
  1458. PyObject *__pyx_t_4 = NULL;
  1459. PyObject *__pyx_t_5 = NULL;
  1460. PyObject *__pyx_t_6 = NULL;
  1461. PyObject *__pyx_t_7 = NULL;
  1462. PyObject *__pyx_t_8 = NULL;
  1463. int __pyx_t_9;
  1464. int __pyx_t_10;
  1465. int __pyx_t_11;
  1466. PyObject *__pyx_t_12 = NULL;
  1467. PyObject *__pyx_t_13 = NULL;
  1468. PyObject *__pyx_t_14 = NULL;
  1469. PyObject *__pyx_t_15 = NULL;
  1470. PyObject *__pyx_t_16 = NULL;
  1471. PyObject *__pyx_t_17 = NULL;
  1472. PyObject *__pyx_t_18 = NULL;
  1473. int __pyx_lineno = 0;
  1474. const char *__pyx_filename = NULL;
  1475. int __pyx_clineno = 0;
  1476. __Pyx_RefNannySetupContext("run", 0);
  1477. /* "lib/Naked/toolshed/c/shell.pyx":45
  1478. * #------------------------------------------------------------------------------
  1479. * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True):
  1480. * try: # <<<<<<<<<<<<<<
  1481. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  1482. * if not suppress_stdout:
  1483. */
  1484. {
  1485. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  1486. __Pyx_XGOTREF(__pyx_t_1);
  1487. __Pyx_XGOTREF(__pyx_t_2);
  1488. __Pyx_XGOTREF(__pyx_t_3);
  1489. /*try:*/ {
  1490. /* "lib/Naked/toolshed/c/shell.pyx":46
  1491. * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True):
  1492. * try:
  1493. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) # <<<<<<<<<<<<<<
  1494. * if not suppress_stdout:
  1495. * print(response)
  1496. */
  1497. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1498. __Pyx_GOTREF(__pyx_t_4);
  1499. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_check_output); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1500. __Pyx_GOTREF(__pyx_t_5);
  1501. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1502. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1503. __Pyx_GOTREF(__pyx_t_4);
  1504. __Pyx_INCREF(__pyx_v_command);
  1505. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_command);
  1506. __Pyx_GIVEREF(__pyx_v_command);
  1507. __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1508. __Pyx_GOTREF(__pyx_t_6);
  1509. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1510. __Pyx_GOTREF(__pyx_t_7);
  1511. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_STDOUT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1512. __Pyx_GOTREF(__pyx_t_8);
  1513. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1514. if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_stderr, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1515. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1516. if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shell, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1517. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1518. __Pyx_GOTREF(__pyx_t_8);
  1519. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1520. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1521. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1522. __pyx_v_response = __pyx_t_8;
  1523. __pyx_t_8 = 0;
  1524. /* "lib/Naked/toolshed/c/shell.pyx":47
  1525. * try:
  1526. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  1527. * if not suppress_stdout: # <<<<<<<<<<<<<<
  1528. * print(response)
  1529. * return response
  1530. */
  1531. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_stdout); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1532. __pyx_t_10 = ((!__pyx_t_9) != 0);
  1533. if (__pyx_t_10) {
  1534. /* "lib/Naked/toolshed/c/shell.pyx":48
  1535. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  1536. * if not suppress_stdout:
  1537. * print(response) # <<<<<<<<<<<<<<
  1538. * return response
  1539. * except subprocess.CalledProcessError as cpe:
  1540. */
  1541. if (__Pyx_PrintOne(0, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1542. goto __pyx_L11;
  1543. }
  1544. __pyx_L11:;
  1545. /* "lib/Naked/toolshed/c/shell.pyx":49
  1546. * if not suppress_stdout:
  1547. * print(response)
  1548. * return response # <<<<<<<<<<<<<<
  1549. * except subprocess.CalledProcessError as cpe:
  1550. * if not suppress_stderr: # error in existing application (non-zero exit status)
  1551. */
  1552. __Pyx_XDECREF(__pyx_r);
  1553. __Pyx_INCREF(__pyx_v_response);
  1554. __pyx_r = __pyx_v_response;
  1555. goto __pyx_L7_try_return;
  1556. }
  1557. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  1558. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  1559. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  1560. goto __pyx_L10_try_end;
  1561. __pyx_L3_error:;
  1562. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  1563. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  1564. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1565. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  1566. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  1567. /* "lib/Naked/toolshed/c/shell.pyx":50
  1568. * print(response)
  1569. * return response
  1570. * except subprocess.CalledProcessError as cpe: # <<<<<<<<<<<<<<
  1571. * if not suppress_stderr: # error in existing application (non-zero exit status)
  1572. * try:
  1573. */
  1574. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1575. __Pyx_GOTREF(__pyx_t_8);
  1576. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1577. __Pyx_GOTREF(__pyx_t_6);
  1578. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1579. __pyx_t_11 = PyErr_ExceptionMatches(__pyx_t_6);
  1580. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1581. if (__pyx_t_11) {
  1582. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1583. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1584. __Pyx_GOTREF(__pyx_t_6);
  1585. __Pyx_GOTREF(__pyx_t_8);
  1586. __Pyx_GOTREF(__pyx_t_4);
  1587. __Pyx_INCREF(__pyx_t_8);
  1588. __pyx_v_cpe = __pyx_t_8;
  1589. /* "lib/Naked/toolshed/c/shell.pyx":51
  1590. * return response
  1591. * except subprocess.CalledProcessError as cpe:
  1592. * if not suppress_stderr: # error in existing application (non-zero exit status) # <<<<<<<<<<<<<<
  1593. * try:
  1594. * sys.stderr.write(cpe.output)
  1595. */
  1596. __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_stderr); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1597. __pyx_t_9 = ((!__pyx_t_10) != 0);
  1598. if (__pyx_t_9) {
  1599. /* "lib/Naked/toolshed/c/shell.pyx":52
  1600. * except subprocess.CalledProcessError as cpe:
  1601. * if not suppress_stderr: # error in existing application (non-zero exit status)
  1602. * try: # <<<<<<<<<<<<<<
  1603. * sys.stderr.write(cpe.output)
  1604. * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output
  1605. */
  1606. {
  1607. __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
  1608. __Pyx_XGOTREF(__pyx_t_12);
  1609. __Pyx_XGOTREF(__pyx_t_13);
  1610. __Pyx_XGOTREF(__pyx_t_14);
  1611. /*try:*/ {
  1612. /* "lib/Naked/toolshed/c/shell.pyx":53
  1613. * if not suppress_stderr: # error in existing application (non-zero exit status)
  1614. * try:
  1615. * sys.stderr.write(cpe.output) # <<<<<<<<<<<<<<
  1616. * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output
  1617. * sys.stderr.write(str(cpe.output))
  1618. */
  1619. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
  1620. __Pyx_GOTREF(__pyx_t_5);
  1621. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
  1622. __Pyx_GOTREF(__pyx_t_7);
  1623. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1624. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
  1625. __Pyx_GOTREF(__pyx_t_5);
  1626. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1627. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
  1628. __Pyx_GOTREF(__pyx_t_7);
  1629. __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
  1630. __Pyx_GOTREF(__pyx_t_15);
  1631. PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7);
  1632. __Pyx_GIVEREF(__pyx_t_7);
  1633. __pyx_t_7 = 0;
  1634. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
  1635. __Pyx_GOTREF(__pyx_t_7);
  1636. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1637. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  1638. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1639. }
  1640. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  1641. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  1642. __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  1643. goto __pyx_L22_try_end;
  1644. __pyx_L15_error:;
  1645. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  1646. __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
  1647. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  1648. /* "lib/Naked/toolshed/c/shell.pyx":54
  1649. * try:
  1650. * sys.stderr.write(cpe.output)
  1651. * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output # <<<<<<<<<<<<<<
  1652. * sys.stderr.write(str(cpe.output))
  1653. * if not suppress_exit_status_call:
  1654. */
  1655. __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
  1656. if (__pyx_t_11) {
  1657. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1658. if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_15, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
  1659. __Pyx_GOTREF(__pyx_t_7);
  1660. __Pyx_GOTREF(__pyx_t_15);
  1661. __Pyx_GOTREF(__pyx_t_5);
  1662. __Pyx_INCREF(__pyx_t_15);
  1663. __pyx_v_te = __pyx_t_15;
  1664. /* "lib/Naked/toolshed/c/shell.pyx":55
  1665. * sys.stderr.write(cpe.output)
  1666. * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output
  1667. * sys.stderr.write(str(cpe.output)) # <<<<<<<<<<<<<<
  1668. * if not suppress_exit_status_call:
  1669. * if cpe.returncode:
  1670. */
  1671. __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
  1672. __Pyx_GOTREF(__pyx_t_16);
  1673. __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_stderr); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
  1674. __Pyx_GOTREF(__pyx_t_17);
  1675. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  1676. __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_write); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
  1677. __Pyx_GOTREF(__pyx_t_16);
  1678. __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  1679. __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
  1680. __Pyx_GOTREF(__pyx_t_17);
  1681. __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
  1682. __Pyx_GOTREF(__pyx_t_18);
  1683. PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17);
  1684. __Pyx_GIVEREF(__pyx_t_17);
  1685. __pyx_t_17 = 0;
  1686. __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
  1687. __Pyx_GOTREF(__pyx_t_17);
  1688. __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  1689. __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
  1690. __Pyx_GOTREF(__pyx_t_18);
  1691. PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17);
  1692. __Pyx_GIVEREF(__pyx_t_17);
  1693. __pyx_t_17 = 0;
  1694. __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
  1695. __Pyx_GOTREF(__pyx_t_17);
  1696. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  1697. __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  1698. __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  1699. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1700. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  1701. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1702. goto __pyx_L16_exception_handled;
  1703. }
  1704. goto __pyx_L17_except_error;
  1705. __pyx_L17_except_error:;
  1706. __Pyx_XGIVEREF(__pyx_t_12);
  1707. __Pyx_XGIVEREF(__pyx_t_13);
  1708. __Pyx_XGIVEREF(__pyx_t_14);
  1709. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  1710. goto __pyx_L5_except_error;
  1711. __pyx_L16_exception_handled:;
  1712. __Pyx_XGIVEREF(__pyx_t_12);
  1713. __Pyx_XGIVEREF(__pyx_t_13);
  1714. __Pyx_XGIVEREF(__pyx_t_14);
  1715. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  1716. __pyx_L22_try_end:;
  1717. }
  1718. goto __pyx_L14;
  1719. }
  1720. __pyx_L14:;
  1721. /* "lib/Naked/toolshed/c/shell.pyx":56
  1722. * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output
  1723. * sys.stderr.write(str(cpe.output))
  1724. * if not suppress_exit_status_call: # <<<<<<<<<<<<<<
  1725. * if cpe.returncode:
  1726. * sys.exit(cpe.returncode)
  1727. */
  1728. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_exit_status_call); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1729. __pyx_t_10 = ((!__pyx_t_9) != 0);
  1730. if (__pyx_t_10) {
  1731. /* "lib/Naked/toolshed/c/shell.pyx":57
  1732. * sys.stderr.write(str(cpe.output))
  1733. * if not suppress_exit_status_call:
  1734. * if cpe.returncode: # <<<<<<<<<<<<<<
  1735. * sys.exit(cpe.returncode)
  1736. * else:
  1737. */
  1738. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1739. __Pyx_GOTREF(__pyx_t_5);
  1740. __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1741. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1742. if (__pyx_t_10) {
  1743. /* "lib/Naked/toolshed/c/shell.pyx":58
  1744. * if not suppress_exit_status_call:
  1745. * if cpe.returncode:
  1746. * sys.exit(cpe.returncode) # <<<<<<<<<<<<<<
  1747. * else:
  1748. * sys.exit(1)
  1749. */
  1750. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1751. __Pyx_GOTREF(__pyx_t_5);
  1752. __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1753. __Pyx_GOTREF(__pyx_t_15);
  1754. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1755. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1756. __Pyx_GOTREF(__pyx_t_5);
  1757. __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1758. __Pyx_GOTREF(__pyx_t_7);
  1759. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  1760. __Pyx_GIVEREF(__pyx_t_5);
  1761. __pyx_t_5 = 0;
  1762. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1763. __Pyx_GOTREF(__pyx_t_5);
  1764. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  1765. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1766. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1767. goto __pyx_L26;
  1768. }
  1769. /*else*/ {
  1770. /* "lib/Naked/toolshed/c/shell.pyx":60
  1771. * sys.exit(cpe.returncode)
  1772. * else:
  1773. * sys.exit(1) # <<<<<<<<<<<<<<
  1774. * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable)
  1775. * except Exception as e:
  1776. */
  1777. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1778. __Pyx_GOTREF(__pyx_t_5);
  1779. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1780. __Pyx_GOTREF(__pyx_t_7);
  1781. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1782. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1783. __Pyx_GOTREF(__pyx_t_5);
  1784. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1785. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1786. }
  1787. __pyx_L26:;
  1788. goto __pyx_L25;
  1789. }
  1790. __pyx_L25:;
  1791. /* "lib/Naked/toolshed/c/shell.pyx":61
  1792. * else:
  1793. * sys.exit(1)
  1794. * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) # <<<<<<<<<<<<<<
  1795. * except Exception as e:
  1796. * if DEBUG_FLAG:
  1797. */
  1798. __Pyx_XDECREF(__pyx_r);
  1799. __Pyx_INCREF(Py_False);
  1800. __pyx_r = Py_False;
  1801. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1802. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1803. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1804. goto __pyx_L6_except_return;
  1805. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1806. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1807. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1808. goto __pyx_L4_exception_handled;
  1809. }
  1810. /* "lib/Naked/toolshed/c/shell.pyx":62
  1811. * sys.exit(1)
  1812. * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable)
  1813. * except Exception as e: # <<<<<<<<<<<<<<
  1814. * if DEBUG_FLAG:
  1815. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).")
  1816. */
  1817. __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  1818. if (__pyx_t_11) {
  1819. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1820. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1821. __Pyx_GOTREF(__pyx_t_4);
  1822. __Pyx_GOTREF(__pyx_t_8);
  1823. __Pyx_GOTREF(__pyx_t_6);
  1824. __Pyx_INCREF(__pyx_t_8);
  1825. __pyx_v_e = __pyx_t_8;
  1826. /* "lib/Naked/toolshed/c/shell.pyx":63
  1827. * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable)
  1828. * except Exception as e:
  1829. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  1830. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).")
  1831. * raise e
  1832. */
  1833. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1834. __Pyx_GOTREF(__pyx_t_5);
  1835. __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1836. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1837. if (__pyx_t_10) {
  1838. /* "lib/Naked/toolshed/c/shell.pyx":64
  1839. * except Exception as e:
  1840. * if DEBUG_FLAG:
  1841. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  1842. * raise e
  1843. *
  1844. */
  1845. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1846. __Pyx_GOTREF(__pyx_t_5);
  1847. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1848. __Pyx_GOTREF(__pyx_t_7);
  1849. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1850. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1851. __Pyx_GOTREF(__pyx_t_5);
  1852. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1853. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1854. __Pyx_GOTREF(__pyx_t_7);
  1855. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1856. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1857. goto __pyx_L29;
  1858. }
  1859. __pyx_L29:;
  1860. /* "lib/Naked/toolshed/c/shell.pyx":65
  1861. * if DEBUG_FLAG:
  1862. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).")
  1863. * raise e # <<<<<<<<<<<<<<
  1864. *
  1865. *
  1866. */
  1867. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  1868. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1869. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1870. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1871. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1872. goto __pyx_L4_exception_handled;
  1873. }
  1874. goto __pyx_L5_except_error;
  1875. __pyx_L5_except_error:;
  1876. __Pyx_XGIVEREF(__pyx_t_1);
  1877. __Pyx_XGIVEREF(__pyx_t_2);
  1878. __Pyx_XGIVEREF(__pyx_t_3);
  1879. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1880. goto __pyx_L1_error;
  1881. __pyx_L7_try_return:;
  1882. __Pyx_XGIVEREF(__pyx_t_1);
  1883. __Pyx_XGIVEREF(__pyx_t_2);
  1884. __Pyx_XGIVEREF(__pyx_t_3);
  1885. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1886. goto __pyx_L0;
  1887. __pyx_L6_except_return:;
  1888. __Pyx_XGIVEREF(__pyx_t_1);
  1889. __Pyx_XGIVEREF(__pyx_t_2);
  1890. __Pyx_XGIVEREF(__pyx_t_3);
  1891. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1892. goto __pyx_L0;
  1893. __pyx_L4_exception_handled:;
  1894. __Pyx_XGIVEREF(__pyx_t_1);
  1895. __Pyx_XGIVEREF(__pyx_t_2);
  1896. __Pyx_XGIVEREF(__pyx_t_3);
  1897. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1898. __pyx_L10_try_end:;
  1899. }
  1900. /* "lib/Naked/toolshed/c/shell.pyx":44
  1901. * # suppress_exit_status_call = False >> raise SystemExit with the returned status code
  1902. * #------------------------------------------------------------------------------
  1903. * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  1904. * try:
  1905. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  1906. */
  1907. /* function exit code */
  1908. __pyx_L1_error:;
  1909. __Pyx_XDECREF(__pyx_t_4);
  1910. __Pyx_XDECREF(__pyx_t_5);
  1911. __Pyx_XDECREF(__pyx_t_6);
  1912. __Pyx_XDECREF(__pyx_t_7);
  1913. __Pyx_XDECREF(__pyx_t_8);
  1914. __Pyx_XDECREF(__pyx_t_15);
  1915. __Pyx_XDECREF(__pyx_t_16);
  1916. __Pyx_XDECREF(__pyx_t_17);
  1917. __Pyx_XDECREF(__pyx_t_18);
  1918. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1919. __pyx_r = NULL;
  1920. __pyx_L0:;
  1921. __Pyx_XDECREF(__pyx_v_response);
  1922. __Pyx_XDECREF(__pyx_v_cpe);
  1923. __Pyx_XDECREF(__pyx_v_te);
  1924. __Pyx_XDECREF(__pyx_v_e);
  1925. __Pyx_XGIVEREF(__pyx_r);
  1926. __Pyx_RefNannyFinishContext();
  1927. return __pyx_r;
  1928. }
  1929. /* "lib/Naked/toolshed/c/shell.pyx":73
  1930. * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int)
  1931. * #------------------------------------------------------------------------------
  1932. * def muterun(command): # <<<<<<<<<<<<<<
  1933. * try:
  1934. * from Naked.toolshed.types import NakedObject
  1935. */
  1936. /* Python wrapper */
  1937. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_5muterun(PyObject *__pyx_self, PyObject *__pyx_v_command); /*proto*/
  1938. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_5muterun = {__Pyx_NAMESTR("muterun"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_5muterun, METH_O, __Pyx_DOCSTR(0)};
  1939. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_5muterun(PyObject *__pyx_self, PyObject *__pyx_v_command) {
  1940. PyObject *__pyx_r = 0;
  1941. __Pyx_RefNannyDeclarations
  1942. __Pyx_RefNannySetupContext("muterun (wrapper)", 0);
  1943. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_4muterun(__pyx_self, ((PyObject *)__pyx_v_command));
  1944. /* function exit code */
  1945. __Pyx_RefNannyFinishContext();
  1946. return __pyx_r;
  1947. }
  1948. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_4muterun(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command) {
  1949. PyObject *__pyx_v_NakedObject = NULL;
  1950. PyObject *__pyx_v_response_obj = NULL;
  1951. PyObject *__pyx_v_response = NULL;
  1952. PyObject *__pyx_v_cpe = NULL;
  1953. PyObject *__pyx_v_e = NULL;
  1954. PyObject *__pyx_r = NULL;
  1955. __Pyx_RefNannyDeclarations
  1956. PyObject *__pyx_t_1 = NULL;
  1957. PyObject *__pyx_t_2 = NULL;
  1958. PyObject *__pyx_t_3 = NULL;
  1959. PyObject *__pyx_t_4 = NULL;
  1960. PyObject *__pyx_t_5 = NULL;
  1961. PyObject *__pyx_t_6 = NULL;
  1962. PyObject *__pyx_t_7 = NULL;
  1963. PyObject *__pyx_t_8 = NULL;
  1964. int __pyx_t_9;
  1965. int __pyx_t_10;
  1966. int __pyx_lineno = 0;
  1967. const char *__pyx_filename = NULL;
  1968. int __pyx_clineno = 0;
  1969. __Pyx_RefNannySetupContext("muterun", 0);
  1970. /* "lib/Naked/toolshed/c/shell.pyx":74
  1971. * #------------------------------------------------------------------------------
  1972. * def muterun(command):
  1973. * try: # <<<<<<<<<<<<<<
  1974. * from Naked.toolshed.types import NakedObject
  1975. * response_obj = NakedObject()
  1976. */
  1977. {
  1978. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  1979. __Pyx_XGOTREF(__pyx_t_1);
  1980. __Pyx_XGOTREF(__pyx_t_2);
  1981. __Pyx_XGOTREF(__pyx_t_3);
  1982. /*try:*/ {
  1983. /* "lib/Naked/toolshed/c/shell.pyx":75
  1984. * def muterun(command):
  1985. * try:
  1986. * from Naked.toolshed.types import NakedObject # <<<<<<<<<<<<<<
  1987. * response_obj = NakedObject()
  1988. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  1989. */
  1990. __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1991. __Pyx_GOTREF(__pyx_t_4);
  1992. __Pyx_INCREF(__pyx_n_s_NakedObject);
  1993. PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_NakedObject);
  1994. __Pyx_GIVEREF(__pyx_n_s_NakedObject);
  1995. __pyx_t_5 = __Pyx_Import(__pyx_n_s_Naked_toolshed_types, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1996. __Pyx_GOTREF(__pyx_t_5);
  1997. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1998. __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_NakedObject); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1999. __Pyx_GOTREF(__pyx_t_4);
  2000. __Pyx_INCREF(__pyx_t_4);
  2001. __pyx_v_NakedObject = __pyx_t_4;
  2002. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2003. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2004. /* "lib/Naked/toolshed/c/shell.pyx":76
  2005. * try:
  2006. * from Naked.toolshed.types import NakedObject
  2007. * response_obj = NakedObject() # <<<<<<<<<<<<<<
  2008. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  2009. * response_obj.stdout = response
  2010. */
  2011. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_NakedObject, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2012. __Pyx_GOTREF(__pyx_t_5);
  2013. __pyx_v_response_obj = __pyx_t_5;
  2014. __pyx_t_5 = 0;
  2015. /* "lib/Naked/toolshed/c/shell.pyx":77
  2016. * from Naked.toolshed.types import NakedObject
  2017. * response_obj = NakedObject()
  2018. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) # <<<<<<<<<<<<<<
  2019. * response_obj.stdout = response
  2020. * response_obj.exitcode = 0
  2021. */
  2022. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2023. __Pyx_GOTREF(__pyx_t_5);
  2024. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_check_output); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2025. __Pyx_GOTREF(__pyx_t_4);
  2026. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2027. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2028. __Pyx_GOTREF(__pyx_t_5);
  2029. __Pyx_INCREF(__pyx_v_command);
  2030. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_command);
  2031. __Pyx_GIVEREF(__pyx_v_command);
  2032. __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2033. __Pyx_GOTREF(__pyx_t_6);
  2034. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2035. __Pyx_GOTREF(__pyx_t_7);
  2036. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_STDOUT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2037. __Pyx_GOTREF(__pyx_t_8);
  2038. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2039. if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_stderr, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2040. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2041. if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shell, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2042. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2043. __Pyx_GOTREF(__pyx_t_8);
  2044. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2045. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2046. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2047. __pyx_v_response = __pyx_t_8;
  2048. __pyx_t_8 = 0;
  2049. /* "lib/Naked/toolshed/c/shell.pyx":78
  2050. * response_obj = NakedObject()
  2051. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  2052. * response_obj.stdout = response # <<<<<<<<<<<<<<
  2053. * response_obj.exitcode = 0
  2054. * response_obj.stderr = b""
  2055. */
  2056. if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stdout, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2057. /* "lib/Naked/toolshed/c/shell.pyx":79
  2058. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  2059. * response_obj.stdout = response
  2060. * response_obj.exitcode = 0 # <<<<<<<<<<<<<<
  2061. * response_obj.stderr = b""
  2062. * return response_obj
  2063. */
  2064. if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_exitcode, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2065. /* "lib/Naked/toolshed/c/shell.pyx":80
  2066. * response_obj.stdout = response
  2067. * response_obj.exitcode = 0
  2068. * response_obj.stderr = b"" # <<<<<<<<<<<<<<
  2069. * return response_obj
  2070. * except subprocess.CalledProcessError as cpe:
  2071. */
  2072. if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stderr, __pyx_kp_b__4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2073. /* "lib/Naked/toolshed/c/shell.pyx":81
  2074. * response_obj.exitcode = 0
  2075. * response_obj.stderr = b""
  2076. * return response_obj # <<<<<<<<<<<<<<
  2077. * except subprocess.CalledProcessError as cpe:
  2078. * response_obj.stdout = b""
  2079. */
  2080. __Pyx_XDECREF(__pyx_r);
  2081. __Pyx_INCREF(__pyx_v_response_obj);
  2082. __pyx_r = __pyx_v_response_obj;
  2083. goto __pyx_L7_try_return;
  2084. }
  2085. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  2086. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  2087. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  2088. goto __pyx_L10_try_end;
  2089. __pyx_L3_error:;
  2090. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  2091. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  2092. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  2093. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  2094. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  2095. /* "lib/Naked/toolshed/c/shell.pyx":82
  2096. * response_obj.stderr = b""
  2097. * return response_obj
  2098. * except subprocess.CalledProcessError as cpe: # <<<<<<<<<<<<<<
  2099. * response_obj.stdout = b""
  2100. * response_obj.stderr = cpe.output
  2101. */
  2102. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2103. __Pyx_GOTREF(__pyx_t_8);
  2104. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2105. __Pyx_GOTREF(__pyx_t_6);
  2106. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2107. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_6);
  2108. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2109. if (__pyx_t_9) {
  2110. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2111. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2112. __Pyx_GOTREF(__pyx_t_6);
  2113. __Pyx_GOTREF(__pyx_t_8);
  2114. __Pyx_GOTREF(__pyx_t_5);
  2115. __Pyx_INCREF(__pyx_t_8);
  2116. __pyx_v_cpe = __pyx_t_8;
  2117. /* "lib/Naked/toolshed/c/shell.pyx":83
  2118. * return response_obj
  2119. * except subprocess.CalledProcessError as cpe:
  2120. * response_obj.stdout = b"" # <<<<<<<<<<<<<<
  2121. * response_obj.stderr = cpe.output
  2122. * if cpe.returncode:
  2123. */
  2124. if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} }
  2125. if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stdout, __pyx_kp_b__4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2126. /* "lib/Naked/toolshed/c/shell.pyx":84
  2127. * except subprocess.CalledProcessError as cpe:
  2128. * response_obj.stdout = b""
  2129. * response_obj.stderr = cpe.output # <<<<<<<<<<<<<<
  2130. * if cpe.returncode:
  2131. * response_obj.exitcode = cpe.returncode
  2132. */
  2133. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2134. __Pyx_GOTREF(__pyx_t_4);
  2135. if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} }
  2136. if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stderr, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2137. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2138. /* "lib/Naked/toolshed/c/shell.pyx":85
  2139. * response_obj.stdout = b""
  2140. * response_obj.stderr = cpe.output
  2141. * if cpe.returncode: # <<<<<<<<<<<<<<
  2142. * response_obj.exitcode = cpe.returncode
  2143. * else:
  2144. */
  2145. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2146. __Pyx_GOTREF(__pyx_t_4);
  2147. __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2148. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2149. if (__pyx_t_10) {
  2150. /* "lib/Naked/toolshed/c/shell.pyx":86
  2151. * response_obj.stderr = cpe.output
  2152. * if cpe.returncode:
  2153. * response_obj.exitcode = cpe.returncode # <<<<<<<<<<<<<<
  2154. * else:
  2155. * response_obj.exitcode = 1
  2156. */
  2157. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2158. __Pyx_GOTREF(__pyx_t_4);
  2159. if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} }
  2160. if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_exitcode, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2161. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2162. goto __pyx_L13;
  2163. }
  2164. /*else*/ {
  2165. /* "lib/Naked/toolshed/c/shell.pyx":88
  2166. * response_obj.exitcode = cpe.returncode
  2167. * else:
  2168. * response_obj.exitcode = 1 # <<<<<<<<<<<<<<
  2169. * return response_obj
  2170. * except Exception as e:
  2171. */
  2172. if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} }
  2173. if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_exitcode, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2174. }
  2175. __pyx_L13:;
  2176. /* "lib/Naked/toolshed/c/shell.pyx":89
  2177. * else:
  2178. * response_obj.exitcode = 1
  2179. * return response_obj # <<<<<<<<<<<<<<
  2180. * except Exception as e:
  2181. * if DEBUG_FLAG:
  2182. */
  2183. __Pyx_XDECREF(__pyx_r);
  2184. if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} }
  2185. __Pyx_INCREF(__pyx_v_response_obj);
  2186. __pyx_r = __pyx_v_response_obj;
  2187. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2188. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2189. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2190. goto __pyx_L6_except_return;
  2191. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2192. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2193. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2194. goto __pyx_L4_exception_handled;
  2195. }
  2196. /* "lib/Naked/toolshed/c/shell.pyx":90
  2197. * response_obj.exitcode = 1
  2198. * return response_obj
  2199. * except Exception as e: # <<<<<<<<<<<<<<
  2200. * if DEBUG_FLAG:
  2201. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).")
  2202. */
  2203. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  2204. if (__pyx_t_9) {
  2205. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2206. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2207. __Pyx_GOTREF(__pyx_t_5);
  2208. __Pyx_GOTREF(__pyx_t_8);
  2209. __Pyx_GOTREF(__pyx_t_6);
  2210. __Pyx_INCREF(__pyx_t_8);
  2211. __pyx_v_e = __pyx_t_8;
  2212. /* "lib/Naked/toolshed/c/shell.pyx":91
  2213. * return response_obj
  2214. * except Exception as e:
  2215. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  2216. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).")
  2217. * raise e
  2218. */
  2219. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2220. __Pyx_GOTREF(__pyx_t_4);
  2221. __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2222. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2223. if (__pyx_t_10) {
  2224. /* "lib/Naked/toolshed/c/shell.pyx":92
  2225. * except Exception as e:
  2226. * if DEBUG_FLAG:
  2227. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  2228. * raise e
  2229. *
  2230. */
  2231. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2232. __Pyx_GOTREF(__pyx_t_4);
  2233. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2234. __Pyx_GOTREF(__pyx_t_7);
  2235. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2236. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2237. __Pyx_GOTREF(__pyx_t_4);
  2238. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2239. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2240. __Pyx_GOTREF(__pyx_t_7);
  2241. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2242. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2243. goto __pyx_L16;
  2244. }
  2245. __pyx_L16:;
  2246. /* "lib/Naked/toolshed/c/shell.pyx":93
  2247. * if DEBUG_FLAG:
  2248. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).")
  2249. * raise e # <<<<<<<<<<<<<<
  2250. *
  2251. *
  2252. */
  2253. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  2254. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2255. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2256. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2257. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2258. goto __pyx_L4_exception_handled;
  2259. }
  2260. goto __pyx_L5_except_error;
  2261. __pyx_L5_except_error:;
  2262. __Pyx_XGIVEREF(__pyx_t_1);
  2263. __Pyx_XGIVEREF(__pyx_t_2);
  2264. __Pyx_XGIVEREF(__pyx_t_3);
  2265. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2266. goto __pyx_L1_error;
  2267. __pyx_L7_try_return:;
  2268. __Pyx_XGIVEREF(__pyx_t_1);
  2269. __Pyx_XGIVEREF(__pyx_t_2);
  2270. __Pyx_XGIVEREF(__pyx_t_3);
  2271. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2272. goto __pyx_L0;
  2273. __pyx_L6_except_return:;
  2274. __Pyx_XGIVEREF(__pyx_t_1);
  2275. __Pyx_XGIVEREF(__pyx_t_2);
  2276. __Pyx_XGIVEREF(__pyx_t_3);
  2277. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2278. goto __pyx_L0;
  2279. __pyx_L4_exception_handled:;
  2280. __Pyx_XGIVEREF(__pyx_t_1);
  2281. __Pyx_XGIVEREF(__pyx_t_2);
  2282. __Pyx_XGIVEREF(__pyx_t_3);
  2283. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2284. __pyx_L10_try_end:;
  2285. }
  2286. /* "lib/Naked/toolshed/c/shell.pyx":73
  2287. * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int)
  2288. * #------------------------------------------------------------------------------
  2289. * def muterun(command): # <<<<<<<<<<<<<<
  2290. * try:
  2291. * from Naked.toolshed.types import NakedObject
  2292. */
  2293. /* function exit code */
  2294. __pyx_L1_error:;
  2295. __Pyx_XDECREF(__pyx_t_4);
  2296. __Pyx_XDECREF(__pyx_t_5);
  2297. __Pyx_XDECREF(__pyx_t_6);
  2298. __Pyx_XDECREF(__pyx_t_7);
  2299. __Pyx_XDECREF(__pyx_t_8);
  2300. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2301. __pyx_r = NULL;
  2302. __pyx_L0:;
  2303. __Pyx_XDECREF(__pyx_v_NakedObject);
  2304. __Pyx_XDECREF(__pyx_v_response_obj);
  2305. __Pyx_XDECREF(__pyx_v_response);
  2306. __Pyx_XDECREF(__pyx_v_cpe);
  2307. __Pyx_XDECREF(__pyx_v_e);
  2308. __Pyx_XGIVEREF(__pyx_r);
  2309. __Pyx_RefNannyFinishContext();
  2310. return __pyx_r;
  2311. }
  2312. /* "lib/Naked/toolshed/c/shell.pyx":103
  2313. * # execute a ruby script file in a shell subprocess
  2314. * #------------------------------------------------------------------------------
  2315. * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<<
  2316. * try:
  2317. * if len(arguments) > 0:
  2318. */
  2319. /* Python wrapper */
  2320. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_7execute_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2321. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_7execute_rb = {__Pyx_NAMESTR("execute_rb"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_7execute_rb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2322. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_7execute_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2323. PyObject *__pyx_v_file_path = 0;
  2324. PyObject *__pyx_v_arguments = 0;
  2325. int __pyx_lineno = 0;
  2326. const char *__pyx_filename = NULL;
  2327. int __pyx_clineno = 0;
  2328. PyObject *__pyx_r = 0;
  2329. __Pyx_RefNannyDeclarations
  2330. __Pyx_RefNannySetupContext("execute_rb (wrapper)", 0);
  2331. {
  2332. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0};
  2333. PyObject* values[2] = {0,0};
  2334. values[1] = ((PyObject *)__pyx_kp_s__4);
  2335. if (unlikely(__pyx_kwds)) {
  2336. Py_ssize_t kw_args;
  2337. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2338. switch (pos_args) {
  2339. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2340. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2341. case 0: break;
  2342. default: goto __pyx_L5_argtuple_error;
  2343. }
  2344. kw_args = PyDict_Size(__pyx_kwds);
  2345. switch (pos_args) {
  2346. case 0:
  2347. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--;
  2348. else goto __pyx_L5_argtuple_error;
  2349. case 1:
  2350. if (kw_args > 0) {
  2351. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments);
  2352. if (value) { values[1] = value; kw_args--; }
  2353. }
  2354. }
  2355. if (unlikely(kw_args > 0)) {
  2356. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute_rb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2357. }
  2358. } else {
  2359. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2360. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2361. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2362. break;
  2363. default: goto __pyx_L5_argtuple_error;
  2364. }
  2365. }
  2366. __pyx_v_file_path = values[0];
  2367. __pyx_v_arguments = values[1];
  2368. }
  2369. goto __pyx_L4_argument_unpacking_done;
  2370. __pyx_L5_argtuple_error:;
  2371. __Pyx_RaiseArgtupleInvalid("execute_rb", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2372. __pyx_L3_error:;
  2373. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_rb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2374. __Pyx_RefNannyFinishContext();
  2375. return NULL;
  2376. __pyx_L4_argument_unpacking_done:;
  2377. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_6execute_rb(__pyx_self, __pyx_v_file_path, __pyx_v_arguments);
  2378. /* function exit code */
  2379. __Pyx_RefNannyFinishContext();
  2380. return __pyx_r;
  2381. }
  2382. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_6execute_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) {
  2383. PyObject *__pyx_v_rb_command = NULL;
  2384. PyObject *__pyx_v_e = NULL;
  2385. PyObject *__pyx_r = NULL;
  2386. __Pyx_RefNannyDeclarations
  2387. PyObject *__pyx_t_1 = NULL;
  2388. PyObject *__pyx_t_2 = NULL;
  2389. PyObject *__pyx_t_3 = NULL;
  2390. Py_ssize_t __pyx_t_4;
  2391. int __pyx_t_5;
  2392. PyObject *__pyx_t_6 = NULL;
  2393. PyObject *__pyx_t_7 = NULL;
  2394. PyObject *__pyx_t_8 = NULL;
  2395. int __pyx_t_9;
  2396. PyObject *__pyx_t_10 = NULL;
  2397. PyObject *__pyx_t_11 = NULL;
  2398. int __pyx_lineno = 0;
  2399. const char *__pyx_filename = NULL;
  2400. int __pyx_clineno = 0;
  2401. __Pyx_RefNannySetupContext("execute_rb", 0);
  2402. /* "lib/Naked/toolshed/c/shell.pyx":104
  2403. * #------------------------------------------------------------------------------
  2404. * def execute_rb(file_path, arguments=""):
  2405. * try: # <<<<<<<<<<<<<<
  2406. * if len(arguments) > 0:
  2407. * rb_command = 'ruby ' + file_path + " " + arguments
  2408. */
  2409. {
  2410. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  2411. __Pyx_XGOTREF(__pyx_t_1);
  2412. __Pyx_XGOTREF(__pyx_t_2);
  2413. __Pyx_XGOTREF(__pyx_t_3);
  2414. /*try:*/ {
  2415. /* "lib/Naked/toolshed/c/shell.pyx":105
  2416. * def execute_rb(file_path, arguments=""):
  2417. * try:
  2418. * if len(arguments) > 0: # <<<<<<<<<<<<<<
  2419. * rb_command = 'ruby ' + file_path + " " + arguments
  2420. * else:
  2421. */
  2422. __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2423. __pyx_t_5 = ((__pyx_t_4 > 0) != 0);
  2424. if (__pyx_t_5) {
  2425. /* "lib/Naked/toolshed/c/shell.pyx":106
  2426. * try:
  2427. * if len(arguments) > 0:
  2428. * rb_command = 'ruby ' + file_path + " " + arguments # <<<<<<<<<<<<<<
  2429. * else:
  2430. * rb_command = 'ruby ' + file_path
  2431. */
  2432. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2433. __Pyx_GOTREF(__pyx_t_6);
  2434. __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2435. __Pyx_GOTREF(__pyx_t_7);
  2436. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2437. __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2438. __Pyx_GOTREF(__pyx_t_6);
  2439. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2440. __pyx_v_rb_command = __pyx_t_6;
  2441. __pyx_t_6 = 0;
  2442. goto __pyx_L11;
  2443. }
  2444. /*else*/ {
  2445. /* "lib/Naked/toolshed/c/shell.pyx":108
  2446. * rb_command = 'ruby ' + file_path + " " + arguments
  2447. * else:
  2448. * rb_command = 'ruby ' + file_path # <<<<<<<<<<<<<<
  2449. * return execute(rb_command) # return result of execute() of the ruby file
  2450. * except Exception as e:
  2451. */
  2452. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2453. __Pyx_GOTREF(__pyx_t_6);
  2454. __pyx_v_rb_command = __pyx_t_6;
  2455. __pyx_t_6 = 0;
  2456. }
  2457. __pyx_L11:;
  2458. /* "lib/Naked/toolshed/c/shell.pyx":109
  2459. * else:
  2460. * rb_command = 'ruby ' + file_path
  2461. * return execute(rb_command) # return result of execute() of the ruby file # <<<<<<<<<<<<<<
  2462. * except Exception as e:
  2463. * if DEBUG_FLAG:
  2464. */
  2465. __Pyx_XDECREF(__pyx_r);
  2466. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_execute); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2467. __Pyx_GOTREF(__pyx_t_6);
  2468. __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2469. __Pyx_GOTREF(__pyx_t_7);
  2470. __Pyx_INCREF(__pyx_v_rb_command);
  2471. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rb_command);
  2472. __Pyx_GIVEREF(__pyx_v_rb_command);
  2473. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2474. __Pyx_GOTREF(__pyx_t_8);
  2475. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2476. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2477. __pyx_r = __pyx_t_8;
  2478. __pyx_t_8 = 0;
  2479. goto __pyx_L7_try_return;
  2480. }
  2481. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  2482. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  2483. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  2484. goto __pyx_L10_try_end;
  2485. __pyx_L3_error:;
  2486. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  2487. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  2488. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  2489. /* "lib/Naked/toolshed/c/shell.pyx":110
  2490. * rb_command = 'ruby ' + file_path
  2491. * return execute(rb_command) # return result of execute() of the ruby file
  2492. * except Exception as e: # <<<<<<<<<<<<<<
  2493. * if DEBUG_FLAG:
  2494. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).")
  2495. */
  2496. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  2497. if (__pyx_t_9) {
  2498. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_rb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2499. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2500. __Pyx_GOTREF(__pyx_t_8);
  2501. __Pyx_GOTREF(__pyx_t_7);
  2502. __Pyx_GOTREF(__pyx_t_6);
  2503. __Pyx_INCREF(__pyx_t_7);
  2504. __pyx_v_e = __pyx_t_7;
  2505. /* "lib/Naked/toolshed/c/shell.pyx":111
  2506. * return execute(rb_command) # return result of execute() of the ruby file
  2507. * except Exception as e:
  2508. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  2509. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).")
  2510. * raise e
  2511. */
  2512. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2513. __Pyx_GOTREF(__pyx_t_10);
  2514. __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2515. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2516. if (__pyx_t_5) {
  2517. /* "lib/Naked/toolshed/c/shell.pyx":112
  2518. * except Exception as e:
  2519. * if DEBUG_FLAG:
  2520. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  2521. * raise e
  2522. *
  2523. */
  2524. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2525. __Pyx_GOTREF(__pyx_t_10);
  2526. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2527. __Pyx_GOTREF(__pyx_t_11);
  2528. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2529. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2530. __Pyx_GOTREF(__pyx_t_10);
  2531. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  2532. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2533. __Pyx_GOTREF(__pyx_t_11);
  2534. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2535. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  2536. goto __pyx_L14;
  2537. }
  2538. __pyx_L14:;
  2539. /* "lib/Naked/toolshed/c/shell.pyx":113
  2540. * if DEBUG_FLAG:
  2541. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).")
  2542. * raise e # <<<<<<<<<<<<<<
  2543. *
  2544. * #------------------------------------------------------------------------------
  2545. */
  2546. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  2547. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2548. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2549. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2550. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2551. goto __pyx_L4_exception_handled;
  2552. }
  2553. goto __pyx_L5_except_error;
  2554. __pyx_L5_except_error:;
  2555. __Pyx_XGIVEREF(__pyx_t_1);
  2556. __Pyx_XGIVEREF(__pyx_t_2);
  2557. __Pyx_XGIVEREF(__pyx_t_3);
  2558. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2559. goto __pyx_L1_error;
  2560. __pyx_L7_try_return:;
  2561. __Pyx_XGIVEREF(__pyx_t_1);
  2562. __Pyx_XGIVEREF(__pyx_t_2);
  2563. __Pyx_XGIVEREF(__pyx_t_3);
  2564. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2565. goto __pyx_L0;
  2566. __pyx_L4_exception_handled:;
  2567. __Pyx_XGIVEREF(__pyx_t_1);
  2568. __Pyx_XGIVEREF(__pyx_t_2);
  2569. __Pyx_XGIVEREF(__pyx_t_3);
  2570. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2571. __pyx_L10_try_end:;
  2572. }
  2573. /* "lib/Naked/toolshed/c/shell.pyx":103
  2574. * # execute a ruby script file in a shell subprocess
  2575. * #------------------------------------------------------------------------------
  2576. * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<<
  2577. * try:
  2578. * if len(arguments) > 0:
  2579. */
  2580. /* function exit code */
  2581. __pyx_L1_error:;
  2582. __Pyx_XDECREF(__pyx_t_6);
  2583. __Pyx_XDECREF(__pyx_t_7);
  2584. __Pyx_XDECREF(__pyx_t_8);
  2585. __Pyx_XDECREF(__pyx_t_10);
  2586. __Pyx_XDECREF(__pyx_t_11);
  2587. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_rb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2588. __pyx_r = NULL;
  2589. __pyx_L0:;
  2590. __Pyx_XDECREF(__pyx_v_rb_command);
  2591. __Pyx_XDECREF(__pyx_v_e);
  2592. __Pyx_XGIVEREF(__pyx_r);
  2593. __Pyx_RefNannyFinishContext();
  2594. return __pyx_r;
  2595. }
  2596. /* "lib/Naked/toolshed/c/shell.pyx":119
  2597. * # execute a ruby script file in a shell subprocess, return the output
  2598. * #------------------------------------------------------------------------------
  2599. * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  2600. * try:
  2601. * if len(arguments) > 0:
  2602. */
  2603. /* Python wrapper */
  2604. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_9run_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2605. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_9run_rb = {__Pyx_NAMESTR("run_rb"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_9run_rb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2606. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_9run_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2607. PyObject *__pyx_v_file_path = 0;
  2608. PyObject *__pyx_v_arguments = 0;
  2609. PyObject *__pyx_v_suppress_stdout = 0;
  2610. PyObject *__pyx_v_suppress_stderr = 0;
  2611. PyObject *__pyx_v_suppress_exit_status_call = 0;
  2612. int __pyx_lineno = 0;
  2613. const char *__pyx_filename = NULL;
  2614. int __pyx_clineno = 0;
  2615. PyObject *__pyx_r = 0;
  2616. __Pyx_RefNannyDeclarations
  2617. __Pyx_RefNannySetupContext("run_rb (wrapper)", 0);
  2618. {
  2619. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,&__pyx_n_s_suppress_stdout,&__pyx_n_s_suppress_stderr,&__pyx_n_s_suppress_exit_status_call,0};
  2620. PyObject* values[5] = {0,0,0,0,0};
  2621. values[1] = ((PyObject *)__pyx_kp_s__4);
  2622. values[2] = ((PyObject *)Py_False);
  2623. values[3] = ((PyObject *)Py_False);
  2624. values[4] = ((PyObject *)Py_True);
  2625. if (unlikely(__pyx_kwds)) {
  2626. Py_ssize_t kw_args;
  2627. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2628. switch (pos_args) {
  2629. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2630. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2631. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2632. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2633. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2634. case 0: break;
  2635. default: goto __pyx_L5_argtuple_error;
  2636. }
  2637. kw_args = PyDict_Size(__pyx_kwds);
  2638. switch (pos_args) {
  2639. case 0:
  2640. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--;
  2641. else goto __pyx_L5_argtuple_error;
  2642. case 1:
  2643. if (kw_args > 0) {
  2644. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments);
  2645. if (value) { values[1] = value; kw_args--; }
  2646. }
  2647. case 2:
  2648. if (kw_args > 0) {
  2649. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stdout);
  2650. if (value) { values[2] = value; kw_args--; }
  2651. }
  2652. case 3:
  2653. if (kw_args > 0) {
  2654. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stderr);
  2655. if (value) { values[3] = value; kw_args--; }
  2656. }
  2657. case 4:
  2658. if (kw_args > 0) {
  2659. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_exit_status_call);
  2660. if (value) { values[4] = value; kw_args--; }
  2661. }
  2662. }
  2663. if (unlikely(kw_args > 0)) {
  2664. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_rb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2665. }
  2666. } else {
  2667. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2668. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2669. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2670. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2671. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2672. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2673. break;
  2674. default: goto __pyx_L5_argtuple_error;
  2675. }
  2676. }
  2677. __pyx_v_file_path = values[0];
  2678. __pyx_v_arguments = values[1];
  2679. __pyx_v_suppress_stdout = values[2];
  2680. __pyx_v_suppress_stderr = values[3];
  2681. __pyx_v_suppress_exit_status_call = values[4];
  2682. }
  2683. goto __pyx_L4_argument_unpacking_done;
  2684. __pyx_L5_argtuple_error:;
  2685. __Pyx_RaiseArgtupleInvalid("run_rb", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2686. __pyx_L3_error:;
  2687. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_rb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2688. __Pyx_RefNannyFinishContext();
  2689. return NULL;
  2690. __pyx_L4_argument_unpacking_done:;
  2691. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_8run_rb(__pyx_self, __pyx_v_file_path, __pyx_v_arguments, __pyx_v_suppress_stdout, __pyx_v_suppress_stderr, __pyx_v_suppress_exit_status_call);
  2692. /* function exit code */
  2693. __Pyx_RefNannyFinishContext();
  2694. return __pyx_r;
  2695. }
  2696. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_8run_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call) {
  2697. PyObject *__pyx_v_rb_command = NULL;
  2698. PyObject *__pyx_v_e = NULL;
  2699. PyObject *__pyx_r = NULL;
  2700. __Pyx_RefNannyDeclarations
  2701. PyObject *__pyx_t_1 = NULL;
  2702. PyObject *__pyx_t_2 = NULL;
  2703. PyObject *__pyx_t_3 = NULL;
  2704. Py_ssize_t __pyx_t_4;
  2705. int __pyx_t_5;
  2706. PyObject *__pyx_t_6 = NULL;
  2707. PyObject *__pyx_t_7 = NULL;
  2708. PyObject *__pyx_t_8 = NULL;
  2709. int __pyx_t_9;
  2710. PyObject *__pyx_t_10 = NULL;
  2711. PyObject *__pyx_t_11 = NULL;
  2712. int __pyx_lineno = 0;
  2713. const char *__pyx_filename = NULL;
  2714. int __pyx_clineno = 0;
  2715. __Pyx_RefNannySetupContext("run_rb", 0);
  2716. /* "lib/Naked/toolshed/c/shell.pyx":120
  2717. * #------------------------------------------------------------------------------
  2718. * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True):
  2719. * try: # <<<<<<<<<<<<<<
  2720. * if len(arguments) > 0:
  2721. * rb_command = 'ruby ' + file_path + " " + arguments
  2722. */
  2723. {
  2724. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  2725. __Pyx_XGOTREF(__pyx_t_1);
  2726. __Pyx_XGOTREF(__pyx_t_2);
  2727. __Pyx_XGOTREF(__pyx_t_3);
  2728. /*try:*/ {
  2729. /* "lib/Naked/toolshed/c/shell.pyx":121
  2730. * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True):
  2731. * try:
  2732. * if len(arguments) > 0: # <<<<<<<<<<<<<<
  2733. * rb_command = 'ruby ' + file_path + " " + arguments
  2734. * else:
  2735. */
  2736. __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2737. __pyx_t_5 = ((__pyx_t_4 > 0) != 0);
  2738. if (__pyx_t_5) {
  2739. /* "lib/Naked/toolshed/c/shell.pyx":122
  2740. * try:
  2741. * if len(arguments) > 0:
  2742. * rb_command = 'ruby ' + file_path + " " + arguments # <<<<<<<<<<<<<<
  2743. * else:
  2744. * rb_command = 'ruby ' + file_path
  2745. */
  2746. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2747. __Pyx_GOTREF(__pyx_t_6);
  2748. __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2749. __Pyx_GOTREF(__pyx_t_7);
  2750. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2751. __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2752. __Pyx_GOTREF(__pyx_t_6);
  2753. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2754. __pyx_v_rb_command = __pyx_t_6;
  2755. __pyx_t_6 = 0;
  2756. goto __pyx_L11;
  2757. }
  2758. /*else*/ {
  2759. /* "lib/Naked/toolshed/c/shell.pyx":124
  2760. * rb_command = 'ruby ' + file_path + " " + arguments
  2761. * else:
  2762. * rb_command = 'ruby ' + file_path # <<<<<<<<<<<<<<
  2763. * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file
  2764. * except Exception as e:
  2765. */
  2766. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2767. __Pyx_GOTREF(__pyx_t_6);
  2768. __pyx_v_rb_command = __pyx_t_6;
  2769. __pyx_t_6 = 0;
  2770. }
  2771. __pyx_L11:;
  2772. /* "lib/Naked/toolshed/c/shell.pyx":125
  2773. * else:
  2774. * rb_command = 'ruby ' + file_path
  2775. * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file # <<<<<<<<<<<<<<
  2776. * except Exception as e:
  2777. * if DEBUG_FLAG:
  2778. */
  2779. __Pyx_XDECREF(__pyx_r);
  2780. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_run); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2781. __Pyx_GOTREF(__pyx_t_6);
  2782. __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2783. __Pyx_GOTREF(__pyx_t_7);
  2784. __Pyx_INCREF(__pyx_v_rb_command);
  2785. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rb_command);
  2786. __Pyx_GIVEREF(__pyx_v_rb_command);
  2787. __Pyx_INCREF(__pyx_v_suppress_stdout);
  2788. PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_suppress_stdout);
  2789. __Pyx_GIVEREF(__pyx_v_suppress_stdout);
  2790. __Pyx_INCREF(__pyx_v_suppress_stderr);
  2791. PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_suppress_stderr);
  2792. __Pyx_GIVEREF(__pyx_v_suppress_stderr);
  2793. __Pyx_INCREF(__pyx_v_suppress_exit_status_call);
  2794. PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_suppress_exit_status_call);
  2795. __Pyx_GIVEREF(__pyx_v_suppress_exit_status_call);
  2796. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2797. __Pyx_GOTREF(__pyx_t_8);
  2798. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2799. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2800. __pyx_r = __pyx_t_8;
  2801. __pyx_t_8 = 0;
  2802. goto __pyx_L7_try_return;
  2803. }
  2804. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  2805. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  2806. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  2807. goto __pyx_L10_try_end;
  2808. __pyx_L3_error:;
  2809. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  2810. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  2811. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  2812. /* "lib/Naked/toolshed/c/shell.pyx":126
  2813. * rb_command = 'ruby ' + file_path
  2814. * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file
  2815. * except Exception as e: # <<<<<<<<<<<<<<
  2816. * if DEBUG_FLAG:
  2817. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).")
  2818. */
  2819. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  2820. if (__pyx_t_9) {
  2821. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_rb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2822. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2823. __Pyx_GOTREF(__pyx_t_8);
  2824. __Pyx_GOTREF(__pyx_t_7);
  2825. __Pyx_GOTREF(__pyx_t_6);
  2826. __Pyx_INCREF(__pyx_t_7);
  2827. __pyx_v_e = __pyx_t_7;
  2828. /* "lib/Naked/toolshed/c/shell.pyx":127
  2829. * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file
  2830. * except Exception as e:
  2831. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  2832. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).")
  2833. * raise e
  2834. */
  2835. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2836. __Pyx_GOTREF(__pyx_t_10);
  2837. __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2838. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2839. if (__pyx_t_5) {
  2840. /* "lib/Naked/toolshed/c/shell.pyx":128
  2841. * except Exception as e:
  2842. * if DEBUG_FLAG:
  2843. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  2844. * raise e
  2845. *
  2846. */
  2847. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2848. __Pyx_GOTREF(__pyx_t_10);
  2849. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2850. __Pyx_GOTREF(__pyx_t_11);
  2851. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2852. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2853. __Pyx_GOTREF(__pyx_t_10);
  2854. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  2855. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2856. __Pyx_GOTREF(__pyx_t_11);
  2857. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2858. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  2859. goto __pyx_L14;
  2860. }
  2861. __pyx_L14:;
  2862. /* "lib/Naked/toolshed/c/shell.pyx":129
  2863. * if DEBUG_FLAG:
  2864. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).")
  2865. * raise e # <<<<<<<<<<<<<<
  2866. *
  2867. * #------------------------------------------------------------------------------
  2868. */
  2869. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  2870. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2871. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2872. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2873. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2874. goto __pyx_L4_exception_handled;
  2875. }
  2876. goto __pyx_L5_except_error;
  2877. __pyx_L5_except_error:;
  2878. __Pyx_XGIVEREF(__pyx_t_1);
  2879. __Pyx_XGIVEREF(__pyx_t_2);
  2880. __Pyx_XGIVEREF(__pyx_t_3);
  2881. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2882. goto __pyx_L1_error;
  2883. __pyx_L7_try_return:;
  2884. __Pyx_XGIVEREF(__pyx_t_1);
  2885. __Pyx_XGIVEREF(__pyx_t_2);
  2886. __Pyx_XGIVEREF(__pyx_t_3);
  2887. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2888. goto __pyx_L0;
  2889. __pyx_L4_exception_handled:;
  2890. __Pyx_XGIVEREF(__pyx_t_1);
  2891. __Pyx_XGIVEREF(__pyx_t_2);
  2892. __Pyx_XGIVEREF(__pyx_t_3);
  2893. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2894. __pyx_L10_try_end:;
  2895. }
  2896. /* "lib/Naked/toolshed/c/shell.pyx":119
  2897. * # execute a ruby script file in a shell subprocess, return the output
  2898. * #------------------------------------------------------------------------------
  2899. * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  2900. * try:
  2901. * if len(arguments) > 0:
  2902. */
  2903. /* function exit code */
  2904. __pyx_L1_error:;
  2905. __Pyx_XDECREF(__pyx_t_6);
  2906. __Pyx_XDECREF(__pyx_t_7);
  2907. __Pyx_XDECREF(__pyx_t_8);
  2908. __Pyx_XDECREF(__pyx_t_10);
  2909. __Pyx_XDECREF(__pyx_t_11);
  2910. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_rb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2911. __pyx_r = NULL;
  2912. __pyx_L0:;
  2913. __Pyx_XDECREF(__pyx_v_rb_command);
  2914. __Pyx_XDECREF(__pyx_v_e);
  2915. __Pyx_XGIVEREF(__pyx_r);
  2916. __Pyx_RefNannyFinishContext();
  2917. return __pyx_r;
  2918. }
  2919. /* "lib/Naked/toolshed/c/shell.pyx":134
  2920. * # [ muterun_rb function ] (NakedObject response object)
  2921. * #------------------------------------------------------------------------------
  2922. * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<<
  2923. * try:
  2924. * if len(arguments) > 0:
  2925. */
  2926. /* Python wrapper */
  2927. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2928. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb = {__Pyx_NAMESTR("muterun_rb"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2929. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2930. PyObject *__pyx_v_file_path = 0;
  2931. PyObject *__pyx_v_arguments = 0;
  2932. int __pyx_lineno = 0;
  2933. const char *__pyx_filename = NULL;
  2934. int __pyx_clineno = 0;
  2935. PyObject *__pyx_r = 0;
  2936. __Pyx_RefNannyDeclarations
  2937. __Pyx_RefNannySetupContext("muterun_rb (wrapper)", 0);
  2938. {
  2939. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0};
  2940. PyObject* values[2] = {0,0};
  2941. values[1] = ((PyObject *)__pyx_kp_s__4);
  2942. if (unlikely(__pyx_kwds)) {
  2943. Py_ssize_t kw_args;
  2944. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2945. switch (pos_args) {
  2946. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2947. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2948. case 0: break;
  2949. default: goto __pyx_L5_argtuple_error;
  2950. }
  2951. kw_args = PyDict_Size(__pyx_kwds);
  2952. switch (pos_args) {
  2953. case 0:
  2954. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--;
  2955. else goto __pyx_L5_argtuple_error;
  2956. case 1:
  2957. if (kw_args > 0) {
  2958. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments);
  2959. if (value) { values[1] = value; kw_args--; }
  2960. }
  2961. }
  2962. if (unlikely(kw_args > 0)) {
  2963. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "muterun_rb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2964. }
  2965. } else {
  2966. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2967. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2968. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2969. break;
  2970. default: goto __pyx_L5_argtuple_error;
  2971. }
  2972. }
  2973. __pyx_v_file_path = values[0];
  2974. __pyx_v_arguments = values[1];
  2975. }
  2976. goto __pyx_L4_argument_unpacking_done;
  2977. __pyx_L5_argtuple_error:;
  2978. __Pyx_RaiseArgtupleInvalid("muterun_rb", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2979. __pyx_L3_error:;
  2980. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_rb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2981. __Pyx_RefNannyFinishContext();
  2982. return NULL;
  2983. __pyx_L4_argument_unpacking_done:;
  2984. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_10muterun_rb(__pyx_self, __pyx_v_file_path, __pyx_v_arguments);
  2985. /* function exit code */
  2986. __Pyx_RefNannyFinishContext();
  2987. return __pyx_r;
  2988. }
  2989. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_10muterun_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) {
  2990. PyObject *__pyx_v_rb_command = NULL;
  2991. PyObject *__pyx_v_e = NULL;
  2992. PyObject *__pyx_r = NULL;
  2993. __Pyx_RefNannyDeclarations
  2994. PyObject *__pyx_t_1 = NULL;
  2995. PyObject *__pyx_t_2 = NULL;
  2996. PyObject *__pyx_t_3 = NULL;
  2997. Py_ssize_t __pyx_t_4;
  2998. int __pyx_t_5;
  2999. PyObject *__pyx_t_6 = NULL;
  3000. PyObject *__pyx_t_7 = NULL;
  3001. PyObject *__pyx_t_8 = NULL;
  3002. int __pyx_t_9;
  3003. PyObject *__pyx_t_10 = NULL;
  3004. PyObject *__pyx_t_11 = NULL;
  3005. int __pyx_lineno = 0;
  3006. const char *__pyx_filename = NULL;
  3007. int __pyx_clineno = 0;
  3008. __Pyx_RefNannySetupContext("muterun_rb", 0);
  3009. /* "lib/Naked/toolshed/c/shell.pyx":135
  3010. * #------------------------------------------------------------------------------
  3011. * def muterun_rb(file_path, arguments=""):
  3012. * try: # <<<<<<<<<<<<<<
  3013. * if len(arguments) > 0:
  3014. * rb_command = 'ruby ' + file_path + " " + arguments
  3015. */
  3016. {
  3017. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  3018. __Pyx_XGOTREF(__pyx_t_1);
  3019. __Pyx_XGOTREF(__pyx_t_2);
  3020. __Pyx_XGOTREF(__pyx_t_3);
  3021. /*try:*/ {
  3022. /* "lib/Naked/toolshed/c/shell.pyx":136
  3023. * def muterun_rb(file_path, arguments=""):
  3024. * try:
  3025. * if len(arguments) > 0: # <<<<<<<<<<<<<<
  3026. * rb_command = 'ruby ' + file_path + " " + arguments
  3027. * else:
  3028. */
  3029. __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3030. __pyx_t_5 = ((__pyx_t_4 > 0) != 0);
  3031. if (__pyx_t_5) {
  3032. /* "lib/Naked/toolshed/c/shell.pyx":137
  3033. * try:
  3034. * if len(arguments) > 0:
  3035. * rb_command = 'ruby ' + file_path + " " + arguments # <<<<<<<<<<<<<<
  3036. * else:
  3037. * rb_command = 'ruby ' + file_path
  3038. */
  3039. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3040. __Pyx_GOTREF(__pyx_t_6);
  3041. __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3042. __Pyx_GOTREF(__pyx_t_7);
  3043. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3044. __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3045. __Pyx_GOTREF(__pyx_t_6);
  3046. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3047. __pyx_v_rb_command = __pyx_t_6;
  3048. __pyx_t_6 = 0;
  3049. goto __pyx_L11;
  3050. }
  3051. /*else*/ {
  3052. /* "lib/Naked/toolshed/c/shell.pyx":139
  3053. * rb_command = 'ruby ' + file_path + " " + arguments
  3054. * else:
  3055. * rb_command = 'ruby ' + file_path # <<<<<<<<<<<<<<
  3056. * return muterun(rb_command) # return result of muterun() of the ruby file
  3057. * except Exception as e:
  3058. */
  3059. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3060. __Pyx_GOTREF(__pyx_t_6);
  3061. __pyx_v_rb_command = __pyx_t_6;
  3062. __pyx_t_6 = 0;
  3063. }
  3064. __pyx_L11:;
  3065. /* "lib/Naked/toolshed/c/shell.pyx":140
  3066. * else:
  3067. * rb_command = 'ruby ' + file_path
  3068. * return muterun(rb_command) # return result of muterun() of the ruby file # <<<<<<<<<<<<<<
  3069. * except Exception as e:
  3070. * if DEBUG_FLAG:
  3071. */
  3072. __Pyx_XDECREF(__pyx_r);
  3073. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_muterun); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3074. __Pyx_GOTREF(__pyx_t_6);
  3075. __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3076. __Pyx_GOTREF(__pyx_t_7);
  3077. __Pyx_INCREF(__pyx_v_rb_command);
  3078. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rb_command);
  3079. __Pyx_GIVEREF(__pyx_v_rb_command);
  3080. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3081. __Pyx_GOTREF(__pyx_t_8);
  3082. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3083. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3084. __pyx_r = __pyx_t_8;
  3085. __pyx_t_8 = 0;
  3086. goto __pyx_L7_try_return;
  3087. }
  3088. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  3089. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3090. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3091. goto __pyx_L10_try_end;
  3092. __pyx_L3_error:;
  3093. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  3094. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  3095. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  3096. /* "lib/Naked/toolshed/c/shell.pyx":141
  3097. * rb_command = 'ruby ' + file_path
  3098. * return muterun(rb_command) # return result of muterun() of the ruby file
  3099. * except Exception as e: # <<<<<<<<<<<<<<
  3100. * if DEBUG_FLAG:
  3101. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).")
  3102. */
  3103. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  3104. if (__pyx_t_9) {
  3105. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_rb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3106. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3107. __Pyx_GOTREF(__pyx_t_8);
  3108. __Pyx_GOTREF(__pyx_t_7);
  3109. __Pyx_GOTREF(__pyx_t_6);
  3110. __Pyx_INCREF(__pyx_t_7);
  3111. __pyx_v_e = __pyx_t_7;
  3112. /* "lib/Naked/toolshed/c/shell.pyx":142
  3113. * return muterun(rb_command) # return result of muterun() of the ruby file
  3114. * except Exception as e:
  3115. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  3116. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).")
  3117. * raise e
  3118. */
  3119. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3120. __Pyx_GOTREF(__pyx_t_10);
  3121. __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3122. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3123. if (__pyx_t_5) {
  3124. /* "lib/Naked/toolshed/c/shell.pyx":143
  3125. * except Exception as e:
  3126. * if DEBUG_FLAG:
  3127. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  3128. * raise e
  3129. *
  3130. */
  3131. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3132. __Pyx_GOTREF(__pyx_t_10);
  3133. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3134. __Pyx_GOTREF(__pyx_t_11);
  3135. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3136. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3137. __Pyx_GOTREF(__pyx_t_10);
  3138. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  3139. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3140. __Pyx_GOTREF(__pyx_t_11);
  3141. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3142. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  3143. goto __pyx_L14;
  3144. }
  3145. __pyx_L14:;
  3146. /* "lib/Naked/toolshed/c/shell.pyx":144
  3147. * if DEBUG_FLAG:
  3148. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).")
  3149. * raise e # <<<<<<<<<<<<<<
  3150. *
  3151. * #------------------------------------------------------------------------------
  3152. */
  3153. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  3154. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3155. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  3156. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3157. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3158. goto __pyx_L4_exception_handled;
  3159. }
  3160. goto __pyx_L5_except_error;
  3161. __pyx_L5_except_error:;
  3162. __Pyx_XGIVEREF(__pyx_t_1);
  3163. __Pyx_XGIVEREF(__pyx_t_2);
  3164. __Pyx_XGIVEREF(__pyx_t_3);
  3165. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3166. goto __pyx_L1_error;
  3167. __pyx_L7_try_return:;
  3168. __Pyx_XGIVEREF(__pyx_t_1);
  3169. __Pyx_XGIVEREF(__pyx_t_2);
  3170. __Pyx_XGIVEREF(__pyx_t_3);
  3171. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3172. goto __pyx_L0;
  3173. __pyx_L4_exception_handled:;
  3174. __Pyx_XGIVEREF(__pyx_t_1);
  3175. __Pyx_XGIVEREF(__pyx_t_2);
  3176. __Pyx_XGIVEREF(__pyx_t_3);
  3177. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3178. __pyx_L10_try_end:;
  3179. }
  3180. /* "lib/Naked/toolshed/c/shell.pyx":134
  3181. * # [ muterun_rb function ] (NakedObject response object)
  3182. * #------------------------------------------------------------------------------
  3183. * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<<
  3184. * try:
  3185. * if len(arguments) > 0:
  3186. */
  3187. /* function exit code */
  3188. __pyx_L1_error:;
  3189. __Pyx_XDECREF(__pyx_t_6);
  3190. __Pyx_XDECREF(__pyx_t_7);
  3191. __Pyx_XDECREF(__pyx_t_8);
  3192. __Pyx_XDECREF(__pyx_t_10);
  3193. __Pyx_XDECREF(__pyx_t_11);
  3194. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_rb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3195. __pyx_r = NULL;
  3196. __pyx_L0:;
  3197. __Pyx_XDECREF(__pyx_v_rb_command);
  3198. __Pyx_XDECREF(__pyx_v_e);
  3199. __Pyx_XGIVEREF(__pyx_r);
  3200. __Pyx_RefNannyFinishContext();
  3201. return __pyx_r;
  3202. }
  3203. /* "lib/Naked/toolshed/c/shell.pyx":156
  3204. * # returns False for unsuccessful (!=0) exit status code
  3205. * #------------------------------------------------------------------------------
  3206. * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<<
  3207. * try:
  3208. * if len(arguments) > 0:
  3209. */
  3210. /* Python wrapper */
  3211. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_13execute_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3212. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_13execute_js = {__Pyx_NAMESTR("execute_js"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_13execute_js, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  3213. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_13execute_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3214. PyObject *__pyx_v_file_path = 0;
  3215. PyObject *__pyx_v_arguments = 0;
  3216. int __pyx_lineno = 0;
  3217. const char *__pyx_filename = NULL;
  3218. int __pyx_clineno = 0;
  3219. PyObject *__pyx_r = 0;
  3220. __Pyx_RefNannyDeclarations
  3221. __Pyx_RefNannySetupContext("execute_js (wrapper)", 0);
  3222. {
  3223. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0};
  3224. PyObject* values[2] = {0,0};
  3225. values[1] = ((PyObject *)__pyx_kp_s__4);
  3226. if (unlikely(__pyx_kwds)) {
  3227. Py_ssize_t kw_args;
  3228. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3229. switch (pos_args) {
  3230. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3231. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3232. case 0: break;
  3233. default: goto __pyx_L5_argtuple_error;
  3234. }
  3235. kw_args = PyDict_Size(__pyx_kwds);
  3236. switch (pos_args) {
  3237. case 0:
  3238. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--;
  3239. else goto __pyx_L5_argtuple_error;
  3240. case 1:
  3241. if (kw_args > 0) {
  3242. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments);
  3243. if (value) { values[1] = value; kw_args--; }
  3244. }
  3245. }
  3246. if (unlikely(kw_args > 0)) {
  3247. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute_js") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3248. }
  3249. } else {
  3250. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3251. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3252. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3253. break;
  3254. default: goto __pyx_L5_argtuple_error;
  3255. }
  3256. }
  3257. __pyx_v_file_path = values[0];
  3258. __pyx_v_arguments = values[1];
  3259. }
  3260. goto __pyx_L4_argument_unpacking_done;
  3261. __pyx_L5_argtuple_error:;
  3262. __Pyx_RaiseArgtupleInvalid("execute_js", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3263. __pyx_L3_error:;
  3264. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_js", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3265. __Pyx_RefNannyFinishContext();
  3266. return NULL;
  3267. __pyx_L4_argument_unpacking_done:;
  3268. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_12execute_js(__pyx_self, __pyx_v_file_path, __pyx_v_arguments);
  3269. /* function exit code */
  3270. __Pyx_RefNannyFinishContext();
  3271. return __pyx_r;
  3272. }
  3273. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_12execute_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) {
  3274. PyObject *__pyx_v_js_command = NULL;
  3275. PyObject *__pyx_v_e = NULL;
  3276. PyObject *__pyx_r = NULL;
  3277. __Pyx_RefNannyDeclarations
  3278. PyObject *__pyx_t_1 = NULL;
  3279. PyObject *__pyx_t_2 = NULL;
  3280. PyObject *__pyx_t_3 = NULL;
  3281. Py_ssize_t __pyx_t_4;
  3282. int __pyx_t_5;
  3283. PyObject *__pyx_t_6 = NULL;
  3284. PyObject *__pyx_t_7 = NULL;
  3285. PyObject *__pyx_t_8 = NULL;
  3286. int __pyx_t_9;
  3287. PyObject *__pyx_t_10 = NULL;
  3288. PyObject *__pyx_t_11 = NULL;
  3289. int __pyx_lineno = 0;
  3290. const char *__pyx_filename = NULL;
  3291. int __pyx_clineno = 0;
  3292. __Pyx_RefNannySetupContext("execute_js", 0);
  3293. /* "lib/Naked/toolshed/c/shell.pyx":157
  3294. * #------------------------------------------------------------------------------
  3295. * def execute_js(file_path, arguments=""):
  3296. * try: # <<<<<<<<<<<<<<
  3297. * if len(arguments) > 0:
  3298. * js_command = 'node ' + file_path + " " + arguments
  3299. */
  3300. {
  3301. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  3302. __Pyx_XGOTREF(__pyx_t_1);
  3303. __Pyx_XGOTREF(__pyx_t_2);
  3304. __Pyx_XGOTREF(__pyx_t_3);
  3305. /*try:*/ {
  3306. /* "lib/Naked/toolshed/c/shell.pyx":158
  3307. * def execute_js(file_path, arguments=""):
  3308. * try:
  3309. * if len(arguments) > 0: # <<<<<<<<<<<<<<
  3310. * js_command = 'node ' + file_path + " " + arguments
  3311. * else:
  3312. */
  3313. __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3314. __pyx_t_5 = ((__pyx_t_4 > 0) != 0);
  3315. if (__pyx_t_5) {
  3316. /* "lib/Naked/toolshed/c/shell.pyx":159
  3317. * try:
  3318. * if len(arguments) > 0:
  3319. * js_command = 'node ' + file_path + " " + arguments # <<<<<<<<<<<<<<
  3320. * else:
  3321. * js_command = 'node ' + file_path
  3322. */
  3323. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3324. __Pyx_GOTREF(__pyx_t_6);
  3325. __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3326. __Pyx_GOTREF(__pyx_t_7);
  3327. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3328. __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3329. __Pyx_GOTREF(__pyx_t_6);
  3330. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3331. __pyx_v_js_command = __pyx_t_6;
  3332. __pyx_t_6 = 0;
  3333. goto __pyx_L11;
  3334. }
  3335. /*else*/ {
  3336. /* "lib/Naked/toolshed/c/shell.pyx":161
  3337. * js_command = 'node ' + file_path + " " + arguments
  3338. * else:
  3339. * js_command = 'node ' + file_path # <<<<<<<<<<<<<<
  3340. * return execute(js_command) # return result of execute() of node.js file
  3341. * except Exception as e:
  3342. */
  3343. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3344. __Pyx_GOTREF(__pyx_t_6);
  3345. __pyx_v_js_command = __pyx_t_6;
  3346. __pyx_t_6 = 0;
  3347. }
  3348. __pyx_L11:;
  3349. /* "lib/Naked/toolshed/c/shell.pyx":162
  3350. * else:
  3351. * js_command = 'node ' + file_path
  3352. * return execute(js_command) # return result of execute() of node.js file # <<<<<<<<<<<<<<
  3353. * except Exception as e:
  3354. * if DEBUG_FLAG:
  3355. */
  3356. __Pyx_XDECREF(__pyx_r);
  3357. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_execute); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3358. __Pyx_GOTREF(__pyx_t_6);
  3359. __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3360. __Pyx_GOTREF(__pyx_t_7);
  3361. __Pyx_INCREF(__pyx_v_js_command);
  3362. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_js_command);
  3363. __Pyx_GIVEREF(__pyx_v_js_command);
  3364. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3365. __Pyx_GOTREF(__pyx_t_8);
  3366. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3367. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3368. __pyx_r = __pyx_t_8;
  3369. __pyx_t_8 = 0;
  3370. goto __pyx_L7_try_return;
  3371. }
  3372. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  3373. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3374. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3375. goto __pyx_L10_try_end;
  3376. __pyx_L3_error:;
  3377. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  3378. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  3379. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  3380. /* "lib/Naked/toolshed/c/shell.pyx":163
  3381. * js_command = 'node ' + file_path
  3382. * return execute(js_command) # return result of execute() of node.js file
  3383. * except Exception as e: # <<<<<<<<<<<<<<
  3384. * if DEBUG_FLAG:
  3385. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).")
  3386. */
  3387. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  3388. if (__pyx_t_9) {
  3389. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_js", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3390. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3391. __Pyx_GOTREF(__pyx_t_8);
  3392. __Pyx_GOTREF(__pyx_t_7);
  3393. __Pyx_GOTREF(__pyx_t_6);
  3394. __Pyx_INCREF(__pyx_t_7);
  3395. __pyx_v_e = __pyx_t_7;
  3396. /* "lib/Naked/toolshed/c/shell.pyx":164
  3397. * return execute(js_command) # return result of execute() of node.js file
  3398. * except Exception as e:
  3399. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  3400. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).")
  3401. * raise e
  3402. */
  3403. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3404. __Pyx_GOTREF(__pyx_t_10);
  3405. __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3406. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3407. if (__pyx_t_5) {
  3408. /* "lib/Naked/toolshed/c/shell.pyx":165
  3409. * except Exception as e:
  3410. * if DEBUG_FLAG:
  3411. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  3412. * raise e
  3413. * #------------------------------------------------------------------------------
  3414. */
  3415. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3416. __Pyx_GOTREF(__pyx_t_10);
  3417. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3418. __Pyx_GOTREF(__pyx_t_11);
  3419. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3420. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3421. __Pyx_GOTREF(__pyx_t_10);
  3422. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  3423. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3424. __Pyx_GOTREF(__pyx_t_11);
  3425. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3426. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  3427. goto __pyx_L14;
  3428. }
  3429. __pyx_L14:;
  3430. /* "lib/Naked/toolshed/c/shell.pyx":166
  3431. * if DEBUG_FLAG:
  3432. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).")
  3433. * raise e # <<<<<<<<<<<<<<
  3434. * #------------------------------------------------------------------------------
  3435. * # [ run_js function ] (byte string or False)
  3436. */
  3437. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  3438. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3439. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  3440. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3441. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3442. goto __pyx_L4_exception_handled;
  3443. }
  3444. goto __pyx_L5_except_error;
  3445. __pyx_L5_except_error:;
  3446. __Pyx_XGIVEREF(__pyx_t_1);
  3447. __Pyx_XGIVEREF(__pyx_t_2);
  3448. __Pyx_XGIVEREF(__pyx_t_3);
  3449. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3450. goto __pyx_L1_error;
  3451. __pyx_L7_try_return:;
  3452. __Pyx_XGIVEREF(__pyx_t_1);
  3453. __Pyx_XGIVEREF(__pyx_t_2);
  3454. __Pyx_XGIVEREF(__pyx_t_3);
  3455. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3456. goto __pyx_L0;
  3457. __pyx_L4_exception_handled:;
  3458. __Pyx_XGIVEREF(__pyx_t_1);
  3459. __Pyx_XGIVEREF(__pyx_t_2);
  3460. __Pyx_XGIVEREF(__pyx_t_3);
  3461. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3462. __pyx_L10_try_end:;
  3463. }
  3464. /* "lib/Naked/toolshed/c/shell.pyx":156
  3465. * # returns False for unsuccessful (!=0) exit status code
  3466. * #------------------------------------------------------------------------------
  3467. * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<<
  3468. * try:
  3469. * if len(arguments) > 0:
  3470. */
  3471. /* function exit code */
  3472. __pyx_L1_error:;
  3473. __Pyx_XDECREF(__pyx_t_6);
  3474. __Pyx_XDECREF(__pyx_t_7);
  3475. __Pyx_XDECREF(__pyx_t_8);
  3476. __Pyx_XDECREF(__pyx_t_10);
  3477. __Pyx_XDECREF(__pyx_t_11);
  3478. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_js", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3479. __pyx_r = NULL;
  3480. __pyx_L0:;
  3481. __Pyx_XDECREF(__pyx_v_js_command);
  3482. __Pyx_XDECREF(__pyx_v_e);
  3483. __Pyx_XGIVEREF(__pyx_r);
  3484. __Pyx_RefNannyFinishContext();
  3485. return __pyx_r;
  3486. }
  3487. /* "lib/Naked/toolshed/c/shell.pyx":176
  3488. * # returns False if the subprocess exits with a non-zero exit code
  3489. * #------------------------------------------------------------------------------
  3490. * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  3491. * try:
  3492. * if len(arguments) > 0:
  3493. */
  3494. /* Python wrapper */
  3495. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_15run_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3496. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_15run_js = {__Pyx_NAMESTR("run_js"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_15run_js, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  3497. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_15run_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3498. PyObject *__pyx_v_file_path = 0;
  3499. PyObject *__pyx_v_arguments = 0;
  3500. PyObject *__pyx_v_suppress_stdout = 0;
  3501. PyObject *__pyx_v_suppress_stderr = 0;
  3502. PyObject *__pyx_v_suppress_exit_status_call = 0;
  3503. int __pyx_lineno = 0;
  3504. const char *__pyx_filename = NULL;
  3505. int __pyx_clineno = 0;
  3506. PyObject *__pyx_r = 0;
  3507. __Pyx_RefNannyDeclarations
  3508. __Pyx_RefNannySetupContext("run_js (wrapper)", 0);
  3509. {
  3510. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,&__pyx_n_s_suppress_stdout,&__pyx_n_s_suppress_stderr,&__pyx_n_s_suppress_exit_status_call,0};
  3511. PyObject* values[5] = {0,0,0,0,0};
  3512. values[1] = ((PyObject *)__pyx_kp_s__4);
  3513. values[2] = ((PyObject *)Py_False);
  3514. values[3] = ((PyObject *)Py_False);
  3515. values[4] = ((PyObject *)Py_True);
  3516. if (unlikely(__pyx_kwds)) {
  3517. Py_ssize_t kw_args;
  3518. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3519. switch (pos_args) {
  3520. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3521. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3522. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3523. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3524. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3525. case 0: break;
  3526. default: goto __pyx_L5_argtuple_error;
  3527. }
  3528. kw_args = PyDict_Size(__pyx_kwds);
  3529. switch (pos_args) {
  3530. case 0:
  3531. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--;
  3532. else goto __pyx_L5_argtuple_error;
  3533. case 1:
  3534. if (kw_args > 0) {
  3535. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments);
  3536. if (value) { values[1] = value; kw_args--; }
  3537. }
  3538. case 2:
  3539. if (kw_args > 0) {
  3540. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stdout);
  3541. if (value) { values[2] = value; kw_args--; }
  3542. }
  3543. case 3:
  3544. if (kw_args > 0) {
  3545. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stderr);
  3546. if (value) { values[3] = value; kw_args--; }
  3547. }
  3548. case 4:
  3549. if (kw_args > 0) {
  3550. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_exit_status_call);
  3551. if (value) { values[4] = value; kw_args--; }
  3552. }
  3553. }
  3554. if (unlikely(kw_args > 0)) {
  3555. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_js") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3556. }
  3557. } else {
  3558. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3559. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3560. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3561. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3562. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3563. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3564. break;
  3565. default: goto __pyx_L5_argtuple_error;
  3566. }
  3567. }
  3568. __pyx_v_file_path = values[0];
  3569. __pyx_v_arguments = values[1];
  3570. __pyx_v_suppress_stdout = values[2];
  3571. __pyx_v_suppress_stderr = values[3];
  3572. __pyx_v_suppress_exit_status_call = values[4];
  3573. }
  3574. goto __pyx_L4_argument_unpacking_done;
  3575. __pyx_L5_argtuple_error:;
  3576. __Pyx_RaiseArgtupleInvalid("run_js", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3577. __pyx_L3_error:;
  3578. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_js", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3579. __Pyx_RefNannyFinishContext();
  3580. return NULL;
  3581. __pyx_L4_argument_unpacking_done:;
  3582. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_14run_js(__pyx_self, __pyx_v_file_path, __pyx_v_arguments, __pyx_v_suppress_stdout, __pyx_v_suppress_stderr, __pyx_v_suppress_exit_status_call);
  3583. /* function exit code */
  3584. __Pyx_RefNannyFinishContext();
  3585. return __pyx_r;
  3586. }
  3587. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_14run_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call) {
  3588. PyObject *__pyx_v_js_command = NULL;
  3589. PyObject *__pyx_v_e = NULL;
  3590. PyObject *__pyx_r = NULL;
  3591. __Pyx_RefNannyDeclarations
  3592. PyObject *__pyx_t_1 = NULL;
  3593. PyObject *__pyx_t_2 = NULL;
  3594. PyObject *__pyx_t_3 = NULL;
  3595. Py_ssize_t __pyx_t_4;
  3596. int __pyx_t_5;
  3597. PyObject *__pyx_t_6 = NULL;
  3598. PyObject *__pyx_t_7 = NULL;
  3599. PyObject *__pyx_t_8 = NULL;
  3600. int __pyx_t_9;
  3601. PyObject *__pyx_t_10 = NULL;
  3602. PyObject *__pyx_t_11 = NULL;
  3603. int __pyx_lineno = 0;
  3604. const char *__pyx_filename = NULL;
  3605. int __pyx_clineno = 0;
  3606. __Pyx_RefNannySetupContext("run_js", 0);
  3607. /* "lib/Naked/toolshed/c/shell.pyx":177
  3608. * #------------------------------------------------------------------------------
  3609. * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True):
  3610. * try: # <<<<<<<<<<<<<<
  3611. * if len(arguments) > 0:
  3612. * js_command = 'node ' + file_path + " " + arguments
  3613. */
  3614. {
  3615. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  3616. __Pyx_XGOTREF(__pyx_t_1);
  3617. __Pyx_XGOTREF(__pyx_t_2);
  3618. __Pyx_XGOTREF(__pyx_t_3);
  3619. /*try:*/ {
  3620. /* "lib/Naked/toolshed/c/shell.pyx":178
  3621. * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True):
  3622. * try:
  3623. * if len(arguments) > 0: # <<<<<<<<<<<<<<
  3624. * js_command = 'node ' + file_path + " " + arguments
  3625. * else:
  3626. */
  3627. __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3628. __pyx_t_5 = ((__pyx_t_4 > 0) != 0);
  3629. if (__pyx_t_5) {
  3630. /* "lib/Naked/toolshed/c/shell.pyx":179
  3631. * try:
  3632. * if len(arguments) > 0:
  3633. * js_command = 'node ' + file_path + " " + arguments # <<<<<<<<<<<<<<
  3634. * else:
  3635. * js_command = 'node ' + file_path
  3636. */
  3637. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3638. __Pyx_GOTREF(__pyx_t_6);
  3639. __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3640. __Pyx_GOTREF(__pyx_t_7);
  3641. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3642. __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3643. __Pyx_GOTREF(__pyx_t_6);
  3644. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3645. __pyx_v_js_command = __pyx_t_6;
  3646. __pyx_t_6 = 0;
  3647. goto __pyx_L11;
  3648. }
  3649. /*else*/ {
  3650. /* "lib/Naked/toolshed/c/shell.pyx":181
  3651. * js_command = 'node ' + file_path + " " + arguments
  3652. * else:
  3653. * js_command = 'node ' + file_path # <<<<<<<<<<<<<<
  3654. * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file
  3655. * except Exception as e:
  3656. */
  3657. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3658. __Pyx_GOTREF(__pyx_t_6);
  3659. __pyx_v_js_command = __pyx_t_6;
  3660. __pyx_t_6 = 0;
  3661. }
  3662. __pyx_L11:;
  3663. /* "lib/Naked/toolshed/c/shell.pyx":182
  3664. * else:
  3665. * js_command = 'node ' + file_path
  3666. * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file # <<<<<<<<<<<<<<
  3667. * except Exception as e:
  3668. * if DEBUG_FLAG:
  3669. */
  3670. __Pyx_XDECREF(__pyx_r);
  3671. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_run); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3672. __Pyx_GOTREF(__pyx_t_6);
  3673. __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3674. __Pyx_GOTREF(__pyx_t_7);
  3675. __Pyx_INCREF(__pyx_v_js_command);
  3676. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_js_command);
  3677. __Pyx_GIVEREF(__pyx_v_js_command);
  3678. __Pyx_INCREF(__pyx_v_suppress_stdout);
  3679. PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_suppress_stdout);
  3680. __Pyx_GIVEREF(__pyx_v_suppress_stdout);
  3681. __Pyx_INCREF(__pyx_v_suppress_stderr);
  3682. PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_suppress_stderr);
  3683. __Pyx_GIVEREF(__pyx_v_suppress_stderr);
  3684. __Pyx_INCREF(__pyx_v_suppress_exit_status_call);
  3685. PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_suppress_exit_status_call);
  3686. __Pyx_GIVEREF(__pyx_v_suppress_exit_status_call);
  3687. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3688. __Pyx_GOTREF(__pyx_t_8);
  3689. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3690. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3691. __pyx_r = __pyx_t_8;
  3692. __pyx_t_8 = 0;
  3693. goto __pyx_L7_try_return;
  3694. }
  3695. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  3696. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3697. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3698. goto __pyx_L10_try_end;
  3699. __pyx_L3_error:;
  3700. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  3701. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  3702. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  3703. /* "lib/Naked/toolshed/c/shell.pyx":183
  3704. * js_command = 'node ' + file_path
  3705. * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file
  3706. * except Exception as e: # <<<<<<<<<<<<<<
  3707. * if DEBUG_FLAG:
  3708. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).")
  3709. */
  3710. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  3711. if (__pyx_t_9) {
  3712. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_js", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3713. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3714. __Pyx_GOTREF(__pyx_t_8);
  3715. __Pyx_GOTREF(__pyx_t_7);
  3716. __Pyx_GOTREF(__pyx_t_6);
  3717. __Pyx_INCREF(__pyx_t_7);
  3718. __pyx_v_e = __pyx_t_7;
  3719. /* "lib/Naked/toolshed/c/shell.pyx":184
  3720. * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file
  3721. * except Exception as e:
  3722. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  3723. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).")
  3724. * raise e
  3725. */
  3726. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3727. __Pyx_GOTREF(__pyx_t_10);
  3728. __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3729. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3730. if (__pyx_t_5) {
  3731. /* "lib/Naked/toolshed/c/shell.pyx":185
  3732. * except Exception as e:
  3733. * if DEBUG_FLAG:
  3734. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  3735. * raise e
  3736. *
  3737. */
  3738. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3739. __Pyx_GOTREF(__pyx_t_10);
  3740. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3741. __Pyx_GOTREF(__pyx_t_11);
  3742. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3743. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3744. __Pyx_GOTREF(__pyx_t_10);
  3745. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  3746. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3747. __Pyx_GOTREF(__pyx_t_11);
  3748. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3749. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  3750. goto __pyx_L14;
  3751. }
  3752. __pyx_L14:;
  3753. /* "lib/Naked/toolshed/c/shell.pyx":186
  3754. * if DEBUG_FLAG:
  3755. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).")
  3756. * raise e # <<<<<<<<<<<<<<
  3757. *
  3758. * #------------------------------------------------------------------------------
  3759. */
  3760. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  3761. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3762. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  3763. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3764. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3765. goto __pyx_L4_exception_handled;
  3766. }
  3767. goto __pyx_L5_except_error;
  3768. __pyx_L5_except_error:;
  3769. __Pyx_XGIVEREF(__pyx_t_1);
  3770. __Pyx_XGIVEREF(__pyx_t_2);
  3771. __Pyx_XGIVEREF(__pyx_t_3);
  3772. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3773. goto __pyx_L1_error;
  3774. __pyx_L7_try_return:;
  3775. __Pyx_XGIVEREF(__pyx_t_1);
  3776. __Pyx_XGIVEREF(__pyx_t_2);
  3777. __Pyx_XGIVEREF(__pyx_t_3);
  3778. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3779. goto __pyx_L0;
  3780. __pyx_L4_exception_handled:;
  3781. __Pyx_XGIVEREF(__pyx_t_1);
  3782. __Pyx_XGIVEREF(__pyx_t_2);
  3783. __Pyx_XGIVEREF(__pyx_t_3);
  3784. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3785. __pyx_L10_try_end:;
  3786. }
  3787. /* "lib/Naked/toolshed/c/shell.pyx":176
  3788. * # returns False if the subprocess exits with a non-zero exit code
  3789. * #------------------------------------------------------------------------------
  3790. * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  3791. * try:
  3792. * if len(arguments) > 0:
  3793. */
  3794. /* function exit code */
  3795. __pyx_L1_error:;
  3796. __Pyx_XDECREF(__pyx_t_6);
  3797. __Pyx_XDECREF(__pyx_t_7);
  3798. __Pyx_XDECREF(__pyx_t_8);
  3799. __Pyx_XDECREF(__pyx_t_10);
  3800. __Pyx_XDECREF(__pyx_t_11);
  3801. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_js", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3802. __pyx_r = NULL;
  3803. __pyx_L0:;
  3804. __Pyx_XDECREF(__pyx_v_js_command);
  3805. __Pyx_XDECREF(__pyx_v_e);
  3806. __Pyx_XGIVEREF(__pyx_r);
  3807. __Pyx_RefNannyFinishContext();
  3808. return __pyx_r;
  3809. }
  3810. /* "lib/Naked/toolshed/c/shell.pyx":191
  3811. * # [ muterun_js function ] (NakedObject response object)
  3812. * #------------------------------------------------------------------------------
  3813. * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<<
  3814. * try:
  3815. * if len(arguments) > 0:
  3816. */
  3817. /* Python wrapper */
  3818. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_17muterun_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3819. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_17muterun_js = {__Pyx_NAMESTR("muterun_js"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_17muterun_js, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  3820. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_17muterun_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3821. PyObject *__pyx_v_file_path = 0;
  3822. PyObject *__pyx_v_arguments = 0;
  3823. int __pyx_lineno = 0;
  3824. const char *__pyx_filename = NULL;
  3825. int __pyx_clineno = 0;
  3826. PyObject *__pyx_r = 0;
  3827. __Pyx_RefNannyDeclarations
  3828. __Pyx_RefNannySetupContext("muterun_js (wrapper)", 0);
  3829. {
  3830. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0};
  3831. PyObject* values[2] = {0,0};
  3832. values[1] = ((PyObject *)__pyx_kp_s__4);
  3833. if (unlikely(__pyx_kwds)) {
  3834. Py_ssize_t kw_args;
  3835. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3836. switch (pos_args) {
  3837. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3838. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3839. case 0: break;
  3840. default: goto __pyx_L5_argtuple_error;
  3841. }
  3842. kw_args = PyDict_Size(__pyx_kwds);
  3843. switch (pos_args) {
  3844. case 0:
  3845. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--;
  3846. else goto __pyx_L5_argtuple_error;
  3847. case 1:
  3848. if (kw_args > 0) {
  3849. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments);
  3850. if (value) { values[1] = value; kw_args--; }
  3851. }
  3852. }
  3853. if (unlikely(kw_args > 0)) {
  3854. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "muterun_js") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3855. }
  3856. } else {
  3857. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3858. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3859. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3860. break;
  3861. default: goto __pyx_L5_argtuple_error;
  3862. }
  3863. }
  3864. __pyx_v_file_path = values[0];
  3865. __pyx_v_arguments = values[1];
  3866. }
  3867. goto __pyx_L4_argument_unpacking_done;
  3868. __pyx_L5_argtuple_error:;
  3869. __Pyx_RaiseArgtupleInvalid("muterun_js", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3870. __pyx_L3_error:;
  3871. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_js", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3872. __Pyx_RefNannyFinishContext();
  3873. return NULL;
  3874. __pyx_L4_argument_unpacking_done:;
  3875. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_16muterun_js(__pyx_self, __pyx_v_file_path, __pyx_v_arguments);
  3876. /* function exit code */
  3877. __Pyx_RefNannyFinishContext();
  3878. return __pyx_r;
  3879. }
  3880. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_16muterun_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) {
  3881. PyObject *__pyx_v_js_command = NULL;
  3882. PyObject *__pyx_v_e = NULL;
  3883. PyObject *__pyx_r = NULL;
  3884. __Pyx_RefNannyDeclarations
  3885. PyObject *__pyx_t_1 = NULL;
  3886. PyObject *__pyx_t_2 = NULL;
  3887. PyObject *__pyx_t_3 = NULL;
  3888. Py_ssize_t __pyx_t_4;
  3889. int __pyx_t_5;
  3890. PyObject *__pyx_t_6 = NULL;
  3891. PyObject *__pyx_t_7 = NULL;
  3892. PyObject *__pyx_t_8 = NULL;
  3893. int __pyx_t_9;
  3894. PyObject *__pyx_t_10 = NULL;
  3895. PyObject *__pyx_t_11 = NULL;
  3896. int __pyx_lineno = 0;
  3897. const char *__pyx_filename = NULL;
  3898. int __pyx_clineno = 0;
  3899. __Pyx_RefNannySetupContext("muterun_js", 0);
  3900. /* "lib/Naked/toolshed/c/shell.pyx":192
  3901. * #------------------------------------------------------------------------------
  3902. * def muterun_js(file_path, arguments=""):
  3903. * try: # <<<<<<<<<<<<<<
  3904. * if len(arguments) > 0:
  3905. * js_command = 'node ' + file_path + " " + arguments
  3906. */
  3907. {
  3908. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  3909. __Pyx_XGOTREF(__pyx_t_1);
  3910. __Pyx_XGOTREF(__pyx_t_2);
  3911. __Pyx_XGOTREF(__pyx_t_3);
  3912. /*try:*/ {
  3913. /* "lib/Naked/toolshed/c/shell.pyx":193
  3914. * def muterun_js(file_path, arguments=""):
  3915. * try:
  3916. * if len(arguments) > 0: # <<<<<<<<<<<<<<
  3917. * js_command = 'node ' + file_path + " " + arguments
  3918. * else:
  3919. */
  3920. __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3921. __pyx_t_5 = ((__pyx_t_4 > 0) != 0);
  3922. if (__pyx_t_5) {
  3923. /* "lib/Naked/toolshed/c/shell.pyx":194
  3924. * try:
  3925. * if len(arguments) > 0:
  3926. * js_command = 'node ' + file_path + " " + arguments # <<<<<<<<<<<<<<
  3927. * else:
  3928. * js_command = 'node ' + file_path
  3929. */
  3930. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3931. __Pyx_GOTREF(__pyx_t_6);
  3932. __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3933. __Pyx_GOTREF(__pyx_t_7);
  3934. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3935. __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3936. __Pyx_GOTREF(__pyx_t_6);
  3937. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3938. __pyx_v_js_command = __pyx_t_6;
  3939. __pyx_t_6 = 0;
  3940. goto __pyx_L11;
  3941. }
  3942. /*else*/ {
  3943. /* "lib/Naked/toolshed/c/shell.pyx":196
  3944. * js_command = 'node ' + file_path + " " + arguments
  3945. * else:
  3946. * js_command = 'node ' + file_path # <<<<<<<<<<<<<<
  3947. * return muterun(js_command) # return result of muterun() of node.js file
  3948. * except Exception as e:
  3949. */
  3950. __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3951. __Pyx_GOTREF(__pyx_t_6);
  3952. __pyx_v_js_command = __pyx_t_6;
  3953. __pyx_t_6 = 0;
  3954. }
  3955. __pyx_L11:;
  3956. /* "lib/Naked/toolshed/c/shell.pyx":197
  3957. * else:
  3958. * js_command = 'node ' + file_path
  3959. * return muterun(js_command) # return result of muterun() of node.js file # <<<<<<<<<<<<<<
  3960. * except Exception as e:
  3961. * if DEBUG_FLAG:
  3962. */
  3963. __Pyx_XDECREF(__pyx_r);
  3964. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_muterun); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3965. __Pyx_GOTREF(__pyx_t_6);
  3966. __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3967. __Pyx_GOTREF(__pyx_t_7);
  3968. __Pyx_INCREF(__pyx_v_js_command);
  3969. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_js_command);
  3970. __Pyx_GIVEREF(__pyx_v_js_command);
  3971. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3972. __Pyx_GOTREF(__pyx_t_8);
  3973. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3974. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  3975. __pyx_r = __pyx_t_8;
  3976. __pyx_t_8 = 0;
  3977. goto __pyx_L7_try_return;
  3978. }
  3979. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  3980. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3981. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3982. goto __pyx_L10_try_end;
  3983. __pyx_L3_error:;
  3984. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  3985. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  3986. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  3987. /* "lib/Naked/toolshed/c/shell.pyx":198
  3988. * js_command = 'node ' + file_path
  3989. * return muterun(js_command) # return result of muterun() of node.js file
  3990. * except Exception as e: # <<<<<<<<<<<<<<
  3991. * if DEBUG_FLAG:
  3992. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).")
  3993. */
  3994. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  3995. if (__pyx_t_9) {
  3996. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_js", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3997. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3998. __Pyx_GOTREF(__pyx_t_8);
  3999. __Pyx_GOTREF(__pyx_t_7);
  4000. __Pyx_GOTREF(__pyx_t_6);
  4001. __Pyx_INCREF(__pyx_t_7);
  4002. __pyx_v_e = __pyx_t_7;
  4003. /* "lib/Naked/toolshed/c/shell.pyx":199
  4004. * return muterun(js_command) # return result of muterun() of node.js file
  4005. * except Exception as e:
  4006. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  4007. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).")
  4008. * raise e
  4009. */
  4010. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4011. __Pyx_GOTREF(__pyx_t_10);
  4012. __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4013. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4014. if (__pyx_t_5) {
  4015. /* "lib/Naked/toolshed/c/shell.pyx":200
  4016. * except Exception as e:
  4017. * if DEBUG_FLAG:
  4018. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  4019. * raise e
  4020. *
  4021. */
  4022. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4023. __Pyx_GOTREF(__pyx_t_10);
  4024. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4025. __Pyx_GOTREF(__pyx_t_11);
  4026. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4027. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4028. __Pyx_GOTREF(__pyx_t_10);
  4029. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  4030. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4031. __Pyx_GOTREF(__pyx_t_11);
  4032. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4033. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  4034. goto __pyx_L14;
  4035. }
  4036. __pyx_L14:;
  4037. /* "lib/Naked/toolshed/c/shell.pyx":201
  4038. * if DEBUG_FLAG:
  4039. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).")
  4040. * raise e # <<<<<<<<<<<<<<
  4041. *
  4042. * #------------------------------------------------------------------------------
  4043. */
  4044. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  4045. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4046. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4047. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4048. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4049. goto __pyx_L4_exception_handled;
  4050. }
  4051. goto __pyx_L5_except_error;
  4052. __pyx_L5_except_error:;
  4053. __Pyx_XGIVEREF(__pyx_t_1);
  4054. __Pyx_XGIVEREF(__pyx_t_2);
  4055. __Pyx_XGIVEREF(__pyx_t_3);
  4056. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4057. goto __pyx_L1_error;
  4058. __pyx_L7_try_return:;
  4059. __Pyx_XGIVEREF(__pyx_t_1);
  4060. __Pyx_XGIVEREF(__pyx_t_2);
  4061. __Pyx_XGIVEREF(__pyx_t_3);
  4062. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4063. goto __pyx_L0;
  4064. __pyx_L4_exception_handled:;
  4065. __Pyx_XGIVEREF(__pyx_t_1);
  4066. __Pyx_XGIVEREF(__pyx_t_2);
  4067. __Pyx_XGIVEREF(__pyx_t_3);
  4068. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4069. __pyx_L10_try_end:;
  4070. }
  4071. /* "lib/Naked/toolshed/c/shell.pyx":191
  4072. * # [ muterun_js function ] (NakedObject response object)
  4073. * #------------------------------------------------------------------------------
  4074. * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<<
  4075. * try:
  4076. * if len(arguments) > 0:
  4077. */
  4078. /* function exit code */
  4079. __pyx_L1_error:;
  4080. __Pyx_XDECREF(__pyx_t_6);
  4081. __Pyx_XDECREF(__pyx_t_7);
  4082. __Pyx_XDECREF(__pyx_t_8);
  4083. __Pyx_XDECREF(__pyx_t_10);
  4084. __Pyx_XDECREF(__pyx_t_11);
  4085. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_js", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4086. __pyx_r = NULL;
  4087. __pyx_L0:;
  4088. __Pyx_XDECREF(__pyx_v_js_command);
  4089. __Pyx_XDECREF(__pyx_v_e);
  4090. __Pyx_XGIVEREF(__pyx_r);
  4091. __Pyx_RefNannyFinishContext();
  4092. return __pyx_r;
  4093. }
  4094. /* "lib/Naked/toolshed/c/shell.pyx":210
  4095. * #------------------------------------------------------------------------------
  4096. * class Environment():
  4097. * def __init__(self): # <<<<<<<<<<<<<<
  4098. * self.env = os.environ
  4099. * self.vars = list(os.environ.keys())
  4100. */
  4101. /* Python wrapper */
  4102. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
  4103. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__, METH_O, __Pyx_DOCSTR(0)};
  4104. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  4105. PyObject *__pyx_r = 0;
  4106. __Pyx_RefNannyDeclarations
  4107. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  4108. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment___init__(__pyx_self, ((PyObject *)__pyx_v_self));
  4109. /* function exit code */
  4110. __Pyx_RefNannyFinishContext();
  4111. return __pyx_r;
  4112. }
  4113. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  4114. PyObject *__pyx_r = NULL;
  4115. __Pyx_RefNannyDeclarations
  4116. PyObject *__pyx_t_1 = NULL;
  4117. PyObject *__pyx_t_2 = NULL;
  4118. int __pyx_lineno = 0;
  4119. const char *__pyx_filename = NULL;
  4120. int __pyx_clineno = 0;
  4121. __Pyx_RefNannySetupContext("__init__", 0);
  4122. /* "lib/Naked/toolshed/c/shell.pyx":211
  4123. * class Environment():
  4124. * def __init__(self):
  4125. * self.env = os.environ # <<<<<<<<<<<<<<
  4126. * self.vars = list(os.environ.keys())
  4127. *
  4128. */
  4129. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4130. __Pyx_GOTREF(__pyx_t_1);
  4131. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4132. __Pyx_GOTREF(__pyx_t_2);
  4133. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4134. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_env, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4135. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4136. /* "lib/Naked/toolshed/c/shell.pyx":212
  4137. * def __init__(self):
  4138. * self.env = os.environ
  4139. * self.vars = list(os.environ.keys()) # <<<<<<<<<<<<<<
  4140. *
  4141. * #------------------------------------------------------------------------------
  4142. */
  4143. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4144. __Pyx_GOTREF(__pyx_t_2);
  4145. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4146. __Pyx_GOTREF(__pyx_t_1);
  4147. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4148. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4149. __Pyx_GOTREF(__pyx_t_2);
  4150. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4151. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4152. __Pyx_GOTREF(__pyx_t_1);
  4153. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4154. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4155. __Pyx_GOTREF(__pyx_t_2);
  4156. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  4157. __Pyx_GIVEREF(__pyx_t_1);
  4158. __pyx_t_1 = 0;
  4159. __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4160. __Pyx_GOTREF(__pyx_t_1);
  4161. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4162. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_vars, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4163. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4164. /* "lib/Naked/toolshed/c/shell.pyx":210
  4165. * #------------------------------------------------------------------------------
  4166. * class Environment():
  4167. * def __init__(self): # <<<<<<<<<<<<<<
  4168. * self.env = os.environ
  4169. * self.vars = list(os.environ.keys())
  4170. */
  4171. /* function exit code */
  4172. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4173. goto __pyx_L0;
  4174. __pyx_L1_error:;
  4175. __Pyx_XDECREF(__pyx_t_1);
  4176. __Pyx_XDECREF(__pyx_t_2);
  4177. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4178. __pyx_r = NULL;
  4179. __pyx_L0:;
  4180. __Pyx_XGIVEREF(__pyx_r);
  4181. __Pyx_RefNannyFinishContext();
  4182. return __pyx_r;
  4183. }
  4184. /* "lib/Naked/toolshed/c/shell.pyx":218
  4185. * # return boolean for presence of a variable name in the shell environment
  4186. * #------------------------------------------------------------------------------
  4187. * def is_var(self, var_name): # <<<<<<<<<<<<<<
  4188. * try:
  4189. * return (var_name in self.vars)
  4190. */
  4191. /* Python wrapper */
  4192. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4193. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var = {__Pyx_NAMESTR("is_var"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  4194. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4195. PyObject *__pyx_v_self = 0;
  4196. PyObject *__pyx_v_var_name = 0;
  4197. int __pyx_lineno = 0;
  4198. const char *__pyx_filename = NULL;
  4199. int __pyx_clineno = 0;
  4200. PyObject *__pyx_r = 0;
  4201. __Pyx_RefNannyDeclarations
  4202. __Pyx_RefNannySetupContext("is_var (wrapper)", 0);
  4203. {
  4204. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var_name,0};
  4205. PyObject* values[2] = {0,0};
  4206. if (unlikely(__pyx_kwds)) {
  4207. Py_ssize_t kw_args;
  4208. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4209. switch (pos_args) {
  4210. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4211. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4212. case 0: break;
  4213. default: goto __pyx_L5_argtuple_error;
  4214. }
  4215. kw_args = PyDict_Size(__pyx_kwds);
  4216. switch (pos_args) {
  4217. case 0:
  4218. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  4219. else goto __pyx_L5_argtuple_error;
  4220. case 1:
  4221. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_name)) != 0)) kw_args--;
  4222. else {
  4223. __Pyx_RaiseArgtupleInvalid("is_var", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4224. }
  4225. }
  4226. if (unlikely(kw_args > 0)) {
  4227. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_var") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4228. }
  4229. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  4230. goto __pyx_L5_argtuple_error;
  4231. } else {
  4232. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4233. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4234. }
  4235. __pyx_v_self = values[0];
  4236. __pyx_v_var_name = values[1];
  4237. }
  4238. goto __pyx_L4_argument_unpacking_done;
  4239. __pyx_L5_argtuple_error:;
  4240. __Pyx_RaiseArgtupleInvalid("is_var", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4241. __pyx_L3_error:;
  4242. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.is_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4243. __Pyx_RefNannyFinishContext();
  4244. return NULL;
  4245. __pyx_L4_argument_unpacking_done:;
  4246. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_2is_var(__pyx_self, __pyx_v_self, __pyx_v_var_name);
  4247. /* function exit code */
  4248. __Pyx_RefNannyFinishContext();
  4249. return __pyx_r;
  4250. }
  4251. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_2is_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name) {
  4252. PyObject *__pyx_v_e = NULL;
  4253. PyObject *__pyx_r = NULL;
  4254. __Pyx_RefNannyDeclarations
  4255. PyObject *__pyx_t_1 = NULL;
  4256. PyObject *__pyx_t_2 = NULL;
  4257. PyObject *__pyx_t_3 = NULL;
  4258. PyObject *__pyx_t_4 = NULL;
  4259. int __pyx_t_5;
  4260. int __pyx_t_6;
  4261. PyObject *__pyx_t_7 = NULL;
  4262. PyObject *__pyx_t_8 = NULL;
  4263. PyObject *__pyx_t_9 = NULL;
  4264. PyObject *__pyx_t_10 = NULL;
  4265. int __pyx_lineno = 0;
  4266. const char *__pyx_filename = NULL;
  4267. int __pyx_clineno = 0;
  4268. __Pyx_RefNannySetupContext("is_var", 0);
  4269. /* "lib/Naked/toolshed/c/shell.pyx":219
  4270. * #------------------------------------------------------------------------------
  4271. * def is_var(self, var_name):
  4272. * try: # <<<<<<<<<<<<<<
  4273. * return (var_name in self.vars)
  4274. * except Exception as e:
  4275. */
  4276. {
  4277. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  4278. __Pyx_XGOTREF(__pyx_t_1);
  4279. __Pyx_XGOTREF(__pyx_t_2);
  4280. __Pyx_XGOTREF(__pyx_t_3);
  4281. /*try:*/ {
  4282. /* "lib/Naked/toolshed/c/shell.pyx":220
  4283. * def is_var(self, var_name):
  4284. * try:
  4285. * return (var_name in self.vars) # <<<<<<<<<<<<<<
  4286. * except Exception as e:
  4287. * if DEBUG_FLAG:
  4288. */
  4289. __Pyx_XDECREF(__pyx_r);
  4290. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4291. __Pyx_GOTREF(__pyx_t_4);
  4292. __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_var_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4293. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4294. __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4295. __Pyx_GOTREF(__pyx_t_4);
  4296. __pyx_r = __pyx_t_4;
  4297. __pyx_t_4 = 0;
  4298. goto __pyx_L7_try_return;
  4299. }
  4300. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  4301. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  4302. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4303. goto __pyx_L10_try_end;
  4304. __pyx_L3_error:;
  4305. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  4306. /* "lib/Naked/toolshed/c/shell.pyx":221
  4307. * try:
  4308. * return (var_name in self.vars)
  4309. * except Exception as e: # <<<<<<<<<<<<<<
  4310. * if DEBUG_FLAG:
  4311. * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).")
  4312. */
  4313. __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  4314. if (__pyx_t_6) {
  4315. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.is_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4316. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4317. __Pyx_GOTREF(__pyx_t_4);
  4318. __Pyx_GOTREF(__pyx_t_7);
  4319. __Pyx_GOTREF(__pyx_t_8);
  4320. __Pyx_INCREF(__pyx_t_7);
  4321. __pyx_v_e = __pyx_t_7;
  4322. /* "lib/Naked/toolshed/c/shell.pyx":222
  4323. * return (var_name in self.vars)
  4324. * except Exception as e:
  4325. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  4326. * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).")
  4327. * raise e
  4328. */
  4329. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4330. __Pyx_GOTREF(__pyx_t_9);
  4331. __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4332. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4333. if (__pyx_t_5) {
  4334. /* "lib/Naked/toolshed/c/shell.pyx":223
  4335. * except Exception as e:
  4336. * if DEBUG_FLAG:
  4337. * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<<
  4338. * raise e
  4339. *
  4340. */
  4341. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4342. __Pyx_GOTREF(__pyx_t_9);
  4343. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4344. __Pyx_GOTREF(__pyx_t_10);
  4345. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4346. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4347. __Pyx_GOTREF(__pyx_t_9);
  4348. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4349. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4350. __Pyx_GOTREF(__pyx_t_10);
  4351. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4352. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4353. goto __pyx_L13;
  4354. }
  4355. __pyx_L13:;
  4356. /* "lib/Naked/toolshed/c/shell.pyx":224
  4357. * if DEBUG_FLAG:
  4358. * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).")
  4359. * raise e # <<<<<<<<<<<<<<
  4360. *
  4361. * #------------------------------------------------------------------------------
  4362. */
  4363. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  4364. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4365. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4366. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4367. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4368. goto __pyx_L4_exception_handled;
  4369. }
  4370. goto __pyx_L5_except_error;
  4371. __pyx_L5_except_error:;
  4372. __Pyx_XGIVEREF(__pyx_t_1);
  4373. __Pyx_XGIVEREF(__pyx_t_2);
  4374. __Pyx_XGIVEREF(__pyx_t_3);
  4375. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4376. goto __pyx_L1_error;
  4377. __pyx_L7_try_return:;
  4378. __Pyx_XGIVEREF(__pyx_t_1);
  4379. __Pyx_XGIVEREF(__pyx_t_2);
  4380. __Pyx_XGIVEREF(__pyx_t_3);
  4381. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4382. goto __pyx_L0;
  4383. __pyx_L4_exception_handled:;
  4384. __Pyx_XGIVEREF(__pyx_t_1);
  4385. __Pyx_XGIVEREF(__pyx_t_2);
  4386. __Pyx_XGIVEREF(__pyx_t_3);
  4387. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4388. __pyx_L10_try_end:;
  4389. }
  4390. /* "lib/Naked/toolshed/c/shell.pyx":218
  4391. * # return boolean for presence of a variable name in the shell environment
  4392. * #------------------------------------------------------------------------------
  4393. * def is_var(self, var_name): # <<<<<<<<<<<<<<
  4394. * try:
  4395. * return (var_name in self.vars)
  4396. */
  4397. /* function exit code */
  4398. __pyx_L1_error:;
  4399. __Pyx_XDECREF(__pyx_t_4);
  4400. __Pyx_XDECREF(__pyx_t_7);
  4401. __Pyx_XDECREF(__pyx_t_8);
  4402. __Pyx_XDECREF(__pyx_t_9);
  4403. __Pyx_XDECREF(__pyx_t_10);
  4404. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.is_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4405. __pyx_r = NULL;
  4406. __pyx_L0:;
  4407. __Pyx_XDECREF(__pyx_v_e);
  4408. __Pyx_XGIVEREF(__pyx_r);
  4409. __Pyx_RefNannyFinishContext();
  4410. return __pyx_r;
  4411. }
  4412. /* "lib/Naked/toolshed/c/shell.pyx":231
  4413. * # returns empty string if the variable is not included in the environment variable list
  4414. * #------------------------------------------------------------------------------
  4415. * def get_var(self, var_name): # <<<<<<<<<<<<<<
  4416. * try:
  4417. * if var_name in self.vars:
  4418. */
  4419. /* Python wrapper */
  4420. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4421. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var = {__Pyx_NAMESTR("get_var"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  4422. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4423. PyObject *__pyx_v_self = 0;
  4424. PyObject *__pyx_v_var_name = 0;
  4425. int __pyx_lineno = 0;
  4426. const char *__pyx_filename = NULL;
  4427. int __pyx_clineno = 0;
  4428. PyObject *__pyx_r = 0;
  4429. __Pyx_RefNannyDeclarations
  4430. __Pyx_RefNannySetupContext("get_var (wrapper)", 0);
  4431. {
  4432. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var_name,0};
  4433. PyObject* values[2] = {0,0};
  4434. if (unlikely(__pyx_kwds)) {
  4435. Py_ssize_t kw_args;
  4436. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4437. switch (pos_args) {
  4438. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4439. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4440. case 0: break;
  4441. default: goto __pyx_L5_argtuple_error;
  4442. }
  4443. kw_args = PyDict_Size(__pyx_kwds);
  4444. switch (pos_args) {
  4445. case 0:
  4446. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  4447. else goto __pyx_L5_argtuple_error;
  4448. case 1:
  4449. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_name)) != 0)) kw_args--;
  4450. else {
  4451. __Pyx_RaiseArgtupleInvalid("get_var", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4452. }
  4453. }
  4454. if (unlikely(kw_args > 0)) {
  4455. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_var") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4456. }
  4457. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  4458. goto __pyx_L5_argtuple_error;
  4459. } else {
  4460. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4461. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4462. }
  4463. __pyx_v_self = values[0];
  4464. __pyx_v_var_name = values[1];
  4465. }
  4466. goto __pyx_L4_argument_unpacking_done;
  4467. __pyx_L5_argtuple_error:;
  4468. __Pyx_RaiseArgtupleInvalid("get_var", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4469. __pyx_L3_error:;
  4470. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4471. __Pyx_RefNannyFinishContext();
  4472. return NULL;
  4473. __pyx_L4_argument_unpacking_done:;
  4474. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_4get_var(__pyx_self, __pyx_v_self, __pyx_v_var_name);
  4475. /* function exit code */
  4476. __Pyx_RefNannyFinishContext();
  4477. return __pyx_r;
  4478. }
  4479. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_4get_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name) {
  4480. PyObject *__pyx_v_e = NULL;
  4481. PyObject *__pyx_r = NULL;
  4482. __Pyx_RefNannyDeclarations
  4483. PyObject *__pyx_t_1 = NULL;
  4484. PyObject *__pyx_t_2 = NULL;
  4485. PyObject *__pyx_t_3 = NULL;
  4486. PyObject *__pyx_t_4 = NULL;
  4487. int __pyx_t_5;
  4488. int __pyx_t_6;
  4489. PyObject *__pyx_t_7 = NULL;
  4490. int __pyx_t_8;
  4491. PyObject *__pyx_t_9 = NULL;
  4492. PyObject *__pyx_t_10 = NULL;
  4493. PyObject *__pyx_t_11 = NULL;
  4494. int __pyx_lineno = 0;
  4495. const char *__pyx_filename = NULL;
  4496. int __pyx_clineno = 0;
  4497. __Pyx_RefNannySetupContext("get_var", 0);
  4498. /* "lib/Naked/toolshed/c/shell.pyx":232
  4499. * #------------------------------------------------------------------------------
  4500. * def get_var(self, var_name):
  4501. * try: # <<<<<<<<<<<<<<
  4502. * if var_name in self.vars:
  4503. * return self.env[var_name]
  4504. */
  4505. {
  4506. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  4507. __Pyx_XGOTREF(__pyx_t_1);
  4508. __Pyx_XGOTREF(__pyx_t_2);
  4509. __Pyx_XGOTREF(__pyx_t_3);
  4510. /*try:*/ {
  4511. /* "lib/Naked/toolshed/c/shell.pyx":233
  4512. * def get_var(self, var_name):
  4513. * try:
  4514. * if var_name in self.vars: # <<<<<<<<<<<<<<
  4515. * return self.env[var_name]
  4516. * else:
  4517. */
  4518. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4519. __Pyx_GOTREF(__pyx_t_4);
  4520. __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_var_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4521. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4522. __pyx_t_6 = (__pyx_t_5 != 0);
  4523. if (__pyx_t_6) {
  4524. /* "lib/Naked/toolshed/c/shell.pyx":234
  4525. * try:
  4526. * if var_name in self.vars:
  4527. * return self.env[var_name] # <<<<<<<<<<<<<<
  4528. * else:
  4529. * return ""
  4530. */
  4531. __Pyx_XDECREF(__pyx_r);
  4532. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_env); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4533. __Pyx_GOTREF(__pyx_t_4);
  4534. __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_v_var_name); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;};
  4535. __Pyx_GOTREF(__pyx_t_7);
  4536. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4537. __pyx_r = __pyx_t_7;
  4538. __pyx_t_7 = 0;
  4539. goto __pyx_L7_try_return;
  4540. }
  4541. /*else*/ {
  4542. /* "lib/Naked/toolshed/c/shell.pyx":236
  4543. * return self.env[var_name]
  4544. * else:
  4545. * return "" # <<<<<<<<<<<<<<
  4546. * except Exception as e:
  4547. * if DEBUG_FLAG:
  4548. */
  4549. __Pyx_XDECREF(__pyx_r);
  4550. __Pyx_INCREF(__pyx_kp_s__4);
  4551. __pyx_r = __pyx_kp_s__4;
  4552. goto __pyx_L7_try_return;
  4553. }
  4554. }
  4555. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  4556. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  4557. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4558. goto __pyx_L10_try_end;
  4559. __pyx_L3_error:;
  4560. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  4561. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  4562. /* "lib/Naked/toolshed/c/shell.pyx":237
  4563. * else:
  4564. * return ""
  4565. * except Exception as e: # <<<<<<<<<<<<<<
  4566. * if DEBUG_FLAG:
  4567. * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).")
  4568. */
  4569. __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  4570. if (__pyx_t_8) {
  4571. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4572. if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4573. __Pyx_GOTREF(__pyx_t_7);
  4574. __Pyx_GOTREF(__pyx_t_4);
  4575. __Pyx_GOTREF(__pyx_t_9);
  4576. __Pyx_INCREF(__pyx_t_4);
  4577. __pyx_v_e = __pyx_t_4;
  4578. /* "lib/Naked/toolshed/c/shell.pyx":238
  4579. * return ""
  4580. * except Exception as e:
  4581. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  4582. * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).")
  4583. * raise e
  4584. */
  4585. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4586. __Pyx_GOTREF(__pyx_t_10);
  4587. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4588. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4589. if (__pyx_t_6) {
  4590. /* "lib/Naked/toolshed/c/shell.pyx":239
  4591. * except Exception as e:
  4592. * if DEBUG_FLAG:
  4593. * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<<
  4594. * raise e
  4595. *
  4596. */
  4597. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4598. __Pyx_GOTREF(__pyx_t_10);
  4599. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4600. __Pyx_GOTREF(__pyx_t_11);
  4601. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4602. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4603. __Pyx_GOTREF(__pyx_t_10);
  4604. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  4605. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4606. __Pyx_GOTREF(__pyx_t_11);
  4607. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4608. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  4609. goto __pyx_L14;
  4610. }
  4611. __pyx_L14:;
  4612. /* "lib/Naked/toolshed/c/shell.pyx":240
  4613. * if DEBUG_FLAG:
  4614. * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).")
  4615. * raise e # <<<<<<<<<<<<<<
  4616. *
  4617. * #------------------------------------------------------------------------------
  4618. */
  4619. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  4620. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4621. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4622. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4623. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4624. goto __pyx_L4_exception_handled;
  4625. }
  4626. goto __pyx_L5_except_error;
  4627. __pyx_L5_except_error:;
  4628. __Pyx_XGIVEREF(__pyx_t_1);
  4629. __Pyx_XGIVEREF(__pyx_t_2);
  4630. __Pyx_XGIVEREF(__pyx_t_3);
  4631. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4632. goto __pyx_L1_error;
  4633. __pyx_L7_try_return:;
  4634. __Pyx_XGIVEREF(__pyx_t_1);
  4635. __Pyx_XGIVEREF(__pyx_t_2);
  4636. __Pyx_XGIVEREF(__pyx_t_3);
  4637. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4638. goto __pyx_L0;
  4639. __pyx_L4_exception_handled:;
  4640. __Pyx_XGIVEREF(__pyx_t_1);
  4641. __Pyx_XGIVEREF(__pyx_t_2);
  4642. __Pyx_XGIVEREF(__pyx_t_3);
  4643. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4644. __pyx_L10_try_end:;
  4645. }
  4646. /* "lib/Naked/toolshed/c/shell.pyx":231
  4647. * # returns empty string if the variable is not included in the environment variable list
  4648. * #------------------------------------------------------------------------------
  4649. * def get_var(self, var_name): # <<<<<<<<<<<<<<
  4650. * try:
  4651. * if var_name in self.vars:
  4652. */
  4653. /* function exit code */
  4654. __pyx_L1_error:;
  4655. __Pyx_XDECREF(__pyx_t_4);
  4656. __Pyx_XDECREF(__pyx_t_7);
  4657. __Pyx_XDECREF(__pyx_t_9);
  4658. __Pyx_XDECREF(__pyx_t_10);
  4659. __Pyx_XDECREF(__pyx_t_11);
  4660. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4661. __pyx_r = NULL;
  4662. __pyx_L0:;
  4663. __Pyx_XDECREF(__pyx_v_e);
  4664. __Pyx_XGIVEREF(__pyx_r);
  4665. __Pyx_RefNannyFinishContext();
  4666. return __pyx_r;
  4667. }
  4668. /* "lib/Naked/toolshed/c/shell.pyx":247
  4669. * # if the variable name is not in the environment list, returns an empty list
  4670. * #------------------------------------------------------------------------------
  4671. * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<<
  4672. * try:
  4673. * if var_name in self.vars:
  4674. */
  4675. /* Python wrapper */
  4676. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4677. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list = {__Pyx_NAMESTR("get_split_var_list"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  4678. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4679. PyObject *__pyx_v_self = 0;
  4680. PyObject *__pyx_v_var_name = 0;
  4681. int __pyx_lineno = 0;
  4682. const char *__pyx_filename = NULL;
  4683. int __pyx_clineno = 0;
  4684. PyObject *__pyx_r = 0;
  4685. __Pyx_RefNannyDeclarations
  4686. __Pyx_RefNannySetupContext("get_split_var_list (wrapper)", 0);
  4687. {
  4688. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var_name,0};
  4689. PyObject* values[2] = {0,0};
  4690. if (unlikely(__pyx_kwds)) {
  4691. Py_ssize_t kw_args;
  4692. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4693. switch (pos_args) {
  4694. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4695. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4696. case 0: break;
  4697. default: goto __pyx_L5_argtuple_error;
  4698. }
  4699. kw_args = PyDict_Size(__pyx_kwds);
  4700. switch (pos_args) {
  4701. case 0:
  4702. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  4703. else goto __pyx_L5_argtuple_error;
  4704. case 1:
  4705. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_name)) != 0)) kw_args--;
  4706. else {
  4707. __Pyx_RaiseArgtupleInvalid("get_split_var_list", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4708. }
  4709. }
  4710. if (unlikely(kw_args > 0)) {
  4711. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_split_var_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4712. }
  4713. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  4714. goto __pyx_L5_argtuple_error;
  4715. } else {
  4716. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4717. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4718. }
  4719. __pyx_v_self = values[0];
  4720. __pyx_v_var_name = values[1];
  4721. }
  4722. goto __pyx_L4_argument_unpacking_done;
  4723. __pyx_L5_argtuple_error:;
  4724. __Pyx_RaiseArgtupleInvalid("get_split_var_list", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4725. __pyx_L3_error:;
  4726. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_split_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4727. __Pyx_RefNannyFinishContext();
  4728. return NULL;
  4729. __pyx_L4_argument_unpacking_done:;
  4730. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_6get_split_var_list(__pyx_self, __pyx_v_self, __pyx_v_var_name);
  4731. /* function exit code */
  4732. __Pyx_RefNannyFinishContext();
  4733. return __pyx_r;
  4734. }
  4735. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_6get_split_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name) {
  4736. PyObject *__pyx_v_e = NULL;
  4737. PyObject *__pyx_r = NULL;
  4738. __Pyx_RefNannyDeclarations
  4739. PyObject *__pyx_t_1 = NULL;
  4740. PyObject *__pyx_t_2 = NULL;
  4741. PyObject *__pyx_t_3 = NULL;
  4742. PyObject *__pyx_t_4 = NULL;
  4743. int __pyx_t_5;
  4744. int __pyx_t_6;
  4745. PyObject *__pyx_t_7 = NULL;
  4746. PyObject *__pyx_t_8 = NULL;
  4747. int __pyx_t_9;
  4748. PyObject *__pyx_t_10 = NULL;
  4749. PyObject *__pyx_t_11 = NULL;
  4750. int __pyx_lineno = 0;
  4751. const char *__pyx_filename = NULL;
  4752. int __pyx_clineno = 0;
  4753. __Pyx_RefNannySetupContext("get_split_var_list", 0);
  4754. /* "lib/Naked/toolshed/c/shell.pyx":248
  4755. * #------------------------------------------------------------------------------
  4756. * def get_split_var_list(self, var_name):
  4757. * try: # <<<<<<<<<<<<<<
  4758. * if var_name in self.vars:
  4759. * return self.env[var_name].split(os.pathsep)
  4760. */
  4761. {
  4762. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  4763. __Pyx_XGOTREF(__pyx_t_1);
  4764. __Pyx_XGOTREF(__pyx_t_2);
  4765. __Pyx_XGOTREF(__pyx_t_3);
  4766. /*try:*/ {
  4767. /* "lib/Naked/toolshed/c/shell.pyx":249
  4768. * def get_split_var_list(self, var_name):
  4769. * try:
  4770. * if var_name in self.vars: # <<<<<<<<<<<<<<
  4771. * return self.env[var_name].split(os.pathsep)
  4772. * else:
  4773. */
  4774. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4775. __Pyx_GOTREF(__pyx_t_4);
  4776. __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_var_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4777. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4778. __pyx_t_6 = (__pyx_t_5 != 0);
  4779. if (__pyx_t_6) {
  4780. /* "lib/Naked/toolshed/c/shell.pyx":250
  4781. * try:
  4782. * if var_name in self.vars:
  4783. * return self.env[var_name].split(os.pathsep) # <<<<<<<<<<<<<<
  4784. * else:
  4785. * return []
  4786. */
  4787. __Pyx_XDECREF(__pyx_r);
  4788. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_env); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4789. __Pyx_GOTREF(__pyx_t_4);
  4790. __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_v_var_name); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;};
  4791. __Pyx_GOTREF(__pyx_t_7);
  4792. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4793. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4794. __Pyx_GOTREF(__pyx_t_4);
  4795. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4796. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4797. __Pyx_GOTREF(__pyx_t_7);
  4798. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pathsep); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4799. __Pyx_GOTREF(__pyx_t_8);
  4800. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4801. __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4802. __Pyx_GOTREF(__pyx_t_7);
  4803. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
  4804. __Pyx_GIVEREF(__pyx_t_8);
  4805. __pyx_t_8 = 0;
  4806. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4807. __Pyx_GOTREF(__pyx_t_8);
  4808. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4809. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4810. __pyx_r = __pyx_t_8;
  4811. __pyx_t_8 = 0;
  4812. goto __pyx_L7_try_return;
  4813. }
  4814. /*else*/ {
  4815. /* "lib/Naked/toolshed/c/shell.pyx":252
  4816. * return self.env[var_name].split(os.pathsep)
  4817. * else:
  4818. * return [] # <<<<<<<<<<<<<<
  4819. * except Exception as e:
  4820. * if DEBUG_FLAG:
  4821. */
  4822. __Pyx_XDECREF(__pyx_r);
  4823. __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4824. __Pyx_GOTREF(__pyx_t_8);
  4825. __pyx_r = __pyx_t_8;
  4826. __pyx_t_8 = 0;
  4827. goto __pyx_L7_try_return;
  4828. }
  4829. }
  4830. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  4831. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  4832. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4833. goto __pyx_L10_try_end;
  4834. __pyx_L3_error:;
  4835. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  4836. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  4837. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  4838. /* "lib/Naked/toolshed/c/shell.pyx":253
  4839. * else:
  4840. * return []
  4841. * except Exception as e: # <<<<<<<<<<<<<<
  4842. * if DEBUG_FLAG:
  4843. * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).")
  4844. */
  4845. __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  4846. if (__pyx_t_9) {
  4847. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_split_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4848. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4849. __Pyx_GOTREF(__pyx_t_8);
  4850. __Pyx_GOTREF(__pyx_t_7);
  4851. __Pyx_GOTREF(__pyx_t_4);
  4852. __Pyx_INCREF(__pyx_t_7);
  4853. __pyx_v_e = __pyx_t_7;
  4854. /* "lib/Naked/toolshed/c/shell.pyx":254
  4855. * return []
  4856. * except Exception as e:
  4857. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  4858. * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).")
  4859. * raise e
  4860. */
  4861. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4862. __Pyx_GOTREF(__pyx_t_10);
  4863. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4864. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4865. if (__pyx_t_6) {
  4866. /* "lib/Naked/toolshed/c/shell.pyx":255
  4867. * except Exception as e:
  4868. * if DEBUG_FLAG:
  4869. * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<<
  4870. * raise e
  4871. *
  4872. */
  4873. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4874. __Pyx_GOTREF(__pyx_t_10);
  4875. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4876. __Pyx_GOTREF(__pyx_t_11);
  4877. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4878. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4879. __Pyx_GOTREF(__pyx_t_10);
  4880. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  4881. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4882. __Pyx_GOTREF(__pyx_t_11);
  4883. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4884. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  4885. goto __pyx_L14;
  4886. }
  4887. __pyx_L14:;
  4888. /* "lib/Naked/toolshed/c/shell.pyx":256
  4889. * if DEBUG_FLAG:
  4890. * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).")
  4891. * raise e # <<<<<<<<<<<<<<
  4892. *
  4893. *
  4894. */
  4895. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  4896. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4897. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4898. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4899. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4900. goto __pyx_L4_exception_handled;
  4901. }
  4902. goto __pyx_L5_except_error;
  4903. __pyx_L5_except_error:;
  4904. __Pyx_XGIVEREF(__pyx_t_1);
  4905. __Pyx_XGIVEREF(__pyx_t_2);
  4906. __Pyx_XGIVEREF(__pyx_t_3);
  4907. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4908. goto __pyx_L1_error;
  4909. __pyx_L7_try_return:;
  4910. __Pyx_XGIVEREF(__pyx_t_1);
  4911. __Pyx_XGIVEREF(__pyx_t_2);
  4912. __Pyx_XGIVEREF(__pyx_t_3);
  4913. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4914. goto __pyx_L0;
  4915. __pyx_L4_exception_handled:;
  4916. __Pyx_XGIVEREF(__pyx_t_1);
  4917. __Pyx_XGIVEREF(__pyx_t_2);
  4918. __Pyx_XGIVEREF(__pyx_t_3);
  4919. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4920. __pyx_L10_try_end:;
  4921. }
  4922. /* "lib/Naked/toolshed/c/shell.pyx":247
  4923. * # if the variable name is not in the environment list, returns an empty list
  4924. * #------------------------------------------------------------------------------
  4925. * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<<
  4926. * try:
  4927. * if var_name in self.vars:
  4928. */
  4929. /* function exit code */
  4930. __pyx_L1_error:;
  4931. __Pyx_XDECREF(__pyx_t_4);
  4932. __Pyx_XDECREF(__pyx_t_7);
  4933. __Pyx_XDECREF(__pyx_t_8);
  4934. __Pyx_XDECREF(__pyx_t_10);
  4935. __Pyx_XDECREF(__pyx_t_11);
  4936. __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_split_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4937. __pyx_r = NULL;
  4938. __pyx_L0:;
  4939. __Pyx_XDECREF(__pyx_v_e);
  4940. __Pyx_XGIVEREF(__pyx_r);
  4941. __Pyx_RefNannyFinishContext();
  4942. return __pyx_r;
  4943. }
  4944. static PyMethodDef __pyx_methods[] = {
  4945. {0, 0, 0, 0}
  4946. };
  4947. #if PY_MAJOR_VERSION >= 3
  4948. static struct PyModuleDef __pyx_moduledef = {
  4949. #if PY_VERSION_HEX < 0x03020000
  4950. { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  4951. #else
  4952. PyModuleDef_HEAD_INIT,
  4953. #endif
  4954. __Pyx_NAMESTR("shell"),
  4955. 0, /* m_doc */
  4956. -1, /* m_size */
  4957. __pyx_methods /* m_methods */,
  4958. NULL, /* m_reload */
  4959. NULL, /* m_traverse */
  4960. NULL, /* m_clear */
  4961. NULL /* m_free */
  4962. };
  4963. #endif
  4964. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  4965. {&__pyx_n_s_CalledProcessError, __pyx_k_CalledProcessError, sizeof(__pyx_k_CalledProcessError), 0, 0, 1, 1},
  4966. {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1},
  4967. {&__pyx_n_s_Environment, __pyx_k_Environment, sizeof(__pyx_k_Environment), 0, 0, 1, 1},
  4968. {&__pyx_n_s_Environment___init, __pyx_k_Environment___init, sizeof(__pyx_k_Environment___init), 0, 0, 1, 1},
  4969. {&__pyx_n_s_Environment_get_split_var_list, __pyx_k_Environment_get_split_var_list, sizeof(__pyx_k_Environment_get_split_var_list), 0, 0, 1, 1},
  4970. {&__pyx_n_s_Environment_get_var, __pyx_k_Environment_get_var, sizeof(__pyx_k_Environment_get_var), 0, 0, 1, 1},
  4971. {&__pyx_n_s_Environment_is_var, __pyx_k_Environment_is_var, sizeof(__pyx_k_Environment_is_var), 0, 0, 1, 1},
  4972. {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  4973. {&__pyx_n_s_NakedObject, __pyx_k_NakedObject, sizeof(__pyx_k_NakedObject), 0, 0, 1, 1},
  4974. {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0},
  4975. {&__pyx_kp_s_Naked_Framework_Error_unable_to_10, __pyx_k_Naked_Framework_Error_unable_to_10, sizeof(__pyx_k_Naked_Framework_Error_unable_to_10), 0, 0, 1, 0},
  4976. {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0},
  4977. {&__pyx_kp_s_Naked_Framework_Error_unable_to_3, __pyx_k_Naked_Framework_Error_unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_unable_to_3), 0, 0, 1, 0},
  4978. {&__pyx_kp_s_Naked_Framework_Error_unable_to_4, __pyx_k_Naked_Framework_Error_unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_unable_to_4), 0, 0, 1, 0},
  4979. {&__pyx_kp_s_Naked_Framework_Error_unable_to_5, __pyx_k_Naked_Framework_Error_unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_unable_to_5), 0, 0, 1, 0},
  4980. {&__pyx_kp_s_Naked_Framework_Error_unable_to_6, __pyx_k_Naked_Framework_Error_unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_unable_to_6), 0, 0, 1, 0},
  4981. {&__pyx_kp_s_Naked_Framework_Error_unable_to_7, __pyx_k_Naked_Framework_Error_unable_to_7, sizeof(__pyx_k_Naked_Framework_Error_unable_to_7), 0, 0, 1, 0},
  4982. {&__pyx_kp_s_Naked_Framework_Error_unable_to_8, __pyx_k_Naked_Framework_Error_unable_to_8, sizeof(__pyx_k_Naked_Framework_Error_unable_to_8), 0, 0, 1, 0},
  4983. {&__pyx_kp_s_Naked_Framework_Error_unable_to_9, __pyx_k_Naked_Framework_Error_unable_to_9, sizeof(__pyx_k_Naked_Framework_Error_unable_to_9), 0, 0, 1, 0},
  4984. {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1},
  4985. {&__pyx_n_s_Naked_toolshed_types, __pyx_k_Naked_toolshed_types, sizeof(__pyx_k_Naked_toolshed_types), 0, 0, 1, 1},
  4986. {&__pyx_n_s_STDOUT, __pyx_k_STDOUT, sizeof(__pyx_k_STDOUT), 0, 0, 1, 1},
  4987. {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  4988. {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0},
  4989. {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0},
  4990. {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0},
  4991. {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0},
  4992. {&__pyx_n_s_arguments, __pyx_k_arguments, sizeof(__pyx_k_arguments), 0, 0, 1, 1},
  4993. {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
  4994. {&__pyx_n_s_check_output, __pyx_k_check_output, sizeof(__pyx_k_check_output), 0, 0, 1, 1},
  4995. {&__pyx_n_s_command, __pyx_k_command, sizeof(__pyx_k_command), 0, 0, 1, 1},
  4996. {&__pyx_n_s_cpe, __pyx_k_cpe, sizeof(__pyx_k_cpe), 0, 0, 1, 1},
  4997. {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
  4998. {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  4999. {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  5000. {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  5001. {&__pyx_n_s_env, __pyx_k_env, sizeof(__pyx_k_env), 0, 0, 1, 1},
  5002. {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1},
  5003. {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1},
  5004. {&__pyx_n_s_execute_js, __pyx_k_execute_js, sizeof(__pyx_k_execute_js), 0, 0, 1, 1},
  5005. {&__pyx_n_s_execute_rb, __pyx_k_execute_rb, sizeof(__pyx_k_execute_rb), 0, 0, 1, 1},
  5006. {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  5007. {&__pyx_n_s_exitcode, __pyx_k_exitcode, sizeof(__pyx_k_exitcode), 0, 0, 1, 1},
  5008. {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  5009. {&__pyx_n_s_file_path, __pyx_k_file_path, sizeof(__pyx_k_file_path), 0, 0, 1, 1},
  5010. {&__pyx_n_s_get_split_var_list, __pyx_k_get_split_var_list, sizeof(__pyx_k_get_split_var_list), 0, 0, 1, 1},
  5011. {&__pyx_n_s_get_var, __pyx_k_get_var, sizeof(__pyx_k_get_var), 0, 0, 1, 1},
  5012. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  5013. {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  5014. {&__pyx_n_s_is_var, __pyx_k_is_var, sizeof(__pyx_k_is_var), 0, 0, 1, 1},
  5015. {&__pyx_n_s_js_command, __pyx_k_js_command, sizeof(__pyx_k_js_command), 0, 0, 1, 1},
  5016. {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  5017. {&__pyx_n_s_lib_Naked_toolshed_c_shell, __pyx_k_lib_Naked_toolshed_c_shell, sizeof(__pyx_k_lib_Naked_toolshed_c_shell), 0, 0, 1, 1},
  5018. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  5019. {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  5020. {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  5021. {&__pyx_n_s_muterun, __pyx_k_muterun, sizeof(__pyx_k_muterun), 0, 0, 1, 1},
  5022. {&__pyx_n_s_muterun_js, __pyx_k_muterun_js, sizeof(__pyx_k_muterun_js), 0, 0, 1, 1},
  5023. {&__pyx_n_s_muterun_rb, __pyx_k_muterun_rb, sizeof(__pyx_k_muterun_rb), 0, 0, 1, 1},
  5024. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  5025. {&__pyx_kp_s_node, __pyx_k_node, sizeof(__pyx_k_node), 0, 0, 1, 0},
  5026. {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  5027. {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
  5028. {&__pyx_n_s_pathsep, __pyx_k_pathsep, sizeof(__pyx_k_pathsep), 0, 0, 1, 1},
  5029. {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  5030. {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  5031. {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  5032. {&__pyx_n_s_rb_command, __pyx_k_rb_command, sizeof(__pyx_k_rb_command), 0, 0, 1, 1},
  5033. {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1},
  5034. {&__pyx_n_s_response_obj, __pyx_k_response_obj, sizeof(__pyx_k_response_obj), 0, 0, 1, 1},
  5035. {&__pyx_n_s_returncode, __pyx_k_returncode, sizeof(__pyx_k_returncode), 0, 0, 1, 1},
  5036. {&__pyx_kp_s_ruby, __pyx_k_ruby, sizeof(__pyx_k_ruby), 0, 0, 1, 0},
  5037. {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1},
  5038. {&__pyx_n_s_run_js, __pyx_k_run_js, sizeof(__pyx_k_run_js), 0, 0, 1, 1},
  5039. {&__pyx_n_s_run_rb, __pyx_k_run_rb, sizeof(__pyx_k_run_rb), 0, 0, 1, 1},
  5040. {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  5041. {&__pyx_n_s_shell, __pyx_k_shell, sizeof(__pyx_k_shell), 0, 0, 1, 1},
  5042. {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  5043. {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
  5044. {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  5045. {&__pyx_n_s_subprocess, __pyx_k_subprocess, sizeof(__pyx_k_subprocess), 0, 0, 1, 1},
  5046. {&__pyx_n_s_suppress_exit_status_call, __pyx_k_suppress_exit_status_call, sizeof(__pyx_k_suppress_exit_status_call), 0, 0, 1, 1},
  5047. {&__pyx_n_s_suppress_stderr, __pyx_k_suppress_stderr, sizeof(__pyx_k_suppress_stderr), 0, 0, 1, 1},
  5048. {&__pyx_n_s_suppress_stdout, __pyx_k_suppress_stdout, sizeof(__pyx_k_suppress_stdout), 0, 0, 1, 1},
  5049. {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  5050. {&__pyx_n_s_te, __pyx_k_te, sizeof(__pyx_k_te), 0, 0, 1, 1},
  5051. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  5052. {&__pyx_n_s_var_name, __pyx_k_var_name, sizeof(__pyx_k_var_name), 0, 0, 1, 1},
  5053. {&__pyx_n_s_vars, __pyx_k_vars, sizeof(__pyx_k_vars), 0, 0, 1, 1},
  5054. {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  5055. {0, 0, 0, 0, 0, 0, 0}
  5056. };
  5057. static int __Pyx_InitCachedBuiltins(void) {
  5058. __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5059. __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5060. return 0;
  5061. __pyx_L1_error:;
  5062. return -1;
  5063. }
  5064. static int __Pyx_InitCachedConstants(void) {
  5065. __Pyx_RefNannyDeclarations
  5066. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  5067. /* "lib/Naked/toolshed/c/shell.pyx":30
  5068. * except Exception as e:
  5069. * if DEBUG_FLAG:
  5070. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  5071. * raise e
  5072. *
  5073. */
  5074. __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5075. __Pyx_GOTREF(__pyx_tuple_);
  5076. __Pyx_GIVEREF(__pyx_tuple_);
  5077. /* "lib/Naked/toolshed/c/shell.pyx":60
  5078. * sys.exit(cpe.returncode)
  5079. * else:
  5080. * sys.exit(1) # <<<<<<<<<<<<<<
  5081. * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable)
  5082. * except Exception as e:
  5083. */
  5084. __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5085. __Pyx_GOTREF(__pyx_tuple__2);
  5086. __Pyx_GIVEREF(__pyx_tuple__2);
  5087. /* "lib/Naked/toolshed/c/shell.pyx":64
  5088. * except Exception as e:
  5089. * if DEBUG_FLAG:
  5090. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  5091. * raise e
  5092. *
  5093. */
  5094. __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5095. __Pyx_GOTREF(__pyx_tuple__3);
  5096. __Pyx_GIVEREF(__pyx_tuple__3);
  5097. /* "lib/Naked/toolshed/c/shell.pyx":92
  5098. * except Exception as e:
  5099. * if DEBUG_FLAG:
  5100. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  5101. * raise e
  5102. *
  5103. */
  5104. __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_3); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5105. __Pyx_GOTREF(__pyx_tuple__5);
  5106. __Pyx_GIVEREF(__pyx_tuple__5);
  5107. /* "lib/Naked/toolshed/c/shell.pyx":112
  5108. * except Exception as e:
  5109. * if DEBUG_FLAG:
  5110. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  5111. * raise e
  5112. *
  5113. */
  5114. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5115. __Pyx_GOTREF(__pyx_tuple__7);
  5116. __Pyx_GIVEREF(__pyx_tuple__7);
  5117. /* "lib/Naked/toolshed/c/shell.pyx":128
  5118. * except Exception as e:
  5119. * if DEBUG_FLAG:
  5120. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  5121. * raise e
  5122. *
  5123. */
  5124. __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5125. __Pyx_GOTREF(__pyx_tuple__8);
  5126. __Pyx_GIVEREF(__pyx_tuple__8);
  5127. /* "lib/Naked/toolshed/c/shell.pyx":143
  5128. * except Exception as e:
  5129. * if DEBUG_FLAG:
  5130. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  5131. * raise e
  5132. *
  5133. */
  5134. __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_5); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5135. __Pyx_GOTREF(__pyx_tuple__9);
  5136. __Pyx_GIVEREF(__pyx_tuple__9);
  5137. /* "lib/Naked/toolshed/c/shell.pyx":165
  5138. * except Exception as e:
  5139. * if DEBUG_FLAG:
  5140. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  5141. * raise e
  5142. * #------------------------------------------------------------------------------
  5143. */
  5144. __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_6); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5145. __Pyx_GOTREF(__pyx_tuple__10);
  5146. __Pyx_GIVEREF(__pyx_tuple__10);
  5147. /* "lib/Naked/toolshed/c/shell.pyx":185
  5148. * except Exception as e:
  5149. * if DEBUG_FLAG:
  5150. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  5151. * raise e
  5152. *
  5153. */
  5154. __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_6); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5155. __Pyx_GOTREF(__pyx_tuple__11);
  5156. __Pyx_GIVEREF(__pyx_tuple__11);
  5157. /* "lib/Naked/toolshed/c/shell.pyx":200
  5158. * except Exception as e:
  5159. * if DEBUG_FLAG:
  5160. * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<<
  5161. * raise e
  5162. *
  5163. */
  5164. __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_7); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5165. __Pyx_GOTREF(__pyx_tuple__12);
  5166. __Pyx_GIVEREF(__pyx_tuple__12);
  5167. /* "lib/Naked/toolshed/c/shell.pyx":223
  5168. * except Exception as e:
  5169. * if DEBUG_FLAG:
  5170. * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<<
  5171. * raise e
  5172. *
  5173. */
  5174. __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_8); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5175. __Pyx_GOTREF(__pyx_tuple__13);
  5176. __Pyx_GIVEREF(__pyx_tuple__13);
  5177. /* "lib/Naked/toolshed/c/shell.pyx":239
  5178. * except Exception as e:
  5179. * if DEBUG_FLAG:
  5180. * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<<
  5181. * raise e
  5182. *
  5183. */
  5184. __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_9); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5185. __Pyx_GOTREF(__pyx_tuple__14);
  5186. __Pyx_GIVEREF(__pyx_tuple__14);
  5187. /* "lib/Naked/toolshed/c/shell.pyx":255
  5188. * except Exception as e:
  5189. * if DEBUG_FLAG:
  5190. * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<<
  5191. * raise e
  5192. *
  5193. */
  5194. __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_10); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5195. __Pyx_GOTREF(__pyx_tuple__15);
  5196. __Pyx_GIVEREF(__pyx_tuple__15);
  5197. /* "lib/Naked/toolshed/c/shell.pyx":16
  5198. * # returns False if exit status != 0
  5199. * #------------------------------------------------------------------------------
  5200. * def execute(command): # <<<<<<<<<<<<<<
  5201. * try:
  5202. * response = subprocess.call(command, shell=True)
  5203. */
  5204. __pyx_tuple__16 = PyTuple_Pack(5, __pyx_n_s_command, __pyx_n_s_response, __pyx_n_s_cpe, __pyx_n_s_te, __pyx_n_s_e); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5205. __Pyx_GOTREF(__pyx_tuple__16);
  5206. __Pyx_GIVEREF(__pyx_tuple__16);
  5207. __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_execute, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5208. /* "lib/Naked/toolshed/c/shell.pyx":44
  5209. * # suppress_exit_status_call = False >> raise SystemExit with the returned status code
  5210. * #------------------------------------------------------------------------------
  5211. * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  5212. * try:
  5213. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  5214. */
  5215. __pyx_tuple__18 = PyTuple_Pack(8, __pyx_n_s_command, __pyx_n_s_suppress_stdout, __pyx_n_s_suppress_stderr, __pyx_n_s_suppress_exit_status_call, __pyx_n_s_response, __pyx_n_s_cpe, __pyx_n_s_te, __pyx_n_s_e); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5216. __Pyx_GOTREF(__pyx_tuple__18);
  5217. __Pyx_GIVEREF(__pyx_tuple__18);
  5218. __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_run, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5219. /* "lib/Naked/toolshed/c/shell.pyx":73
  5220. * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int)
  5221. * #------------------------------------------------------------------------------
  5222. * def muterun(command): # <<<<<<<<<<<<<<
  5223. * try:
  5224. * from Naked.toolshed.types import NakedObject
  5225. */
  5226. __pyx_tuple__20 = PyTuple_Pack(6, __pyx_n_s_command, __pyx_n_s_NakedObject, __pyx_n_s_response_obj, __pyx_n_s_response, __pyx_n_s_cpe, __pyx_n_s_e); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5227. __Pyx_GOTREF(__pyx_tuple__20);
  5228. __Pyx_GIVEREF(__pyx_tuple__20);
  5229. __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_muterun, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5230. /* "lib/Naked/toolshed/c/shell.pyx":103
  5231. * # execute a ruby script file in a shell subprocess
  5232. * #------------------------------------------------------------------------------
  5233. * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<<
  5234. * try:
  5235. * if len(arguments) > 0:
  5236. */
  5237. __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_rb_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5238. __Pyx_GOTREF(__pyx_tuple__22);
  5239. __Pyx_GIVEREF(__pyx_tuple__22);
  5240. __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_execute_rb, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5241. /* "lib/Naked/toolshed/c/shell.pyx":119
  5242. * # execute a ruby script file in a shell subprocess, return the output
  5243. * #------------------------------------------------------------------------------
  5244. * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  5245. * try:
  5246. * if len(arguments) > 0:
  5247. */
  5248. __pyx_tuple__24 = PyTuple_Pack(7, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_suppress_stdout, __pyx_n_s_suppress_stderr, __pyx_n_s_suppress_exit_status_call, __pyx_n_s_rb_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5249. __Pyx_GOTREF(__pyx_tuple__24);
  5250. __Pyx_GIVEREF(__pyx_tuple__24);
  5251. __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_run_rb, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5252. /* "lib/Naked/toolshed/c/shell.pyx":134
  5253. * # [ muterun_rb function ] (NakedObject response object)
  5254. * #------------------------------------------------------------------------------
  5255. * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<<
  5256. * try:
  5257. * if len(arguments) > 0:
  5258. */
  5259. __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_rb_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5260. __Pyx_GOTREF(__pyx_tuple__26);
  5261. __Pyx_GIVEREF(__pyx_tuple__26);
  5262. __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_muterun_rb, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5263. /* "lib/Naked/toolshed/c/shell.pyx":156
  5264. * # returns False for unsuccessful (!=0) exit status code
  5265. * #------------------------------------------------------------------------------
  5266. * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<<
  5267. * try:
  5268. * if len(arguments) > 0:
  5269. */
  5270. __pyx_tuple__28 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_js_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5271. __Pyx_GOTREF(__pyx_tuple__28);
  5272. __Pyx_GIVEREF(__pyx_tuple__28);
  5273. __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_execute_js, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5274. /* "lib/Naked/toolshed/c/shell.pyx":176
  5275. * # returns False if the subprocess exits with a non-zero exit code
  5276. * #------------------------------------------------------------------------------
  5277. * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  5278. * try:
  5279. * if len(arguments) > 0:
  5280. */
  5281. __pyx_tuple__30 = PyTuple_Pack(7, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_suppress_stdout, __pyx_n_s_suppress_stderr, __pyx_n_s_suppress_exit_status_call, __pyx_n_s_js_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5282. __Pyx_GOTREF(__pyx_tuple__30);
  5283. __Pyx_GIVEREF(__pyx_tuple__30);
  5284. __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_run_js, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5285. /* "lib/Naked/toolshed/c/shell.pyx":191
  5286. * # [ muterun_js function ] (NakedObject response object)
  5287. * #------------------------------------------------------------------------------
  5288. * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<<
  5289. * try:
  5290. * if len(arguments) > 0:
  5291. */
  5292. __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_js_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5293. __Pyx_GOTREF(__pyx_tuple__32);
  5294. __Pyx_GIVEREF(__pyx_tuple__32);
  5295. __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_muterun_js, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5296. /* "lib/Naked/toolshed/c/shell.pyx":210
  5297. * #------------------------------------------------------------------------------
  5298. * class Environment():
  5299. * def __init__(self): # <<<<<<<<<<<<<<
  5300. * self.env = os.environ
  5301. * self.vars = list(os.environ.keys())
  5302. */
  5303. __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5304. __Pyx_GOTREF(__pyx_tuple__34);
  5305. __Pyx_GIVEREF(__pyx_tuple__34);
  5306. __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5307. /* "lib/Naked/toolshed/c/shell.pyx":218
  5308. * # return boolean for presence of a variable name in the shell environment
  5309. * #------------------------------------------------------------------------------
  5310. * def is_var(self, var_name): # <<<<<<<<<<<<<<
  5311. * try:
  5312. * return (var_name in self.vars)
  5313. */
  5314. __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_var_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5315. __Pyx_GOTREF(__pyx_tuple__36);
  5316. __Pyx_GIVEREF(__pyx_tuple__36);
  5317. __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_var, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5318. /* "lib/Naked/toolshed/c/shell.pyx":231
  5319. * # returns empty string if the variable is not included in the environment variable list
  5320. * #------------------------------------------------------------------------------
  5321. * def get_var(self, var_name): # <<<<<<<<<<<<<<
  5322. * try:
  5323. * if var_name in self.vars:
  5324. */
  5325. __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_var_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5326. __Pyx_GOTREF(__pyx_tuple__38);
  5327. __Pyx_GIVEREF(__pyx_tuple__38);
  5328. __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_var, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5329. /* "lib/Naked/toolshed/c/shell.pyx":247
  5330. * # if the variable name is not in the environment list, returns an empty list
  5331. * #------------------------------------------------------------------------------
  5332. * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<<
  5333. * try:
  5334. * if var_name in self.vars:
  5335. */
  5336. __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_var_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5337. __Pyx_GOTREF(__pyx_tuple__40);
  5338. __Pyx_GIVEREF(__pyx_tuple__40);
  5339. __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_split_var_list, 247, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5340. __Pyx_RefNannyFinishContext();
  5341. return 0;
  5342. __pyx_L1_error:;
  5343. __Pyx_RefNannyFinishContext();
  5344. return -1;
  5345. }
  5346. static int __Pyx_InitGlobals(void) {
  5347. if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  5348. __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5349. __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5350. return 0;
  5351. __pyx_L1_error:;
  5352. return -1;
  5353. }
  5354. #if PY_MAJOR_VERSION < 3
  5355. PyMODINIT_FUNC initshell(void); /*proto*/
  5356. PyMODINIT_FUNC initshell(void)
  5357. #else
  5358. PyMODINIT_FUNC PyInit_shell(void); /*proto*/
  5359. PyMODINIT_FUNC PyInit_shell(void)
  5360. #endif
  5361. {
  5362. PyObject *__pyx_t_1 = NULL;
  5363. PyObject *__pyx_t_2 = NULL;
  5364. int __pyx_t_3;
  5365. int __pyx_lineno = 0;
  5366. const char *__pyx_filename = NULL;
  5367. int __pyx_clineno = 0;
  5368. __Pyx_RefNannyDeclarations
  5369. #if CYTHON_REFNANNY
  5370. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  5371. if (!__Pyx_RefNanny) {
  5372. PyErr_Clear();
  5373. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  5374. if (!__Pyx_RefNanny)
  5375. Py_FatalError("failed to import 'refnanny' module");
  5376. }
  5377. #endif
  5378. __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_shell(void)", 0);
  5379. if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5380. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5381. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5382. #ifdef __Pyx_CyFunction_USED
  5383. if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5384. #endif
  5385. #ifdef __Pyx_FusedFunction_USED
  5386. if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5387. #endif
  5388. #ifdef __Pyx_Generator_USED
  5389. if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5390. #endif
  5391. /*--- Library function declarations ---*/
  5392. /*--- Threads initialization code ---*/
  5393. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  5394. #ifdef WITH_THREAD /* Python build with threading support? */
  5395. PyEval_InitThreads();
  5396. #endif
  5397. #endif
  5398. /*--- Module creation code ---*/
  5399. #if PY_MAJOR_VERSION < 3
  5400. __pyx_m = Py_InitModule4(__Pyx_NAMESTR("shell"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  5401. #else
  5402. __pyx_m = PyModule_Create(&__pyx_moduledef);
  5403. #endif
  5404. if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5405. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5406. Py_INCREF(__pyx_d);
  5407. __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5408. #if CYTHON_COMPILING_IN_PYPY
  5409. Py_INCREF(__pyx_b);
  5410. #endif
  5411. if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  5412. /*--- Initialize various global constants etc. ---*/
  5413. if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5414. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  5415. if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5416. #endif
  5417. if (__pyx_module_is_main_lib__Naked__toolshed__c__shell) {
  5418. if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  5419. }
  5420. #if PY_MAJOR_VERSION >= 3
  5421. {
  5422. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5423. if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.shell")) {
  5424. if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.shell", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5425. }
  5426. }
  5427. #endif
  5428. /*--- Builtin init code ---*/
  5429. if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5430. /*--- Constants init code ---*/
  5431. if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5432. /*--- Global init code ---*/
  5433. /*--- Variable export code ---*/
  5434. /*--- Function export code ---*/
  5435. /*--- Type init code ---*/
  5436. /*--- Type import code ---*/
  5437. /*--- Variable import code ---*/
  5438. /*--- Function import code ---*/
  5439. /*--- Execution code ---*/
  5440. /* "lib/Naked/toolshed/c/shell.pyx":5
  5441. * # cython: profile=False
  5442. *
  5443. * import os # <<<<<<<<<<<<<<
  5444. * import sys
  5445. * import subprocess
  5446. */
  5447. __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5448. __Pyx_GOTREF(__pyx_t_1);
  5449. if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5450. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5451. /* "lib/Naked/toolshed/c/shell.pyx":6
  5452. *
  5453. * import os
  5454. * import sys # <<<<<<<<<<<<<<
  5455. * import subprocess
  5456. * from Naked.settings import debug as DEBUG_FLAG
  5457. */
  5458. __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5459. __Pyx_GOTREF(__pyx_t_1);
  5460. if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5461. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5462. /* "lib/Naked/toolshed/c/shell.pyx":7
  5463. * import os
  5464. * import sys
  5465. * import subprocess # <<<<<<<<<<<<<<
  5466. * from Naked.settings import debug as DEBUG_FLAG
  5467. *
  5468. */
  5469. __pyx_t_1 = __Pyx_Import(__pyx_n_s_subprocess, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5470. __Pyx_GOTREF(__pyx_t_1);
  5471. if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5472. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5473. /* "lib/Naked/toolshed/c/shell.pyx":8
  5474. * import sys
  5475. * import subprocess
  5476. * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<<
  5477. *
  5478. * #------------------------------------------------------------------------------
  5479. */
  5480. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5481. __Pyx_GOTREF(__pyx_t_1);
  5482. __Pyx_INCREF(__pyx_n_s_debug);
  5483. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug);
  5484. __Pyx_GIVEREF(__pyx_n_s_debug);
  5485. __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5486. __Pyx_GOTREF(__pyx_t_2);
  5487. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5488. __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5489. __Pyx_GOTREF(__pyx_t_1);
  5490. if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5491. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5492. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5493. /* "lib/Naked/toolshed/c/shell.pyx":16
  5494. * # returns False if exit status != 0
  5495. * #------------------------------------------------------------------------------
  5496. * def execute(command): # <<<<<<<<<<<<<<
  5497. * try:
  5498. * response = subprocess.call(command, shell=True)
  5499. */
  5500. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_1execute, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5501. __Pyx_GOTREF(__pyx_t_2);
  5502. if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5503. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5504. /* "lib/Naked/toolshed/c/shell.pyx":44
  5505. * # suppress_exit_status_call = False >> raise SystemExit with the returned status code
  5506. * #------------------------------------------------------------------------------
  5507. * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  5508. * try:
  5509. * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
  5510. */
  5511. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_3run, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5512. __Pyx_GOTREF(__pyx_t_2);
  5513. if (PyDict_SetItem(__pyx_d, __pyx_n_s_run, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5514. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5515. /* "lib/Naked/toolshed/c/shell.pyx":73
  5516. * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int)
  5517. * #------------------------------------------------------------------------------
  5518. * def muterun(command): # <<<<<<<<<<<<<<
  5519. * try:
  5520. * from Naked.toolshed.types import NakedObject
  5521. */
  5522. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_5muterun, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5523. __Pyx_GOTREF(__pyx_t_2);
  5524. if (PyDict_SetItem(__pyx_d, __pyx_n_s_muterun, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5525. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5526. /* "lib/Naked/toolshed/c/shell.pyx":103
  5527. * # execute a ruby script file in a shell subprocess
  5528. * #------------------------------------------------------------------------------
  5529. * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<<
  5530. * try:
  5531. * if len(arguments) > 0:
  5532. */
  5533. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_7execute_rb, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5534. __Pyx_GOTREF(__pyx_t_2);
  5535. if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_rb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5536. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5537. /* "lib/Naked/toolshed/c/shell.pyx":119
  5538. * # execute a ruby script file in a shell subprocess, return the output
  5539. * #------------------------------------------------------------------------------
  5540. * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  5541. * try:
  5542. * if len(arguments) > 0:
  5543. */
  5544. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_9run_rb, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5545. __Pyx_GOTREF(__pyx_t_2);
  5546. if (PyDict_SetItem(__pyx_d, __pyx_n_s_run_rb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5547. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5548. /* "lib/Naked/toolshed/c/shell.pyx":134
  5549. * # [ muterun_rb function ] (NakedObject response object)
  5550. * #------------------------------------------------------------------------------
  5551. * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<<
  5552. * try:
  5553. * if len(arguments) > 0:
  5554. */
  5555. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5556. __Pyx_GOTREF(__pyx_t_2);
  5557. if (PyDict_SetItem(__pyx_d, __pyx_n_s_muterun_rb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5558. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5559. /* "lib/Naked/toolshed/c/shell.pyx":156
  5560. * # returns False for unsuccessful (!=0) exit status code
  5561. * #------------------------------------------------------------------------------
  5562. * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<<
  5563. * try:
  5564. * if len(arguments) > 0:
  5565. */
  5566. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_13execute_js, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5567. __Pyx_GOTREF(__pyx_t_2);
  5568. if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_js, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5569. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5570. /* "lib/Naked/toolshed/c/shell.pyx":176
  5571. * # returns False if the subprocess exits with a non-zero exit code
  5572. * #------------------------------------------------------------------------------
  5573. * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<<
  5574. * try:
  5575. * if len(arguments) > 0:
  5576. */
  5577. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_15run_js, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5578. __Pyx_GOTREF(__pyx_t_2);
  5579. if (PyDict_SetItem(__pyx_d, __pyx_n_s_run_js, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5580. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5581. /* "lib/Naked/toolshed/c/shell.pyx":191
  5582. * # [ muterun_js function ] (NakedObject response object)
  5583. * #------------------------------------------------------------------------------
  5584. * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<<
  5585. * try:
  5586. * if len(arguments) > 0:
  5587. */
  5588. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_17muterun_js, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5589. __Pyx_GOTREF(__pyx_t_2);
  5590. if (PyDict_SetItem(__pyx_d, __pyx_n_s_muterun_js, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5591. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5592. /* "lib/Naked/toolshed/c/shell.pyx":209
  5593. * # self.vars = the environment variable names list
  5594. * #------------------------------------------------------------------------------
  5595. * class Environment(): # <<<<<<<<<<<<<<
  5596. * def __init__(self):
  5597. * self.env = os.environ
  5598. */
  5599. __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Environment, __pyx_n_s_Environment, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5600. __Pyx_GOTREF(__pyx_t_2);
  5601. /* "lib/Naked/toolshed/c/shell.pyx":210
  5602. * #------------------------------------------------------------------------------
  5603. * class Environment():
  5604. * def __init__(self): # <<<<<<<<<<<<<<
  5605. * self.env = os.environ
  5606. * self.vars = list(os.environ.keys())
  5607. */
  5608. __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__, 0, __pyx_n_s_Environment___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5609. __Pyx_GOTREF(__pyx_t_1);
  5610. if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5611. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5612. /* "lib/Naked/toolshed/c/shell.pyx":218
  5613. * # return boolean for presence of a variable name in the shell environment
  5614. * #------------------------------------------------------------------------------
  5615. * def is_var(self, var_name): # <<<<<<<<<<<<<<
  5616. * try:
  5617. * return (var_name in self.vars)
  5618. */
  5619. __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var, 0, __pyx_n_s_Environment_is_var, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5620. __Pyx_GOTREF(__pyx_t_1);
  5621. if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_is_var, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5622. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5623. /* "lib/Naked/toolshed/c/shell.pyx":231
  5624. * # returns empty string if the variable is not included in the environment variable list
  5625. * #------------------------------------------------------------------------------
  5626. * def get_var(self, var_name): # <<<<<<<<<<<<<<
  5627. * try:
  5628. * if var_name in self.vars:
  5629. */
  5630. __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var, 0, __pyx_n_s_Environment_get_var, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5631. __Pyx_GOTREF(__pyx_t_1);
  5632. if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_var, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5633. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5634. /* "lib/Naked/toolshed/c/shell.pyx":247
  5635. * # if the variable name is not in the environment list, returns an empty list
  5636. * #------------------------------------------------------------------------------
  5637. * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<<
  5638. * try:
  5639. * if var_name in self.vars:
  5640. */
  5641. __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list, 0, __pyx_n_s_Environment_get_split_var_list, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5642. __Pyx_GOTREF(__pyx_t_1);
  5643. if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_split_var_list, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5644. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5645. /* "lib/Naked/toolshed/c/shell.pyx":209
  5646. * # self.vars = the environment variable names list
  5647. * #------------------------------------------------------------------------------
  5648. * class Environment(): # <<<<<<<<<<<<<<
  5649. * def __init__(self):
  5650. * self.env = os.environ
  5651. */
  5652. __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Environment, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5653. __Pyx_GOTREF(__pyx_t_1);
  5654. if (PyDict_SetItem(__pyx_d, __pyx_n_s_Environment, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5655. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5656. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5657. /* "lib/Naked/toolshed/c/shell.pyx":259
  5658. *
  5659. *
  5660. * if __name__ == '__main__': # <<<<<<<<<<<<<<
  5661. * pass
  5662. * # e = Environment()
  5663. */
  5664. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5665. __Pyx_GOTREF(__pyx_t_2);
  5666. __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5667. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5668. if (__pyx_t_3) {
  5669. goto __pyx_L2;
  5670. }
  5671. __pyx_L2:;
  5672. /* "lib/Naked/toolshed/c/shell.pyx":1
  5673. * #!/usr/bin/env python # <<<<<<<<<<<<<<
  5674. * # encoding: utf-8
  5675. * # cython: profile=False
  5676. */
  5677. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5678. __Pyx_GOTREF(__pyx_t_2);
  5679. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5680. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5681. goto __pyx_L0;
  5682. __pyx_L1_error:;
  5683. __Pyx_XDECREF(__pyx_t_1);
  5684. __Pyx_XDECREF(__pyx_t_2);
  5685. if (__pyx_m) {
  5686. __Pyx_AddTraceback("init lib.Naked.toolshed.c.shell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5687. Py_DECREF(__pyx_m); __pyx_m = 0;
  5688. } else if (!PyErr_Occurred()) {
  5689. PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.shell");
  5690. }
  5691. __pyx_L0:;
  5692. __Pyx_RefNannyFinishContext();
  5693. #if PY_MAJOR_VERSION < 3
  5694. return;
  5695. #else
  5696. return __pyx_m;
  5697. #endif
  5698. }
  5699. /* Runtime support code */
  5700. #if CYTHON_REFNANNY
  5701. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  5702. PyObject *m = NULL, *p = NULL;
  5703. void *r = NULL;
  5704. m = PyImport_ImportModule((char *)modname);
  5705. if (!m) goto end;
  5706. p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  5707. if (!p) goto end;
  5708. r = PyLong_AsVoidPtr(p);
  5709. end:
  5710. Py_XDECREF(p);
  5711. Py_XDECREF(m);
  5712. return (__Pyx_RefNannyAPIStruct *)r;
  5713. }
  5714. #endif /* CYTHON_REFNANNY */
  5715. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  5716. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  5717. if (unlikely(!result)) {
  5718. PyErr_Format(PyExc_NameError,
  5719. #if PY_MAJOR_VERSION >= 3
  5720. "name '%U' is not defined", name);
  5721. #else
  5722. "name '%.200s' is not defined", PyString_AS_STRING(name));
  5723. #endif
  5724. }
  5725. return result;
  5726. }
  5727. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
  5728. PyObject *result;
  5729. #if CYTHON_COMPILING_IN_CPYTHON
  5730. result = PyDict_GetItem(__pyx_d, name);
  5731. if (result) {
  5732. Py_INCREF(result);
  5733. } else {
  5734. #else
  5735. result = PyObject_GetItem(__pyx_d, name);
  5736. if (!result) {
  5737. PyErr_Clear();
  5738. #endif
  5739. result = __Pyx_GetBuiltinName(name);
  5740. }
  5741. return result;
  5742. }
  5743. #if CYTHON_COMPILING_IN_CPYTHON
  5744. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  5745. PyObject *result;
  5746. ternaryfunc call = func->ob_type->tp_call;
  5747. if (unlikely(!call))
  5748. return PyObject_Call(func, arg, kw);
  5749. #if PY_VERSION_HEX >= 0x02060000
  5750. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  5751. return NULL;
  5752. #endif
  5753. result = (*call)(func, arg, kw);
  5754. #if PY_VERSION_HEX >= 0x02060000
  5755. Py_LeaveRecursiveCall();
  5756. #endif
  5757. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  5758. PyErr_SetString(
  5759. PyExc_SystemError,
  5760. "NULL result without error in PyObject_Call");
  5761. }
  5762. return result;
  5763. }
  5764. #endif
  5765. static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
  5766. #if CYTHON_COMPILING_IN_CPYTHON
  5767. PyThreadState *tstate = PyThreadState_GET();
  5768. *type = tstate->exc_type;
  5769. *value = tstate->exc_value;
  5770. *tb = tstate->exc_traceback;
  5771. Py_XINCREF(*type);
  5772. Py_XINCREF(*value);
  5773. Py_XINCREF(*tb);
  5774. #else
  5775. PyErr_GetExcInfo(type, value, tb);
  5776. #endif
  5777. }
  5778. static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
  5779. #if CYTHON_COMPILING_IN_CPYTHON
  5780. PyObject *tmp_type, *tmp_value, *tmp_tb;
  5781. PyThreadState *tstate = PyThreadState_GET();
  5782. tmp_type = tstate->exc_type;
  5783. tmp_value = tstate->exc_value;
  5784. tmp_tb = tstate->exc_traceback;
  5785. tstate->exc_type = type;
  5786. tstate->exc_value = value;
  5787. tstate->exc_traceback = tb;
  5788. Py_XDECREF(tmp_type);
  5789. Py_XDECREF(tmp_value);
  5790. Py_XDECREF(tmp_tb);
  5791. #else
  5792. PyErr_SetExcInfo(type, value, tb);
  5793. #endif
  5794. }
  5795. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
  5796. PyObject *local_type, *local_value, *local_tb;
  5797. #if CYTHON_COMPILING_IN_CPYTHON
  5798. PyObject *tmp_type, *tmp_value, *tmp_tb;
  5799. PyThreadState *tstate = PyThreadState_GET();
  5800. local_type = tstate->curexc_type;
  5801. local_value = tstate->curexc_value;
  5802. local_tb = tstate->curexc_traceback;
  5803. tstate->curexc_type = 0;
  5804. tstate->curexc_value = 0;
  5805. tstate->curexc_traceback = 0;
  5806. #else
  5807. PyErr_Fetch(&local_type, &local_value, &local_tb);
  5808. #endif
  5809. PyErr_NormalizeException(&local_type, &local_value, &local_tb);
  5810. #if CYTHON_COMPILING_IN_CPYTHON
  5811. if (unlikely(tstate->curexc_type))
  5812. #else
  5813. if (unlikely(PyErr_Occurred()))
  5814. #endif
  5815. goto bad;
  5816. #if PY_MAJOR_VERSION >= 3
  5817. if (local_tb) {
  5818. if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
  5819. goto bad;
  5820. }
  5821. #endif
  5822. Py_XINCREF(local_tb);
  5823. Py_XINCREF(local_type);
  5824. Py_XINCREF(local_value);
  5825. *type = local_type;
  5826. *value = local_value;
  5827. *tb = local_tb;
  5828. #if CYTHON_COMPILING_IN_CPYTHON
  5829. tmp_type = tstate->exc_type;
  5830. tmp_value = tstate->exc_value;
  5831. tmp_tb = tstate->exc_traceback;
  5832. tstate->exc_type = local_type;
  5833. tstate->exc_value = local_value;
  5834. tstate->exc_traceback = local_tb;
  5835. Py_XDECREF(tmp_type);
  5836. Py_XDECREF(tmp_value);
  5837. Py_XDECREF(tmp_tb);
  5838. #else
  5839. PyErr_SetExcInfo(local_type, local_value, local_tb);
  5840. #endif
  5841. return 0;
  5842. bad:
  5843. *type = 0;
  5844. *value = 0;
  5845. *tb = 0;
  5846. Py_XDECREF(local_type);
  5847. Py_XDECREF(local_value);
  5848. Py_XDECREF(local_tb);
  5849. return -1;
  5850. }
  5851. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
  5852. #if CYTHON_COMPILING_IN_CPYTHON
  5853. PyObject *tmp_type, *tmp_value, *tmp_tb;
  5854. PyThreadState *tstate = PyThreadState_GET();
  5855. tmp_type = tstate->curexc_type;
  5856. tmp_value = tstate->curexc_value;
  5857. tmp_tb = tstate->curexc_traceback;
  5858. tstate->curexc_type = type;
  5859. tstate->curexc_value = value;
  5860. tstate->curexc_traceback = tb;
  5861. Py_XDECREF(tmp_type);
  5862. Py_XDECREF(tmp_value);
  5863. Py_XDECREF(tmp_tb);
  5864. #else
  5865. PyErr_Restore(type, value, tb);
  5866. #endif
  5867. }
  5868. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
  5869. #if CYTHON_COMPILING_IN_CPYTHON
  5870. PyThreadState *tstate = PyThreadState_GET();
  5871. *type = tstate->curexc_type;
  5872. *value = tstate->curexc_value;
  5873. *tb = tstate->curexc_traceback;
  5874. tstate->curexc_type = 0;
  5875. tstate->curexc_value = 0;
  5876. tstate->curexc_traceback = 0;
  5877. #else
  5878. PyErr_Fetch(type, value, tb);
  5879. #endif
  5880. }
  5881. #if PY_MAJOR_VERSION < 3
  5882. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  5883. CYTHON_UNUSED PyObject *cause) {
  5884. Py_XINCREF(type);
  5885. if (!value || value == Py_None)
  5886. value = NULL;
  5887. else
  5888. Py_INCREF(value);
  5889. if (!tb || tb == Py_None)
  5890. tb = NULL;
  5891. else {
  5892. Py_INCREF(tb);
  5893. if (!PyTraceBack_Check(tb)) {
  5894. PyErr_SetString(PyExc_TypeError,
  5895. "raise: arg 3 must be a traceback or None");
  5896. goto raise_error;
  5897. }
  5898. }
  5899. #if PY_VERSION_HEX < 0x02050000
  5900. if (PyClass_Check(type)) {
  5901. #else
  5902. if (PyType_Check(type)) {
  5903. #endif
  5904. #if CYTHON_COMPILING_IN_PYPY
  5905. if (!value) {
  5906. Py_INCREF(Py_None);
  5907. value = Py_None;
  5908. }
  5909. #endif
  5910. PyErr_NormalizeException(&type, &value, &tb);
  5911. } else {
  5912. if (value) {
  5913. PyErr_SetString(PyExc_TypeError,
  5914. "instance exception may not have a separate value");
  5915. goto raise_error;
  5916. }
  5917. value = type;
  5918. #if PY_VERSION_HEX < 0x02050000
  5919. if (PyInstance_Check(type)) {
  5920. type = (PyObject*) ((PyInstanceObject*)type)->in_class;
  5921. Py_INCREF(type);
  5922. } else {
  5923. type = 0;
  5924. PyErr_SetString(PyExc_TypeError,
  5925. "raise: exception must be an old-style class or instance");
  5926. goto raise_error;
  5927. }
  5928. #else
  5929. type = (PyObject*) Py_TYPE(type);
  5930. Py_INCREF(type);
  5931. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  5932. PyErr_SetString(PyExc_TypeError,
  5933. "raise: exception class must be a subclass of BaseException");
  5934. goto raise_error;
  5935. }
  5936. #endif
  5937. }
  5938. __Pyx_ErrRestore(type, value, tb);
  5939. return;
  5940. raise_error:
  5941. Py_XDECREF(value);
  5942. Py_XDECREF(type);
  5943. Py_XDECREF(tb);
  5944. return;
  5945. }
  5946. #else /* Python 3+ */
  5947. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  5948. PyObject* owned_instance = NULL;
  5949. if (tb == Py_None) {
  5950. tb = 0;
  5951. } else if (tb && !PyTraceBack_Check(tb)) {
  5952. PyErr_SetString(PyExc_TypeError,
  5953. "raise: arg 3 must be a traceback or None");
  5954. goto bad;
  5955. }
  5956. if (value == Py_None)
  5957. value = 0;
  5958. if (PyExceptionInstance_Check(type)) {
  5959. if (value) {
  5960. PyErr_SetString(PyExc_TypeError,
  5961. "instance exception may not have a separate value");
  5962. goto bad;
  5963. }
  5964. value = type;
  5965. type = (PyObject*) Py_TYPE(value);
  5966. } else if (PyExceptionClass_Check(type)) {
  5967. PyObject *instance_class = NULL;
  5968. if (value && PyExceptionInstance_Check(value)) {
  5969. instance_class = (PyObject*) Py_TYPE(value);
  5970. if (instance_class != type) {
  5971. if (PyObject_IsSubclass(instance_class, type)) {
  5972. type = instance_class;
  5973. } else {
  5974. instance_class = NULL;
  5975. }
  5976. }
  5977. }
  5978. if (!instance_class) {
  5979. PyObject *args;
  5980. if (!value)
  5981. args = PyTuple_New(0);
  5982. else if (PyTuple_Check(value)) {
  5983. Py_INCREF(value);
  5984. args = value;
  5985. } else
  5986. args = PyTuple_Pack(1, value);
  5987. if (!args)
  5988. goto bad;
  5989. owned_instance = PyObject_Call(type, args, NULL);
  5990. Py_DECREF(args);
  5991. if (!owned_instance)
  5992. goto bad;
  5993. value = owned_instance;
  5994. if (!PyExceptionInstance_Check(value)) {
  5995. PyErr_Format(PyExc_TypeError,
  5996. "calling %R should have returned an instance of "
  5997. "BaseException, not %R",
  5998. type, Py_TYPE(value));
  5999. goto bad;
  6000. }
  6001. }
  6002. } else {
  6003. PyErr_SetString(PyExc_TypeError,
  6004. "raise: exception class must be a subclass of BaseException");
  6005. goto bad;
  6006. }
  6007. #if PY_VERSION_HEX >= 0x03030000
  6008. if (cause) {
  6009. #else
  6010. if (cause && cause != Py_None) {
  6011. #endif
  6012. PyObject *fixed_cause;
  6013. if (cause == Py_None) {
  6014. fixed_cause = NULL;
  6015. } else if (PyExceptionClass_Check(cause)) {
  6016. fixed_cause = PyObject_CallObject(cause, NULL);
  6017. if (fixed_cause == NULL)
  6018. goto bad;
  6019. } else if (PyExceptionInstance_Check(cause)) {
  6020. fixed_cause = cause;
  6021. Py_INCREF(fixed_cause);
  6022. } else {
  6023. PyErr_SetString(PyExc_TypeError,
  6024. "exception causes must derive from "
  6025. "BaseException");
  6026. goto bad;
  6027. }
  6028. PyException_SetCause(value, fixed_cause);
  6029. }
  6030. PyErr_SetObject(type, value);
  6031. if (tb) {
  6032. PyThreadState *tstate = PyThreadState_GET();
  6033. PyObject* tmp_tb = tstate->curexc_traceback;
  6034. if (tb != tmp_tb) {
  6035. Py_INCREF(tb);
  6036. tstate->curexc_traceback = tb;
  6037. Py_XDECREF(tmp_tb);
  6038. }
  6039. }
  6040. bad:
  6041. Py_XDECREF(owned_instance);
  6042. return;
  6043. }
  6044. #endif
  6045. static void __Pyx_RaiseDoubleKeywordsError(
  6046. const char* func_name,
  6047. PyObject* kw_name)
  6048. {
  6049. PyErr_Format(PyExc_TypeError,
  6050. #if PY_MAJOR_VERSION >= 3
  6051. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  6052. #else
  6053. "%s() got multiple values for keyword argument '%s'", func_name,
  6054. PyString_AsString(kw_name));
  6055. #endif
  6056. }
  6057. static int __Pyx_ParseOptionalKeywords(
  6058. PyObject *kwds,
  6059. PyObject **argnames[],
  6060. PyObject *kwds2,
  6061. PyObject *values[],
  6062. Py_ssize_t num_pos_args,
  6063. const char* function_name)
  6064. {
  6065. PyObject *key = 0, *value = 0;
  6066. Py_ssize_t pos = 0;
  6067. PyObject*** name;
  6068. PyObject*** first_kw_arg = argnames + num_pos_args;
  6069. while (PyDict_Next(kwds, &pos, &key, &value)) {
  6070. name = first_kw_arg;
  6071. while (*name && (**name != key)) name++;
  6072. if (*name) {
  6073. values[name-argnames] = value;
  6074. continue;
  6075. }
  6076. name = first_kw_arg;
  6077. #if PY_MAJOR_VERSION < 3
  6078. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  6079. while (*name) {
  6080. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  6081. && _PyString_Eq(**name, key)) {
  6082. values[name-argnames] = value;
  6083. break;
  6084. }
  6085. name++;
  6086. }
  6087. if (*name) continue;
  6088. else {
  6089. PyObject*** argname = argnames;
  6090. while (argname != first_kw_arg) {
  6091. if ((**argname == key) || (
  6092. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  6093. && _PyString_Eq(**argname, key))) {
  6094. goto arg_passed_twice;
  6095. }
  6096. argname++;
  6097. }
  6098. }
  6099. } else
  6100. #endif
  6101. if (likely(PyUnicode_Check(key))) {
  6102. while (*name) {
  6103. int cmp = (**name == key) ? 0 :
  6104. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6105. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  6106. #endif
  6107. PyUnicode_Compare(**name, key);
  6108. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6109. if (cmp == 0) {
  6110. values[name-argnames] = value;
  6111. break;
  6112. }
  6113. name++;
  6114. }
  6115. if (*name) continue;
  6116. else {
  6117. PyObject*** argname = argnames;
  6118. while (argname != first_kw_arg) {
  6119. int cmp = (**argname == key) ? 0 :
  6120. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6121. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  6122. #endif
  6123. PyUnicode_Compare(**argname, key);
  6124. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6125. if (cmp == 0) goto arg_passed_twice;
  6126. argname++;
  6127. }
  6128. }
  6129. } else
  6130. goto invalid_keyword_type;
  6131. if (kwds2) {
  6132. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  6133. } else {
  6134. goto invalid_keyword;
  6135. }
  6136. }
  6137. return 0;
  6138. arg_passed_twice:
  6139. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  6140. goto bad;
  6141. invalid_keyword_type:
  6142. PyErr_Format(PyExc_TypeError,
  6143. "%.200s() keywords must be strings", function_name);
  6144. goto bad;
  6145. invalid_keyword:
  6146. PyErr_Format(PyExc_TypeError,
  6147. #if PY_MAJOR_VERSION < 3
  6148. "%.200s() got an unexpected keyword argument '%.200s'",
  6149. function_name, PyString_AsString(key));
  6150. #else
  6151. "%s() got an unexpected keyword argument '%U'",
  6152. function_name, key);
  6153. #endif
  6154. bad:
  6155. return -1;
  6156. }
  6157. static void __Pyx_RaiseArgtupleInvalid(
  6158. const char* func_name,
  6159. int exact,
  6160. Py_ssize_t num_min,
  6161. Py_ssize_t num_max,
  6162. Py_ssize_t num_found)
  6163. {
  6164. Py_ssize_t num_expected;
  6165. const char *more_or_less;
  6166. if (num_found < num_min) {
  6167. num_expected = num_min;
  6168. more_or_less = "at least";
  6169. } else {
  6170. num_expected = num_max;
  6171. more_or_less = "at most";
  6172. }
  6173. if (exact) {
  6174. more_or_less = "exactly";
  6175. }
  6176. PyErr_Format(PyExc_TypeError,
  6177. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  6178. func_name, more_or_less, num_expected,
  6179. (num_expected == 1) ? "" : "s", num_found);
  6180. }
  6181. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  6182. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  6183. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  6184. PyErr_Format(PyExc_ImportError,
  6185. #if PY_MAJOR_VERSION < 3
  6186. "cannot import name %.230s", PyString_AS_STRING(name));
  6187. #else
  6188. "cannot import name %S", name);
  6189. #endif
  6190. }
  6191. return value;
  6192. }
  6193. static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
  6194. PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
  6195. }
  6196. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
  6197. PyObject* fake_module;
  6198. PyTypeObject* cached_type = NULL;
  6199. fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
  6200. if (!fake_module) return NULL;
  6201. Py_INCREF(fake_module);
  6202. cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
  6203. if (cached_type) {
  6204. if (!PyType_Check((PyObject*)cached_type)) {
  6205. PyErr_Format(PyExc_TypeError,
  6206. "Shared Cython type %.200s is not a type object",
  6207. type->tp_name);
  6208. goto bad;
  6209. }
  6210. if (cached_type->tp_basicsize != type->tp_basicsize) {
  6211. PyErr_Format(PyExc_TypeError,
  6212. "Shared Cython type %.200s has the wrong size, try recompiling",
  6213. type->tp_name);
  6214. goto bad;
  6215. }
  6216. } else {
  6217. if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
  6218. PyErr_Clear();
  6219. if (PyType_Ready(type) < 0) goto bad;
  6220. if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
  6221. goto bad;
  6222. Py_INCREF(type);
  6223. cached_type = type;
  6224. }
  6225. done:
  6226. Py_DECREF(fake_module);
  6227. return cached_type;
  6228. bad:
  6229. Py_XDECREF(cached_type);
  6230. cached_type = NULL;
  6231. goto done;
  6232. }
  6233. static PyObject *
  6234. __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
  6235. {
  6236. if (unlikely(op->func_doc == NULL)) {
  6237. if (op->func.m_ml->ml_doc) {
  6238. #if PY_MAJOR_VERSION >= 3
  6239. op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
  6240. #else
  6241. op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
  6242. #endif
  6243. if (unlikely(op->func_doc == NULL))
  6244. return NULL;
  6245. } else {
  6246. Py_INCREF(Py_None);
  6247. return Py_None;
  6248. }
  6249. }
  6250. Py_INCREF(op->func_doc);
  6251. return op->func_doc;
  6252. }
  6253. static int
  6254. __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
  6255. {
  6256. PyObject *tmp = op->func_doc;
  6257. if (value == NULL)
  6258. value = Py_None; /* Mark as deleted */
  6259. Py_INCREF(value);
  6260. op->func_doc = value;
  6261. Py_XDECREF(tmp);
  6262. return 0;
  6263. }
  6264. static PyObject *
  6265. __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
  6266. {
  6267. if (unlikely(op->func_name == NULL)) {
  6268. #if PY_MAJOR_VERSION >= 3
  6269. op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
  6270. #else
  6271. op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
  6272. #endif
  6273. if (unlikely(op->func_name == NULL))
  6274. return NULL;
  6275. }
  6276. Py_INCREF(op->func_name);
  6277. return op->func_name;
  6278. }
  6279. static int
  6280. __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
  6281. {
  6282. PyObject *tmp;
  6283. #if PY_MAJOR_VERSION >= 3
  6284. if (unlikely(value == NULL || !PyUnicode_Check(value))) {
  6285. #else
  6286. if (unlikely(value == NULL || !PyString_Check(value))) {
  6287. #endif
  6288. PyErr_SetString(PyExc_TypeError,
  6289. "__name__ must be set to a string object");
  6290. return -1;
  6291. }
  6292. tmp = op->func_name;
  6293. Py_INCREF(value);
  6294. op->func_name = value;
  6295. Py_XDECREF(tmp);
  6296. return 0;
  6297. }
  6298. static PyObject *
  6299. __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
  6300. {
  6301. Py_INCREF(op->func_qualname);
  6302. return op->func_qualname;
  6303. }
  6304. static int
  6305. __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
  6306. {
  6307. PyObject *tmp;
  6308. #if PY_MAJOR_VERSION >= 3
  6309. if (unlikely(value == NULL || !PyUnicode_Check(value))) {
  6310. #else
  6311. if (unlikely(value == NULL || !PyString_Check(value))) {
  6312. #endif
  6313. PyErr_SetString(PyExc_TypeError,
  6314. "__qualname__ must be set to a string object");
  6315. return -1;
  6316. }
  6317. tmp = op->func_qualname;
  6318. Py_INCREF(value);
  6319. op->func_qualname = value;
  6320. Py_XDECREF(tmp);
  6321. return 0;
  6322. }
  6323. static PyObject *
  6324. __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
  6325. {
  6326. PyObject *self;
  6327. self = m->func_closure;
  6328. if (self == NULL)
  6329. self = Py_None;
  6330. Py_INCREF(self);
  6331. return self;
  6332. }
  6333. static PyObject *
  6334. __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
  6335. {
  6336. if (unlikely(op->func_dict == NULL)) {
  6337. op->func_dict = PyDict_New();
  6338. if (unlikely(op->func_dict == NULL))
  6339. return NULL;
  6340. }
  6341. Py_INCREF(op->func_dict);
  6342. return op->func_dict;
  6343. }
  6344. static int
  6345. __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
  6346. {
  6347. PyObject *tmp;
  6348. if (unlikely(value == NULL)) {
  6349. PyErr_SetString(PyExc_TypeError,
  6350. "function's dictionary may not be deleted");
  6351. return -1;
  6352. }
  6353. if (unlikely(!PyDict_Check(value))) {
  6354. PyErr_SetString(PyExc_TypeError,
  6355. "setting function's dictionary to a non-dict");
  6356. return -1;
  6357. }
  6358. tmp = op->func_dict;
  6359. Py_INCREF(value);
  6360. op->func_dict = value;
  6361. Py_XDECREF(tmp);
  6362. return 0;
  6363. }
  6364. static PyObject *
  6365. __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
  6366. {
  6367. Py_INCREF(op->func_globals);
  6368. return op->func_globals;
  6369. }
  6370. static PyObject *
  6371. __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
  6372. {
  6373. Py_INCREF(Py_None);
  6374. return Py_None;
  6375. }
  6376. static PyObject *
  6377. __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
  6378. {
  6379. PyObject* result = (op->func_code) ? op->func_code : Py_None;
  6380. Py_INCREF(result);
  6381. return result;
  6382. }
  6383. static int
  6384. __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
  6385. PyObject *res = op->defaults_getter((PyObject *) op);
  6386. if (unlikely(!res))
  6387. return -1;
  6388. op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
  6389. Py_INCREF(op->defaults_tuple);
  6390. op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
  6391. Py_INCREF(op->defaults_kwdict);
  6392. Py_DECREF(res);
  6393. return 0;
  6394. }
  6395. static int
  6396. __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
  6397. PyObject* tmp;
  6398. if (!value) {
  6399. value = Py_None;
  6400. } else if (value != Py_None && !PyTuple_Check(value)) {
  6401. PyErr_SetString(PyExc_TypeError,
  6402. "__defaults__ must be set to a tuple object");
  6403. return -1;
  6404. }
  6405. Py_INCREF(value);
  6406. tmp = op->defaults_tuple;
  6407. op->defaults_tuple = value;
  6408. Py_XDECREF(tmp);
  6409. return 0;
  6410. }
  6411. static PyObject *
  6412. __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
  6413. PyObject* result = op->defaults_tuple;
  6414. if (unlikely(!result)) {
  6415. if (op->defaults_getter) {
  6416. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  6417. result = op->defaults_tuple;
  6418. } else {
  6419. result = Py_None;
  6420. }
  6421. }
  6422. Py_INCREF(result);
  6423. return result;
  6424. }
  6425. static int
  6426. __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
  6427. PyObject* tmp;
  6428. if (!value) {
  6429. value = Py_None;
  6430. } else if (value != Py_None && !PyDict_Check(value)) {
  6431. PyErr_SetString(PyExc_TypeError,
  6432. "__kwdefaults__ must be set to a dict object");
  6433. return -1;
  6434. }
  6435. Py_INCREF(value);
  6436. tmp = op->defaults_kwdict;
  6437. op->defaults_kwdict = value;
  6438. Py_XDECREF(tmp);
  6439. return 0;
  6440. }
  6441. static PyObject *
  6442. __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
  6443. PyObject* result = op->defaults_kwdict;
  6444. if (unlikely(!result)) {
  6445. if (op->defaults_getter) {
  6446. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  6447. result = op->defaults_kwdict;
  6448. } else {
  6449. result = Py_None;
  6450. }
  6451. }
  6452. Py_INCREF(result);
  6453. return result;
  6454. }
  6455. static int
  6456. __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
  6457. PyObject* tmp;
  6458. if (!value || value == Py_None) {
  6459. value = NULL;
  6460. } else if (!PyDict_Check(value)) {
  6461. PyErr_SetString(PyExc_TypeError,
  6462. "__annotations__ must be set to a dict object");
  6463. return -1;
  6464. }
  6465. Py_XINCREF(value);
  6466. tmp = op->func_annotations;
  6467. op->func_annotations = value;
  6468. Py_XDECREF(tmp);
  6469. return 0;
  6470. }
  6471. static PyObject *
  6472. __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
  6473. PyObject* result = op->func_annotations;
  6474. if (unlikely(!result)) {
  6475. result = PyDict_New();
  6476. if (unlikely(!result)) return NULL;
  6477. op->func_annotations = result;
  6478. }
  6479. Py_INCREF(result);
  6480. return result;
  6481. }
  6482. static PyGetSetDef __pyx_CyFunction_getsets[] = {
  6483. {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  6484. {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  6485. {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  6486. {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  6487. {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  6488. {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
  6489. {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  6490. {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  6491. {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  6492. {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  6493. {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  6494. {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  6495. {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  6496. {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  6497. {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  6498. {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  6499. {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
  6500. {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
  6501. {0, 0, 0, 0, 0}
  6502. };
  6503. #ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
  6504. #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
  6505. #endif
  6506. static PyMemberDef __pyx_CyFunction_members[] = {
  6507. {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
  6508. {0, 0, 0, 0, 0}
  6509. };
  6510. static PyObject *
  6511. __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
  6512. {
  6513. #if PY_MAJOR_VERSION >= 3
  6514. return PyUnicode_FromString(m->func.m_ml->ml_name);
  6515. #else
  6516. return PyString_FromString(m->func.m_ml->ml_name);
  6517. #endif
  6518. }
  6519. static PyMethodDef __pyx_CyFunction_methods[] = {
  6520. {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
  6521. {0, 0, 0, 0}
  6522. };
  6523. static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
  6524. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  6525. __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
  6526. if (op == NULL)
  6527. return NULL;
  6528. op->flags = flags;
  6529. op->func_weakreflist = NULL;
  6530. op->func.m_ml = ml;
  6531. op->func.m_self = (PyObject *) op;
  6532. Py_XINCREF(closure);
  6533. op->func_closure = closure;
  6534. Py_XINCREF(module);
  6535. op->func.m_module = module;
  6536. op->func_dict = NULL;
  6537. op->func_name = NULL;
  6538. Py_INCREF(qualname);
  6539. op->func_qualname = qualname;
  6540. op->func_doc = NULL;
  6541. op->func_classobj = NULL;
  6542. op->func_globals = globals;
  6543. Py_INCREF(op->func_globals);
  6544. Py_XINCREF(code);
  6545. op->func_code = code;
  6546. op->defaults_pyobjects = 0;
  6547. op->defaults = NULL;
  6548. op->defaults_tuple = NULL;
  6549. op->defaults_kwdict = NULL;
  6550. op->defaults_getter = NULL;
  6551. op->func_annotations = NULL;
  6552. PyObject_GC_Track(op);
  6553. return (PyObject *) op;
  6554. }
  6555. static int
  6556. __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  6557. {
  6558. Py_CLEAR(m->func_closure);
  6559. Py_CLEAR(m->func.m_module);
  6560. Py_CLEAR(m->func_dict);
  6561. Py_CLEAR(m->func_name);
  6562. Py_CLEAR(m->func_qualname);
  6563. Py_CLEAR(m->func_doc);
  6564. Py_CLEAR(m->func_globals);
  6565. Py_CLEAR(m->func_code);
  6566. Py_CLEAR(m->func_classobj);
  6567. Py_CLEAR(m->defaults_tuple);
  6568. Py_CLEAR(m->defaults_kwdict);
  6569. Py_CLEAR(m->func_annotations);
  6570. if (m->defaults) {
  6571. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  6572. int i;
  6573. for (i = 0; i < m->defaults_pyobjects; i++)
  6574. Py_XDECREF(pydefaults[i]);
  6575. PyMem_Free(m->defaults);
  6576. m->defaults = NULL;
  6577. }
  6578. return 0;
  6579. }
  6580. static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  6581. {
  6582. PyObject_GC_UnTrack(m);
  6583. if (m->func_weakreflist != NULL)
  6584. PyObject_ClearWeakRefs((PyObject *) m);
  6585. __Pyx_CyFunction_clear(m);
  6586. PyObject_GC_Del(m);
  6587. }
  6588. static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  6589. {
  6590. Py_VISIT(m->func_closure);
  6591. Py_VISIT(m->func.m_module);
  6592. Py_VISIT(m->func_dict);
  6593. Py_VISIT(m->func_name);
  6594. Py_VISIT(m->func_qualname);
  6595. Py_VISIT(m->func_doc);
  6596. Py_VISIT(m->func_globals);
  6597. Py_VISIT(m->func_code);
  6598. Py_VISIT(m->func_classobj);
  6599. Py_VISIT(m->defaults_tuple);
  6600. Py_VISIT(m->defaults_kwdict);
  6601. if (m->defaults) {
  6602. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  6603. int i;
  6604. for (i = 0; i < m->defaults_pyobjects; i++)
  6605. Py_VISIT(pydefaults[i]);
  6606. }
  6607. return 0;
  6608. }
  6609. static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
  6610. {
  6611. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  6612. if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
  6613. Py_INCREF(func);
  6614. return func;
  6615. }
  6616. if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
  6617. if (type == NULL)
  6618. type = (PyObject *)(Py_TYPE(obj));
  6619. return PyMethod_New(func,
  6620. type, (PyObject *)(Py_TYPE(type)));
  6621. }
  6622. if (obj == Py_None)
  6623. obj = NULL;
  6624. return PyMethod_New(func, obj, type);
  6625. }
  6626. static PyObject*
  6627. __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  6628. {
  6629. #if PY_MAJOR_VERSION >= 3
  6630. return PyUnicode_FromFormat("<cyfunction %U at %p>",
  6631. op->func_qualname, (void *)op);
  6632. #else
  6633. return PyString_FromFormat("<cyfunction %s at %p>",
  6634. PyString_AsString(op->func_qualname), (void *)op);
  6635. #endif
  6636. }
  6637. #if CYTHON_COMPILING_IN_PYPY
  6638. static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  6639. PyCFunctionObject* f = (PyCFunctionObject*)func;
  6640. PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  6641. PyObject *self = PyCFunction_GET_SELF(func);
  6642. Py_ssize_t size;
  6643. switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
  6644. case METH_VARARGS:
  6645. if (likely(kw == NULL) || PyDict_Size(kw) == 0)
  6646. return (*meth)(self, arg);
  6647. break;
  6648. case METH_VARARGS | METH_KEYWORDS:
  6649. return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
  6650. case METH_NOARGS:
  6651. if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
  6652. size = PyTuple_GET_SIZE(arg);
  6653. if (size == 0)
  6654. return (*meth)(self, NULL);
  6655. PyErr_Format(PyExc_TypeError,
  6656. "%.200s() takes no arguments (%zd given)",
  6657. f->m_ml->ml_name, size);
  6658. return NULL;
  6659. }
  6660. break;
  6661. case METH_O:
  6662. if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
  6663. size = PyTuple_GET_SIZE(arg);
  6664. if (size == 1)
  6665. return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
  6666. PyErr_Format(PyExc_TypeError,
  6667. "%.200s() takes exactly one argument (%zd given)",
  6668. f->m_ml->ml_name, size);
  6669. return NULL;
  6670. }
  6671. break;
  6672. default:
  6673. PyErr_SetString(PyExc_SystemError, "Bad call flags in "
  6674. "__Pyx_CyFunction_Call. METH_OLDARGS is no "
  6675. "longer supported!");
  6676. return NULL;
  6677. }
  6678. PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
  6679. f->m_ml->ml_name);
  6680. return NULL;
  6681. }
  6682. #else
  6683. static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  6684. return PyCFunction_Call(func, arg, kw);
  6685. }
  6686. #endif
  6687. static PyTypeObject __pyx_CyFunctionType_type = {
  6688. PyVarObject_HEAD_INIT(0, 0)
  6689. __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
  6690. sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/
  6691. 0, /*tp_itemsize*/
  6692. (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
  6693. 0, /*tp_print*/
  6694. 0, /*tp_getattr*/
  6695. 0, /*tp_setattr*/
  6696. #if PY_MAJOR_VERSION < 3
  6697. 0, /*tp_compare*/
  6698. #else
  6699. 0, /*reserved*/
  6700. #endif
  6701. (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/
  6702. 0, /*tp_as_number*/
  6703. 0, /*tp_as_sequence*/
  6704. 0, /*tp_as_mapping*/
  6705. 0, /*tp_hash*/
  6706. __Pyx_CyFunction_Call, /*tp_call*/
  6707. 0, /*tp_str*/
  6708. 0, /*tp_getattro*/
  6709. 0, /*tp_setattro*/
  6710. 0, /*tp_as_buffer*/
  6711. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
  6712. 0, /*tp_doc*/
  6713. (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/
  6714. (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/
  6715. 0, /*tp_richcompare*/
  6716. offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
  6717. 0, /*tp_iter*/
  6718. 0, /*tp_iternext*/
  6719. __pyx_CyFunction_methods, /*tp_methods*/
  6720. __pyx_CyFunction_members, /*tp_members*/
  6721. __pyx_CyFunction_getsets, /*tp_getset*/
  6722. 0, /*tp_base*/
  6723. 0, /*tp_dict*/
  6724. __Pyx_CyFunction_descr_get, /*tp_descr_get*/
  6725. 0, /*tp_descr_set*/
  6726. offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
  6727. 0, /*tp_init*/
  6728. 0, /*tp_alloc*/
  6729. 0, /*tp_new*/
  6730. 0, /*tp_free*/
  6731. 0, /*tp_is_gc*/
  6732. 0, /*tp_bases*/
  6733. 0, /*tp_mro*/
  6734. 0, /*tp_cache*/
  6735. 0, /*tp_subclasses*/
  6736. 0, /*tp_weaklist*/
  6737. 0, /*tp_del*/
  6738. #if PY_VERSION_HEX >= 0x02060000
  6739. 0, /*tp_version_tag*/
  6740. #endif
  6741. #if PY_VERSION_HEX >= 0x030400a1
  6742. 0, /*tp_finalize*/
  6743. #endif
  6744. };
  6745. static int __Pyx_CyFunction_init(void) {
  6746. #if !CYTHON_COMPILING_IN_PYPY
  6747. __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
  6748. #endif
  6749. __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
  6750. if (__pyx_CyFunctionType == NULL) {
  6751. return -1;
  6752. }
  6753. return 0;
  6754. }
  6755. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
  6756. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  6757. m->defaults = PyMem_Malloc(size);
  6758. if (!m->defaults)
  6759. return PyErr_NoMemory();
  6760. memset(m->defaults, 0, size);
  6761. m->defaults_pyobjects = pyobjects;
  6762. return m->defaults;
  6763. }
  6764. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
  6765. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  6766. m->defaults_tuple = tuple;
  6767. Py_INCREF(tuple);
  6768. }
  6769. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
  6770. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  6771. m->defaults_kwdict = dict;
  6772. Py_INCREF(dict);
  6773. }
  6774. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
  6775. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  6776. m->func_annotations = dict;
  6777. Py_INCREF(dict);
  6778. }
  6779. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
  6780. Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
  6781. for (i=0; i < nbases; i++) {
  6782. PyTypeObject *tmptype;
  6783. PyObject *tmp = PyTuple_GET_ITEM(bases, i);
  6784. tmptype = Py_TYPE(tmp);
  6785. #if PY_MAJOR_VERSION < 3
  6786. if (tmptype == &PyClass_Type)
  6787. continue;
  6788. #endif
  6789. if (!metaclass) {
  6790. metaclass = tmptype;
  6791. continue;
  6792. }
  6793. if (PyType_IsSubtype(metaclass, tmptype))
  6794. continue;
  6795. if (PyType_IsSubtype(tmptype, metaclass)) {
  6796. metaclass = tmptype;
  6797. continue;
  6798. }
  6799. PyErr_SetString(PyExc_TypeError,
  6800. "metaclass conflict: "
  6801. "the metaclass of a derived class "
  6802. "must be a (non-strict) subclass "
  6803. "of the metaclasses of all its bases");
  6804. return NULL;
  6805. }
  6806. if (!metaclass) {
  6807. #if PY_MAJOR_VERSION < 3
  6808. metaclass = &PyClass_Type;
  6809. #else
  6810. metaclass = &PyType_Type;
  6811. #endif
  6812. }
  6813. Py_INCREF((PyObject*) metaclass);
  6814. return (PyObject*) metaclass;
  6815. }
  6816. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
  6817. PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
  6818. PyObject *ns;
  6819. if (metaclass) {
  6820. PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
  6821. if (prep) {
  6822. PyObject *pargs = PyTuple_Pack(2, name, bases);
  6823. if (unlikely(!pargs)) {
  6824. Py_DECREF(prep);
  6825. return NULL;
  6826. }
  6827. ns = PyObject_Call(prep, pargs, mkw);
  6828. Py_DECREF(prep);
  6829. Py_DECREF(pargs);
  6830. } else {
  6831. if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
  6832. return NULL;
  6833. PyErr_Clear();
  6834. ns = PyDict_New();
  6835. }
  6836. } else {
  6837. ns = PyDict_New();
  6838. }
  6839. if (unlikely(!ns))
  6840. return NULL;
  6841. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
  6842. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
  6843. if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
  6844. return ns;
  6845. bad:
  6846. Py_DECREF(ns);
  6847. return NULL;
  6848. }
  6849. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
  6850. PyObject *dict, PyObject *mkw,
  6851. int calculate_metaclass, int allow_py2_metaclass) {
  6852. PyObject *result, *margs;
  6853. PyObject *owned_metaclass = NULL;
  6854. if (allow_py2_metaclass) {
  6855. owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
  6856. if (owned_metaclass) {
  6857. metaclass = owned_metaclass;
  6858. } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
  6859. PyErr_Clear();
  6860. } else {
  6861. return NULL;
  6862. }
  6863. }
  6864. if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
  6865. metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
  6866. Py_XDECREF(owned_metaclass);
  6867. if (unlikely(!metaclass))
  6868. return NULL;
  6869. owned_metaclass = metaclass;
  6870. }
  6871. margs = PyTuple_Pack(3, name, bases, dict);
  6872. if (unlikely(!margs)) {
  6873. result = NULL;
  6874. } else {
  6875. result = PyObject_Call(metaclass, margs, mkw);
  6876. Py_DECREF(margs);
  6877. }
  6878. Py_XDECREF(owned_metaclass);
  6879. return result;
  6880. }
  6881. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
  6882. #if CYTHON_COMPILING_IN_PYPY
  6883. return PyObject_RichCompareBool(s1, s2, equals);
  6884. #else
  6885. if (s1 == s2) {
  6886. return (equals == Py_EQ);
  6887. } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
  6888. const char *ps1, *ps2;
  6889. Py_ssize_t length = PyBytes_GET_SIZE(s1);
  6890. if (length != PyBytes_GET_SIZE(s2))
  6891. return (equals == Py_NE);
  6892. ps1 = PyBytes_AS_STRING(s1);
  6893. ps2 = PyBytes_AS_STRING(s2);
  6894. if (ps1[0] != ps2[0]) {
  6895. return (equals == Py_NE);
  6896. } else if (length == 1) {
  6897. return (equals == Py_EQ);
  6898. } else {
  6899. int result = memcmp(ps1, ps2, (size_t)length);
  6900. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  6901. }
  6902. } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
  6903. return (equals == Py_NE);
  6904. } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
  6905. return (equals == Py_NE);
  6906. } else {
  6907. int result;
  6908. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  6909. if (!py_result)
  6910. return -1;
  6911. result = __Pyx_PyObject_IsTrue(py_result);
  6912. Py_DECREF(py_result);
  6913. return result;
  6914. }
  6915. #endif
  6916. }
  6917. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
  6918. #if CYTHON_COMPILING_IN_PYPY
  6919. return PyObject_RichCompareBool(s1, s2, equals);
  6920. #else
  6921. #if PY_MAJOR_VERSION < 3
  6922. PyObject* owned_ref = NULL;
  6923. #endif
  6924. int s1_is_unicode, s2_is_unicode;
  6925. if (s1 == s2) {
  6926. goto return_eq;
  6927. }
  6928. s1_is_unicode = PyUnicode_CheckExact(s1);
  6929. s2_is_unicode = PyUnicode_CheckExact(s2);
  6930. #if PY_MAJOR_VERSION < 3
  6931. if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
  6932. owned_ref = PyUnicode_FromObject(s2);
  6933. if (unlikely(!owned_ref))
  6934. return -1;
  6935. s2 = owned_ref;
  6936. s2_is_unicode = 1;
  6937. } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
  6938. owned_ref = PyUnicode_FromObject(s1);
  6939. if (unlikely(!owned_ref))
  6940. return -1;
  6941. s1 = owned_ref;
  6942. s1_is_unicode = 1;
  6943. } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
  6944. return __Pyx_PyBytes_Equals(s1, s2, equals);
  6945. }
  6946. #endif
  6947. if (s1_is_unicode & s2_is_unicode) {
  6948. Py_ssize_t length;
  6949. int kind;
  6950. void *data1, *data2;
  6951. #if CYTHON_PEP393_ENABLED
  6952. if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
  6953. return -1;
  6954. #endif
  6955. length = __Pyx_PyUnicode_GET_LENGTH(s1);
  6956. if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
  6957. goto return_ne;
  6958. }
  6959. kind = __Pyx_PyUnicode_KIND(s1);
  6960. if (kind != __Pyx_PyUnicode_KIND(s2)) {
  6961. goto return_ne;
  6962. }
  6963. data1 = __Pyx_PyUnicode_DATA(s1);
  6964. data2 = __Pyx_PyUnicode_DATA(s2);
  6965. if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
  6966. goto return_ne;
  6967. } else if (length == 1) {
  6968. goto return_eq;
  6969. } else {
  6970. int result = memcmp(data1, data2, length * kind);
  6971. #if PY_MAJOR_VERSION < 3
  6972. Py_XDECREF(owned_ref);
  6973. #endif
  6974. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  6975. }
  6976. } else if ((s1 == Py_None) & s2_is_unicode) {
  6977. goto return_ne;
  6978. } else if ((s2 == Py_None) & s1_is_unicode) {
  6979. goto return_ne;
  6980. } else {
  6981. int result;
  6982. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  6983. if (!py_result)
  6984. return -1;
  6985. result = __Pyx_PyObject_IsTrue(py_result);
  6986. Py_DECREF(py_result);
  6987. return result;
  6988. }
  6989. return_eq:
  6990. #if PY_MAJOR_VERSION < 3
  6991. Py_XDECREF(owned_ref);
  6992. #endif
  6993. return (equals == Py_EQ);
  6994. return_ne:
  6995. #if PY_MAJOR_VERSION < 3
  6996. Py_XDECREF(owned_ref);
  6997. #endif
  6998. return (equals == Py_NE);
  6999. #endif
  7000. }
  7001. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  7002. PyObject *empty_list = 0;
  7003. PyObject *module = 0;
  7004. PyObject *global_dict = 0;
  7005. PyObject *empty_dict = 0;
  7006. PyObject *list;
  7007. #if PY_VERSION_HEX < 0x03030000
  7008. PyObject *py_import;
  7009. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  7010. if (!py_import)
  7011. goto bad;
  7012. #endif
  7013. if (from_list)
  7014. list = from_list;
  7015. else {
  7016. empty_list = PyList_New(0);
  7017. if (!empty_list)
  7018. goto bad;
  7019. list = empty_list;
  7020. }
  7021. global_dict = PyModule_GetDict(__pyx_m);
  7022. if (!global_dict)
  7023. goto bad;
  7024. empty_dict = PyDict_New();
  7025. if (!empty_dict)
  7026. goto bad;
  7027. #if PY_VERSION_HEX >= 0x02050000
  7028. {
  7029. #if PY_MAJOR_VERSION >= 3
  7030. if (level == -1) {
  7031. if (strchr(__Pyx_MODULE_NAME, '.')) {
  7032. #if PY_VERSION_HEX < 0x03030000
  7033. PyObject *py_level = PyInt_FromLong(1);
  7034. if (!py_level)
  7035. goto bad;
  7036. module = PyObject_CallFunctionObjArgs(py_import,
  7037. name, global_dict, empty_dict, list, py_level, NULL);
  7038. Py_DECREF(py_level);
  7039. #else
  7040. module = PyImport_ImportModuleLevelObject(
  7041. name, global_dict, empty_dict, list, 1);
  7042. #endif
  7043. if (!module) {
  7044. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  7045. goto bad;
  7046. PyErr_Clear();
  7047. }
  7048. }
  7049. level = 0; /* try absolute import on failure */
  7050. }
  7051. #endif
  7052. if (!module) {
  7053. #if PY_VERSION_HEX < 0x03030000
  7054. PyObject *py_level = PyInt_FromLong(level);
  7055. if (!py_level)
  7056. goto bad;
  7057. module = PyObject_CallFunctionObjArgs(py_import,
  7058. name, global_dict, empty_dict, list, py_level, NULL);
  7059. Py_DECREF(py_level);
  7060. #else
  7061. module = PyImport_ImportModuleLevelObject(
  7062. name, global_dict, empty_dict, list, level);
  7063. #endif
  7064. }
  7065. }
  7066. #else
  7067. if (level>0) {
  7068. PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
  7069. goto bad;
  7070. }
  7071. module = PyObject_CallFunctionObjArgs(py_import,
  7072. name, global_dict, empty_dict, list, NULL);
  7073. #endif
  7074. bad:
  7075. #if PY_VERSION_HEX < 0x03030000
  7076. Py_XDECREF(py_import);
  7077. #endif
  7078. Py_XDECREF(empty_list);
  7079. Py_XDECREF(empty_dict);
  7080. return module;
  7081. }
  7082. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
  7083. static PyObject *__Pyx_GetStdout(void) {
  7084. PyObject *f = PySys_GetObject((char *)"stdout");
  7085. if (!f) {
  7086. PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
  7087. }
  7088. return f;
  7089. }
  7090. static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
  7091. int i;
  7092. if (!f) {
  7093. if (!(f = __Pyx_GetStdout()))
  7094. return -1;
  7095. }
  7096. Py_INCREF(f);
  7097. for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
  7098. PyObject* v;
  7099. if (PyFile_SoftSpace(f, 1)) {
  7100. if (PyFile_WriteString(" ", f) < 0)
  7101. goto error;
  7102. }
  7103. v = PyTuple_GET_ITEM(arg_tuple, i);
  7104. if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
  7105. goto error;
  7106. if (PyString_Check(v)) {
  7107. char *s = PyString_AsString(v);
  7108. Py_ssize_t len = PyString_Size(v);
  7109. if (len > 0) {
  7110. switch (s[len-1]) {
  7111. case ' ': break;
  7112. case '\f': case '\r': case '\n': case '\t': case '\v':
  7113. PyFile_SoftSpace(f, 0);
  7114. break;
  7115. default: break;
  7116. }
  7117. }
  7118. }
  7119. }
  7120. if (newline) {
  7121. if (PyFile_WriteString("\n", f) < 0)
  7122. goto error;
  7123. PyFile_SoftSpace(f, 0);
  7124. }
  7125. Py_DECREF(f);
  7126. return 0;
  7127. error:
  7128. Py_DECREF(f);
  7129. return -1;
  7130. }
  7131. #else /* Python 3 has a print function */
  7132. static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
  7133. PyObject* kwargs = 0;
  7134. PyObject* result = 0;
  7135. PyObject* end_string;
  7136. if (unlikely(!__pyx_print)) {
  7137. __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
  7138. if (!__pyx_print)
  7139. return -1;
  7140. }
  7141. if (stream) {
  7142. kwargs = PyDict_New();
  7143. if (unlikely(!kwargs))
  7144. return -1;
  7145. if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
  7146. goto bad;
  7147. if (!newline) {
  7148. end_string = PyUnicode_FromStringAndSize(" ", 1);
  7149. if (unlikely(!end_string))
  7150. goto bad;
  7151. if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
  7152. Py_DECREF(end_string);
  7153. goto bad;
  7154. }
  7155. Py_DECREF(end_string);
  7156. }
  7157. } else if (!newline) {
  7158. if (unlikely(!__pyx_print_kwargs)) {
  7159. __pyx_print_kwargs = PyDict_New();
  7160. if (unlikely(!__pyx_print_kwargs))
  7161. return -1;
  7162. end_string = PyUnicode_FromStringAndSize(" ", 1);
  7163. if (unlikely(!end_string))
  7164. return -1;
  7165. if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
  7166. Py_DECREF(end_string);
  7167. return -1;
  7168. }
  7169. Py_DECREF(end_string);
  7170. }
  7171. kwargs = __pyx_print_kwargs;
  7172. }
  7173. result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
  7174. if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
  7175. Py_DECREF(kwargs);
  7176. if (!result)
  7177. return -1;
  7178. Py_DECREF(result);
  7179. return 0;
  7180. bad:
  7181. if (kwargs != __pyx_print_kwargs)
  7182. Py_XDECREF(kwargs);
  7183. return -1;
  7184. }
  7185. #endif
  7186. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
  7187. static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
  7188. if (!f) {
  7189. if (!(f = __Pyx_GetStdout()))
  7190. return -1;
  7191. }
  7192. Py_INCREF(f);
  7193. if (PyFile_SoftSpace(f, 0)) {
  7194. if (PyFile_WriteString(" ", f) < 0)
  7195. goto error;
  7196. }
  7197. if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
  7198. goto error;
  7199. if (PyFile_WriteString("\n", f) < 0)
  7200. goto error;
  7201. Py_DECREF(f);
  7202. return 0;
  7203. error:
  7204. Py_DECREF(f);
  7205. return -1;
  7206. /* the line below is just to avoid C compiler
  7207. * warnings about unused functions */
  7208. return __Pyx_Print(f, NULL, 0);
  7209. }
  7210. #else /* Python 3 has a print function */
  7211. static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
  7212. int res;
  7213. PyObject* arg_tuple = PyTuple_Pack(1, o);
  7214. if (unlikely(!arg_tuple))
  7215. return -1;
  7216. res = __Pyx_Print(stream, arg_tuple, 1);
  7217. Py_DECREF(arg_tuple);
  7218. return res;
  7219. }
  7220. #endif
  7221. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  7222. const long neg_one = (long) -1, const_zero = 0;
  7223. const int is_unsigned = neg_one > const_zero;
  7224. if (is_unsigned) {
  7225. if (sizeof(long) < sizeof(long)) {
  7226. return PyInt_FromLong((long) value);
  7227. } else if (sizeof(long) <= sizeof(unsigned long)) {
  7228. return PyLong_FromUnsignedLong((unsigned long) value);
  7229. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  7230. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  7231. }
  7232. } else {
  7233. if (sizeof(long) <= sizeof(long)) {
  7234. return PyInt_FromLong((long) value);
  7235. } else if (sizeof(long) <= sizeof(long long)) {
  7236. return PyLong_FromLongLong((long long) value);
  7237. }
  7238. }
  7239. {
  7240. int one = 1; int little = (int)*(unsigned char *)&one;
  7241. unsigned char *bytes = (unsigned char *)&value;
  7242. return _PyLong_FromByteArray(bytes, sizeof(long),
  7243. little, !is_unsigned);
  7244. }
  7245. }
  7246. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
  7247. { \
  7248. func_type value = func(x); \
  7249. if (sizeof(target_type) < sizeof(func_type)) { \
  7250. if (unlikely(value != (func_type) (target_type) value)) { \
  7251. func_type zero = 0; \
  7252. PyErr_SetString(PyExc_OverflowError, \
  7253. (is_unsigned && unlikely(value < zero)) ? \
  7254. "can't convert negative value to " #target_type : \
  7255. "value too large to convert to " #target_type); \
  7256. return (target_type) -1; \
  7257. } \
  7258. } \
  7259. return (target_type) value; \
  7260. }
  7261. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7262. #if CYTHON_USE_PYLONG_INTERNALS
  7263. #include "longintrepr.h"
  7264. #endif
  7265. #endif
  7266. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  7267. const long neg_one = (long) -1, const_zero = 0;
  7268. const int is_unsigned = neg_one > const_zero;
  7269. #if PY_MAJOR_VERSION < 3
  7270. if (likely(PyInt_Check(x))) {
  7271. if (sizeof(long) < sizeof(long)) {
  7272. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
  7273. } else {
  7274. long val = PyInt_AS_LONG(x);
  7275. if (is_unsigned && unlikely(val < 0)) {
  7276. PyErr_SetString(PyExc_OverflowError,
  7277. "can't convert negative value to long");
  7278. return (long) -1;
  7279. }
  7280. return (long) val;
  7281. }
  7282. } else
  7283. #endif
  7284. if (likely(PyLong_Check(x))) {
  7285. if (is_unsigned) {
  7286. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7287. #if CYTHON_USE_PYLONG_INTERNALS
  7288. if (sizeof(digit) <= sizeof(long)) {
  7289. switch (Py_SIZE(x)) {
  7290. case 0: return 0;
  7291. case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
  7292. }
  7293. }
  7294. #endif
  7295. #endif
  7296. if (unlikely(Py_SIZE(x) < 0)) {
  7297. PyErr_SetString(PyExc_OverflowError,
  7298. "can't convert negative value to long");
  7299. return (long) -1;
  7300. }
  7301. if (sizeof(long) <= sizeof(unsigned long)) {
  7302. __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
  7303. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  7304. __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
  7305. }
  7306. } else {
  7307. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7308. #if CYTHON_USE_PYLONG_INTERNALS
  7309. if (sizeof(digit) <= sizeof(long)) {
  7310. switch (Py_SIZE(x)) {
  7311. case 0: return 0;
  7312. case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
  7313. case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
  7314. }
  7315. }
  7316. #endif
  7317. #endif
  7318. if (sizeof(long) <= sizeof(long)) {
  7319. __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
  7320. } else if (sizeof(long) <= sizeof(long long)) {
  7321. __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
  7322. }
  7323. }
  7324. {
  7325. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  7326. PyErr_SetString(PyExc_RuntimeError,
  7327. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  7328. #else
  7329. long val;
  7330. PyObject *v = __Pyx_PyNumber_Int(x);
  7331. #if PY_MAJOR_VERSION < 3
  7332. if (likely(v) && !PyLong_Check(v)) {
  7333. PyObject *tmp = v;
  7334. v = PyNumber_Long(tmp);
  7335. Py_DECREF(tmp);
  7336. }
  7337. #endif
  7338. if (likely(v)) {
  7339. int one = 1; int is_little = (int)*(unsigned char *)&one;
  7340. unsigned char *bytes = (unsigned char *)&val;
  7341. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  7342. bytes, sizeof(val),
  7343. is_little, !is_unsigned);
  7344. Py_DECREF(v);
  7345. if (likely(!ret))
  7346. return val;
  7347. }
  7348. #endif
  7349. return (long) -1;
  7350. }
  7351. } else {
  7352. long val;
  7353. PyObject *tmp = __Pyx_PyNumber_Int(x);
  7354. if (!tmp) return (long) -1;
  7355. val = __Pyx_PyInt_As_long(tmp);
  7356. Py_DECREF(tmp);
  7357. return val;
  7358. }
  7359. }
  7360. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7361. #if CYTHON_USE_PYLONG_INTERNALS
  7362. #include "longintrepr.h"
  7363. #endif
  7364. #endif
  7365. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  7366. const int neg_one = (int) -1, const_zero = 0;
  7367. const int is_unsigned = neg_one > const_zero;
  7368. #if PY_MAJOR_VERSION < 3
  7369. if (likely(PyInt_Check(x))) {
  7370. if (sizeof(int) < sizeof(long)) {
  7371. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
  7372. } else {
  7373. long val = PyInt_AS_LONG(x);
  7374. if (is_unsigned && unlikely(val < 0)) {
  7375. PyErr_SetString(PyExc_OverflowError,
  7376. "can't convert negative value to int");
  7377. return (int) -1;
  7378. }
  7379. return (int) val;
  7380. }
  7381. } else
  7382. #endif
  7383. if (likely(PyLong_Check(x))) {
  7384. if (is_unsigned) {
  7385. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7386. #if CYTHON_USE_PYLONG_INTERNALS
  7387. if (sizeof(digit) <= sizeof(int)) {
  7388. switch (Py_SIZE(x)) {
  7389. case 0: return 0;
  7390. case 1: return (int) ((PyLongObject*)x)->ob_digit[0];
  7391. }
  7392. }
  7393. #endif
  7394. #endif
  7395. if (unlikely(Py_SIZE(x) < 0)) {
  7396. PyErr_SetString(PyExc_OverflowError,
  7397. "can't convert negative value to int");
  7398. return (int) -1;
  7399. }
  7400. if (sizeof(int) <= sizeof(unsigned long)) {
  7401. __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
  7402. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  7403. __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
  7404. }
  7405. } else {
  7406. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7407. #if CYTHON_USE_PYLONG_INTERNALS
  7408. if (sizeof(digit) <= sizeof(int)) {
  7409. switch (Py_SIZE(x)) {
  7410. case 0: return 0;
  7411. case 1: return +(int) ((PyLongObject*)x)->ob_digit[0];
  7412. case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
  7413. }
  7414. }
  7415. #endif
  7416. #endif
  7417. if (sizeof(int) <= sizeof(long)) {
  7418. __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
  7419. } else if (sizeof(int) <= sizeof(long long)) {
  7420. __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
  7421. }
  7422. }
  7423. {
  7424. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  7425. PyErr_SetString(PyExc_RuntimeError,
  7426. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  7427. #else
  7428. int val;
  7429. PyObject *v = __Pyx_PyNumber_Int(x);
  7430. #if PY_MAJOR_VERSION < 3
  7431. if (likely(v) && !PyLong_Check(v)) {
  7432. PyObject *tmp = v;
  7433. v = PyNumber_Long(tmp);
  7434. Py_DECREF(tmp);
  7435. }
  7436. #endif
  7437. if (likely(v)) {
  7438. int one = 1; int is_little = (int)*(unsigned char *)&one;
  7439. unsigned char *bytes = (unsigned char *)&val;
  7440. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  7441. bytes, sizeof(val),
  7442. is_little, !is_unsigned);
  7443. Py_DECREF(v);
  7444. if (likely(!ret))
  7445. return val;
  7446. }
  7447. #endif
  7448. return (int) -1;
  7449. }
  7450. } else {
  7451. int val;
  7452. PyObject *tmp = __Pyx_PyNumber_Int(x);
  7453. if (!tmp) return (int) -1;
  7454. val = __Pyx_PyInt_As_int(tmp);
  7455. Py_DECREF(tmp);
  7456. return val;
  7457. }
  7458. }
  7459. static int __Pyx_check_binary_version(void) {
  7460. char ctversion[4], rtversion[4];
  7461. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  7462. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  7463. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  7464. char message[200];
  7465. PyOS_snprintf(message, sizeof(message),
  7466. "compiletime version %s of module '%.100s' "
  7467. "does not match runtime version %s",
  7468. ctversion, __Pyx_MODULE_NAME, rtversion);
  7469. #if PY_VERSION_HEX < 0x02050000
  7470. return PyErr_Warn(NULL, message);
  7471. #else
  7472. return PyErr_WarnEx(NULL, message, 1);
  7473. #endif
  7474. }
  7475. return 0;
  7476. }
  7477. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  7478. int start = 0, mid = 0, end = count - 1;
  7479. if (end >= 0 && code_line > entries[end].code_line) {
  7480. return count;
  7481. }
  7482. while (start < end) {
  7483. mid = (start + end) / 2;
  7484. if (code_line < entries[mid].code_line) {
  7485. end = mid;
  7486. } else if (code_line > entries[mid].code_line) {
  7487. start = mid + 1;
  7488. } else {
  7489. return mid;
  7490. }
  7491. }
  7492. if (code_line <= entries[mid].code_line) {
  7493. return mid;
  7494. } else {
  7495. return mid + 1;
  7496. }
  7497. }
  7498. static PyCodeObject *__pyx_find_code_object(int code_line) {
  7499. PyCodeObject* code_object;
  7500. int pos;
  7501. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  7502. return NULL;
  7503. }
  7504. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  7505. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  7506. return NULL;
  7507. }
  7508. code_object = __pyx_code_cache.entries[pos].code_object;
  7509. Py_INCREF(code_object);
  7510. return code_object;
  7511. }
  7512. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  7513. int pos, i;
  7514. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  7515. if (unlikely(!code_line)) {
  7516. return;
  7517. }
  7518. if (unlikely(!entries)) {
  7519. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  7520. if (likely(entries)) {
  7521. __pyx_code_cache.entries = entries;
  7522. __pyx_code_cache.max_count = 64;
  7523. __pyx_code_cache.count = 1;
  7524. entries[0].code_line = code_line;
  7525. entries[0].code_object = code_object;
  7526. Py_INCREF(code_object);
  7527. }
  7528. return;
  7529. }
  7530. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  7531. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  7532. PyCodeObject* tmp = entries[pos].code_object;
  7533. entries[pos].code_object = code_object;
  7534. Py_DECREF(tmp);
  7535. return;
  7536. }
  7537. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  7538. int new_max = __pyx_code_cache.max_count + 64;
  7539. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  7540. __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  7541. if (unlikely(!entries)) {
  7542. return;
  7543. }
  7544. __pyx_code_cache.entries = entries;
  7545. __pyx_code_cache.max_count = new_max;
  7546. }
  7547. for (i=__pyx_code_cache.count; i>pos; i--) {
  7548. entries[i] = entries[i-1];
  7549. }
  7550. entries[pos].code_line = code_line;
  7551. entries[pos].code_object = code_object;
  7552. __pyx_code_cache.count++;
  7553. Py_INCREF(code_object);
  7554. }
  7555. #include "compile.h"
  7556. #include "frameobject.h"
  7557. #include "traceback.h"
  7558. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  7559. const char *funcname, int c_line,
  7560. int py_line, const char *filename) {
  7561. PyCodeObject *py_code = 0;
  7562. PyObject *py_srcfile = 0;
  7563. PyObject *py_funcname = 0;
  7564. #if PY_MAJOR_VERSION < 3
  7565. py_srcfile = PyString_FromString(filename);
  7566. #else
  7567. py_srcfile = PyUnicode_FromString(filename);
  7568. #endif
  7569. if (!py_srcfile) goto bad;
  7570. if (c_line) {
  7571. #if PY_MAJOR_VERSION < 3
  7572. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  7573. #else
  7574. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  7575. #endif
  7576. }
  7577. else {
  7578. #if PY_MAJOR_VERSION < 3
  7579. py_funcname = PyString_FromString(funcname);
  7580. #else
  7581. py_funcname = PyUnicode_FromString(funcname);
  7582. #endif
  7583. }
  7584. if (!py_funcname) goto bad;
  7585. py_code = __Pyx_PyCode_New(
  7586. 0, /*int argcount,*/
  7587. 0, /*int kwonlyargcount,*/
  7588. 0, /*int nlocals,*/
  7589. 0, /*int stacksize,*/
  7590. 0, /*int flags,*/
  7591. __pyx_empty_bytes, /*PyObject *code,*/
  7592. __pyx_empty_tuple, /*PyObject *consts,*/
  7593. __pyx_empty_tuple, /*PyObject *names,*/
  7594. __pyx_empty_tuple, /*PyObject *varnames,*/
  7595. __pyx_empty_tuple, /*PyObject *freevars,*/
  7596. __pyx_empty_tuple, /*PyObject *cellvars,*/
  7597. py_srcfile, /*PyObject *filename,*/
  7598. py_funcname, /*PyObject *name,*/
  7599. py_line, /*int firstlineno,*/
  7600. __pyx_empty_bytes /*PyObject *lnotab*/
  7601. );
  7602. Py_DECREF(py_srcfile);
  7603. Py_DECREF(py_funcname);
  7604. return py_code;
  7605. bad:
  7606. Py_XDECREF(py_srcfile);
  7607. Py_XDECREF(py_funcname);
  7608. return NULL;
  7609. }
  7610. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  7611. int py_line, const char *filename) {
  7612. PyCodeObject *py_code = 0;
  7613. PyObject *py_globals = 0;
  7614. PyFrameObject *py_frame = 0;
  7615. py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  7616. if (!py_code) {
  7617. py_code = __Pyx_CreateCodeObjectForTraceback(
  7618. funcname, c_line, py_line, filename);
  7619. if (!py_code) goto bad;
  7620. __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  7621. }
  7622. py_globals = PyModule_GetDict(__pyx_m);
  7623. if (!py_globals) goto bad;
  7624. py_frame = PyFrame_New(
  7625. PyThreadState_GET(), /*PyThreadState *tstate,*/
  7626. py_code, /*PyCodeObject *code,*/
  7627. py_globals, /*PyObject *globals,*/
  7628. 0 /*PyObject *locals*/
  7629. );
  7630. if (!py_frame) goto bad;
  7631. py_frame->f_lineno = py_line;
  7632. PyTraceBack_Here(py_frame);
  7633. bad:
  7634. Py_XDECREF(py_code);
  7635. Py_XDECREF(py_frame);
  7636. }
  7637. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  7638. while (t->p) {
  7639. #if PY_MAJOR_VERSION < 3
  7640. if (t->is_unicode) {
  7641. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  7642. } else if (t->intern) {
  7643. *t->p = PyString_InternFromString(t->s);
  7644. } else {
  7645. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  7646. }
  7647. #else /* Python 3+ has unicode identifiers */
  7648. if (t->is_unicode | t->is_str) {
  7649. if (t->intern) {
  7650. *t->p = PyUnicode_InternFromString(t->s);
  7651. } else if (t->encoding) {
  7652. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  7653. } else {
  7654. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  7655. }
  7656. } else {
  7657. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  7658. }
  7659. #endif
  7660. if (!*t->p)
  7661. return -1;
  7662. ++t;
  7663. }
  7664. return 0;
  7665. }
  7666. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
  7667. return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
  7668. }
  7669. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
  7670. Py_ssize_t ignore;
  7671. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  7672. }
  7673. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  7674. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  7675. if (
  7676. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  7677. __Pyx_sys_getdefaultencoding_not_ascii &&
  7678. #endif
  7679. PyUnicode_Check(o)) {
  7680. #if PY_VERSION_HEX < 0x03030000
  7681. char* defenc_c;
  7682. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  7683. if (!defenc) return NULL;
  7684. defenc_c = PyBytes_AS_STRING(defenc);
  7685. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  7686. {
  7687. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  7688. char* c;
  7689. for (c = defenc_c; c < end; c++) {
  7690. if ((unsigned char) (*c) >= 128) {
  7691. PyUnicode_AsASCIIString(o);
  7692. return NULL;
  7693. }
  7694. }
  7695. }
  7696. #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
  7697. *length = PyBytes_GET_SIZE(defenc);
  7698. return defenc_c;
  7699. #else /* PY_VERSION_HEX < 0x03030000 */
  7700. if (PyUnicode_READY(o) == -1) return NULL;
  7701. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  7702. if (PyUnicode_IS_ASCII(o)) {
  7703. *length = PyUnicode_GET_DATA_SIZE(o);
  7704. return PyUnicode_AsUTF8(o);
  7705. } else {
  7706. PyUnicode_AsASCIIString(o);
  7707. return NULL;
  7708. }
  7709. #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  7710. return PyUnicode_AsUTF8AndSize(o, length);
  7711. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  7712. #endif /* PY_VERSION_HEX < 0x03030000 */
  7713. } else
  7714. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
  7715. #if !CYTHON_COMPILING_IN_PYPY
  7716. #if PY_VERSION_HEX >= 0x02060000
  7717. if (PyByteArray_Check(o)) {
  7718. *length = PyByteArray_GET_SIZE(o);
  7719. return PyByteArray_AS_STRING(o);
  7720. } else
  7721. #endif
  7722. #endif
  7723. {
  7724. char* result;
  7725. int r = PyBytes_AsStringAndSize(o, &result, length);
  7726. if (unlikely(r < 0)) {
  7727. return NULL;
  7728. } else {
  7729. return result;
  7730. }
  7731. }
  7732. }
  7733. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  7734. int is_true = x == Py_True;
  7735. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  7736. else return PyObject_IsTrue(x);
  7737. }
  7738. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  7739. PyNumberMethods *m;
  7740. const char *name = NULL;
  7741. PyObject *res = NULL;
  7742. #if PY_MAJOR_VERSION < 3
  7743. if (PyInt_Check(x) || PyLong_Check(x))
  7744. #else
  7745. if (PyLong_Check(x))
  7746. #endif
  7747. return Py_INCREF(x), x;
  7748. m = Py_TYPE(x)->tp_as_number;
  7749. #if PY_MAJOR_VERSION < 3
  7750. if (m && m->nb_int) {
  7751. name = "int";
  7752. res = PyNumber_Int(x);
  7753. }
  7754. else if (m && m->nb_long) {
  7755. name = "long";
  7756. res = PyNumber_Long(x);
  7757. }
  7758. #else
  7759. if (m && m->nb_int) {
  7760. name = "int";
  7761. res = PyNumber_Long(x);
  7762. }
  7763. #endif
  7764. if (res) {
  7765. #if PY_MAJOR_VERSION < 3
  7766. if (!PyInt_Check(res) && !PyLong_Check(res)) {
  7767. #else
  7768. if (!PyLong_Check(res)) {
  7769. #endif
  7770. PyErr_Format(PyExc_TypeError,
  7771. "__%.4s__ returned non-%.4s (type %.200s)",
  7772. name, name, Py_TYPE(res)->tp_name);
  7773. Py_DECREF(res);
  7774. return NULL;
  7775. }
  7776. }
  7777. else if (!PyErr_Occurred()) {
  7778. PyErr_SetString(PyExc_TypeError,
  7779. "an integer is required");
  7780. }
  7781. return res;
  7782. }
  7783. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7784. #if CYTHON_USE_PYLONG_INTERNALS
  7785. #include "longintrepr.h"
  7786. #endif
  7787. #endif
  7788. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  7789. Py_ssize_t ival;
  7790. PyObject *x;
  7791. #if PY_MAJOR_VERSION < 3
  7792. if (likely(PyInt_CheckExact(b)))
  7793. return PyInt_AS_LONG(b);
  7794. #endif
  7795. if (likely(PyLong_CheckExact(b))) {
  7796. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7797. #if CYTHON_USE_PYLONG_INTERNALS
  7798. switch (Py_SIZE(b)) {
  7799. case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
  7800. case 0: return 0;
  7801. case 1: return ((PyLongObject*)b)->ob_digit[0];
  7802. }
  7803. #endif
  7804. #endif
  7805. #if PY_VERSION_HEX < 0x02060000
  7806. return PyInt_AsSsize_t(b);
  7807. #else
  7808. return PyLong_AsSsize_t(b);
  7809. #endif
  7810. }
  7811. x = PyNumber_Index(b);
  7812. if (!x) return -1;
  7813. ival = PyInt_AsSsize_t(x);
  7814. Py_DECREF(x);
  7815. return ival;
  7816. }
  7817. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  7818. #if PY_VERSION_HEX < 0x02050000
  7819. if (ival <= LONG_MAX)
  7820. return PyInt_FromLong((long)ival);
  7821. else {
  7822. unsigned char *bytes = (unsigned char *) &ival;
  7823. int one = 1; int little = (int)*(unsigned char*)&one;
  7824. return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
  7825. }
  7826. #else
  7827. return PyInt_FromSize_t(ival);
  7828. #endif
  7829. }
  7830. #endif /* Py_PYTHON_H */