system.c 606 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040
  1. /* Generated by Cython 0.20.1 on Sun Mar 16 22:58:16 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__system
  337. #define __PYX_HAVE_API__lib__Naked__toolshed__c__system
  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. "system.pyx",
  516. };
  517. /*--- Type declarations ---*/
  518. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile;
  519. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam;
  520. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam;
  521. /* "lib/Naked/toolshed/c/system.pyx":74
  522. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile
  523. * #------------------------------------------------------------------------------
  524. * def currentdir_to_basefile(func): # <<<<<<<<<<<<<<
  525. * try:
  526. * from functools import wraps
  527. */
  528. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile {
  529. PyObject_HEAD
  530. PyObject *__pyx_v_func;
  531. };
  532. /* "lib/Naked/toolshed/c/system.pyx":94
  533. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg
  534. * #------------------------------------------------------------------------------
  535. * def currentdir_firstparam(func): # <<<<<<<<<<<<<<
  536. * try:
  537. * from functools import wraps
  538. */
  539. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam {
  540. PyObject_HEAD
  541. PyObject *__pyx_v_func;
  542. };
  543. /* "lib/Naked/toolshed/c/system.pyx":116
  544. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg
  545. * #------------------------------------------------------------------------------
  546. * def currentdir_lastparam(func): # <<<<<<<<<<<<<<
  547. * try:
  548. * from functools import wraps
  549. */
  550. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam {
  551. PyObject_HEAD
  552. PyObject *__pyx_v_func;
  553. };
  554. #ifndef CYTHON_REFNANNY
  555. #define CYTHON_REFNANNY 0
  556. #endif
  557. #if CYTHON_REFNANNY
  558. typedef struct {
  559. void (*INCREF)(void*, PyObject*, int);
  560. void (*DECREF)(void*, PyObject*, int);
  561. void (*GOTREF)(void*, PyObject*, int);
  562. void (*GIVEREF)(void*, PyObject*, int);
  563. void* (*SetupContext)(const char*, int, const char*);
  564. void (*FinishContext)(void**);
  565. } __Pyx_RefNannyAPIStruct;
  566. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  567. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  568. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  569. #ifdef WITH_THREAD
  570. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  571. if (acquire_gil) { \
  572. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
  573. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  574. PyGILState_Release(__pyx_gilstate_save); \
  575. } else { \
  576. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  577. }
  578. #else
  579. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  580. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  581. #endif
  582. #define __Pyx_RefNannyFinishContext() \
  583. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  584. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  585. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  586. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  587. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  588. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  589. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  590. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  591. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  592. #else
  593. #define __Pyx_RefNannyDeclarations
  594. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  595. #define __Pyx_RefNannyFinishContext()
  596. #define __Pyx_INCREF(r) Py_INCREF(r)
  597. #define __Pyx_DECREF(r) Py_DECREF(r)
  598. #define __Pyx_GOTREF(r)
  599. #define __Pyx_GIVEREF(r)
  600. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  601. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  602. #define __Pyx_XGOTREF(r)
  603. #define __Pyx_XGIVEREF(r)
  604. #endif /* CYTHON_REFNANNY */
  605. #define __Pyx_XDECREF_SET(r, v) do { \
  606. PyObject *tmp = (PyObject *) r; \
  607. r = v; __Pyx_XDECREF(tmp); \
  608. } while (0)
  609. #define __Pyx_DECREF_SET(r, v) do { \
  610. PyObject *tmp = (PyObject *) r; \
  611. r = v; __Pyx_DECREF(tmp); \
  612. } while (0)
  613. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  614. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  615. #if CYTHON_COMPILING_IN_CPYTHON
  616. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  617. PyTypeObject* tp = Py_TYPE(obj);
  618. if (likely(tp->tp_getattro))
  619. return tp->tp_getattro(obj, attr_name);
  620. #if PY_MAJOR_VERSION < 3
  621. if (likely(tp->tp_getattr))
  622. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  623. #endif
  624. return PyObject_GetAttr(obj, attr_name);
  625. }
  626. #else
  627. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  628. #endif
  629. static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
  630. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
  631. #if CYTHON_COMPILING_IN_CPYTHON
  632. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
  633. #else
  634. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  635. #endif
  636. static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  637. static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
  638. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  639. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
  640. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  641. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
  642. #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  643. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  644. __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
  645. (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
  646. __Pyx_GetItemInt_Generic(o, to_py_func(i))))
  647. #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  648. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  649. __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  650. (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  651. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  652. int wraparound, int boundscheck);
  653. #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  654. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  655. __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  656. (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
  657. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  658. int wraparound, int boundscheck);
  659. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
  660. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  661. int is_list, int wraparound, int boundscheck);
  662. static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
  663. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
  664. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
  665. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
  666. const char* function_name); /*proto*/
  667. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  668. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
  669. static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
  670. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/
  671. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
  672. #define __Pyx_CyFunction_USED 1
  673. #include <structmember.h>
  674. #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
  675. #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
  676. #define __Pyx_CYFUNCTION_CCLASS 0x04
  677. #define __Pyx_CyFunction_GetClosure(f) \
  678. (((__pyx_CyFunctionObject *) (f))->func_closure)
  679. #define __Pyx_CyFunction_GetClassObj(f) \
  680. (((__pyx_CyFunctionObject *) (f))->func_classobj)
  681. #define __Pyx_CyFunction_Defaults(type, f) \
  682. ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
  683. #define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
  684. ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
  685. typedef struct {
  686. PyCFunctionObject func;
  687. PyObject *func_dict;
  688. PyObject *func_weakreflist;
  689. PyObject *func_name;
  690. PyObject *func_qualname;
  691. PyObject *func_doc;
  692. PyObject *func_globals;
  693. PyObject *func_code;
  694. PyObject *func_closure;
  695. PyObject *func_classobj; /* No-args super() class cell */
  696. void *defaults;
  697. int defaults_pyobjects;
  698. int flags;
  699. PyObject *defaults_tuple; /* Const defaults tuple */
  700. PyObject *defaults_kwdict; /* Const kwonly defaults dict */
  701. PyObject *(*defaults_getter)(PyObject *);
  702. PyObject *func_annotations; /* function annotations dict */
  703. } __pyx_CyFunctionObject;
  704. static PyTypeObject *__pyx_CyFunctionType = 0;
  705. #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
  706. __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
  707. static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
  708. int flags, PyObject* qualname,
  709. PyObject *self,
  710. PyObject *module, PyObject *globals,
  711. PyObject* code);
  712. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
  713. size_t size,
  714. int pyobjects);
  715. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
  716. PyObject *tuple);
  717. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
  718. PyObject *dict);
  719. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
  720. PyObject *dict);
  721. static int __Pyx_CyFunction_init(void);
  722. static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
  723. #if CYTHON_COMPILING_IN_CPYTHON
  724. static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
  725. PyListObject* L = (PyListObject*) list;
  726. Py_ssize_t len = Py_SIZE(list);
  727. if (likely(L->allocated > len)) {
  728. Py_INCREF(x);
  729. PyList_SET_ITEM(list, len, x);
  730. Py_SIZE(list) = len+1;
  731. return 0;
  732. }
  733. return PyList_Append(list, x);
  734. }
  735. #else
  736. #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
  737. #endif
  738. #if CYTHON_COMPILING_IN_CPYTHON
  739. static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
  740. PyListObject* L = (PyListObject*) list;
  741. Py_ssize_t len = Py_SIZE(list);
  742. if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
  743. Py_INCREF(x);
  744. PyList_SET_ITEM(list, len, x);
  745. Py_SIZE(list) = len+1;
  746. return 0;
  747. }
  748. return PyList_Append(list, x);
  749. }
  750. #else
  751. #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
  752. #endif
  753. #include <string.h>
  754. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
  755. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
  756. #if PY_MAJOR_VERSION >= 3
  757. #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
  758. #else
  759. #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
  760. #endif
  761. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
  762. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  763. static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
  764. #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
  765. static PyObject* __pyx_print = 0;
  766. static PyObject* __pyx_print_kwargs = 0;
  767. #endif
  768. static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/
  769. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  770. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  771. static int __Pyx_check_binary_version(void);
  772. typedef struct {
  773. int code_line;
  774. PyCodeObject* code_object;
  775. } __Pyx_CodeObjectCacheEntry;
  776. struct __Pyx_CodeObjectCache {
  777. int count;
  778. int max_count;
  779. __Pyx_CodeObjectCacheEntry* entries;
  780. };
  781. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  782. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  783. static PyCodeObject *__pyx_find_code_object(int code_line);
  784. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  785. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  786. int py_line, const char *filename); /*proto*/
  787. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
  788. /* Module declarations from 'lib.Naked.toolshed.c.system' */
  789. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = 0;
  790. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = 0;
  791. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = 0;
  792. #define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.system"
  793. int __pyx_module_is_main_lib__Naked__toolshed__c__system = 0;
  794. /* Implementation of 'lib.Naked.toolshed.c.system' */
  795. static PyObject *__pyx_builtin_Exception;
  796. static PyObject *__pyx_builtin_OSError;
  797. static PyObject *__pyx_builtin_SystemExit;
  798. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_filename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */
  799. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_2file_extension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */
  800. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_4directory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */
  801. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_6make_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_list); /* proto */
  802. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  803. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_8currentdir_to_basefile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */
  804. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_wrapper(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_dir, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  805. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_10currentdir_firstparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */
  806. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
  807. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_12currentdir_lastparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */
  808. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_14fullpath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_name); /* proto */
  809. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_16cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir); /* proto */
  810. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_18make_dirs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /* proto */
  811. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20file_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */
  812. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22is_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */
  813. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_24dir_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /* proto */
  814. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_26is_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /* proto */
  815. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_28file_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */
  816. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_30file_mod_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */
  817. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_32list_all_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir); /* proto */
  818. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_34list_filter_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_dir); /* proto */
  819. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_36list_all_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir); /* proto */
  820. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_38list_filter_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_current_dir); /* proto */
  821. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_40list_match_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_match_pattern, PyObject *__pyx_v_full_path); /* proto */
  822. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_42is_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */
  823. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_44real_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */
  824. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_46stdout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */
  825. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_48stdout_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */
  826. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_50stdout_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter); /* proto */
  827. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_52stdout_iter_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter); /* proto */
  828. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_54stderr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit); /* proto */
  829. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_56stderr_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit); /* proto */
  830. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_58exit_with_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exit); /* proto */
  831. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_60exit_fail(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  832. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_62exit_success(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  833. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  834. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  835. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  836. static char __pyx_k_e[] = "e";
  837. static char __pyx_k_x[] = "x";
  838. static char __pyx_k__8[] = "";
  839. static char __pyx_k_os[] = "os";
  840. static char __pyx_k__24[] = ".";
  841. static char __pyx_k__36[] = "\n";
  842. static char __pyx_k_cwd[] = "cwd";
  843. static char __pyx_k_dir[] = "dir";
  844. static char __pyx_k_end[] = "end";
  845. static char __pyx_k_ose[] = "ose";
  846. static char __pyx_k_sys[] = "sys";
  847. static char __pyx_k_args[] = "args";
  848. static char __pyx_k_exit[] = "exit";
  849. static char __pyx_k_file[] = "file";
  850. static char __pyx_k_func[] = "func";
  851. static char __pyx_k_glob[] = "glob";
  852. static char __pyx_k_iter[] = "iter";
  853. static char __pyx_k_join[] = "join";
  854. static char __pyx_k_main[] = "__main__";
  855. static char __pyx_k_name[] = "name";
  856. static char __pyx_k_path[] = "path";
  857. static char __pyx_k_test[] = "__test__";
  858. static char __pyx_k_text[] = "text";
  859. static char __pyx_k_time[] = "time";
  860. static char __pyx_k_ctime[] = "ctime";
  861. static char __pyx_k_debug[] = "debug";
  862. static char __pyx_k_errno[] = "errno";
  863. static char __pyx_k_isdir[] = "isdir";
  864. static char __pyx_k_print[] = "print";
  865. static char __pyx_k_wraps[] = "wraps";
  866. static char __pyx_k_write[] = "write";
  867. static char __pyx_k_EEXIST[] = "EEXIST";
  868. static char __pyx_k_exists[] = "exists";
  869. static char __pyx_k_getcwd[] = "getcwd";
  870. static char __pyx_k_import[] = "__import__";
  871. static char __pyx_k_is_dir[] = "is_dir";
  872. static char __pyx_k_isfile[] = "isfile";
  873. static char __pyx_k_islink[] = "islink";
  874. static char __pyx_k_kwargs[] = "kwargs";
  875. static char __pyx_k_name_2[] = "__name__";
  876. static char __pyx_k_stderr[] = "stderr";
  877. static char __pyx_k_stdout[] = "stdout";
  878. static char __pyx_k_OSError[] = "OSError";
  879. static char __pyx_k_dirname[] = "dirname";
  880. static char __pyx_k_dirpath[] = "dirpath";
  881. static char __pyx_k_getsize[] = "getsize";
  882. static char __pyx_k_is_file[] = "is_file";
  883. static char __pyx_k_is_link[] = "is_link";
  884. static char __pyx_k_listdir[] = "listdir";
  885. static char __pyx_k_the_cwd[] = "the_cwd";
  886. static char __pyx_k_wrapper[] = "wrapper";
  887. static char __pyx_k_basename[] = "basename";
  888. static char __pyx_k_endswith[] = "endswith";
  889. static char __pyx_k_filename[] = "filename";
  890. static char __pyx_k_filepath[] = "filepath";
  891. static char __pyx_k_fullpath[] = "fullpath";
  892. static char __pyx_k_getmtime[] = "getmtime";
  893. static char __pyx_k_makedirs[] = "makedirs";
  894. static char __pyx_k_realpath[] = "realpath";
  895. static char __pyx_k_splitext[] = "splitext";
  896. static char __pyx_k_Exception[] = "Exception";
  897. static char __pyx_k_directory[] = "directory";
  898. static char __pyx_k_exit_fail[] = "exit_fail";
  899. static char __pyx_k_file_name[] = "file_name";
  900. static char __pyx_k_file_size[] = "file_size";
  901. static char __pyx_k_filenames[] = "filenames";
  902. static char __pyx_k_full_path[] = "full_path";
  903. static char __pyx_k_functools[] = "functools";
  904. static char __pyx_k_make_dirs[] = "make_dirs";
  905. static char __pyx_k_make_path[] = "make_path";
  906. static char __pyx_k_path_list[] = "path_list";
  907. static char __pyx_k_real_path[] = "real_path";
  908. static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG";
  909. static char __pyx_k_SystemExit[] = "SystemExit";
  910. static char __pyx_k_dir_exists[] = "dir_exists";
  911. static char __pyx_k_startswith[] = "startswith";
  912. static char __pyx_k_stderr_xnl[] = "stderr_xnl";
  913. static char __pyx_k_stdout_xnl[] = "stdout_xnl";
  914. static char __pyx_k_current_dir[] = "current_dir";
  915. static char __pyx_k_file_exists[] = "file_exists";
  916. static char __pyx_k_stdout_iter[] = "stdout_iter";
  917. static char __pyx_k_exit_success[] = "exit_success";
  918. static char __pyx_k_file_mod_time[] = "file_mod_time";
  919. static char __pyx_k_match_pattern[] = "match_pattern";
  920. static char __pyx_k_Naked_settings[] = "Naked.settings";
  921. static char __pyx_k_file_extension[] = "file_extension";
  922. static char __pyx_k_list_all_files[] = "list_all_files";
  923. static char __pyx_k_stdout_iter_xnl[] = "stdout_iter_xnl";
  924. static char __pyx_k_exit_with_status[] = "exit_with_status";
  925. static char __pyx_k_extension_filter[] = "extension_filter";
  926. static char __pyx_k_list_match_files[] = "list_match_files";
  927. static char __pyx_k_current_directory[] = "current_directory";
  928. static char __pyx_k_list_filter_files[] = "list_filter_files";
  929. static char __pyx_k_filenames_fullpath[] = "filenames_fullpath";
  930. static char __pyx_k_list_all_files_cwd[] = "list_all_files_cwd";
  931. static char __pyx_k_currentdir_lastparam[] = "currentdir_lastparam";
  932. static char __pyx_k_currentdir_firstparam[] = "currentdir_firstparam";
  933. static char __pyx_k_list_filter_files_cwd[] = "list_filter_files_cwd";
  934. static char __pyx_k_currentdir_to_basefile[] = "currentdir_to_basefile";
  935. static char __pyx_k_lib_Naked_toolshed_c_system[] = "lib.Naked.toolshed.c.system";
  936. static char __pyx_k_Naked_Framework_Error_Could_not[] = "Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).";
  937. static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).";
  938. static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/system.pyx";
  939. static char __pyx_k_Naked_Framework_Error_error_with[] = "Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).";
  940. static char __pyx_k_currentdir_firstparam_locals_wra[] = "currentdir_firstparam.<locals>.wrapper";
  941. static char __pyx_k_currentdir_lastparam_locals_wrap[] = "currentdir_lastparam.<locals>.wrapper";
  942. static char __pyx_k_currentdir_to_basefile_locals_wr[] = "currentdir_to_basefile.<locals>.wrapper";
  943. static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).";
  944. static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).";
  945. static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).";
  946. static char __pyx_k_Naked_Framework_Error_unable_to_5[] = "Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).";
  947. static char __pyx_k_Naked_Framework_Error_unable_to_6[] = "Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).";
  948. static char __pyx_k_Naked_Framework_Error_unable_to_7[] = "Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).";
  949. static char __pyx_k_Naked_Framework_Error_unable_to_8[] = "Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).";
  950. static char __pyx_k_Naked_Framework_Error_unable_to_9[] = "Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).";
  951. static char __pyx_k_Naked_Framework_Error_error_with_2[] = "Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).";
  952. static char __pyx_k_Naked_Framework_Error_error_with_3[] = "Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).";
  953. static char __pyx_k_Naked_Framework_Error_error_with_4[] = "Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).";
  954. static char __pyx_k_Naked_Framework_Error_error_with_5[] = "Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).";
  955. static char __pyx_k_Naked_Framework_Error_error_with_6[] = "Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).";
  956. static char __pyx_k_Naked_Framework_Error_error_with_7[] = "Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).";
  957. static char __pyx_k_Naked_Framework_Error_unable_to_10[] = "Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).";
  958. static char __pyx_k_Naked_Framework_Error_unable_to_11[] = "Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).";
  959. static char __pyx_k_Naked_Framework_Error_unable_to_12[] = "Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).";
  960. static char __pyx_k_Naked_Framework_Error_unable_to_13[] = "Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).";
  961. static char __pyx_k_Naked_Framework_Error_unable_to_14[] = "Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).";
  962. static char __pyx_k_Naked_Framework_Error_unable_to_15[] = "Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).";
  963. static char __pyx_k_Naked_Framework_Error_unable_to_16[] = "Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).";
  964. static char __pyx_k_Naked_Framework_Error_unable_to_17[] = "Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).";
  965. static PyObject *__pyx_n_s_DEBUG_FLAG;
  966. static PyObject *__pyx_n_s_EEXIST;
  967. static PyObject *__pyx_n_s_Exception;
  968. static PyObject *__pyx_kp_s_Naked_Framework_Error_Could_not;
  969. static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with;
  970. static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_2;
  971. static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_3;
  972. static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_4;
  973. static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_5;
  974. static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_6;
  975. static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_7;
  976. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to;
  977. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_10;
  978. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_11;
  979. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_12;
  980. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_13;
  981. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_14;
  982. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_15;
  983. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_16;
  984. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_17;
  985. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2;
  986. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3;
  987. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4;
  988. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_5;
  989. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_6;
  990. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_7;
  991. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_8;
  992. static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_9;
  993. static PyObject *__pyx_n_s_Naked_settings;
  994. static PyObject *__pyx_n_s_OSError;
  995. static PyObject *__pyx_n_s_SystemExit;
  996. static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li;
  997. static PyObject *__pyx_kp_s__24;
  998. static PyObject *__pyx_kp_s__36;
  999. static PyObject *__pyx_kp_s__8;
  1000. static PyObject *__pyx_n_s_args;
  1001. static PyObject *__pyx_n_s_basename;
  1002. static PyObject *__pyx_n_s_ctime;
  1003. static PyObject *__pyx_n_s_current_dir;
  1004. static PyObject *__pyx_n_s_current_directory;
  1005. static PyObject *__pyx_n_s_currentdir_firstparam;
  1006. static PyObject *__pyx_n_s_currentdir_firstparam_locals_wra;
  1007. static PyObject *__pyx_n_s_currentdir_lastparam;
  1008. static PyObject *__pyx_n_s_currentdir_lastparam_locals_wrap;
  1009. static PyObject *__pyx_n_s_currentdir_to_basefile;
  1010. static PyObject *__pyx_n_s_currentdir_to_basefile_locals_wr;
  1011. static PyObject *__pyx_n_s_cwd;
  1012. static PyObject *__pyx_n_s_debug;
  1013. static PyObject *__pyx_n_s_dir;
  1014. static PyObject *__pyx_n_s_dir_exists;
  1015. static PyObject *__pyx_n_s_directory;
  1016. static PyObject *__pyx_n_s_dirname;
  1017. static PyObject *__pyx_n_s_dirpath;
  1018. static PyObject *__pyx_n_s_e;
  1019. static PyObject *__pyx_n_s_end;
  1020. static PyObject *__pyx_n_s_endswith;
  1021. static PyObject *__pyx_n_s_errno;
  1022. static PyObject *__pyx_n_s_exists;
  1023. static PyObject *__pyx_n_s_exit;
  1024. static PyObject *__pyx_n_s_exit_fail;
  1025. static PyObject *__pyx_n_s_exit_success;
  1026. static PyObject *__pyx_n_s_exit_with_status;
  1027. static PyObject *__pyx_n_s_extension_filter;
  1028. static PyObject *__pyx_n_s_file;
  1029. static PyObject *__pyx_n_s_file_exists;
  1030. static PyObject *__pyx_n_s_file_extension;
  1031. static PyObject *__pyx_n_s_file_mod_time;
  1032. static PyObject *__pyx_n_s_file_name;
  1033. static PyObject *__pyx_n_s_file_size;
  1034. static PyObject *__pyx_n_s_filename;
  1035. static PyObject *__pyx_n_s_filenames;
  1036. static PyObject *__pyx_n_s_filenames_fullpath;
  1037. static PyObject *__pyx_n_s_filepath;
  1038. static PyObject *__pyx_n_s_full_path;
  1039. static PyObject *__pyx_n_s_fullpath;
  1040. static PyObject *__pyx_n_s_func;
  1041. static PyObject *__pyx_n_s_functools;
  1042. static PyObject *__pyx_n_s_getcwd;
  1043. static PyObject *__pyx_n_s_getmtime;
  1044. static PyObject *__pyx_n_s_getsize;
  1045. static PyObject *__pyx_n_s_glob;
  1046. static PyObject *__pyx_n_s_import;
  1047. static PyObject *__pyx_n_s_is_dir;
  1048. static PyObject *__pyx_n_s_is_file;
  1049. static PyObject *__pyx_n_s_is_link;
  1050. static PyObject *__pyx_n_s_isdir;
  1051. static PyObject *__pyx_n_s_isfile;
  1052. static PyObject *__pyx_n_s_islink;
  1053. static PyObject *__pyx_n_s_iter;
  1054. static PyObject *__pyx_n_s_join;
  1055. static PyObject *__pyx_n_s_kwargs;
  1056. static PyObject *__pyx_n_s_lib_Naked_toolshed_c_system;
  1057. static PyObject *__pyx_n_s_list_all_files;
  1058. static PyObject *__pyx_n_s_list_all_files_cwd;
  1059. static PyObject *__pyx_n_s_list_filter_files;
  1060. static PyObject *__pyx_n_s_list_filter_files_cwd;
  1061. static PyObject *__pyx_n_s_list_match_files;
  1062. static PyObject *__pyx_n_s_listdir;
  1063. static PyObject *__pyx_n_s_main;
  1064. static PyObject *__pyx_n_s_make_dirs;
  1065. static PyObject *__pyx_n_s_make_path;
  1066. static PyObject *__pyx_n_s_makedirs;
  1067. static PyObject *__pyx_n_s_match_pattern;
  1068. static PyObject *__pyx_n_s_name;
  1069. static PyObject *__pyx_n_s_name_2;
  1070. static PyObject *__pyx_n_s_os;
  1071. static PyObject *__pyx_n_s_ose;
  1072. static PyObject *__pyx_n_s_path;
  1073. static PyObject *__pyx_n_s_path_list;
  1074. static PyObject *__pyx_n_s_print;
  1075. static PyObject *__pyx_n_s_real_path;
  1076. static PyObject *__pyx_n_s_realpath;
  1077. static PyObject *__pyx_n_s_splitext;
  1078. static PyObject *__pyx_n_s_startswith;
  1079. static PyObject *__pyx_n_s_stderr;
  1080. static PyObject *__pyx_n_s_stderr_xnl;
  1081. static PyObject *__pyx_n_s_stdout;
  1082. static PyObject *__pyx_n_s_stdout_iter;
  1083. static PyObject *__pyx_n_s_stdout_iter_xnl;
  1084. static PyObject *__pyx_n_s_stdout_xnl;
  1085. static PyObject *__pyx_n_s_sys;
  1086. static PyObject *__pyx_n_s_test;
  1087. static PyObject *__pyx_n_s_text;
  1088. static PyObject *__pyx_n_s_the_cwd;
  1089. static PyObject *__pyx_n_s_time;
  1090. static PyObject *__pyx_n_s_wrapper;
  1091. static PyObject *__pyx_n_s_wraps;
  1092. static PyObject *__pyx_n_s_write;
  1093. static PyObject *__pyx_n_s_x;
  1094. static PyObject *__pyx_int_0;
  1095. static PyObject *__pyx_int_1;
  1096. static PyObject *__pyx_tuple_;
  1097. static PyObject *__pyx_tuple__2;
  1098. static PyObject *__pyx_tuple__3;
  1099. static PyObject *__pyx_tuple__4;
  1100. static PyObject *__pyx_tuple__5;
  1101. static PyObject *__pyx_tuple__7;
  1102. static PyObject *__pyx_tuple__9;
  1103. static PyObject *__pyx_tuple__11;
  1104. static PyObject *__pyx_tuple__12;
  1105. static PyObject *__pyx_tuple__13;
  1106. static PyObject *__pyx_tuple__15;
  1107. static PyObject *__pyx_tuple__16;
  1108. static PyObject *__pyx_tuple__17;
  1109. static PyObject *__pyx_tuple__18;
  1110. static PyObject *__pyx_tuple__19;
  1111. static PyObject *__pyx_tuple__20;
  1112. static PyObject *__pyx_tuple__21;
  1113. static PyObject *__pyx_tuple__22;
  1114. static PyObject *__pyx_tuple__23;
  1115. static PyObject *__pyx_tuple__25;
  1116. static PyObject *__pyx_tuple__26;
  1117. static PyObject *__pyx_tuple__27;
  1118. static PyObject *__pyx_tuple__28;
  1119. static PyObject *__pyx_tuple__29;
  1120. static PyObject *__pyx_tuple__30;
  1121. static PyObject *__pyx_tuple__31;
  1122. static PyObject *__pyx_tuple__32;
  1123. static PyObject *__pyx_tuple__33;
  1124. static PyObject *__pyx_tuple__34;
  1125. static PyObject *__pyx_tuple__35;
  1126. static PyObject *__pyx_tuple__37;
  1127. static PyObject *__pyx_tuple__38;
  1128. static PyObject *__pyx_tuple__39;
  1129. static PyObject *__pyx_tuple__40;
  1130. static PyObject *__pyx_tuple__41;
  1131. static PyObject *__pyx_tuple__43;
  1132. static PyObject *__pyx_tuple__45;
  1133. static PyObject *__pyx_tuple__47;
  1134. static PyObject *__pyx_tuple__49;
  1135. static PyObject *__pyx_tuple__51;
  1136. static PyObject *__pyx_tuple__53;
  1137. static PyObject *__pyx_tuple__55;
  1138. static PyObject *__pyx_tuple__57;
  1139. static PyObject *__pyx_tuple__59;
  1140. static PyObject *__pyx_tuple__61;
  1141. static PyObject *__pyx_tuple__63;
  1142. static PyObject *__pyx_tuple__65;
  1143. static PyObject *__pyx_tuple__67;
  1144. static PyObject *__pyx_tuple__69;
  1145. static PyObject *__pyx_tuple__71;
  1146. static PyObject *__pyx_tuple__73;
  1147. static PyObject *__pyx_tuple__75;
  1148. static PyObject *__pyx_tuple__77;
  1149. static PyObject *__pyx_tuple__79;
  1150. static PyObject *__pyx_tuple__81;
  1151. static PyObject *__pyx_tuple__83;
  1152. static PyObject *__pyx_tuple__85;
  1153. static PyObject *__pyx_tuple__87;
  1154. static PyObject *__pyx_tuple__89;
  1155. static PyObject *__pyx_tuple__91;
  1156. static PyObject *__pyx_tuple__93;
  1157. static PyObject *__pyx_tuple__95;
  1158. static PyObject *__pyx_tuple__97;
  1159. static PyObject *__pyx_tuple__99;
  1160. static PyObject *__pyx_codeobj__6;
  1161. static PyObject *__pyx_codeobj__10;
  1162. static PyObject *__pyx_codeobj__14;
  1163. static PyObject *__pyx_codeobj__42;
  1164. static PyObject *__pyx_codeobj__44;
  1165. static PyObject *__pyx_codeobj__46;
  1166. static PyObject *__pyx_codeobj__48;
  1167. static PyObject *__pyx_codeobj__50;
  1168. static PyObject *__pyx_codeobj__52;
  1169. static PyObject *__pyx_codeobj__54;
  1170. static PyObject *__pyx_codeobj__56;
  1171. static PyObject *__pyx_codeobj__58;
  1172. static PyObject *__pyx_codeobj__60;
  1173. static PyObject *__pyx_codeobj__62;
  1174. static PyObject *__pyx_codeobj__64;
  1175. static PyObject *__pyx_codeobj__66;
  1176. static PyObject *__pyx_codeobj__68;
  1177. static PyObject *__pyx_codeobj__70;
  1178. static PyObject *__pyx_codeobj__72;
  1179. static PyObject *__pyx_codeobj__74;
  1180. static PyObject *__pyx_codeobj__76;
  1181. static PyObject *__pyx_codeobj__78;
  1182. static PyObject *__pyx_codeobj__80;
  1183. static PyObject *__pyx_codeobj__82;
  1184. static PyObject *__pyx_codeobj__84;
  1185. static PyObject *__pyx_codeobj__86;
  1186. static PyObject *__pyx_codeobj__88;
  1187. static PyObject *__pyx_codeobj__90;
  1188. static PyObject *__pyx_codeobj__92;
  1189. static PyObject *__pyx_codeobj__94;
  1190. static PyObject *__pyx_codeobj__96;
  1191. static PyObject *__pyx_codeobj__98;
  1192. static PyObject *__pyx_codeobj__100;
  1193. static PyObject *__pyx_codeobj__101;
  1194. static PyObject *__pyx_codeobj__102;
  1195. /* "lib/Naked/toolshed/c/system.pyx":20
  1196. * # Tests: test_SYSTEM.py :: test_sys_filename
  1197. * #------------------------------------------------------------------------------
  1198. * def filename(filepath): # <<<<<<<<<<<<<<
  1199. * try:
  1200. * return os.path.basename(filepath)
  1201. */
  1202. /* Python wrapper */
  1203. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_1filename(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/
  1204. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_1filename = {__Pyx_NAMESTR("filename"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_1filename, METH_O, __Pyx_DOCSTR(0)};
  1205. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_1filename(PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  1206. PyObject *__pyx_r = 0;
  1207. __Pyx_RefNannyDeclarations
  1208. __Pyx_RefNannySetupContext("filename (wrapper)", 0);
  1209. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_filename(__pyx_self, ((PyObject *)__pyx_v_filepath));
  1210. /* function exit code */
  1211. __Pyx_RefNannyFinishContext();
  1212. return __pyx_r;
  1213. }
  1214. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_filename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  1215. PyObject *__pyx_v_e = NULL;
  1216. PyObject *__pyx_r = NULL;
  1217. __Pyx_RefNannyDeclarations
  1218. PyObject *__pyx_t_1 = NULL;
  1219. PyObject *__pyx_t_2 = NULL;
  1220. PyObject *__pyx_t_3 = NULL;
  1221. PyObject *__pyx_t_4 = NULL;
  1222. PyObject *__pyx_t_5 = NULL;
  1223. PyObject *__pyx_t_6 = NULL;
  1224. int __pyx_t_7;
  1225. PyObject *__pyx_t_8 = NULL;
  1226. int __pyx_t_9;
  1227. PyObject *__pyx_t_10 = NULL;
  1228. int __pyx_lineno = 0;
  1229. const char *__pyx_filename = NULL;
  1230. int __pyx_clineno = 0;
  1231. __Pyx_RefNannySetupContext("filename", 0);
  1232. /* "lib/Naked/toolshed/c/system.pyx":21
  1233. * #------------------------------------------------------------------------------
  1234. * def filename(filepath):
  1235. * try: # <<<<<<<<<<<<<<
  1236. * return os.path.basename(filepath)
  1237. * except Exception as e:
  1238. */
  1239. {
  1240. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  1241. __Pyx_XGOTREF(__pyx_t_1);
  1242. __Pyx_XGOTREF(__pyx_t_2);
  1243. __Pyx_XGOTREF(__pyx_t_3);
  1244. /*try:*/ {
  1245. /* "lib/Naked/toolshed/c/system.pyx":22
  1246. * def filename(filepath):
  1247. * try:
  1248. * return os.path.basename(filepath) # <<<<<<<<<<<<<<
  1249. * except Exception as e:
  1250. * if DEBUG_FLAG:
  1251. */
  1252. __Pyx_XDECREF(__pyx_r);
  1253. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1254. __Pyx_GOTREF(__pyx_t_4);
  1255. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1256. __Pyx_GOTREF(__pyx_t_5);
  1257. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1258. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_basename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1259. __Pyx_GOTREF(__pyx_t_4);
  1260. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1261. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1262. __Pyx_GOTREF(__pyx_t_5);
  1263. __Pyx_INCREF(__pyx_v_filepath);
  1264. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath);
  1265. __Pyx_GIVEREF(__pyx_v_filepath);
  1266. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1267. __Pyx_GOTREF(__pyx_t_6);
  1268. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1269. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1270. __pyx_r = __pyx_t_6;
  1271. __pyx_t_6 = 0;
  1272. goto __pyx_L7_try_return;
  1273. }
  1274. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  1275. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  1276. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  1277. goto __pyx_L10_try_end;
  1278. __pyx_L3_error:;
  1279. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1280. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  1281. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  1282. /* "lib/Naked/toolshed/c/system.pyx":23
  1283. * try:
  1284. * return os.path.basename(filepath)
  1285. * except Exception as e: # <<<<<<<<<<<<<<
  1286. * if DEBUG_FLAG:
  1287. * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).")
  1288. */
  1289. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  1290. if (__pyx_t_7) {
  1291. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.filename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1292. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1293. __Pyx_GOTREF(__pyx_t_6);
  1294. __Pyx_GOTREF(__pyx_t_5);
  1295. __Pyx_GOTREF(__pyx_t_4);
  1296. __Pyx_INCREF(__pyx_t_5);
  1297. __pyx_v_e = __pyx_t_5;
  1298. /* "lib/Naked/toolshed/c/system.pyx":24
  1299. * return os.path.basename(filepath)
  1300. * except Exception as e:
  1301. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  1302. * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).")
  1303. * raise e
  1304. */
  1305. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1306. __Pyx_GOTREF(__pyx_t_8);
  1307. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1308. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1309. if (__pyx_t_9) {
  1310. /* "lib/Naked/toolshed/c/system.pyx":25
  1311. * except Exception as e:
  1312. * if DEBUG_FLAG:
  1313. * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  1314. * raise e
  1315. *
  1316. */
  1317. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1318. __Pyx_GOTREF(__pyx_t_8);
  1319. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1320. __Pyx_GOTREF(__pyx_t_10);
  1321. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1322. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1323. __Pyx_GOTREF(__pyx_t_8);
  1324. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1325. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1326. __Pyx_GOTREF(__pyx_t_10);
  1327. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1328. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1329. goto __pyx_L13;
  1330. }
  1331. __pyx_L13:;
  1332. /* "lib/Naked/toolshed/c/system.pyx":26
  1333. * if DEBUG_FLAG:
  1334. * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).")
  1335. * raise e # <<<<<<<<<<<<<<
  1336. *
  1337. * #------------------------------------------------------------------------------
  1338. */
  1339. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  1340. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1341. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1342. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1343. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1344. goto __pyx_L4_exception_handled;
  1345. }
  1346. goto __pyx_L5_except_error;
  1347. __pyx_L5_except_error:;
  1348. __Pyx_XGIVEREF(__pyx_t_1);
  1349. __Pyx_XGIVEREF(__pyx_t_2);
  1350. __Pyx_XGIVEREF(__pyx_t_3);
  1351. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1352. goto __pyx_L1_error;
  1353. __pyx_L7_try_return:;
  1354. __Pyx_XGIVEREF(__pyx_t_1);
  1355. __Pyx_XGIVEREF(__pyx_t_2);
  1356. __Pyx_XGIVEREF(__pyx_t_3);
  1357. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1358. goto __pyx_L0;
  1359. __pyx_L4_exception_handled:;
  1360. __Pyx_XGIVEREF(__pyx_t_1);
  1361. __Pyx_XGIVEREF(__pyx_t_2);
  1362. __Pyx_XGIVEREF(__pyx_t_3);
  1363. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1364. __pyx_L10_try_end:;
  1365. }
  1366. /* "lib/Naked/toolshed/c/system.pyx":20
  1367. * # Tests: test_SYSTEM.py :: test_sys_filename
  1368. * #------------------------------------------------------------------------------
  1369. * def filename(filepath): # <<<<<<<<<<<<<<
  1370. * try:
  1371. * return os.path.basename(filepath)
  1372. */
  1373. /* function exit code */
  1374. __pyx_L1_error:;
  1375. __Pyx_XDECREF(__pyx_t_4);
  1376. __Pyx_XDECREF(__pyx_t_5);
  1377. __Pyx_XDECREF(__pyx_t_6);
  1378. __Pyx_XDECREF(__pyx_t_8);
  1379. __Pyx_XDECREF(__pyx_t_10);
  1380. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.filename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1381. __pyx_r = NULL;
  1382. __pyx_L0:;
  1383. __Pyx_XDECREF(__pyx_v_e);
  1384. __Pyx_XGIVEREF(__pyx_r);
  1385. __Pyx_RefNannyFinishContext();
  1386. return __pyx_r;
  1387. }
  1388. /* "lib/Naked/toolshed/c/system.pyx":33
  1389. * # Tests: test_SYSTEM.py :: test_sys_file_extension
  1390. * #------------------------------------------------------------------------------
  1391. * def file_extension(filepath): # <<<<<<<<<<<<<<
  1392. * try:
  1393. * return os.path.splitext(filepath)[1]
  1394. */
  1395. /* Python wrapper */
  1396. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_3file_extension(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/
  1397. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_3file_extension = {__Pyx_NAMESTR("file_extension"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_3file_extension, METH_O, __Pyx_DOCSTR(0)};
  1398. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_3file_extension(PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  1399. PyObject *__pyx_r = 0;
  1400. __Pyx_RefNannyDeclarations
  1401. __Pyx_RefNannySetupContext("file_extension (wrapper)", 0);
  1402. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_2file_extension(__pyx_self, ((PyObject *)__pyx_v_filepath));
  1403. /* function exit code */
  1404. __Pyx_RefNannyFinishContext();
  1405. return __pyx_r;
  1406. }
  1407. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_2file_extension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  1408. PyObject *__pyx_v_e = NULL;
  1409. PyObject *__pyx_r = NULL;
  1410. __Pyx_RefNannyDeclarations
  1411. PyObject *__pyx_t_1 = NULL;
  1412. PyObject *__pyx_t_2 = NULL;
  1413. PyObject *__pyx_t_3 = NULL;
  1414. PyObject *__pyx_t_4 = NULL;
  1415. PyObject *__pyx_t_5 = NULL;
  1416. PyObject *__pyx_t_6 = NULL;
  1417. int __pyx_t_7;
  1418. PyObject *__pyx_t_8 = NULL;
  1419. int __pyx_t_9;
  1420. PyObject *__pyx_t_10 = NULL;
  1421. int __pyx_lineno = 0;
  1422. const char *__pyx_filename = NULL;
  1423. int __pyx_clineno = 0;
  1424. __Pyx_RefNannySetupContext("file_extension", 0);
  1425. /* "lib/Naked/toolshed/c/system.pyx":34
  1426. * #------------------------------------------------------------------------------
  1427. * def file_extension(filepath):
  1428. * try: # <<<<<<<<<<<<<<
  1429. * return os.path.splitext(filepath)[1]
  1430. * except Exception as e:
  1431. */
  1432. {
  1433. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  1434. __Pyx_XGOTREF(__pyx_t_1);
  1435. __Pyx_XGOTREF(__pyx_t_2);
  1436. __Pyx_XGOTREF(__pyx_t_3);
  1437. /*try:*/ {
  1438. /* "lib/Naked/toolshed/c/system.pyx":35
  1439. * def file_extension(filepath):
  1440. * try:
  1441. * return os.path.splitext(filepath)[1] # <<<<<<<<<<<<<<
  1442. * except Exception as e:
  1443. * if DEBUG_FLAG:
  1444. */
  1445. __Pyx_XDECREF(__pyx_r);
  1446. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1447. __Pyx_GOTREF(__pyx_t_4);
  1448. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1449. __Pyx_GOTREF(__pyx_t_5);
  1450. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1451. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_splitext); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1452. __Pyx_GOTREF(__pyx_t_4);
  1453. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1454. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1455. __Pyx_GOTREF(__pyx_t_5);
  1456. __Pyx_INCREF(__pyx_v_filepath);
  1457. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath);
  1458. __Pyx_GIVEREF(__pyx_v_filepath);
  1459. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1460. __Pyx_GOTREF(__pyx_t_6);
  1461. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1462. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1463. __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;};
  1464. __Pyx_GOTREF(__pyx_t_5);
  1465. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1466. __pyx_r = __pyx_t_5;
  1467. __pyx_t_5 = 0;
  1468. goto __pyx_L7_try_return;
  1469. }
  1470. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  1471. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  1472. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  1473. goto __pyx_L10_try_end;
  1474. __pyx_L3_error:;
  1475. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1476. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  1477. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  1478. /* "lib/Naked/toolshed/c/system.pyx":36
  1479. * try:
  1480. * return os.path.splitext(filepath)[1]
  1481. * except Exception as e: # <<<<<<<<<<<<<<
  1482. * if DEBUG_FLAG:
  1483. * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).")
  1484. */
  1485. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  1486. if (__pyx_t_7) {
  1487. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_extension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1488. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1489. __Pyx_GOTREF(__pyx_t_5);
  1490. __Pyx_GOTREF(__pyx_t_6);
  1491. __Pyx_GOTREF(__pyx_t_4);
  1492. __Pyx_INCREF(__pyx_t_6);
  1493. __pyx_v_e = __pyx_t_6;
  1494. /* "lib/Naked/toolshed/c/system.pyx":37
  1495. * return os.path.splitext(filepath)[1]
  1496. * except Exception as e:
  1497. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  1498. * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).")
  1499. * raise e
  1500. */
  1501. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1502. __Pyx_GOTREF(__pyx_t_8);
  1503. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1504. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1505. if (__pyx_t_9) {
  1506. /* "lib/Naked/toolshed/c/system.pyx":38
  1507. * except Exception as e:
  1508. * if DEBUG_FLAG:
  1509. * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  1510. * raise e
  1511. *
  1512. */
  1513. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1514. __Pyx_GOTREF(__pyx_t_8);
  1515. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1516. __Pyx_GOTREF(__pyx_t_10);
  1517. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1518. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1519. __Pyx_GOTREF(__pyx_t_8);
  1520. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1521. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1522. __Pyx_GOTREF(__pyx_t_10);
  1523. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1524. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1525. goto __pyx_L13;
  1526. }
  1527. __pyx_L13:;
  1528. /* "lib/Naked/toolshed/c/system.pyx":39
  1529. * if DEBUG_FLAG:
  1530. * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).")
  1531. * raise e # <<<<<<<<<<<<<<
  1532. *
  1533. *
  1534. */
  1535. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  1536. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1537. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1538. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1539. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1540. goto __pyx_L4_exception_handled;
  1541. }
  1542. goto __pyx_L5_except_error;
  1543. __pyx_L5_except_error:;
  1544. __Pyx_XGIVEREF(__pyx_t_1);
  1545. __Pyx_XGIVEREF(__pyx_t_2);
  1546. __Pyx_XGIVEREF(__pyx_t_3);
  1547. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1548. goto __pyx_L1_error;
  1549. __pyx_L7_try_return:;
  1550. __Pyx_XGIVEREF(__pyx_t_1);
  1551. __Pyx_XGIVEREF(__pyx_t_2);
  1552. __Pyx_XGIVEREF(__pyx_t_3);
  1553. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1554. goto __pyx_L0;
  1555. __pyx_L4_exception_handled:;
  1556. __Pyx_XGIVEREF(__pyx_t_1);
  1557. __Pyx_XGIVEREF(__pyx_t_2);
  1558. __Pyx_XGIVEREF(__pyx_t_3);
  1559. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1560. __pyx_L10_try_end:;
  1561. }
  1562. /* "lib/Naked/toolshed/c/system.pyx":33
  1563. * # Tests: test_SYSTEM.py :: test_sys_file_extension
  1564. * #------------------------------------------------------------------------------
  1565. * def file_extension(filepath): # <<<<<<<<<<<<<<
  1566. * try:
  1567. * return os.path.splitext(filepath)[1]
  1568. */
  1569. /* function exit code */
  1570. __pyx_L1_error:;
  1571. __Pyx_XDECREF(__pyx_t_4);
  1572. __Pyx_XDECREF(__pyx_t_5);
  1573. __Pyx_XDECREF(__pyx_t_6);
  1574. __Pyx_XDECREF(__pyx_t_8);
  1575. __Pyx_XDECREF(__pyx_t_10);
  1576. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_extension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1577. __pyx_r = NULL;
  1578. __pyx_L0:;
  1579. __Pyx_XDECREF(__pyx_v_e);
  1580. __Pyx_XGIVEREF(__pyx_r);
  1581. __Pyx_RefNannyFinishContext();
  1582. return __pyx_r;
  1583. }
  1584. /* "lib/Naked/toolshed/c/system.pyx":47
  1585. * # Tests: test_SYSTEM.py :: test_sys_dir_path
  1586. * #------------------------------------------------------------------------------
  1587. * def directory(filepath): # <<<<<<<<<<<<<<
  1588. * try:
  1589. * return os.path.dirname(filepath)
  1590. */
  1591. /* Python wrapper */
  1592. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_5directory(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/
  1593. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_5directory = {__Pyx_NAMESTR("directory"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_5directory, METH_O, __Pyx_DOCSTR(0)};
  1594. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_5directory(PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  1595. PyObject *__pyx_r = 0;
  1596. __Pyx_RefNannyDeclarations
  1597. __Pyx_RefNannySetupContext("directory (wrapper)", 0);
  1598. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_4directory(__pyx_self, ((PyObject *)__pyx_v_filepath));
  1599. /* function exit code */
  1600. __Pyx_RefNannyFinishContext();
  1601. return __pyx_r;
  1602. }
  1603. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_4directory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  1604. PyObject *__pyx_v_e = NULL;
  1605. PyObject *__pyx_r = NULL;
  1606. __Pyx_RefNannyDeclarations
  1607. PyObject *__pyx_t_1 = NULL;
  1608. PyObject *__pyx_t_2 = NULL;
  1609. PyObject *__pyx_t_3 = NULL;
  1610. PyObject *__pyx_t_4 = NULL;
  1611. PyObject *__pyx_t_5 = NULL;
  1612. PyObject *__pyx_t_6 = NULL;
  1613. int __pyx_t_7;
  1614. PyObject *__pyx_t_8 = NULL;
  1615. int __pyx_t_9;
  1616. PyObject *__pyx_t_10 = NULL;
  1617. int __pyx_lineno = 0;
  1618. const char *__pyx_filename = NULL;
  1619. int __pyx_clineno = 0;
  1620. __Pyx_RefNannySetupContext("directory", 0);
  1621. /* "lib/Naked/toolshed/c/system.pyx":48
  1622. * #------------------------------------------------------------------------------
  1623. * def directory(filepath):
  1624. * try: # <<<<<<<<<<<<<<
  1625. * return os.path.dirname(filepath)
  1626. * except Exception as e:
  1627. */
  1628. {
  1629. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  1630. __Pyx_XGOTREF(__pyx_t_1);
  1631. __Pyx_XGOTREF(__pyx_t_2);
  1632. __Pyx_XGOTREF(__pyx_t_3);
  1633. /*try:*/ {
  1634. /* "lib/Naked/toolshed/c/system.pyx":49
  1635. * def directory(filepath):
  1636. * try:
  1637. * return os.path.dirname(filepath) # <<<<<<<<<<<<<<
  1638. * except Exception as e:
  1639. * if DEBUG_FLAG:
  1640. */
  1641. __Pyx_XDECREF(__pyx_r);
  1642. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1643. __Pyx_GOTREF(__pyx_t_4);
  1644. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1645. __Pyx_GOTREF(__pyx_t_5);
  1646. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1647. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1648. __Pyx_GOTREF(__pyx_t_4);
  1649. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1650. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1651. __Pyx_GOTREF(__pyx_t_5);
  1652. __Pyx_INCREF(__pyx_v_filepath);
  1653. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath);
  1654. __Pyx_GIVEREF(__pyx_v_filepath);
  1655. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1656. __Pyx_GOTREF(__pyx_t_6);
  1657. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1658. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1659. __pyx_r = __pyx_t_6;
  1660. __pyx_t_6 = 0;
  1661. goto __pyx_L7_try_return;
  1662. }
  1663. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  1664. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  1665. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  1666. goto __pyx_L10_try_end;
  1667. __pyx_L3_error:;
  1668. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1669. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  1670. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  1671. /* "lib/Naked/toolshed/c/system.pyx":50
  1672. * try:
  1673. * return os.path.dirname(filepath)
  1674. * except Exception as e: # <<<<<<<<<<<<<<
  1675. * if DEBUG_FLAG:
  1676. * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).")
  1677. */
  1678. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  1679. if (__pyx_t_7) {
  1680. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.directory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1681. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1682. __Pyx_GOTREF(__pyx_t_6);
  1683. __Pyx_GOTREF(__pyx_t_5);
  1684. __Pyx_GOTREF(__pyx_t_4);
  1685. __Pyx_INCREF(__pyx_t_5);
  1686. __pyx_v_e = __pyx_t_5;
  1687. /* "lib/Naked/toolshed/c/system.pyx":51
  1688. * return os.path.dirname(filepath)
  1689. * except Exception as e:
  1690. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  1691. * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).")
  1692. * raise e
  1693. */
  1694. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1695. __Pyx_GOTREF(__pyx_t_8);
  1696. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1697. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1698. if (__pyx_t_9) {
  1699. /* "lib/Naked/toolshed/c/system.pyx":52
  1700. * except Exception as e:
  1701. * if DEBUG_FLAG:
  1702. * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  1703. * raise e
  1704. *
  1705. */
  1706. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1707. __Pyx_GOTREF(__pyx_t_8);
  1708. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1709. __Pyx_GOTREF(__pyx_t_10);
  1710. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1711. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1712. __Pyx_GOTREF(__pyx_t_8);
  1713. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1714. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1715. __Pyx_GOTREF(__pyx_t_10);
  1716. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1717. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1718. goto __pyx_L13;
  1719. }
  1720. __pyx_L13:;
  1721. /* "lib/Naked/toolshed/c/system.pyx":53
  1722. * if DEBUG_FLAG:
  1723. * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).")
  1724. * raise e # <<<<<<<<<<<<<<
  1725. *
  1726. * #------------------------------------------------------------------------------
  1727. */
  1728. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  1729. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1730. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1731. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1732. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1733. goto __pyx_L4_exception_handled;
  1734. }
  1735. goto __pyx_L5_except_error;
  1736. __pyx_L5_except_error:;
  1737. __Pyx_XGIVEREF(__pyx_t_1);
  1738. __Pyx_XGIVEREF(__pyx_t_2);
  1739. __Pyx_XGIVEREF(__pyx_t_3);
  1740. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1741. goto __pyx_L1_error;
  1742. __pyx_L7_try_return:;
  1743. __Pyx_XGIVEREF(__pyx_t_1);
  1744. __Pyx_XGIVEREF(__pyx_t_2);
  1745. __Pyx_XGIVEREF(__pyx_t_3);
  1746. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1747. goto __pyx_L0;
  1748. __pyx_L4_exception_handled:;
  1749. __Pyx_XGIVEREF(__pyx_t_1);
  1750. __Pyx_XGIVEREF(__pyx_t_2);
  1751. __Pyx_XGIVEREF(__pyx_t_3);
  1752. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1753. __pyx_L10_try_end:;
  1754. }
  1755. /* "lib/Naked/toolshed/c/system.pyx":47
  1756. * # Tests: test_SYSTEM.py :: test_sys_dir_path
  1757. * #------------------------------------------------------------------------------
  1758. * def directory(filepath): # <<<<<<<<<<<<<<
  1759. * try:
  1760. * return os.path.dirname(filepath)
  1761. */
  1762. /* function exit code */
  1763. __pyx_L1_error:;
  1764. __Pyx_XDECREF(__pyx_t_4);
  1765. __Pyx_XDECREF(__pyx_t_5);
  1766. __Pyx_XDECREF(__pyx_t_6);
  1767. __Pyx_XDECREF(__pyx_t_8);
  1768. __Pyx_XDECREF(__pyx_t_10);
  1769. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.directory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1770. __pyx_r = NULL;
  1771. __pyx_L0:;
  1772. __Pyx_XDECREF(__pyx_v_e);
  1773. __Pyx_XGIVEREF(__pyx_r);
  1774. __Pyx_RefNannyFinishContext();
  1775. return __pyx_r;
  1776. }
  1777. /* "lib/Naked/toolshed/c/system.pyx":60
  1778. * # Tests: test_SYSTEM.py :: test_sys_make_filepath
  1779. * #------------------------------------------------------------------------------
  1780. * def make_path(*path_list): # <<<<<<<<<<<<<<
  1781. * try:
  1782. * return os.path.join(*path_list)
  1783. */
  1784. /* Python wrapper */
  1785. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_7make_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1786. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_7make_path = {__Pyx_NAMESTR("make_path"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_7make_path, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1787. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_7make_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1788. PyObject *__pyx_v_path_list = 0;
  1789. PyObject *__pyx_r = 0;
  1790. __Pyx_RefNannyDeclarations
  1791. __Pyx_RefNannySetupContext("make_path (wrapper)", 0);
  1792. if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "make_path", 0))) return NULL;
  1793. __Pyx_INCREF(__pyx_args);
  1794. __pyx_v_path_list = __pyx_args;
  1795. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_6make_path(__pyx_self, __pyx_v_path_list);
  1796. /* function exit code */
  1797. __Pyx_XDECREF(__pyx_v_path_list);
  1798. __Pyx_RefNannyFinishContext();
  1799. return __pyx_r;
  1800. }
  1801. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_6make_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_list) {
  1802. PyObject *__pyx_v_e = NULL;
  1803. PyObject *__pyx_r = NULL;
  1804. __Pyx_RefNannyDeclarations
  1805. PyObject *__pyx_t_1 = NULL;
  1806. PyObject *__pyx_t_2 = NULL;
  1807. PyObject *__pyx_t_3 = NULL;
  1808. PyObject *__pyx_t_4 = NULL;
  1809. PyObject *__pyx_t_5 = NULL;
  1810. PyObject *__pyx_t_6 = NULL;
  1811. int __pyx_t_7;
  1812. PyObject *__pyx_t_8 = NULL;
  1813. int __pyx_t_9;
  1814. PyObject *__pyx_t_10 = NULL;
  1815. int __pyx_lineno = 0;
  1816. const char *__pyx_filename = NULL;
  1817. int __pyx_clineno = 0;
  1818. __Pyx_RefNannySetupContext("make_path", 0);
  1819. /* "lib/Naked/toolshed/c/system.pyx":61
  1820. * #------------------------------------------------------------------------------
  1821. * def make_path(*path_list):
  1822. * try: # <<<<<<<<<<<<<<
  1823. * return os.path.join(*path_list)
  1824. * except Exception as e:
  1825. */
  1826. {
  1827. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  1828. __Pyx_XGOTREF(__pyx_t_1);
  1829. __Pyx_XGOTREF(__pyx_t_2);
  1830. __Pyx_XGOTREF(__pyx_t_3);
  1831. /*try:*/ {
  1832. /* "lib/Naked/toolshed/c/system.pyx":62
  1833. * def make_path(*path_list):
  1834. * try:
  1835. * return os.path.join(*path_list) # <<<<<<<<<<<<<<
  1836. * except Exception as e:
  1837. * if DEBUG_FLAG:
  1838. */
  1839. __Pyx_XDECREF(__pyx_r);
  1840. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1841. __Pyx_GOTREF(__pyx_t_4);
  1842. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1843. __Pyx_GOTREF(__pyx_t_5);
  1844. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1845. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1846. __Pyx_GOTREF(__pyx_t_4);
  1847. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1848. __pyx_t_5 = PySequence_Tuple(__pyx_v_path_list); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1849. __Pyx_GOTREF(__pyx_t_5);
  1850. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1851. __Pyx_GOTREF(__pyx_t_6);
  1852. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1853. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1854. __pyx_r = __pyx_t_6;
  1855. __pyx_t_6 = 0;
  1856. goto __pyx_L7_try_return;
  1857. }
  1858. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  1859. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  1860. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  1861. goto __pyx_L10_try_end;
  1862. __pyx_L3_error:;
  1863. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1864. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  1865. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  1866. /* "lib/Naked/toolshed/c/system.pyx":63
  1867. * try:
  1868. * return os.path.join(*path_list)
  1869. * except Exception as e: # <<<<<<<<<<<<<<
  1870. * if DEBUG_FLAG:
  1871. * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).")
  1872. */
  1873. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  1874. if (__pyx_t_7) {
  1875. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1876. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1877. __Pyx_GOTREF(__pyx_t_6);
  1878. __Pyx_GOTREF(__pyx_t_5);
  1879. __Pyx_GOTREF(__pyx_t_4);
  1880. __Pyx_INCREF(__pyx_t_5);
  1881. __pyx_v_e = __pyx_t_5;
  1882. /* "lib/Naked/toolshed/c/system.pyx":64
  1883. * return os.path.join(*path_list)
  1884. * except Exception as e:
  1885. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  1886. * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).")
  1887. * raise e
  1888. */
  1889. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1890. __Pyx_GOTREF(__pyx_t_8);
  1891. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1892. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1893. if (__pyx_t_9) {
  1894. /* "lib/Naked/toolshed/c/system.pyx":65
  1895. * except Exception as e:
  1896. * if DEBUG_FLAG:
  1897. * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  1898. * raise e
  1899. *
  1900. */
  1901. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1902. __Pyx_GOTREF(__pyx_t_8);
  1903. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1904. __Pyx_GOTREF(__pyx_t_10);
  1905. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1906. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1907. __Pyx_GOTREF(__pyx_t_8);
  1908. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1909. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1910. __Pyx_GOTREF(__pyx_t_10);
  1911. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1912. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1913. goto __pyx_L13;
  1914. }
  1915. __pyx_L13:;
  1916. /* "lib/Naked/toolshed/c/system.pyx":66
  1917. * if DEBUG_FLAG:
  1918. * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).")
  1919. * raise e # <<<<<<<<<<<<<<
  1920. *
  1921. *
  1922. */
  1923. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  1924. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  1925. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1926. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1927. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1928. goto __pyx_L4_exception_handled;
  1929. }
  1930. goto __pyx_L5_except_error;
  1931. __pyx_L5_except_error:;
  1932. __Pyx_XGIVEREF(__pyx_t_1);
  1933. __Pyx_XGIVEREF(__pyx_t_2);
  1934. __Pyx_XGIVEREF(__pyx_t_3);
  1935. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1936. goto __pyx_L1_error;
  1937. __pyx_L7_try_return:;
  1938. __Pyx_XGIVEREF(__pyx_t_1);
  1939. __Pyx_XGIVEREF(__pyx_t_2);
  1940. __Pyx_XGIVEREF(__pyx_t_3);
  1941. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1942. goto __pyx_L0;
  1943. __pyx_L4_exception_handled:;
  1944. __Pyx_XGIVEREF(__pyx_t_1);
  1945. __Pyx_XGIVEREF(__pyx_t_2);
  1946. __Pyx_XGIVEREF(__pyx_t_3);
  1947. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1948. __pyx_L10_try_end:;
  1949. }
  1950. /* "lib/Naked/toolshed/c/system.pyx":60
  1951. * # Tests: test_SYSTEM.py :: test_sys_make_filepath
  1952. * #------------------------------------------------------------------------------
  1953. * def make_path(*path_list): # <<<<<<<<<<<<<<
  1954. * try:
  1955. * return os.path.join(*path_list)
  1956. */
  1957. /* function exit code */
  1958. __pyx_L1_error:;
  1959. __Pyx_XDECREF(__pyx_t_4);
  1960. __Pyx_XDECREF(__pyx_t_5);
  1961. __Pyx_XDECREF(__pyx_t_6);
  1962. __Pyx_XDECREF(__pyx_t_8);
  1963. __Pyx_XDECREF(__pyx_t_10);
  1964. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1965. __pyx_r = NULL;
  1966. __pyx_L0:;
  1967. __Pyx_XDECREF(__pyx_v_e);
  1968. __Pyx_XGIVEREF(__pyx_r);
  1969. __Pyx_RefNannyFinishContext();
  1970. return __pyx_r;
  1971. }
  1972. /* "lib/Naked/toolshed/c/system.pyx":74
  1973. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile
  1974. * #------------------------------------------------------------------------------
  1975. * def currentdir_to_basefile(func): # <<<<<<<<<<<<<<
  1976. * try:
  1977. * from functools import wraps
  1978. */
  1979. /* Python wrapper */
  1980. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/
  1981. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile = {__Pyx_NAMESTR("currentdir_to_basefile"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile, METH_O, __Pyx_DOCSTR(0)};
  1982. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile(PyObject *__pyx_self, PyObject *__pyx_v_func) {
  1983. PyObject *__pyx_r = 0;
  1984. __Pyx_RefNannyDeclarations
  1985. __Pyx_RefNannySetupContext("currentdir_to_basefile (wrapper)", 0);
  1986. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_8currentdir_to_basefile(__pyx_self, ((PyObject *)__pyx_v_func));
  1987. /* function exit code */
  1988. __Pyx_RefNannyFinishContext();
  1989. return __pyx_r;
  1990. }
  1991. /* "lib/Naked/toolshed/c/system.pyx":79
  1992. *
  1993. * @wraps(func)
  1994. * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<<
  1995. * current_directory = os.getcwd() #get current working directory path
  1996. * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path
  1997. */
  1998. /* Python wrapper */
  1999. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2000. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2001. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2002. PyObject *__pyx_v_file_name = 0;
  2003. PyObject *__pyx_v_args = 0;
  2004. PyObject *__pyx_v_kwargs = 0;
  2005. int __pyx_lineno = 0;
  2006. const char *__pyx_filename = NULL;
  2007. int __pyx_clineno = 0;
  2008. PyObject *__pyx_r = 0;
  2009. __Pyx_RefNannyDeclarations
  2010. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  2011. __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  2012. __Pyx_GOTREF(__pyx_v_kwargs);
  2013. if (PyTuple_GET_SIZE(__pyx_args) > 1) {
  2014. __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
  2015. if (unlikely(!__pyx_v_args)) {
  2016. __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  2017. __Pyx_RefNannyFinishContext();
  2018. return NULL;
  2019. }
  2020. __Pyx_GOTREF(__pyx_v_args);
  2021. } else {
  2022. __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  2023. }
  2024. {
  2025. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_name,0};
  2026. PyObject* values[1] = {0};
  2027. if (unlikely(__pyx_kwds)) {
  2028. Py_ssize_t kw_args;
  2029. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2030. switch (pos_args) {
  2031. default:
  2032. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2033. case 0: break;
  2034. }
  2035. kw_args = PyDict_Size(__pyx_kwds);
  2036. switch (pos_args) {
  2037. case 0:
  2038. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_name)) != 0)) kw_args--;
  2039. else goto __pyx_L5_argtuple_error;
  2040. }
  2041. if (unlikely(kw_args > 0)) {
  2042. const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
  2043. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "wrapper") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2044. }
  2045. } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
  2046. goto __pyx_L5_argtuple_error;
  2047. } else {
  2048. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2049. }
  2050. __pyx_v_file_name = values[0];
  2051. }
  2052. goto __pyx_L4_argument_unpacking_done;
  2053. __pyx_L5_argtuple_error:;
  2054. __Pyx_RaiseArgtupleInvalid("wrapper", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2055. __pyx_L3_error:;
  2056. __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  2057. __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  2058. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2059. __Pyx_RefNannyFinishContext();
  2060. return NULL;
  2061. __pyx_L4_argument_unpacking_done:;
  2062. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_wrapper(__pyx_self, __pyx_v_file_name, __pyx_v_args, __pyx_v_kwargs);
  2063. /* function exit code */
  2064. __Pyx_XDECREF(__pyx_v_args);
  2065. __Pyx_XDECREF(__pyx_v_kwargs);
  2066. __Pyx_RefNannyFinishContext();
  2067. return __pyx_r;
  2068. }
  2069. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  2070. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_cur_scope;
  2071. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_outer_scope;
  2072. PyObject *__pyx_v_current_directory = NULL;
  2073. PyObject *__pyx_v_full_path = NULL;
  2074. PyObject *__pyx_r = NULL;
  2075. __Pyx_RefNannyDeclarations
  2076. PyObject *__pyx_t_1 = NULL;
  2077. PyObject *__pyx_t_2 = NULL;
  2078. PyObject *__pyx_t_3 = NULL;
  2079. int __pyx_lineno = 0;
  2080. const char *__pyx_filename = NULL;
  2081. int __pyx_clineno = 0;
  2082. __Pyx_RefNannySetupContext("wrapper", 0);
  2083. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *) __Pyx_CyFunction_GetClosure(__pyx_self);
  2084. __pyx_cur_scope = __pyx_outer_scope;
  2085. /* "lib/Naked/toolshed/c/system.pyx":80
  2086. * @wraps(func)
  2087. * def wrapper(file_name, *args, **kwargs):
  2088. * current_directory = os.getcwd() #get current working directory path # <<<<<<<<<<<<<<
  2089. * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path
  2090. * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument
  2091. */
  2092. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2093. __Pyx_GOTREF(__pyx_t_1);
  2094. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2095. __Pyx_GOTREF(__pyx_t_2);
  2096. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2097. __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 = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2098. __Pyx_GOTREF(__pyx_t_1);
  2099. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2100. __pyx_v_current_directory = __pyx_t_1;
  2101. __pyx_t_1 = 0;
  2102. /* "lib/Naked/toolshed/c/system.pyx":81
  2103. * def wrapper(file_name, *args, **kwargs):
  2104. * current_directory = os.getcwd() #get current working directory path
  2105. * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path # <<<<<<<<<<<<<<
  2106. * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument
  2107. * return wrapper
  2108. */
  2109. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2110. __Pyx_GOTREF(__pyx_t_1);
  2111. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2112. __Pyx_GOTREF(__pyx_t_2);
  2113. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2114. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2115. __Pyx_GOTREF(__pyx_t_1);
  2116. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2117. __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2118. __Pyx_GOTREF(__pyx_t_2);
  2119. __Pyx_INCREF(__pyx_v_current_directory);
  2120. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_current_directory);
  2121. __Pyx_GIVEREF(__pyx_v_current_directory);
  2122. __Pyx_INCREF(__pyx_v_file_name);
  2123. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_file_name);
  2124. __Pyx_GIVEREF(__pyx_v_file_name);
  2125. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2126. __Pyx_GOTREF(__pyx_t_3);
  2127. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2128. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2129. __pyx_v_full_path = __pyx_t_3;
  2130. __pyx_t_3 = 0;
  2131. /* "lib/Naked/toolshed/c/system.pyx":82
  2132. * current_directory = os.getcwd() #get current working directory path
  2133. * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path
  2134. * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument # <<<<<<<<<<<<<<
  2135. * return wrapper
  2136. * except Exception as e:
  2137. */
  2138. __Pyx_XDECREF(__pyx_r);
  2139. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2140. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2141. __Pyx_GOTREF(__pyx_t_3);
  2142. __Pyx_INCREF(__pyx_v_full_path);
  2143. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_full_path);
  2144. __Pyx_GIVEREF(__pyx_v_full_path);
  2145. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2146. __Pyx_GOTREF(__pyx_t_2);
  2147. __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2148. __Pyx_GOTREF(__pyx_t_1);
  2149. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2150. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2151. __pyx_t_2 = __pyx_v_kwargs;
  2152. __Pyx_INCREF(__pyx_t_2);
  2153. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2154. __Pyx_GOTREF(__pyx_t_3);
  2155. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2156. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2157. __pyx_r = __pyx_t_3;
  2158. __pyx_t_3 = 0;
  2159. goto __pyx_L0;
  2160. /* "lib/Naked/toolshed/c/system.pyx":79
  2161. *
  2162. * @wraps(func)
  2163. * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<<
  2164. * current_directory = os.getcwd() #get current working directory path
  2165. * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path
  2166. */
  2167. /* function exit code */
  2168. __pyx_L1_error:;
  2169. __Pyx_XDECREF(__pyx_t_1);
  2170. __Pyx_XDECREF(__pyx_t_2);
  2171. __Pyx_XDECREF(__pyx_t_3);
  2172. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2173. __pyx_r = NULL;
  2174. __pyx_L0:;
  2175. __Pyx_XDECREF(__pyx_v_current_directory);
  2176. __Pyx_XDECREF(__pyx_v_full_path);
  2177. __Pyx_XGIVEREF(__pyx_r);
  2178. __Pyx_RefNannyFinishContext();
  2179. return __pyx_r;
  2180. }
  2181. /* "lib/Naked/toolshed/c/system.pyx":74
  2182. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile
  2183. * #------------------------------------------------------------------------------
  2184. * def currentdir_to_basefile(func): # <<<<<<<<<<<<<<
  2185. * try:
  2186. * from functools import wraps
  2187. */
  2188. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_8currentdir_to_basefile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) {
  2189. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_cur_scope;
  2190. PyObject *__pyx_v_wraps = NULL;
  2191. PyObject *__pyx_v_wrapper = 0;
  2192. PyObject *__pyx_v_e = NULL;
  2193. PyObject *__pyx_r = NULL;
  2194. __Pyx_RefNannyDeclarations
  2195. PyObject *__pyx_t_1 = NULL;
  2196. PyObject *__pyx_t_2 = NULL;
  2197. PyObject *__pyx_t_3 = NULL;
  2198. PyObject *__pyx_t_4 = NULL;
  2199. PyObject *__pyx_t_5 = NULL;
  2200. PyObject *__pyx_t_6 = NULL;
  2201. int __pyx_t_7;
  2202. PyObject *__pyx_t_8 = NULL;
  2203. int __pyx_t_9;
  2204. PyObject *__pyx_t_10 = NULL;
  2205. int __pyx_lineno = 0;
  2206. const char *__pyx_filename = NULL;
  2207. int __pyx_clineno = 0;
  2208. __Pyx_RefNannySetupContext("currentdir_to_basefile", 0);
  2209. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, __pyx_empty_tuple, NULL);
  2210. if (unlikely(!__pyx_cur_scope)) {
  2211. __Pyx_RefNannyFinishContext();
  2212. return NULL;
  2213. }
  2214. __Pyx_GOTREF(__pyx_cur_scope);
  2215. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  2216. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  2217. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  2218. /* "lib/Naked/toolshed/c/system.pyx":75
  2219. * #------------------------------------------------------------------------------
  2220. * def currentdir_to_basefile(func):
  2221. * try: # <<<<<<<<<<<<<<
  2222. * from functools import wraps
  2223. *
  2224. */
  2225. {
  2226. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  2227. __Pyx_XGOTREF(__pyx_t_1);
  2228. __Pyx_XGOTREF(__pyx_t_2);
  2229. __Pyx_XGOTREF(__pyx_t_3);
  2230. /*try:*/ {
  2231. /* "lib/Naked/toolshed/c/system.pyx":76
  2232. * def currentdir_to_basefile(func):
  2233. * try:
  2234. * from functools import wraps # <<<<<<<<<<<<<<
  2235. *
  2236. * @wraps(func)
  2237. */
  2238. __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2239. __Pyx_GOTREF(__pyx_t_4);
  2240. __Pyx_INCREF(__pyx_n_s_wraps);
  2241. PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_wraps);
  2242. __Pyx_GIVEREF(__pyx_n_s_wraps);
  2243. __pyx_t_5 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2244. __Pyx_GOTREF(__pyx_t_5);
  2245. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2246. __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2247. __Pyx_GOTREF(__pyx_t_4);
  2248. __Pyx_INCREF(__pyx_t_4);
  2249. __pyx_v_wraps = __pyx_t_4;
  2250. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2251. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2252. /* "lib/Naked/toolshed/c/system.pyx":78
  2253. * from functools import wraps
  2254. *
  2255. * @wraps(func) # <<<<<<<<<<<<<<
  2256. * def wrapper(file_name, *args, **kwargs):
  2257. * current_directory = os.getcwd() #get current working directory path
  2258. */
  2259. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2260. __Pyx_GOTREF(__pyx_t_5);
  2261. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  2262. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_func);
  2263. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  2264. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_wraps, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2265. __Pyx_GOTREF(__pyx_t_4);
  2266. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2267. /* "lib/Naked/toolshed/c/system.pyx":79
  2268. *
  2269. * @wraps(func)
  2270. * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<<
  2271. * current_directory = os.getcwd() #get current working directory path
  2272. * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path
  2273. */
  2274. __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper, 0, __pyx_n_s_currentdir_to_basefile_locals_wr, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_system, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2275. __Pyx_GOTREF(__pyx_t_5);
  2276. /* "lib/Naked/toolshed/c/system.pyx":78
  2277. * from functools import wraps
  2278. *
  2279. * @wraps(func) # <<<<<<<<<<<<<<
  2280. * def wrapper(file_name, *args, **kwargs):
  2281. * current_directory = os.getcwd() #get current working directory path
  2282. */
  2283. __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2284. __Pyx_GOTREF(__pyx_t_6);
  2285. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  2286. __Pyx_GIVEREF(__pyx_t_5);
  2287. __pyx_t_5 = 0;
  2288. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2289. __Pyx_GOTREF(__pyx_t_5);
  2290. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2291. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2292. __pyx_v_wrapper = __pyx_t_5;
  2293. __pyx_t_5 = 0;
  2294. /* "lib/Naked/toolshed/c/system.pyx":83
  2295. * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path
  2296. * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument
  2297. * return wrapper # <<<<<<<<<<<<<<
  2298. * except Exception as e:
  2299. * if DEBUG_FLAG:
  2300. */
  2301. __Pyx_XDECREF(__pyx_r);
  2302. __Pyx_INCREF(__pyx_v_wrapper);
  2303. __pyx_r = __pyx_v_wrapper;
  2304. goto __pyx_L7_try_return;
  2305. }
  2306. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  2307. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  2308. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  2309. goto __pyx_L10_try_end;
  2310. __pyx_L3_error:;
  2311. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  2312. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  2313. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  2314. /* "lib/Naked/toolshed/c/system.pyx":84
  2315. * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument
  2316. * return wrapper
  2317. * except Exception as e: # <<<<<<<<<<<<<<
  2318. * if DEBUG_FLAG:
  2319. * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).")
  2320. */
  2321. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  2322. if (__pyx_t_7) {
  2323. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2324. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2325. __Pyx_GOTREF(__pyx_t_5);
  2326. __Pyx_GOTREF(__pyx_t_6);
  2327. __Pyx_GOTREF(__pyx_t_4);
  2328. __Pyx_INCREF(__pyx_t_6);
  2329. __pyx_v_e = __pyx_t_6;
  2330. /* "lib/Naked/toolshed/c/system.pyx":85
  2331. * return wrapper
  2332. * except Exception as e:
  2333. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  2334. * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).")
  2335. * raise e
  2336. */
  2337. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2338. __Pyx_GOTREF(__pyx_t_8);
  2339. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2340. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2341. if (__pyx_t_9) {
  2342. /* "lib/Naked/toolshed/c/system.pyx":86
  2343. * except Exception as e:
  2344. * if DEBUG_FLAG:
  2345. * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  2346. * raise e
  2347. *
  2348. */
  2349. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2350. __Pyx_GOTREF(__pyx_t_8);
  2351. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2352. __Pyx_GOTREF(__pyx_t_10);
  2353. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2354. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2355. __Pyx_GOTREF(__pyx_t_8);
  2356. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2357. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2358. __Pyx_GOTREF(__pyx_t_10);
  2359. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2360. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2361. goto __pyx_L13;
  2362. }
  2363. __pyx_L13:;
  2364. /* "lib/Naked/toolshed/c/system.pyx":87
  2365. * if DEBUG_FLAG:
  2366. * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).")
  2367. * raise e # <<<<<<<<<<<<<<
  2368. *
  2369. * #------------------------------------------------------------------------------
  2370. */
  2371. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  2372. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2373. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2374. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2375. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2376. goto __pyx_L4_exception_handled;
  2377. }
  2378. goto __pyx_L5_except_error;
  2379. __pyx_L5_except_error:;
  2380. __Pyx_XGIVEREF(__pyx_t_1);
  2381. __Pyx_XGIVEREF(__pyx_t_2);
  2382. __Pyx_XGIVEREF(__pyx_t_3);
  2383. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2384. goto __pyx_L1_error;
  2385. __pyx_L7_try_return:;
  2386. __Pyx_XGIVEREF(__pyx_t_1);
  2387. __Pyx_XGIVEREF(__pyx_t_2);
  2388. __Pyx_XGIVEREF(__pyx_t_3);
  2389. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2390. goto __pyx_L0;
  2391. __pyx_L4_exception_handled:;
  2392. __Pyx_XGIVEREF(__pyx_t_1);
  2393. __Pyx_XGIVEREF(__pyx_t_2);
  2394. __Pyx_XGIVEREF(__pyx_t_3);
  2395. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2396. __pyx_L10_try_end:;
  2397. }
  2398. /* "lib/Naked/toolshed/c/system.pyx":74
  2399. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile
  2400. * #------------------------------------------------------------------------------
  2401. * def currentdir_to_basefile(func): # <<<<<<<<<<<<<<
  2402. * try:
  2403. * from functools import wraps
  2404. */
  2405. /* function exit code */
  2406. __pyx_L1_error:;
  2407. __Pyx_XDECREF(__pyx_t_4);
  2408. __Pyx_XDECREF(__pyx_t_5);
  2409. __Pyx_XDECREF(__pyx_t_6);
  2410. __Pyx_XDECREF(__pyx_t_8);
  2411. __Pyx_XDECREF(__pyx_t_10);
  2412. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2413. __pyx_r = NULL;
  2414. __pyx_L0:;
  2415. __Pyx_XDECREF(__pyx_v_wraps);
  2416. __Pyx_XDECREF(__pyx_v_wrapper);
  2417. __Pyx_XDECREF(__pyx_v_e);
  2418. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  2419. __Pyx_XGIVEREF(__pyx_r);
  2420. __Pyx_RefNannyFinishContext();
  2421. return __pyx_r;
  2422. }
  2423. /* "lib/Naked/toolshed/c/system.pyx":94
  2424. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg
  2425. * #------------------------------------------------------------------------------
  2426. * def currentdir_firstparam(func): # <<<<<<<<<<<<<<
  2427. * try:
  2428. * from functools import wraps
  2429. */
  2430. /* Python wrapper */
  2431. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/
  2432. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam = {__Pyx_NAMESTR("currentdir_firstparam"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam, METH_O, __Pyx_DOCSTR(0)};
  2433. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam(PyObject *__pyx_self, PyObject *__pyx_v_func) {
  2434. PyObject *__pyx_r = 0;
  2435. __Pyx_RefNannyDeclarations
  2436. __Pyx_RefNannySetupContext("currentdir_firstparam (wrapper)", 0);
  2437. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_10currentdir_firstparam(__pyx_self, ((PyObject *)__pyx_v_func));
  2438. /* function exit code */
  2439. __Pyx_RefNannyFinishContext();
  2440. return __pyx_r;
  2441. }
  2442. /* "lib/Naked/toolshed/c/system.pyx":99
  2443. *
  2444. * @wraps(func)
  2445. * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<<
  2446. * current_directory = os.getcwd()
  2447. * return func(current_directory, *args, **kwargs)
  2448. */
  2449. /* Python wrapper */
  2450. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2451. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2452. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2453. CYTHON_UNUSED PyObject *__pyx_v_dir = 0;
  2454. PyObject *__pyx_v_args = 0;
  2455. PyObject *__pyx_v_kwargs = 0;
  2456. int __pyx_lineno = 0;
  2457. const char *__pyx_filename = NULL;
  2458. int __pyx_clineno = 0;
  2459. PyObject *__pyx_r = 0;
  2460. __Pyx_RefNannyDeclarations
  2461. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  2462. __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  2463. __Pyx_GOTREF(__pyx_v_kwargs);
  2464. if (PyTuple_GET_SIZE(__pyx_args) > 1) {
  2465. __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
  2466. if (unlikely(!__pyx_v_args)) {
  2467. __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  2468. __Pyx_RefNannyFinishContext();
  2469. return NULL;
  2470. }
  2471. __Pyx_GOTREF(__pyx_v_args);
  2472. } else {
  2473. __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  2474. }
  2475. {
  2476. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir,0};
  2477. PyObject* values[1] = {0};
  2478. values[0] = ((PyObject *)((PyObject*)__pyx_kp_s__8));
  2479. if (unlikely(__pyx_kwds)) {
  2480. Py_ssize_t kw_args;
  2481. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2482. switch (pos_args) {
  2483. default:
  2484. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2485. case 0: break;
  2486. }
  2487. kw_args = PyDict_Size(__pyx_kwds);
  2488. switch (pos_args) {
  2489. case 0:
  2490. if (kw_args > 0) {
  2491. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir);
  2492. if (value) { values[0] = value; kw_args--; }
  2493. }
  2494. }
  2495. if (unlikely(kw_args > 0)) {
  2496. const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
  2497. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "wrapper") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2498. }
  2499. } else {
  2500. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2501. default:
  2502. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2503. case 0: break;
  2504. }
  2505. }
  2506. __pyx_v_dir = values[0];
  2507. }
  2508. goto __pyx_L4_argument_unpacking_done;
  2509. __pyx_L3_error:;
  2510. __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  2511. __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  2512. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2513. __Pyx_RefNannyFinishContext();
  2514. return NULL;
  2515. __pyx_L4_argument_unpacking_done:;
  2516. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_wrapper(__pyx_self, __pyx_v_dir, __pyx_v_args, __pyx_v_kwargs);
  2517. /* function exit code */
  2518. __Pyx_XDECREF(__pyx_v_args);
  2519. __Pyx_XDECREF(__pyx_v_kwargs);
  2520. __Pyx_RefNannyFinishContext();
  2521. return __pyx_r;
  2522. }
  2523. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_wrapper(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_dir, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  2524. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_cur_scope;
  2525. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_outer_scope;
  2526. PyObject *__pyx_v_current_directory = NULL;
  2527. PyObject *__pyx_r = NULL;
  2528. __Pyx_RefNannyDeclarations
  2529. PyObject *__pyx_t_1 = NULL;
  2530. PyObject *__pyx_t_2 = NULL;
  2531. PyObject *__pyx_t_3 = NULL;
  2532. int __pyx_lineno = 0;
  2533. const char *__pyx_filename = NULL;
  2534. int __pyx_clineno = 0;
  2535. __Pyx_RefNannySetupContext("wrapper", 0);
  2536. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *) __Pyx_CyFunction_GetClosure(__pyx_self);
  2537. __pyx_cur_scope = __pyx_outer_scope;
  2538. /* "lib/Naked/toolshed/c/system.pyx":100
  2539. * @wraps(func)
  2540. * def wrapper(dir="", *args, **kwargs):
  2541. * current_directory = os.getcwd() # <<<<<<<<<<<<<<
  2542. * return func(current_directory, *args, **kwargs)
  2543. * return wrapper
  2544. */
  2545. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2546. __Pyx_GOTREF(__pyx_t_1);
  2547. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2548. __Pyx_GOTREF(__pyx_t_2);
  2549. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2550. __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 = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2551. __Pyx_GOTREF(__pyx_t_1);
  2552. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2553. __pyx_v_current_directory = __pyx_t_1;
  2554. __pyx_t_1 = 0;
  2555. /* "lib/Naked/toolshed/c/system.pyx":101
  2556. * def wrapper(dir="", *args, **kwargs):
  2557. * current_directory = os.getcwd()
  2558. * return func(current_directory, *args, **kwargs) # <<<<<<<<<<<<<<
  2559. * return wrapper
  2560. * except Exception as e:
  2561. */
  2562. __Pyx_XDECREF(__pyx_r);
  2563. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2564. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2565. __Pyx_GOTREF(__pyx_t_1);
  2566. __Pyx_INCREF(__pyx_v_current_directory);
  2567. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_current_directory);
  2568. __Pyx_GIVEREF(__pyx_v_current_directory);
  2569. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2570. __Pyx_GOTREF(__pyx_t_2);
  2571. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2572. __Pyx_GOTREF(__pyx_t_3);
  2573. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2574. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2575. __pyx_t_2 = __pyx_v_kwargs;
  2576. __Pyx_INCREF(__pyx_t_2);
  2577. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2578. __Pyx_GOTREF(__pyx_t_1);
  2579. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2580. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2581. __pyx_r = __pyx_t_1;
  2582. __pyx_t_1 = 0;
  2583. goto __pyx_L0;
  2584. /* "lib/Naked/toolshed/c/system.pyx":99
  2585. *
  2586. * @wraps(func)
  2587. * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<<
  2588. * current_directory = os.getcwd()
  2589. * return func(current_directory, *args, **kwargs)
  2590. */
  2591. /* function exit code */
  2592. __pyx_L1_error:;
  2593. __Pyx_XDECREF(__pyx_t_1);
  2594. __Pyx_XDECREF(__pyx_t_2);
  2595. __Pyx_XDECREF(__pyx_t_3);
  2596. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2597. __pyx_r = NULL;
  2598. __pyx_L0:;
  2599. __Pyx_XDECREF(__pyx_v_current_directory);
  2600. __Pyx_XGIVEREF(__pyx_r);
  2601. __Pyx_RefNannyFinishContext();
  2602. return __pyx_r;
  2603. }
  2604. /* "lib/Naked/toolshed/c/system.pyx":94
  2605. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg
  2606. * #------------------------------------------------------------------------------
  2607. * def currentdir_firstparam(func): # <<<<<<<<<<<<<<
  2608. * try:
  2609. * from functools import wraps
  2610. */
  2611. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_10currentdir_firstparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) {
  2612. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_cur_scope;
  2613. PyObject *__pyx_v_wraps = NULL;
  2614. PyObject *__pyx_v_wrapper = 0;
  2615. PyObject *__pyx_v_e = NULL;
  2616. PyObject *__pyx_r = NULL;
  2617. __Pyx_RefNannyDeclarations
  2618. PyObject *__pyx_t_1 = NULL;
  2619. PyObject *__pyx_t_2 = NULL;
  2620. PyObject *__pyx_t_3 = NULL;
  2621. PyObject *__pyx_t_4 = NULL;
  2622. PyObject *__pyx_t_5 = NULL;
  2623. PyObject *__pyx_t_6 = NULL;
  2624. int __pyx_t_7;
  2625. PyObject *__pyx_t_8 = NULL;
  2626. int __pyx_t_9;
  2627. PyObject *__pyx_t_10 = NULL;
  2628. int __pyx_lineno = 0;
  2629. const char *__pyx_filename = NULL;
  2630. int __pyx_clineno = 0;
  2631. __Pyx_RefNannySetupContext("currentdir_firstparam", 0);
  2632. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, __pyx_empty_tuple, NULL);
  2633. if (unlikely(!__pyx_cur_scope)) {
  2634. __Pyx_RefNannyFinishContext();
  2635. return NULL;
  2636. }
  2637. __Pyx_GOTREF(__pyx_cur_scope);
  2638. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  2639. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  2640. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  2641. /* "lib/Naked/toolshed/c/system.pyx":95
  2642. * #------------------------------------------------------------------------------
  2643. * def currentdir_firstparam(func):
  2644. * try: # <<<<<<<<<<<<<<
  2645. * from functools import wraps
  2646. *
  2647. */
  2648. {
  2649. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  2650. __Pyx_XGOTREF(__pyx_t_1);
  2651. __Pyx_XGOTREF(__pyx_t_2);
  2652. __Pyx_XGOTREF(__pyx_t_3);
  2653. /*try:*/ {
  2654. /* "lib/Naked/toolshed/c/system.pyx":96
  2655. * def currentdir_firstparam(func):
  2656. * try:
  2657. * from functools import wraps # <<<<<<<<<<<<<<
  2658. *
  2659. * @wraps(func)
  2660. */
  2661. __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2662. __Pyx_GOTREF(__pyx_t_4);
  2663. __Pyx_INCREF(__pyx_n_s_wraps);
  2664. PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_wraps);
  2665. __Pyx_GIVEREF(__pyx_n_s_wraps);
  2666. __pyx_t_5 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2667. __Pyx_GOTREF(__pyx_t_5);
  2668. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2669. __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2670. __Pyx_GOTREF(__pyx_t_4);
  2671. __Pyx_INCREF(__pyx_t_4);
  2672. __pyx_v_wraps = __pyx_t_4;
  2673. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2674. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2675. /* "lib/Naked/toolshed/c/system.pyx":98
  2676. * from functools import wraps
  2677. *
  2678. * @wraps(func) # <<<<<<<<<<<<<<
  2679. * def wrapper(dir="", *args, **kwargs):
  2680. * current_directory = os.getcwd()
  2681. */
  2682. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2683. __Pyx_GOTREF(__pyx_t_5);
  2684. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  2685. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_func);
  2686. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  2687. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_wraps, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2688. __Pyx_GOTREF(__pyx_t_4);
  2689. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2690. /* "lib/Naked/toolshed/c/system.pyx":99
  2691. *
  2692. * @wraps(func)
  2693. * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<<
  2694. * current_directory = os.getcwd()
  2695. * return func(current_directory, *args, **kwargs)
  2696. */
  2697. __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper, 0, __pyx_n_s_currentdir_firstparam_locals_wra, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_system, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2698. __Pyx_GOTREF(__pyx_t_5);
  2699. __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__11);
  2700. /* "lib/Naked/toolshed/c/system.pyx":98
  2701. * from functools import wraps
  2702. *
  2703. * @wraps(func) # <<<<<<<<<<<<<<
  2704. * def wrapper(dir="", *args, **kwargs):
  2705. * current_directory = os.getcwd()
  2706. */
  2707. __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2708. __Pyx_GOTREF(__pyx_t_6);
  2709. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  2710. __Pyx_GIVEREF(__pyx_t_5);
  2711. __pyx_t_5 = 0;
  2712. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2713. __Pyx_GOTREF(__pyx_t_5);
  2714. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2715. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2716. __pyx_v_wrapper = __pyx_t_5;
  2717. __pyx_t_5 = 0;
  2718. /* "lib/Naked/toolshed/c/system.pyx":102
  2719. * current_directory = os.getcwd()
  2720. * return func(current_directory, *args, **kwargs)
  2721. * return wrapper # <<<<<<<<<<<<<<
  2722. * except Exception as e:
  2723. * if DEBUG_FLAG:
  2724. */
  2725. __Pyx_XDECREF(__pyx_r);
  2726. __Pyx_INCREF(__pyx_v_wrapper);
  2727. __pyx_r = __pyx_v_wrapper;
  2728. goto __pyx_L7_try_return;
  2729. }
  2730. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  2731. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  2732. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  2733. goto __pyx_L10_try_end;
  2734. __pyx_L3_error:;
  2735. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  2736. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  2737. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  2738. /* "lib/Naked/toolshed/c/system.pyx":103
  2739. * return func(current_directory, *args, **kwargs)
  2740. * return wrapper
  2741. * except Exception as e: # <<<<<<<<<<<<<<
  2742. * if DEBUG_FLAG:
  2743. * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).")
  2744. */
  2745. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  2746. if (__pyx_t_7) {
  2747. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2748. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2749. __Pyx_GOTREF(__pyx_t_5);
  2750. __Pyx_GOTREF(__pyx_t_6);
  2751. __Pyx_GOTREF(__pyx_t_4);
  2752. __Pyx_INCREF(__pyx_t_6);
  2753. __pyx_v_e = __pyx_t_6;
  2754. /* "lib/Naked/toolshed/c/system.pyx":104
  2755. * return wrapper
  2756. * except Exception as e:
  2757. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  2758. * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).")
  2759. * raise e
  2760. */
  2761. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2762. __Pyx_GOTREF(__pyx_t_8);
  2763. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2764. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2765. if (__pyx_t_9) {
  2766. /* "lib/Naked/toolshed/c/system.pyx":105
  2767. * except Exception as e:
  2768. * if DEBUG_FLAG:
  2769. * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  2770. * raise e
  2771. *
  2772. */
  2773. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2774. __Pyx_GOTREF(__pyx_t_8);
  2775. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2776. __Pyx_GOTREF(__pyx_t_10);
  2777. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2778. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2779. __Pyx_GOTREF(__pyx_t_8);
  2780. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2781. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2782. __Pyx_GOTREF(__pyx_t_10);
  2783. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  2784. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  2785. goto __pyx_L13;
  2786. }
  2787. __pyx_L13:;
  2788. /* "lib/Naked/toolshed/c/system.pyx":106
  2789. * if DEBUG_FLAG:
  2790. * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).")
  2791. * raise e # <<<<<<<<<<<<<<
  2792. *
  2793. *
  2794. */
  2795. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  2796. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  2797. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2798. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2799. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2800. goto __pyx_L4_exception_handled;
  2801. }
  2802. goto __pyx_L5_except_error;
  2803. __pyx_L5_except_error:;
  2804. __Pyx_XGIVEREF(__pyx_t_1);
  2805. __Pyx_XGIVEREF(__pyx_t_2);
  2806. __Pyx_XGIVEREF(__pyx_t_3);
  2807. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2808. goto __pyx_L1_error;
  2809. __pyx_L7_try_return:;
  2810. __Pyx_XGIVEREF(__pyx_t_1);
  2811. __Pyx_XGIVEREF(__pyx_t_2);
  2812. __Pyx_XGIVEREF(__pyx_t_3);
  2813. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2814. goto __pyx_L0;
  2815. __pyx_L4_exception_handled:;
  2816. __Pyx_XGIVEREF(__pyx_t_1);
  2817. __Pyx_XGIVEREF(__pyx_t_2);
  2818. __Pyx_XGIVEREF(__pyx_t_3);
  2819. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  2820. __pyx_L10_try_end:;
  2821. }
  2822. /* "lib/Naked/toolshed/c/system.pyx":94
  2823. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg
  2824. * #------------------------------------------------------------------------------
  2825. * def currentdir_firstparam(func): # <<<<<<<<<<<<<<
  2826. * try:
  2827. * from functools import wraps
  2828. */
  2829. /* function exit code */
  2830. __pyx_L1_error:;
  2831. __Pyx_XDECREF(__pyx_t_4);
  2832. __Pyx_XDECREF(__pyx_t_5);
  2833. __Pyx_XDECREF(__pyx_t_6);
  2834. __Pyx_XDECREF(__pyx_t_8);
  2835. __Pyx_XDECREF(__pyx_t_10);
  2836. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2837. __pyx_r = NULL;
  2838. __pyx_L0:;
  2839. __Pyx_XDECREF(__pyx_v_wraps);
  2840. __Pyx_XDECREF(__pyx_v_wrapper);
  2841. __Pyx_XDECREF(__pyx_v_e);
  2842. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  2843. __Pyx_XGIVEREF(__pyx_r);
  2844. __Pyx_RefNannyFinishContext();
  2845. return __pyx_r;
  2846. }
  2847. /* "lib/Naked/toolshed/c/system.pyx":116
  2848. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg
  2849. * #------------------------------------------------------------------------------
  2850. * def currentdir_lastparam(func): # <<<<<<<<<<<<<<
  2851. * try:
  2852. * from functools import wraps
  2853. */
  2854. /* Python wrapper */
  2855. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/
  2856. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam = {__Pyx_NAMESTR("currentdir_lastparam"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam, METH_O, __Pyx_DOCSTR(0)};
  2857. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam(PyObject *__pyx_self, PyObject *__pyx_v_func) {
  2858. PyObject *__pyx_r = 0;
  2859. __Pyx_RefNannyDeclarations
  2860. __Pyx_RefNannySetupContext("currentdir_lastparam (wrapper)", 0);
  2861. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_12currentdir_lastparam(__pyx_self, ((PyObject *)__pyx_v_func));
  2862. /* function exit code */
  2863. __Pyx_RefNannyFinishContext();
  2864. return __pyx_r;
  2865. }
  2866. /* "lib/Naked/toolshed/c/system.pyx":121
  2867. *
  2868. * @wraps(func)
  2869. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  2870. * the_cwd = os.getcwd()
  2871. * return func(*args, current_dir=the_cwd)
  2872. */
  2873. /* Python wrapper */
  2874. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2875. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2876. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2877. PyObject *__pyx_v_args = 0;
  2878. CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  2879. PyObject *__pyx_r = 0;
  2880. __Pyx_RefNannyDeclarations
  2881. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  2882. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  2883. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  2884. if (unlikely(!__pyx_v_kwargs)) return NULL;
  2885. __Pyx_GOTREF(__pyx_v_kwargs);
  2886. __Pyx_INCREF(__pyx_args);
  2887. __pyx_v_args = __pyx_args;
  2888. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  2889. /* function exit code */
  2890. __Pyx_XDECREF(__pyx_v_args);
  2891. __Pyx_XDECREF(__pyx_v_kwargs);
  2892. __Pyx_RefNannyFinishContext();
  2893. return __pyx_r;
  2894. }
  2895. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  2896. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_cur_scope;
  2897. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_outer_scope;
  2898. PyObject *__pyx_v_the_cwd = NULL;
  2899. PyObject *__pyx_r = NULL;
  2900. __Pyx_RefNannyDeclarations
  2901. PyObject *__pyx_t_1 = NULL;
  2902. PyObject *__pyx_t_2 = NULL;
  2903. PyObject *__pyx_t_3 = NULL;
  2904. int __pyx_lineno = 0;
  2905. const char *__pyx_filename = NULL;
  2906. int __pyx_clineno = 0;
  2907. __Pyx_RefNannySetupContext("wrapper", 0);
  2908. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *) __Pyx_CyFunction_GetClosure(__pyx_self);
  2909. __pyx_cur_scope = __pyx_outer_scope;
  2910. /* "lib/Naked/toolshed/c/system.pyx":122
  2911. * @wraps(func)
  2912. * def wrapper(*args, **kwargs):
  2913. * the_cwd = os.getcwd() # <<<<<<<<<<<<<<
  2914. * return func(*args, current_dir=the_cwd)
  2915. * return wrapper
  2916. */
  2917. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2918. __Pyx_GOTREF(__pyx_t_1);
  2919. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2920. __Pyx_GOTREF(__pyx_t_2);
  2921. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2922. __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 = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2923. __Pyx_GOTREF(__pyx_t_1);
  2924. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2925. __pyx_v_the_cwd = __pyx_t_1;
  2926. __pyx_t_1 = 0;
  2927. /* "lib/Naked/toolshed/c/system.pyx":123
  2928. * def wrapper(*args, **kwargs):
  2929. * the_cwd = os.getcwd()
  2930. * return func(*args, current_dir=the_cwd) # <<<<<<<<<<<<<<
  2931. * return wrapper
  2932. * except Exception as e:
  2933. */
  2934. __Pyx_XDECREF(__pyx_r);
  2935. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2936. __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2937. __Pyx_GOTREF(__pyx_t_1);
  2938. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2939. __Pyx_GOTREF(__pyx_t_2);
  2940. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_current_dir, __pyx_v_the_cwd) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2941. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2942. __Pyx_GOTREF(__pyx_t_3);
  2943. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2944. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2945. __pyx_r = __pyx_t_3;
  2946. __pyx_t_3 = 0;
  2947. goto __pyx_L0;
  2948. /* "lib/Naked/toolshed/c/system.pyx":121
  2949. *
  2950. * @wraps(func)
  2951. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  2952. * the_cwd = os.getcwd()
  2953. * return func(*args, current_dir=the_cwd)
  2954. */
  2955. /* function exit code */
  2956. __pyx_L1_error:;
  2957. __Pyx_XDECREF(__pyx_t_1);
  2958. __Pyx_XDECREF(__pyx_t_2);
  2959. __Pyx_XDECREF(__pyx_t_3);
  2960. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_lastparam.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2961. __pyx_r = NULL;
  2962. __pyx_L0:;
  2963. __Pyx_XDECREF(__pyx_v_the_cwd);
  2964. __Pyx_XGIVEREF(__pyx_r);
  2965. __Pyx_RefNannyFinishContext();
  2966. return __pyx_r;
  2967. }
  2968. /* "lib/Naked/toolshed/c/system.pyx":116
  2969. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg
  2970. * #------------------------------------------------------------------------------
  2971. * def currentdir_lastparam(func): # <<<<<<<<<<<<<<
  2972. * try:
  2973. * from functools import wraps
  2974. */
  2975. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_12currentdir_lastparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) {
  2976. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_cur_scope;
  2977. PyObject *__pyx_v_wraps = NULL;
  2978. PyObject *__pyx_v_wrapper = 0;
  2979. PyObject *__pyx_v_e = NULL;
  2980. PyObject *__pyx_r = NULL;
  2981. __Pyx_RefNannyDeclarations
  2982. PyObject *__pyx_t_1 = NULL;
  2983. PyObject *__pyx_t_2 = NULL;
  2984. PyObject *__pyx_t_3 = NULL;
  2985. PyObject *__pyx_t_4 = NULL;
  2986. PyObject *__pyx_t_5 = NULL;
  2987. PyObject *__pyx_t_6 = NULL;
  2988. int __pyx_t_7;
  2989. PyObject *__pyx_t_8 = NULL;
  2990. int __pyx_t_9;
  2991. PyObject *__pyx_t_10 = NULL;
  2992. int __pyx_lineno = 0;
  2993. const char *__pyx_filename = NULL;
  2994. int __pyx_clineno = 0;
  2995. __Pyx_RefNannySetupContext("currentdir_lastparam", 0);
  2996. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, __pyx_empty_tuple, NULL);
  2997. if (unlikely(!__pyx_cur_scope)) {
  2998. __Pyx_RefNannyFinishContext();
  2999. return NULL;
  3000. }
  3001. __Pyx_GOTREF(__pyx_cur_scope);
  3002. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  3003. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  3004. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  3005. /* "lib/Naked/toolshed/c/system.pyx":117
  3006. * #------------------------------------------------------------------------------
  3007. * def currentdir_lastparam(func):
  3008. * try: # <<<<<<<<<<<<<<
  3009. * from functools import wraps
  3010. *
  3011. */
  3012. {
  3013. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  3014. __Pyx_XGOTREF(__pyx_t_1);
  3015. __Pyx_XGOTREF(__pyx_t_2);
  3016. __Pyx_XGOTREF(__pyx_t_3);
  3017. /*try:*/ {
  3018. /* "lib/Naked/toolshed/c/system.pyx":118
  3019. * def currentdir_lastparam(func):
  3020. * try:
  3021. * from functools import wraps # <<<<<<<<<<<<<<
  3022. *
  3023. * @wraps(func)
  3024. */
  3025. __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3026. __Pyx_GOTREF(__pyx_t_4);
  3027. __Pyx_INCREF(__pyx_n_s_wraps);
  3028. PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_wraps);
  3029. __Pyx_GIVEREF(__pyx_n_s_wraps);
  3030. __pyx_t_5 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3031. __Pyx_GOTREF(__pyx_t_5);
  3032. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3033. __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3034. __Pyx_GOTREF(__pyx_t_4);
  3035. __Pyx_INCREF(__pyx_t_4);
  3036. __pyx_v_wraps = __pyx_t_4;
  3037. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3038. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3039. /* "lib/Naked/toolshed/c/system.pyx":120
  3040. * from functools import wraps
  3041. *
  3042. * @wraps(func) # <<<<<<<<<<<<<<
  3043. * def wrapper(*args, **kwargs):
  3044. * the_cwd = os.getcwd()
  3045. */
  3046. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3047. __Pyx_GOTREF(__pyx_t_5);
  3048. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  3049. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_func);
  3050. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  3051. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_wraps, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3052. __Pyx_GOTREF(__pyx_t_4);
  3053. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3054. /* "lib/Naked/toolshed/c/system.pyx":121
  3055. *
  3056. * @wraps(func)
  3057. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  3058. * the_cwd = os.getcwd()
  3059. * return func(*args, current_dir=the_cwd)
  3060. */
  3061. __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper, 0, __pyx_n_s_currentdir_lastparam_locals_wrap, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_system, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3062. __Pyx_GOTREF(__pyx_t_5);
  3063. /* "lib/Naked/toolshed/c/system.pyx":120
  3064. * from functools import wraps
  3065. *
  3066. * @wraps(func) # <<<<<<<<<<<<<<
  3067. * def wrapper(*args, **kwargs):
  3068. * the_cwd = os.getcwd()
  3069. */
  3070. __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3071. __Pyx_GOTREF(__pyx_t_6);
  3072. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  3073. __Pyx_GIVEREF(__pyx_t_5);
  3074. __pyx_t_5 = 0;
  3075. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3076. __Pyx_GOTREF(__pyx_t_5);
  3077. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3078. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3079. __pyx_v_wrapper = __pyx_t_5;
  3080. __pyx_t_5 = 0;
  3081. /* "lib/Naked/toolshed/c/system.pyx":124
  3082. * the_cwd = os.getcwd()
  3083. * return func(*args, current_dir=the_cwd)
  3084. * return wrapper # <<<<<<<<<<<<<<
  3085. * except Exception as e:
  3086. * if DEBUG_FLAG:
  3087. */
  3088. __Pyx_XDECREF(__pyx_r);
  3089. __Pyx_INCREF(__pyx_v_wrapper);
  3090. __pyx_r = __pyx_v_wrapper;
  3091. goto __pyx_L7_try_return;
  3092. }
  3093. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  3094. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3095. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3096. goto __pyx_L10_try_end;
  3097. __pyx_L3_error:;
  3098. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3099. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  3100. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  3101. /* "lib/Naked/toolshed/c/system.pyx":125
  3102. * return func(*args, current_dir=the_cwd)
  3103. * return wrapper
  3104. * except Exception as e: # <<<<<<<<<<<<<<
  3105. * if DEBUG_FLAG:
  3106. * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).")
  3107. */
  3108. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  3109. if (__pyx_t_7) {
  3110. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_lastparam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3111. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3112. __Pyx_GOTREF(__pyx_t_5);
  3113. __Pyx_GOTREF(__pyx_t_6);
  3114. __Pyx_GOTREF(__pyx_t_4);
  3115. __Pyx_INCREF(__pyx_t_6);
  3116. __pyx_v_e = __pyx_t_6;
  3117. /* "lib/Naked/toolshed/c/system.pyx":126
  3118. * return wrapper
  3119. * except Exception as e:
  3120. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  3121. * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).")
  3122. * raise e
  3123. */
  3124. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3125. __Pyx_GOTREF(__pyx_t_8);
  3126. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3127. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  3128. if (__pyx_t_9) {
  3129. /* "lib/Naked/toolshed/c/system.pyx":127
  3130. * except Exception as e:
  3131. * if DEBUG_FLAG:
  3132. * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  3133. * raise e
  3134. *
  3135. */
  3136. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3137. __Pyx_GOTREF(__pyx_t_8);
  3138. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3139. __Pyx_GOTREF(__pyx_t_10);
  3140. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  3141. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3142. __Pyx_GOTREF(__pyx_t_8);
  3143. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3144. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3145. __Pyx_GOTREF(__pyx_t_10);
  3146. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  3147. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3148. goto __pyx_L13;
  3149. }
  3150. __pyx_L13:;
  3151. /* "lib/Naked/toolshed/c/system.pyx":128
  3152. * if DEBUG_FLAG:
  3153. * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).")
  3154. * raise e # <<<<<<<<<<<<<<
  3155. *
  3156. * #------------------------------------------------------------------------------
  3157. */
  3158. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  3159. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3160. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3161. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3162. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3163. goto __pyx_L4_exception_handled;
  3164. }
  3165. goto __pyx_L5_except_error;
  3166. __pyx_L5_except_error:;
  3167. __Pyx_XGIVEREF(__pyx_t_1);
  3168. __Pyx_XGIVEREF(__pyx_t_2);
  3169. __Pyx_XGIVEREF(__pyx_t_3);
  3170. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3171. goto __pyx_L1_error;
  3172. __pyx_L7_try_return:;
  3173. __Pyx_XGIVEREF(__pyx_t_1);
  3174. __Pyx_XGIVEREF(__pyx_t_2);
  3175. __Pyx_XGIVEREF(__pyx_t_3);
  3176. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3177. goto __pyx_L0;
  3178. __pyx_L4_exception_handled:;
  3179. __Pyx_XGIVEREF(__pyx_t_1);
  3180. __Pyx_XGIVEREF(__pyx_t_2);
  3181. __Pyx_XGIVEREF(__pyx_t_3);
  3182. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3183. __pyx_L10_try_end:;
  3184. }
  3185. /* "lib/Naked/toolshed/c/system.pyx":116
  3186. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg
  3187. * #------------------------------------------------------------------------------
  3188. * def currentdir_lastparam(func): # <<<<<<<<<<<<<<
  3189. * try:
  3190. * from functools import wraps
  3191. */
  3192. /* function exit code */
  3193. __pyx_L1_error:;
  3194. __Pyx_XDECREF(__pyx_t_4);
  3195. __Pyx_XDECREF(__pyx_t_5);
  3196. __Pyx_XDECREF(__pyx_t_6);
  3197. __Pyx_XDECREF(__pyx_t_8);
  3198. __Pyx_XDECREF(__pyx_t_10);
  3199. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_lastparam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3200. __pyx_r = NULL;
  3201. __pyx_L0:;
  3202. __Pyx_XDECREF(__pyx_v_wraps);
  3203. __Pyx_XDECREF(__pyx_v_wrapper);
  3204. __Pyx_XDECREF(__pyx_v_e);
  3205. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  3206. __Pyx_XGIVEREF(__pyx_r);
  3207. __Pyx_RefNannyFinishContext();
  3208. return __pyx_r;
  3209. }
  3210. /* "lib/Naked/toolshed/c/system.pyx":139
  3211. * #------------------------------------------------------------------------------
  3212. * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function
  3213. * def fullpath(file_name): # <<<<<<<<<<<<<<
  3214. * try:
  3215. * return file_name
  3216. */
  3217. /* Python wrapper */
  3218. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_15fullpath(PyObject *__pyx_self, PyObject *__pyx_v_file_name); /*proto*/
  3219. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_15fullpath = {__Pyx_NAMESTR("fullpath"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_15fullpath, METH_O, __Pyx_DOCSTR(0)};
  3220. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_15fullpath(PyObject *__pyx_self, PyObject *__pyx_v_file_name) {
  3221. PyObject *__pyx_r = 0;
  3222. __Pyx_RefNannyDeclarations
  3223. __Pyx_RefNannySetupContext("fullpath (wrapper)", 0);
  3224. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_14fullpath(__pyx_self, ((PyObject *)__pyx_v_file_name));
  3225. /* function exit code */
  3226. __Pyx_RefNannyFinishContext();
  3227. return __pyx_r;
  3228. }
  3229. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_14fullpath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_name) {
  3230. PyObject *__pyx_v_e = NULL;
  3231. PyObject *__pyx_r = NULL;
  3232. __Pyx_RefNannyDeclarations
  3233. PyObject *__pyx_t_1 = NULL;
  3234. PyObject *__pyx_t_2 = NULL;
  3235. PyObject *__pyx_t_3 = NULL;
  3236. __Pyx_RefNannySetupContext("fullpath", 0);
  3237. /* "lib/Naked/toolshed/c/system.pyx":140
  3238. * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function
  3239. * def fullpath(file_name):
  3240. * try: # <<<<<<<<<<<<<<
  3241. * return file_name
  3242. * except Exception as e:
  3243. */
  3244. {
  3245. if (__pyx_t_1||__pyx_t_2||__pyx_t_3); else {/*mark used*/};
  3246. /*try:*/ {
  3247. /* "lib/Naked/toolshed/c/system.pyx":141
  3248. * def fullpath(file_name):
  3249. * try:
  3250. * return file_name # <<<<<<<<<<<<<<
  3251. * except Exception as e:
  3252. * if DEBUG_FLAG:
  3253. */
  3254. __Pyx_XDECREF(__pyx_r);
  3255. __Pyx_INCREF(__pyx_v_file_name);
  3256. __pyx_r = __pyx_v_file_name;
  3257. goto __pyx_L7_try_return;
  3258. }
  3259. goto __pyx_L10_try_end;
  3260. __pyx_L7_try_return:;
  3261. goto __pyx_L0;
  3262. __pyx_L10_try_end:;
  3263. }
  3264. /* "lib/Naked/toolshed/c/system.pyx":139
  3265. * #------------------------------------------------------------------------------
  3266. * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function
  3267. * def fullpath(file_name): # <<<<<<<<<<<<<<
  3268. * try:
  3269. * return file_name
  3270. */
  3271. /* function exit code */
  3272. __pyx_L0:;
  3273. __Pyx_XDECREF(__pyx_v_e);
  3274. __Pyx_XGIVEREF(__pyx_r);
  3275. __Pyx_RefNannyFinishContext();
  3276. return __pyx_r;
  3277. }
  3278. /* "lib/Naked/toolshed/c/system.pyx":156
  3279. * #------------------------------------------------------------------------------
  3280. * @currentdir_firstparam
  3281. * def cwd(dir=""): # <<<<<<<<<<<<<<
  3282. * try:
  3283. * return dir
  3284. */
  3285. /* Python wrapper */
  3286. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_17cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3287. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_17cwd = {__Pyx_NAMESTR("cwd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_17cwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  3288. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_17cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3289. PyObject *__pyx_v_dir = 0;
  3290. int __pyx_lineno = 0;
  3291. const char *__pyx_filename = NULL;
  3292. int __pyx_clineno = 0;
  3293. PyObject *__pyx_r = 0;
  3294. __Pyx_RefNannyDeclarations
  3295. __Pyx_RefNannySetupContext("cwd (wrapper)", 0);
  3296. {
  3297. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir,0};
  3298. PyObject* values[1] = {0};
  3299. values[0] = ((PyObject *)__pyx_kp_s__8);
  3300. if (unlikely(__pyx_kwds)) {
  3301. Py_ssize_t kw_args;
  3302. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3303. switch (pos_args) {
  3304. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3305. case 0: break;
  3306. default: goto __pyx_L5_argtuple_error;
  3307. }
  3308. kw_args = PyDict_Size(__pyx_kwds);
  3309. switch (pos_args) {
  3310. case 0:
  3311. if (kw_args > 0) {
  3312. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir);
  3313. if (value) { values[0] = value; kw_args--; }
  3314. }
  3315. }
  3316. if (unlikely(kw_args > 0)) {
  3317. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3318. }
  3319. } else {
  3320. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3321. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3322. case 0: break;
  3323. default: goto __pyx_L5_argtuple_error;
  3324. }
  3325. }
  3326. __pyx_v_dir = values[0];
  3327. }
  3328. goto __pyx_L4_argument_unpacking_done;
  3329. __pyx_L5_argtuple_error:;
  3330. __Pyx_RaiseArgtupleInvalid("cwd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3331. __pyx_L3_error:;
  3332. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.cwd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3333. __Pyx_RefNannyFinishContext();
  3334. return NULL;
  3335. __pyx_L4_argument_unpacking_done:;
  3336. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_16cwd(__pyx_self, __pyx_v_dir);
  3337. /* function exit code */
  3338. __Pyx_RefNannyFinishContext();
  3339. return __pyx_r;
  3340. }
  3341. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_16cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir) {
  3342. PyObject *__pyx_v_e = NULL;
  3343. PyObject *__pyx_r = NULL;
  3344. __Pyx_RefNannyDeclarations
  3345. PyObject *__pyx_t_1 = NULL;
  3346. PyObject *__pyx_t_2 = NULL;
  3347. PyObject *__pyx_t_3 = NULL;
  3348. __Pyx_RefNannySetupContext("cwd", 0);
  3349. /* "lib/Naked/toolshed/c/system.pyx":157
  3350. * @currentdir_firstparam
  3351. * def cwd(dir=""):
  3352. * try: # <<<<<<<<<<<<<<
  3353. * return dir
  3354. * except Exception as e:
  3355. */
  3356. {
  3357. if (__pyx_t_1||__pyx_t_2||__pyx_t_3); else {/*mark used*/};
  3358. /*try:*/ {
  3359. /* "lib/Naked/toolshed/c/system.pyx":158
  3360. * def cwd(dir=""):
  3361. * try:
  3362. * return dir # <<<<<<<<<<<<<<
  3363. * except Exception as e:
  3364. * if DEBUG_FLAG:
  3365. */
  3366. __Pyx_XDECREF(__pyx_r);
  3367. __Pyx_INCREF(__pyx_v_dir);
  3368. __pyx_r = __pyx_v_dir;
  3369. goto __pyx_L7_try_return;
  3370. }
  3371. goto __pyx_L10_try_end;
  3372. __pyx_L7_try_return:;
  3373. goto __pyx_L0;
  3374. __pyx_L10_try_end:;
  3375. }
  3376. /* "lib/Naked/toolshed/c/system.pyx":156
  3377. * #------------------------------------------------------------------------------
  3378. * @currentdir_firstparam
  3379. * def cwd(dir=""): # <<<<<<<<<<<<<<
  3380. * try:
  3381. * return dir
  3382. */
  3383. /* function exit code */
  3384. __pyx_L0:;
  3385. __Pyx_XDECREF(__pyx_v_e);
  3386. __Pyx_XGIVEREF(__pyx_r);
  3387. __Pyx_RefNannyFinishContext();
  3388. return __pyx_r;
  3389. }
  3390. /* "lib/Naked/toolshed/c/system.pyx":176
  3391. * # DOES NOT already exist
  3392. * #------------------------------------------------------------------------------
  3393. * def make_dirs(dirpath): # <<<<<<<<<<<<<<
  3394. * try:
  3395. * import os
  3396. */
  3397. /* Python wrapper */
  3398. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_19make_dirs(PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /*proto*/
  3399. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_19make_dirs = {__Pyx_NAMESTR("make_dirs"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_19make_dirs, METH_O, __Pyx_DOCSTR(0)};
  3400. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_19make_dirs(PyObject *__pyx_self, PyObject *__pyx_v_dirpath) {
  3401. PyObject *__pyx_r = 0;
  3402. __Pyx_RefNannyDeclarations
  3403. __Pyx_RefNannySetupContext("make_dirs (wrapper)", 0);
  3404. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_18make_dirs(__pyx_self, ((PyObject *)__pyx_v_dirpath));
  3405. /* function exit code */
  3406. __Pyx_RefNannyFinishContext();
  3407. return __pyx_r;
  3408. }
  3409. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_18make_dirs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath) {
  3410. PyObject *__pyx_v_os = NULL;
  3411. PyObject *__pyx_v_errno = NULL;
  3412. PyObject *__pyx_v_ose = NULL;
  3413. PyObject *__pyx_v_e = NULL;
  3414. PyObject *__pyx_r = NULL;
  3415. __Pyx_RefNannyDeclarations
  3416. PyObject *__pyx_t_1 = NULL;
  3417. PyObject *__pyx_t_2 = NULL;
  3418. PyObject *__pyx_t_3 = NULL;
  3419. PyObject *__pyx_t_4 = NULL;
  3420. PyObject *__pyx_t_5 = NULL;
  3421. PyObject *__pyx_t_6 = NULL;
  3422. int __pyx_t_7;
  3423. PyObject *__pyx_t_8 = NULL;
  3424. PyObject *__pyx_t_9 = NULL;
  3425. PyObject *__pyx_t_10 = NULL;
  3426. int __pyx_t_11;
  3427. int __pyx_lineno = 0;
  3428. const char *__pyx_filename = NULL;
  3429. int __pyx_clineno = 0;
  3430. __Pyx_RefNannySetupContext("make_dirs", 0);
  3431. /* "lib/Naked/toolshed/c/system.pyx":177
  3432. * #------------------------------------------------------------------------------
  3433. * def make_dirs(dirpath):
  3434. * try: # <<<<<<<<<<<<<<
  3435. * import os
  3436. * import errno
  3437. */
  3438. {
  3439. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  3440. __Pyx_XGOTREF(__pyx_t_1);
  3441. __Pyx_XGOTREF(__pyx_t_2);
  3442. __Pyx_XGOTREF(__pyx_t_3);
  3443. /*try:*/ {
  3444. /* "lib/Naked/toolshed/c/system.pyx":178
  3445. * def make_dirs(dirpath):
  3446. * try:
  3447. * import os # <<<<<<<<<<<<<<
  3448. * import errno
  3449. * os.makedirs(dirpath)
  3450. */
  3451. __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3452. __Pyx_GOTREF(__pyx_t_4);
  3453. __pyx_v_os = __pyx_t_4;
  3454. __pyx_t_4 = 0;
  3455. /* "lib/Naked/toolshed/c/system.pyx":179
  3456. * try:
  3457. * import os
  3458. * import errno # <<<<<<<<<<<<<<
  3459. * os.makedirs(dirpath)
  3460. * return True
  3461. */
  3462. __pyx_t_4 = __Pyx_Import(__pyx_n_s_errno, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3463. __Pyx_GOTREF(__pyx_t_4);
  3464. __pyx_v_errno = __pyx_t_4;
  3465. __pyx_t_4 = 0;
  3466. /* "lib/Naked/toolshed/c/system.pyx":180
  3467. * import os
  3468. * import errno
  3469. * os.makedirs(dirpath) # <<<<<<<<<<<<<<
  3470. * return True
  3471. * except OSError as ose:
  3472. */
  3473. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_makedirs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3474. __Pyx_GOTREF(__pyx_t_4);
  3475. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3476. __Pyx_GOTREF(__pyx_t_5);
  3477. __Pyx_INCREF(__pyx_v_dirpath);
  3478. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath);
  3479. __Pyx_GIVEREF(__pyx_v_dirpath);
  3480. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3481. __Pyx_GOTREF(__pyx_t_6);
  3482. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3483. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3484. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3485. /* "lib/Naked/toolshed/c/system.pyx":181
  3486. * import errno
  3487. * os.makedirs(dirpath)
  3488. * return True # <<<<<<<<<<<<<<
  3489. * except OSError as ose:
  3490. * if ose.errno != errno.EEXIST: # directory already exists
  3491. */
  3492. __Pyx_XDECREF(__pyx_r);
  3493. __Pyx_INCREF(Py_True);
  3494. __pyx_r = Py_True;
  3495. goto __pyx_L7_try_return;
  3496. }
  3497. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  3498. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3499. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3500. goto __pyx_L10_try_end;
  3501. __pyx_L3_error:;
  3502. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3503. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  3504. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  3505. /* "lib/Naked/toolshed/c/system.pyx":182
  3506. * os.makedirs(dirpath)
  3507. * return True
  3508. * except OSError as ose: # <<<<<<<<<<<<<<
  3509. * if ose.errno != errno.EEXIST: # directory already exists
  3510. * if DEBUG_FLAG:
  3511. */
  3512. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OSError);
  3513. if (__pyx_t_7) {
  3514. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3515. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3516. __Pyx_GOTREF(__pyx_t_6);
  3517. __Pyx_GOTREF(__pyx_t_5);
  3518. __Pyx_GOTREF(__pyx_t_4);
  3519. __Pyx_INCREF(__pyx_t_5);
  3520. __pyx_v_ose = __pyx_t_5;
  3521. /* "lib/Naked/toolshed/c/system.pyx":183
  3522. * return True
  3523. * except OSError as ose:
  3524. * if ose.errno != errno.EEXIST: # directory already exists # <<<<<<<<<<<<<<
  3525. * if DEBUG_FLAG:
  3526. * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).")
  3527. */
  3528. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_ose, __pyx_n_s_errno); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3529. __Pyx_GOTREF(__pyx_t_8);
  3530. if (unlikely(!__pyx_v_errno)) { __Pyx_RaiseUnboundLocalError("errno"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} }
  3531. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_errno, __pyx_n_s_EEXIST); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3532. __Pyx_GOTREF(__pyx_t_9);
  3533. __pyx_t_10 = PyObject_RichCompare(__pyx_t_8, __pyx_t_9, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3534. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  3535. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  3536. __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3537. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3538. if (__pyx_t_11) {
  3539. /* "lib/Naked/toolshed/c/system.pyx":184
  3540. * except OSError as ose:
  3541. * if ose.errno != errno.EEXIST: # directory already exists
  3542. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  3543. * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).")
  3544. * raise ose
  3545. */
  3546. __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;}
  3547. __Pyx_GOTREF(__pyx_t_10);
  3548. __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3549. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3550. if (__pyx_t_11) {
  3551. /* "lib/Naked/toolshed/c/system.pyx":185
  3552. * if ose.errno != errno.EEXIST: # directory already exists
  3553. * if DEBUG_FLAG:
  3554. * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  3555. * raise ose
  3556. * else:
  3557. */
  3558. __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;}
  3559. __Pyx_GOTREF(__pyx_t_10);
  3560. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3561. __Pyx_GOTREF(__pyx_t_9);
  3562. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3563. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __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;}
  3564. __Pyx_GOTREF(__pyx_t_10);
  3565. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  3566. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3567. __Pyx_GOTREF(__pyx_t_9);
  3568. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  3569. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  3570. goto __pyx_L14;
  3571. }
  3572. __pyx_L14:;
  3573. /* "lib/Naked/toolshed/c/system.pyx":186
  3574. * if DEBUG_FLAG:
  3575. * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).")
  3576. * raise ose # <<<<<<<<<<<<<<
  3577. * else:
  3578. * return False
  3579. */
  3580. __Pyx_Raise(__pyx_v_ose, 0, 0, 0);
  3581. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3582. }
  3583. /*else*/ {
  3584. /* "lib/Naked/toolshed/c/system.pyx":188
  3585. * raise ose
  3586. * else:
  3587. * return False # <<<<<<<<<<<<<<
  3588. * except Exception as e:
  3589. * raise e
  3590. */
  3591. __Pyx_XDECREF(__pyx_r);
  3592. __Pyx_INCREF(Py_False);
  3593. __pyx_r = Py_False;
  3594. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3595. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3596. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3597. goto __pyx_L6_except_return;
  3598. }
  3599. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3600. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3601. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3602. goto __pyx_L4_exception_handled;
  3603. }
  3604. /* "lib/Naked/toolshed/c/system.pyx":189
  3605. * else:
  3606. * return False
  3607. * except Exception as e: # <<<<<<<<<<<<<<
  3608. * raise e
  3609. *
  3610. */
  3611. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  3612. if (__pyx_t_7) {
  3613. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3614. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3615. __Pyx_GOTREF(__pyx_t_4);
  3616. __Pyx_GOTREF(__pyx_t_5);
  3617. __Pyx_GOTREF(__pyx_t_6);
  3618. __Pyx_INCREF(__pyx_t_5);
  3619. __pyx_v_e = __pyx_t_5;
  3620. /* "lib/Naked/toolshed/c/system.pyx":190
  3621. * return False
  3622. * except Exception as e:
  3623. * raise e # <<<<<<<<<<<<<<
  3624. *
  3625. * #------------------------------------------------------------------------------
  3626. */
  3627. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  3628. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3629. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3630. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3631. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3632. goto __pyx_L4_exception_handled;
  3633. }
  3634. goto __pyx_L5_except_error;
  3635. __pyx_L5_except_error:;
  3636. __Pyx_XGIVEREF(__pyx_t_1);
  3637. __Pyx_XGIVEREF(__pyx_t_2);
  3638. __Pyx_XGIVEREF(__pyx_t_3);
  3639. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3640. goto __pyx_L1_error;
  3641. __pyx_L7_try_return:;
  3642. __Pyx_XGIVEREF(__pyx_t_1);
  3643. __Pyx_XGIVEREF(__pyx_t_2);
  3644. __Pyx_XGIVEREF(__pyx_t_3);
  3645. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3646. goto __pyx_L0;
  3647. __pyx_L6_except_return:;
  3648. __Pyx_XGIVEREF(__pyx_t_1);
  3649. __Pyx_XGIVEREF(__pyx_t_2);
  3650. __Pyx_XGIVEREF(__pyx_t_3);
  3651. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3652. goto __pyx_L0;
  3653. __pyx_L4_exception_handled:;
  3654. __Pyx_XGIVEREF(__pyx_t_1);
  3655. __Pyx_XGIVEREF(__pyx_t_2);
  3656. __Pyx_XGIVEREF(__pyx_t_3);
  3657. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3658. __pyx_L10_try_end:;
  3659. }
  3660. /* "lib/Naked/toolshed/c/system.pyx":176
  3661. * # DOES NOT already exist
  3662. * #------------------------------------------------------------------------------
  3663. * def make_dirs(dirpath): # <<<<<<<<<<<<<<
  3664. * try:
  3665. * import os
  3666. */
  3667. /* function exit code */
  3668. __pyx_L1_error:;
  3669. __Pyx_XDECREF(__pyx_t_4);
  3670. __Pyx_XDECREF(__pyx_t_5);
  3671. __Pyx_XDECREF(__pyx_t_6);
  3672. __Pyx_XDECREF(__pyx_t_8);
  3673. __Pyx_XDECREF(__pyx_t_9);
  3674. __Pyx_XDECREF(__pyx_t_10);
  3675. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3676. __pyx_r = NULL;
  3677. __pyx_L0:;
  3678. __Pyx_XDECREF(__pyx_v_os);
  3679. __Pyx_XDECREF(__pyx_v_errno);
  3680. __Pyx_XDECREF(__pyx_v_ose);
  3681. __Pyx_XDECREF(__pyx_v_e);
  3682. __Pyx_XGIVEREF(__pyx_r);
  3683. __Pyx_RefNannyFinishContext();
  3684. return __pyx_r;
  3685. }
  3686. /* "lib/Naked/toolshed/c/system.pyx":203
  3687. * # Tests: test_SYSTEM.py :: test_file_exists
  3688. * #------------------------------------------------------------------------------
  3689. * def file_exists(filepath): # <<<<<<<<<<<<<<
  3690. * try:
  3691. * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file
  3692. */
  3693. /* Python wrapper */
  3694. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21file_exists(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/
  3695. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21file_exists = {__Pyx_NAMESTR("file_exists"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21file_exists, METH_O, __Pyx_DOCSTR(0)};
  3696. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21file_exists(PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  3697. PyObject *__pyx_r = 0;
  3698. __Pyx_RefNannyDeclarations
  3699. __Pyx_RefNannySetupContext("file_exists (wrapper)", 0);
  3700. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_20file_exists(__pyx_self, ((PyObject *)__pyx_v_filepath));
  3701. /* function exit code */
  3702. __Pyx_RefNannyFinishContext();
  3703. return __pyx_r;
  3704. }
  3705. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20file_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  3706. PyObject *__pyx_v_e = NULL;
  3707. PyObject *__pyx_r = NULL;
  3708. __Pyx_RefNannyDeclarations
  3709. PyObject *__pyx_t_1 = NULL;
  3710. PyObject *__pyx_t_2 = NULL;
  3711. PyObject *__pyx_t_3 = NULL;
  3712. PyObject *__pyx_t_4 = NULL;
  3713. PyObject *__pyx_t_5 = NULL;
  3714. PyObject *__pyx_t_6 = NULL;
  3715. int __pyx_t_7;
  3716. int __pyx_t_8;
  3717. int __pyx_t_9;
  3718. int __pyx_t_10;
  3719. PyObject *__pyx_t_11 = NULL;
  3720. PyObject *__pyx_t_12 = NULL;
  3721. int __pyx_lineno = 0;
  3722. const char *__pyx_filename = NULL;
  3723. int __pyx_clineno = 0;
  3724. __Pyx_RefNannySetupContext("file_exists", 0);
  3725. /* "lib/Naked/toolshed/c/system.pyx":204
  3726. * #------------------------------------------------------------------------------
  3727. * def file_exists(filepath):
  3728. * try: # <<<<<<<<<<<<<<
  3729. * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file
  3730. * return True
  3731. */
  3732. {
  3733. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  3734. __Pyx_XGOTREF(__pyx_t_1);
  3735. __Pyx_XGOTREF(__pyx_t_2);
  3736. __Pyx_XGOTREF(__pyx_t_3);
  3737. /*try:*/ {
  3738. /* "lib/Naked/toolshed/c/system.pyx":205
  3739. * def file_exists(filepath):
  3740. * try:
  3741. * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file # <<<<<<<<<<<<<<
  3742. * return True
  3743. * else:
  3744. */
  3745. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3746. __Pyx_GOTREF(__pyx_t_4);
  3747. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3748. __Pyx_GOTREF(__pyx_t_5);
  3749. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3750. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3751. __Pyx_GOTREF(__pyx_t_4);
  3752. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3753. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3754. __Pyx_GOTREF(__pyx_t_5);
  3755. __Pyx_INCREF(__pyx_v_filepath);
  3756. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath);
  3757. __Pyx_GIVEREF(__pyx_v_filepath);
  3758. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3759. __Pyx_GOTREF(__pyx_t_6);
  3760. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3761. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3762. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3763. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3764. if (__pyx_t_7) {
  3765. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3766. __Pyx_GOTREF(__pyx_t_6);
  3767. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3768. __Pyx_GOTREF(__pyx_t_5);
  3769. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3770. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isfile); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3771. __Pyx_GOTREF(__pyx_t_6);
  3772. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3773. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3774. __Pyx_GOTREF(__pyx_t_5);
  3775. __Pyx_INCREF(__pyx_v_filepath);
  3776. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath);
  3777. __Pyx_GIVEREF(__pyx_v_filepath);
  3778. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3779. __Pyx_GOTREF(__pyx_t_4);
  3780. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3781. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3782. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3783. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3784. __pyx_t_9 = __pyx_t_8;
  3785. } else {
  3786. __pyx_t_9 = __pyx_t_7;
  3787. }
  3788. if (__pyx_t_9) {
  3789. /* "lib/Naked/toolshed/c/system.pyx":206
  3790. * try:
  3791. * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file
  3792. * return True # <<<<<<<<<<<<<<
  3793. * else:
  3794. * return False
  3795. */
  3796. __Pyx_XDECREF(__pyx_r);
  3797. __Pyx_INCREF(Py_True);
  3798. __pyx_r = Py_True;
  3799. goto __pyx_L7_try_return;
  3800. }
  3801. /*else*/ {
  3802. /* "lib/Naked/toolshed/c/system.pyx":208
  3803. * return True
  3804. * else:
  3805. * return False # <<<<<<<<<<<<<<
  3806. * except Exception as e:
  3807. * if DEBUG_FLAG:
  3808. */
  3809. __Pyx_XDECREF(__pyx_r);
  3810. __Pyx_INCREF(Py_False);
  3811. __pyx_r = Py_False;
  3812. goto __pyx_L7_try_return;
  3813. }
  3814. }
  3815. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  3816. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3817. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3818. goto __pyx_L10_try_end;
  3819. __pyx_L3_error:;
  3820. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  3821. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  3822. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3823. /* "lib/Naked/toolshed/c/system.pyx":209
  3824. * else:
  3825. * return False
  3826. * except Exception as e: # <<<<<<<<<<<<<<
  3827. * if DEBUG_FLAG:
  3828. * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).")
  3829. */
  3830. __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  3831. if (__pyx_t_10) {
  3832. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3833. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3834. __Pyx_GOTREF(__pyx_t_4);
  3835. __Pyx_GOTREF(__pyx_t_5);
  3836. __Pyx_GOTREF(__pyx_t_6);
  3837. __Pyx_INCREF(__pyx_t_5);
  3838. __pyx_v_e = __pyx_t_5;
  3839. /* "lib/Naked/toolshed/c/system.pyx":210
  3840. * return False
  3841. * except Exception as e:
  3842. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  3843. * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).")
  3844. * raise e
  3845. */
  3846. __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3847. __Pyx_GOTREF(__pyx_t_11);
  3848. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3849. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  3850. if (__pyx_t_9) {
  3851. /* "lib/Naked/toolshed/c/system.pyx":211
  3852. * except Exception as e:
  3853. * if DEBUG_FLAG:
  3854. * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  3855. * raise e
  3856. *
  3857. */
  3858. __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3859. __Pyx_GOTREF(__pyx_t_11);
  3860. __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3861. __Pyx_GOTREF(__pyx_t_12);
  3862. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  3863. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3864. __Pyx_GOTREF(__pyx_t_11);
  3865. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  3866. __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3867. __Pyx_GOTREF(__pyx_t_12);
  3868. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  3869. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  3870. goto __pyx_L14;
  3871. }
  3872. __pyx_L14:;
  3873. /* "lib/Naked/toolshed/c/system.pyx":212
  3874. * if DEBUG_FLAG:
  3875. * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).")
  3876. * raise e # <<<<<<<<<<<<<<
  3877. *
  3878. * #------------------------------------------------------------------------------
  3879. */
  3880. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  3881. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  3882. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3883. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3884. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  3885. goto __pyx_L4_exception_handled;
  3886. }
  3887. goto __pyx_L5_except_error;
  3888. __pyx_L5_except_error:;
  3889. __Pyx_XGIVEREF(__pyx_t_1);
  3890. __Pyx_XGIVEREF(__pyx_t_2);
  3891. __Pyx_XGIVEREF(__pyx_t_3);
  3892. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3893. goto __pyx_L1_error;
  3894. __pyx_L7_try_return:;
  3895. __Pyx_XGIVEREF(__pyx_t_1);
  3896. __Pyx_XGIVEREF(__pyx_t_2);
  3897. __Pyx_XGIVEREF(__pyx_t_3);
  3898. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3899. goto __pyx_L0;
  3900. __pyx_L4_exception_handled:;
  3901. __Pyx_XGIVEREF(__pyx_t_1);
  3902. __Pyx_XGIVEREF(__pyx_t_2);
  3903. __Pyx_XGIVEREF(__pyx_t_3);
  3904. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  3905. __pyx_L10_try_end:;
  3906. }
  3907. /* "lib/Naked/toolshed/c/system.pyx":203
  3908. * # Tests: test_SYSTEM.py :: test_file_exists
  3909. * #------------------------------------------------------------------------------
  3910. * def file_exists(filepath): # <<<<<<<<<<<<<<
  3911. * try:
  3912. * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file
  3913. */
  3914. /* function exit code */
  3915. __pyx_L1_error:;
  3916. __Pyx_XDECREF(__pyx_t_4);
  3917. __Pyx_XDECREF(__pyx_t_5);
  3918. __Pyx_XDECREF(__pyx_t_6);
  3919. __Pyx_XDECREF(__pyx_t_11);
  3920. __Pyx_XDECREF(__pyx_t_12);
  3921. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3922. __pyx_r = NULL;
  3923. __pyx_L0:;
  3924. __Pyx_XDECREF(__pyx_v_e);
  3925. __Pyx_XGIVEREF(__pyx_r);
  3926. __Pyx_RefNannyFinishContext();
  3927. return __pyx_r;
  3928. }
  3929. /* "lib/Naked/toolshed/c/system.pyx":220
  3930. * # test_sys_is_file_when_dir
  3931. * #------------------------------------------------------------------------------
  3932. * def is_file(filepath): # <<<<<<<<<<<<<<
  3933. * try:
  3934. * return os.path.isfile(filepath)
  3935. */
  3936. /* Python wrapper */
  3937. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_23is_file(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/
  3938. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_23is_file = {__Pyx_NAMESTR("is_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_23is_file, METH_O, __Pyx_DOCSTR(0)};
  3939. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_23is_file(PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  3940. PyObject *__pyx_r = 0;
  3941. __Pyx_RefNannyDeclarations
  3942. __Pyx_RefNannySetupContext("is_file (wrapper)", 0);
  3943. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_22is_file(__pyx_self, ((PyObject *)__pyx_v_filepath));
  3944. /* function exit code */
  3945. __Pyx_RefNannyFinishContext();
  3946. return __pyx_r;
  3947. }
  3948. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22is_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  3949. PyObject *__pyx_v_e = NULL;
  3950. PyObject *__pyx_r = NULL;
  3951. __Pyx_RefNannyDeclarations
  3952. PyObject *__pyx_t_1 = NULL;
  3953. PyObject *__pyx_t_2 = NULL;
  3954. PyObject *__pyx_t_3 = NULL;
  3955. PyObject *__pyx_t_4 = NULL;
  3956. PyObject *__pyx_t_5 = NULL;
  3957. PyObject *__pyx_t_6 = NULL;
  3958. int __pyx_t_7;
  3959. PyObject *__pyx_t_8 = NULL;
  3960. int __pyx_t_9;
  3961. PyObject *__pyx_t_10 = NULL;
  3962. int __pyx_lineno = 0;
  3963. const char *__pyx_filename = NULL;
  3964. int __pyx_clineno = 0;
  3965. __Pyx_RefNannySetupContext("is_file", 0);
  3966. /* "lib/Naked/toolshed/c/system.pyx":221
  3967. * #------------------------------------------------------------------------------
  3968. * def is_file(filepath):
  3969. * try: # <<<<<<<<<<<<<<
  3970. * return os.path.isfile(filepath)
  3971. * except Exception as e:
  3972. */
  3973. {
  3974. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  3975. __Pyx_XGOTREF(__pyx_t_1);
  3976. __Pyx_XGOTREF(__pyx_t_2);
  3977. __Pyx_XGOTREF(__pyx_t_3);
  3978. /*try:*/ {
  3979. /* "lib/Naked/toolshed/c/system.pyx":222
  3980. * def is_file(filepath):
  3981. * try:
  3982. * return os.path.isfile(filepath) # <<<<<<<<<<<<<<
  3983. * except Exception as e:
  3984. * if DEBUG_FLAG:
  3985. */
  3986. __Pyx_XDECREF(__pyx_r);
  3987. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3988. __Pyx_GOTREF(__pyx_t_4);
  3989. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3990. __Pyx_GOTREF(__pyx_t_5);
  3991. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3992. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isfile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3993. __Pyx_GOTREF(__pyx_t_4);
  3994. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3995. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3996. __Pyx_GOTREF(__pyx_t_5);
  3997. __Pyx_INCREF(__pyx_v_filepath);
  3998. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath);
  3999. __Pyx_GIVEREF(__pyx_v_filepath);
  4000. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4001. __Pyx_GOTREF(__pyx_t_6);
  4002. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4003. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4004. __pyx_r = __pyx_t_6;
  4005. __pyx_t_6 = 0;
  4006. goto __pyx_L7_try_return;
  4007. }
  4008. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  4009. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  4010. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4011. goto __pyx_L10_try_end;
  4012. __pyx_L3_error:;
  4013. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  4014. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4015. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  4016. /* "lib/Naked/toolshed/c/system.pyx":223
  4017. * try:
  4018. * return os.path.isfile(filepath)
  4019. * except Exception as e: # <<<<<<<<<<<<<<
  4020. * if DEBUG_FLAG:
  4021. * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).")
  4022. */
  4023. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  4024. if (__pyx_t_7) {
  4025. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4026. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4027. __Pyx_GOTREF(__pyx_t_6);
  4028. __Pyx_GOTREF(__pyx_t_5);
  4029. __Pyx_GOTREF(__pyx_t_4);
  4030. __Pyx_INCREF(__pyx_t_5);
  4031. __pyx_v_e = __pyx_t_5;
  4032. /* "lib/Naked/toolshed/c/system.pyx":224
  4033. * return os.path.isfile(filepath)
  4034. * except Exception as e:
  4035. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  4036. * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).")
  4037. * raise e
  4038. */
  4039. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4040. __Pyx_GOTREF(__pyx_t_8);
  4041. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4042. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4043. if (__pyx_t_9) {
  4044. /* "lib/Naked/toolshed/c/system.pyx":225
  4045. * except Exception as e:
  4046. * if DEBUG_FLAG:
  4047. * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  4048. * raise e
  4049. *
  4050. */
  4051. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4052. __Pyx_GOTREF(__pyx_t_8);
  4053. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4054. __Pyx_GOTREF(__pyx_t_10);
  4055. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4056. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4057. __Pyx_GOTREF(__pyx_t_8);
  4058. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4059. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4060. __Pyx_GOTREF(__pyx_t_10);
  4061. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4062. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4063. goto __pyx_L13;
  4064. }
  4065. __pyx_L13:;
  4066. /* "lib/Naked/toolshed/c/system.pyx":226
  4067. * if DEBUG_FLAG:
  4068. * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).")
  4069. * raise e # <<<<<<<<<<<<<<
  4070. *
  4071. * #------------------------------------------------------------------------------
  4072. */
  4073. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  4074. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4075. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4076. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4077. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4078. goto __pyx_L4_exception_handled;
  4079. }
  4080. goto __pyx_L5_except_error;
  4081. __pyx_L5_except_error:;
  4082. __Pyx_XGIVEREF(__pyx_t_1);
  4083. __Pyx_XGIVEREF(__pyx_t_2);
  4084. __Pyx_XGIVEREF(__pyx_t_3);
  4085. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4086. goto __pyx_L1_error;
  4087. __pyx_L7_try_return:;
  4088. __Pyx_XGIVEREF(__pyx_t_1);
  4089. __Pyx_XGIVEREF(__pyx_t_2);
  4090. __Pyx_XGIVEREF(__pyx_t_3);
  4091. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4092. goto __pyx_L0;
  4093. __pyx_L4_exception_handled:;
  4094. __Pyx_XGIVEREF(__pyx_t_1);
  4095. __Pyx_XGIVEREF(__pyx_t_2);
  4096. __Pyx_XGIVEREF(__pyx_t_3);
  4097. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4098. __pyx_L10_try_end:;
  4099. }
  4100. /* "lib/Naked/toolshed/c/system.pyx":220
  4101. * # test_sys_is_file_when_dir
  4102. * #------------------------------------------------------------------------------
  4103. * def is_file(filepath): # <<<<<<<<<<<<<<
  4104. * try:
  4105. * return os.path.isfile(filepath)
  4106. */
  4107. /* function exit code */
  4108. __pyx_L1_error:;
  4109. __Pyx_XDECREF(__pyx_t_4);
  4110. __Pyx_XDECREF(__pyx_t_5);
  4111. __Pyx_XDECREF(__pyx_t_6);
  4112. __Pyx_XDECREF(__pyx_t_8);
  4113. __Pyx_XDECREF(__pyx_t_10);
  4114. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4115. __pyx_r = NULL;
  4116. __pyx_L0:;
  4117. __Pyx_XDECREF(__pyx_v_e);
  4118. __Pyx_XGIVEREF(__pyx_r);
  4119. __Pyx_RefNannyFinishContext();
  4120. return __pyx_r;
  4121. }
  4122. /* "lib/Naked/toolshed/c/system.pyx":233
  4123. * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir
  4124. * #------------------------------------------------------------------------------
  4125. * def dir_exists(dirpath): # <<<<<<<<<<<<<<
  4126. * try:
  4127. * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory
  4128. */
  4129. /* Python wrapper */
  4130. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_25dir_exists(PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /*proto*/
  4131. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_25dir_exists = {__Pyx_NAMESTR("dir_exists"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_25dir_exists, METH_O, __Pyx_DOCSTR(0)};
  4132. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_25dir_exists(PyObject *__pyx_self, PyObject *__pyx_v_dirpath) {
  4133. PyObject *__pyx_r = 0;
  4134. __Pyx_RefNannyDeclarations
  4135. __Pyx_RefNannySetupContext("dir_exists (wrapper)", 0);
  4136. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_24dir_exists(__pyx_self, ((PyObject *)__pyx_v_dirpath));
  4137. /* function exit code */
  4138. __Pyx_RefNannyFinishContext();
  4139. return __pyx_r;
  4140. }
  4141. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_24dir_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath) {
  4142. PyObject *__pyx_v_e = NULL;
  4143. PyObject *__pyx_r = NULL;
  4144. __Pyx_RefNannyDeclarations
  4145. PyObject *__pyx_t_1 = NULL;
  4146. PyObject *__pyx_t_2 = NULL;
  4147. PyObject *__pyx_t_3 = NULL;
  4148. PyObject *__pyx_t_4 = NULL;
  4149. PyObject *__pyx_t_5 = NULL;
  4150. PyObject *__pyx_t_6 = NULL;
  4151. int __pyx_t_7;
  4152. int __pyx_t_8;
  4153. int __pyx_t_9;
  4154. int __pyx_t_10;
  4155. PyObject *__pyx_t_11 = NULL;
  4156. PyObject *__pyx_t_12 = NULL;
  4157. int __pyx_lineno = 0;
  4158. const char *__pyx_filename = NULL;
  4159. int __pyx_clineno = 0;
  4160. __Pyx_RefNannySetupContext("dir_exists", 0);
  4161. /* "lib/Naked/toolshed/c/system.pyx":234
  4162. * #------------------------------------------------------------------------------
  4163. * def dir_exists(dirpath):
  4164. * try: # <<<<<<<<<<<<<<
  4165. * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory
  4166. * return True
  4167. */
  4168. {
  4169. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  4170. __Pyx_XGOTREF(__pyx_t_1);
  4171. __Pyx_XGOTREF(__pyx_t_2);
  4172. __Pyx_XGOTREF(__pyx_t_3);
  4173. /*try:*/ {
  4174. /* "lib/Naked/toolshed/c/system.pyx":235
  4175. * def dir_exists(dirpath):
  4176. * try:
  4177. * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory # <<<<<<<<<<<<<<
  4178. * return True
  4179. * else:
  4180. */
  4181. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4182. __Pyx_GOTREF(__pyx_t_4);
  4183. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4184. __Pyx_GOTREF(__pyx_t_5);
  4185. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4186. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4187. __Pyx_GOTREF(__pyx_t_4);
  4188. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4189. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4190. __Pyx_GOTREF(__pyx_t_5);
  4191. __Pyx_INCREF(__pyx_v_dirpath);
  4192. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath);
  4193. __Pyx_GIVEREF(__pyx_v_dirpath);
  4194. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4195. __Pyx_GOTREF(__pyx_t_6);
  4196. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4197. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4198. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4199. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4200. if (__pyx_t_7) {
  4201. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4202. __Pyx_GOTREF(__pyx_t_6);
  4203. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4204. __Pyx_GOTREF(__pyx_t_5);
  4205. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4206. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isdir); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4207. __Pyx_GOTREF(__pyx_t_6);
  4208. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4209. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4210. __Pyx_GOTREF(__pyx_t_5);
  4211. __Pyx_INCREF(__pyx_v_dirpath);
  4212. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath);
  4213. __Pyx_GIVEREF(__pyx_v_dirpath);
  4214. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4215. __Pyx_GOTREF(__pyx_t_4);
  4216. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4217. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4218. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4219. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4220. __pyx_t_9 = __pyx_t_8;
  4221. } else {
  4222. __pyx_t_9 = __pyx_t_7;
  4223. }
  4224. if (__pyx_t_9) {
  4225. /* "lib/Naked/toolshed/c/system.pyx":236
  4226. * try:
  4227. * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory
  4228. * return True # <<<<<<<<<<<<<<
  4229. * else:
  4230. * return False
  4231. */
  4232. __Pyx_XDECREF(__pyx_r);
  4233. __Pyx_INCREF(Py_True);
  4234. __pyx_r = Py_True;
  4235. goto __pyx_L7_try_return;
  4236. }
  4237. /*else*/ {
  4238. /* "lib/Naked/toolshed/c/system.pyx":238
  4239. * return True
  4240. * else:
  4241. * return False # <<<<<<<<<<<<<<
  4242. * except Exception as e:
  4243. * if DEBUG_FLAG:
  4244. */
  4245. __Pyx_XDECREF(__pyx_r);
  4246. __Pyx_INCREF(Py_False);
  4247. __pyx_r = Py_False;
  4248. goto __pyx_L7_try_return;
  4249. }
  4250. }
  4251. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  4252. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  4253. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4254. goto __pyx_L10_try_end;
  4255. __pyx_L3_error:;
  4256. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  4257. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4258. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  4259. /* "lib/Naked/toolshed/c/system.pyx":239
  4260. * else:
  4261. * return False
  4262. * except Exception as e: # <<<<<<<<<<<<<<
  4263. * if DEBUG_FLAG:
  4264. * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).")
  4265. */
  4266. __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  4267. if (__pyx_t_10) {
  4268. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.dir_exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4269. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4270. __Pyx_GOTREF(__pyx_t_4);
  4271. __Pyx_GOTREF(__pyx_t_5);
  4272. __Pyx_GOTREF(__pyx_t_6);
  4273. __Pyx_INCREF(__pyx_t_5);
  4274. __pyx_v_e = __pyx_t_5;
  4275. /* "lib/Naked/toolshed/c/system.pyx":240
  4276. * return False
  4277. * except Exception as e:
  4278. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  4279. * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).")
  4280. * raise e
  4281. */
  4282. __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4283. __Pyx_GOTREF(__pyx_t_11);
  4284. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4285. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  4286. if (__pyx_t_9) {
  4287. /* "lib/Naked/toolshed/c/system.pyx":241
  4288. * except Exception as e:
  4289. * if DEBUG_FLAG:
  4290. * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  4291. * raise e
  4292. *
  4293. */
  4294. __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4295. __Pyx_GOTREF(__pyx_t_11);
  4296. __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4297. __Pyx_GOTREF(__pyx_t_12);
  4298. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  4299. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4300. __Pyx_GOTREF(__pyx_t_11);
  4301. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  4302. __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4303. __Pyx_GOTREF(__pyx_t_12);
  4304. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  4305. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  4306. goto __pyx_L14;
  4307. }
  4308. __pyx_L14:;
  4309. /* "lib/Naked/toolshed/c/system.pyx":242
  4310. * if DEBUG_FLAG:
  4311. * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).")
  4312. * raise e # <<<<<<<<<<<<<<
  4313. *
  4314. * #------------------------------------------------------------------------------
  4315. */
  4316. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  4317. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4318. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4319. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4320. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4321. goto __pyx_L4_exception_handled;
  4322. }
  4323. goto __pyx_L5_except_error;
  4324. __pyx_L5_except_error:;
  4325. __Pyx_XGIVEREF(__pyx_t_1);
  4326. __Pyx_XGIVEREF(__pyx_t_2);
  4327. __Pyx_XGIVEREF(__pyx_t_3);
  4328. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4329. goto __pyx_L1_error;
  4330. __pyx_L7_try_return:;
  4331. __Pyx_XGIVEREF(__pyx_t_1);
  4332. __Pyx_XGIVEREF(__pyx_t_2);
  4333. __Pyx_XGIVEREF(__pyx_t_3);
  4334. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4335. goto __pyx_L0;
  4336. __pyx_L4_exception_handled:;
  4337. __Pyx_XGIVEREF(__pyx_t_1);
  4338. __Pyx_XGIVEREF(__pyx_t_2);
  4339. __Pyx_XGIVEREF(__pyx_t_3);
  4340. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4341. __pyx_L10_try_end:;
  4342. }
  4343. /* "lib/Naked/toolshed/c/system.pyx":233
  4344. * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir
  4345. * #------------------------------------------------------------------------------
  4346. * def dir_exists(dirpath): # <<<<<<<<<<<<<<
  4347. * try:
  4348. * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory
  4349. */
  4350. /* function exit code */
  4351. __pyx_L1_error:;
  4352. __Pyx_XDECREF(__pyx_t_4);
  4353. __Pyx_XDECREF(__pyx_t_5);
  4354. __Pyx_XDECREF(__pyx_t_6);
  4355. __Pyx_XDECREF(__pyx_t_11);
  4356. __Pyx_XDECREF(__pyx_t_12);
  4357. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.dir_exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4358. __pyx_r = NULL;
  4359. __pyx_L0:;
  4360. __Pyx_XDECREF(__pyx_v_e);
  4361. __Pyx_XGIVEREF(__pyx_r);
  4362. __Pyx_RefNannyFinishContext();
  4363. return __pyx_r;
  4364. }
  4365. /* "lib/Naked/toolshed/c/system.pyx":250
  4366. * # test_sys_dir_is_dir_when_missing
  4367. * #------------------------------------------------------------------------------
  4368. * def is_dir(dirpath): # <<<<<<<<<<<<<<
  4369. * try:
  4370. * return os.path.isdir(dirpath)
  4371. */
  4372. /* Python wrapper */
  4373. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_27is_dir(PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /*proto*/
  4374. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_27is_dir = {__Pyx_NAMESTR("is_dir"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_27is_dir, METH_O, __Pyx_DOCSTR(0)};
  4375. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_27is_dir(PyObject *__pyx_self, PyObject *__pyx_v_dirpath) {
  4376. PyObject *__pyx_r = 0;
  4377. __Pyx_RefNannyDeclarations
  4378. __Pyx_RefNannySetupContext("is_dir (wrapper)", 0);
  4379. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_26is_dir(__pyx_self, ((PyObject *)__pyx_v_dirpath));
  4380. /* function exit code */
  4381. __Pyx_RefNannyFinishContext();
  4382. return __pyx_r;
  4383. }
  4384. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_26is_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath) {
  4385. PyObject *__pyx_v_e = NULL;
  4386. PyObject *__pyx_r = NULL;
  4387. __Pyx_RefNannyDeclarations
  4388. PyObject *__pyx_t_1 = NULL;
  4389. PyObject *__pyx_t_2 = NULL;
  4390. PyObject *__pyx_t_3 = NULL;
  4391. PyObject *__pyx_t_4 = NULL;
  4392. PyObject *__pyx_t_5 = NULL;
  4393. PyObject *__pyx_t_6 = NULL;
  4394. int __pyx_t_7;
  4395. PyObject *__pyx_t_8 = NULL;
  4396. int __pyx_t_9;
  4397. PyObject *__pyx_t_10 = NULL;
  4398. int __pyx_lineno = 0;
  4399. const char *__pyx_filename = NULL;
  4400. int __pyx_clineno = 0;
  4401. __Pyx_RefNannySetupContext("is_dir", 0);
  4402. /* "lib/Naked/toolshed/c/system.pyx":251
  4403. * #------------------------------------------------------------------------------
  4404. * def is_dir(dirpath):
  4405. * try: # <<<<<<<<<<<<<<
  4406. * return os.path.isdir(dirpath)
  4407. * except Exception as e:
  4408. */
  4409. {
  4410. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  4411. __Pyx_XGOTREF(__pyx_t_1);
  4412. __Pyx_XGOTREF(__pyx_t_2);
  4413. __Pyx_XGOTREF(__pyx_t_3);
  4414. /*try:*/ {
  4415. /* "lib/Naked/toolshed/c/system.pyx":252
  4416. * def is_dir(dirpath):
  4417. * try:
  4418. * return os.path.isdir(dirpath) # <<<<<<<<<<<<<<
  4419. * except Exception as e:
  4420. * if DEBUG_FLAG:
  4421. */
  4422. __Pyx_XDECREF(__pyx_r);
  4423. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4424. __Pyx_GOTREF(__pyx_t_4);
  4425. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4426. __Pyx_GOTREF(__pyx_t_5);
  4427. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4428. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isdir); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4429. __Pyx_GOTREF(__pyx_t_4);
  4430. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4431. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4432. __Pyx_GOTREF(__pyx_t_5);
  4433. __Pyx_INCREF(__pyx_v_dirpath);
  4434. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath);
  4435. __Pyx_GIVEREF(__pyx_v_dirpath);
  4436. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4437. __Pyx_GOTREF(__pyx_t_6);
  4438. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4439. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4440. __pyx_r = __pyx_t_6;
  4441. __pyx_t_6 = 0;
  4442. goto __pyx_L7_try_return;
  4443. }
  4444. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  4445. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  4446. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4447. goto __pyx_L10_try_end;
  4448. __pyx_L3_error:;
  4449. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  4450. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4451. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  4452. /* "lib/Naked/toolshed/c/system.pyx":253
  4453. * try:
  4454. * return os.path.isdir(dirpath)
  4455. * except Exception as e: # <<<<<<<<<<<<<<
  4456. * if DEBUG_FLAG:
  4457. * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).")
  4458. */
  4459. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  4460. if (__pyx_t_7) {
  4461. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4462. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4463. __Pyx_GOTREF(__pyx_t_6);
  4464. __Pyx_GOTREF(__pyx_t_5);
  4465. __Pyx_GOTREF(__pyx_t_4);
  4466. __Pyx_INCREF(__pyx_t_5);
  4467. __pyx_v_e = __pyx_t_5;
  4468. /* "lib/Naked/toolshed/c/system.pyx":254
  4469. * return os.path.isdir(dirpath)
  4470. * except Exception as e:
  4471. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  4472. * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).")
  4473. * raise e
  4474. */
  4475. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4476. __Pyx_GOTREF(__pyx_t_8);
  4477. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4478. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4479. if (__pyx_t_9) {
  4480. /* "lib/Naked/toolshed/c/system.pyx":255
  4481. * except Exception as e:
  4482. * if DEBUG_FLAG:
  4483. * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  4484. * raise e
  4485. *
  4486. */
  4487. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4488. __Pyx_GOTREF(__pyx_t_8);
  4489. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4490. __Pyx_GOTREF(__pyx_t_10);
  4491. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4492. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4493. __Pyx_GOTREF(__pyx_t_8);
  4494. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4495. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4496. __Pyx_GOTREF(__pyx_t_10);
  4497. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4498. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4499. goto __pyx_L13;
  4500. }
  4501. __pyx_L13:;
  4502. /* "lib/Naked/toolshed/c/system.pyx":256
  4503. * if DEBUG_FLAG:
  4504. * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).")
  4505. * raise e # <<<<<<<<<<<<<<
  4506. *
  4507. * #------------------------------------------------------------------------------
  4508. */
  4509. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  4510. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4511. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4512. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4513. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4514. goto __pyx_L4_exception_handled;
  4515. }
  4516. goto __pyx_L5_except_error;
  4517. __pyx_L5_except_error:;
  4518. __Pyx_XGIVEREF(__pyx_t_1);
  4519. __Pyx_XGIVEREF(__pyx_t_2);
  4520. __Pyx_XGIVEREF(__pyx_t_3);
  4521. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4522. goto __pyx_L1_error;
  4523. __pyx_L7_try_return:;
  4524. __Pyx_XGIVEREF(__pyx_t_1);
  4525. __Pyx_XGIVEREF(__pyx_t_2);
  4526. __Pyx_XGIVEREF(__pyx_t_3);
  4527. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4528. goto __pyx_L0;
  4529. __pyx_L4_exception_handled:;
  4530. __Pyx_XGIVEREF(__pyx_t_1);
  4531. __Pyx_XGIVEREF(__pyx_t_2);
  4532. __Pyx_XGIVEREF(__pyx_t_3);
  4533. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4534. __pyx_L10_try_end:;
  4535. }
  4536. /* "lib/Naked/toolshed/c/system.pyx":250
  4537. * # test_sys_dir_is_dir_when_missing
  4538. * #------------------------------------------------------------------------------
  4539. * def is_dir(dirpath): # <<<<<<<<<<<<<<
  4540. * try:
  4541. * return os.path.isdir(dirpath)
  4542. */
  4543. /* function exit code */
  4544. __pyx_L1_error:;
  4545. __Pyx_XDECREF(__pyx_t_4);
  4546. __Pyx_XDECREF(__pyx_t_5);
  4547. __Pyx_XDECREF(__pyx_t_6);
  4548. __Pyx_XDECREF(__pyx_t_8);
  4549. __Pyx_XDECREF(__pyx_t_10);
  4550. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4551. __pyx_r = NULL;
  4552. __pyx_L0:;
  4553. __Pyx_XDECREF(__pyx_v_e);
  4554. __Pyx_XGIVEREF(__pyx_r);
  4555. __Pyx_RefNannyFinishContext();
  4556. return __pyx_r;
  4557. }
  4558. /* "lib/Naked/toolshed/c/system.pyx":269
  4559. * # Tests: test_SYSTEM.py :: test_sys_meta_file_size
  4560. * #------------------------------------------------------------------------------
  4561. * def file_size(filepath): # <<<<<<<<<<<<<<
  4562. * try:
  4563. * return os.path.getsize(filepath)
  4564. */
  4565. /* Python wrapper */
  4566. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_29file_size(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/
  4567. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_29file_size = {__Pyx_NAMESTR("file_size"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_29file_size, METH_O, __Pyx_DOCSTR(0)};
  4568. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_29file_size(PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  4569. PyObject *__pyx_r = 0;
  4570. __Pyx_RefNannyDeclarations
  4571. __Pyx_RefNannySetupContext("file_size (wrapper)", 0);
  4572. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_28file_size(__pyx_self, ((PyObject *)__pyx_v_filepath));
  4573. /* function exit code */
  4574. __Pyx_RefNannyFinishContext();
  4575. return __pyx_r;
  4576. }
  4577. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_28file_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  4578. PyObject *__pyx_v_e = NULL;
  4579. PyObject *__pyx_r = NULL;
  4580. __Pyx_RefNannyDeclarations
  4581. PyObject *__pyx_t_1 = NULL;
  4582. PyObject *__pyx_t_2 = NULL;
  4583. PyObject *__pyx_t_3 = NULL;
  4584. PyObject *__pyx_t_4 = NULL;
  4585. PyObject *__pyx_t_5 = NULL;
  4586. PyObject *__pyx_t_6 = NULL;
  4587. int __pyx_t_7;
  4588. PyObject *__pyx_t_8 = NULL;
  4589. int __pyx_t_9;
  4590. PyObject *__pyx_t_10 = NULL;
  4591. int __pyx_lineno = 0;
  4592. const char *__pyx_filename = NULL;
  4593. int __pyx_clineno = 0;
  4594. __Pyx_RefNannySetupContext("file_size", 0);
  4595. /* "lib/Naked/toolshed/c/system.pyx":270
  4596. * #------------------------------------------------------------------------------
  4597. * def file_size(filepath):
  4598. * try: # <<<<<<<<<<<<<<
  4599. * return os.path.getsize(filepath)
  4600. * except Exception as e:
  4601. */
  4602. {
  4603. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  4604. __Pyx_XGOTREF(__pyx_t_1);
  4605. __Pyx_XGOTREF(__pyx_t_2);
  4606. __Pyx_XGOTREF(__pyx_t_3);
  4607. /*try:*/ {
  4608. /* "lib/Naked/toolshed/c/system.pyx":271
  4609. * def file_size(filepath):
  4610. * try:
  4611. * return os.path.getsize(filepath) # <<<<<<<<<<<<<<
  4612. * except Exception as e:
  4613. * if DEBUG_FLAG:
  4614. */
  4615. __Pyx_XDECREF(__pyx_r);
  4616. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4617. __Pyx_GOTREF(__pyx_t_4);
  4618. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4619. __Pyx_GOTREF(__pyx_t_5);
  4620. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4621. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4622. __Pyx_GOTREF(__pyx_t_4);
  4623. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4624. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4625. __Pyx_GOTREF(__pyx_t_5);
  4626. __Pyx_INCREF(__pyx_v_filepath);
  4627. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath);
  4628. __Pyx_GIVEREF(__pyx_v_filepath);
  4629. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4630. __Pyx_GOTREF(__pyx_t_6);
  4631. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4632. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4633. __pyx_r = __pyx_t_6;
  4634. __pyx_t_6 = 0;
  4635. goto __pyx_L7_try_return;
  4636. }
  4637. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  4638. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  4639. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4640. goto __pyx_L10_try_end;
  4641. __pyx_L3_error:;
  4642. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  4643. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4644. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  4645. /* "lib/Naked/toolshed/c/system.pyx":272
  4646. * try:
  4647. * return os.path.getsize(filepath)
  4648. * except Exception as e: # <<<<<<<<<<<<<<
  4649. * if DEBUG_FLAG:
  4650. * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).")
  4651. */
  4652. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  4653. if (__pyx_t_7) {
  4654. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4655. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4656. __Pyx_GOTREF(__pyx_t_6);
  4657. __Pyx_GOTREF(__pyx_t_5);
  4658. __Pyx_GOTREF(__pyx_t_4);
  4659. __Pyx_INCREF(__pyx_t_5);
  4660. __pyx_v_e = __pyx_t_5;
  4661. /* "lib/Naked/toolshed/c/system.pyx":273
  4662. * return os.path.getsize(filepath)
  4663. * except Exception as e:
  4664. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  4665. * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).")
  4666. * raise e
  4667. */
  4668. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4669. __Pyx_GOTREF(__pyx_t_8);
  4670. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4671. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4672. if (__pyx_t_9) {
  4673. /* "lib/Naked/toolshed/c/system.pyx":274
  4674. * except Exception as e:
  4675. * if DEBUG_FLAG:
  4676. * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  4677. * raise e
  4678. *
  4679. */
  4680. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4681. __Pyx_GOTREF(__pyx_t_8);
  4682. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4683. __Pyx_GOTREF(__pyx_t_10);
  4684. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4685. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4686. __Pyx_GOTREF(__pyx_t_8);
  4687. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4688. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4689. __Pyx_GOTREF(__pyx_t_10);
  4690. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4691. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4692. goto __pyx_L13;
  4693. }
  4694. __pyx_L13:;
  4695. /* "lib/Naked/toolshed/c/system.pyx":275
  4696. * if DEBUG_FLAG:
  4697. * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).")
  4698. * raise e # <<<<<<<<<<<<<<
  4699. *
  4700. * #------------------------------------------------------------------------------
  4701. */
  4702. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  4703. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4704. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4705. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4706. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4707. goto __pyx_L4_exception_handled;
  4708. }
  4709. goto __pyx_L5_except_error;
  4710. __pyx_L5_except_error:;
  4711. __Pyx_XGIVEREF(__pyx_t_1);
  4712. __Pyx_XGIVEREF(__pyx_t_2);
  4713. __Pyx_XGIVEREF(__pyx_t_3);
  4714. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4715. goto __pyx_L1_error;
  4716. __pyx_L7_try_return:;
  4717. __Pyx_XGIVEREF(__pyx_t_1);
  4718. __Pyx_XGIVEREF(__pyx_t_2);
  4719. __Pyx_XGIVEREF(__pyx_t_3);
  4720. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4721. goto __pyx_L0;
  4722. __pyx_L4_exception_handled:;
  4723. __Pyx_XGIVEREF(__pyx_t_1);
  4724. __Pyx_XGIVEREF(__pyx_t_2);
  4725. __Pyx_XGIVEREF(__pyx_t_3);
  4726. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4727. __pyx_L10_try_end:;
  4728. }
  4729. /* "lib/Naked/toolshed/c/system.pyx":269
  4730. * # Tests: test_SYSTEM.py :: test_sys_meta_file_size
  4731. * #------------------------------------------------------------------------------
  4732. * def file_size(filepath): # <<<<<<<<<<<<<<
  4733. * try:
  4734. * return os.path.getsize(filepath)
  4735. */
  4736. /* function exit code */
  4737. __pyx_L1_error:;
  4738. __Pyx_XDECREF(__pyx_t_4);
  4739. __Pyx_XDECREF(__pyx_t_5);
  4740. __Pyx_XDECREF(__pyx_t_6);
  4741. __Pyx_XDECREF(__pyx_t_8);
  4742. __Pyx_XDECREF(__pyx_t_10);
  4743. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4744. __pyx_r = NULL;
  4745. __pyx_L0:;
  4746. __Pyx_XDECREF(__pyx_v_e);
  4747. __Pyx_XGIVEREF(__pyx_r);
  4748. __Pyx_RefNannyFinishContext();
  4749. return __pyx_r;
  4750. }
  4751. /* "lib/Naked/toolshed/c/system.pyx":282
  4752. * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod
  4753. * #------------------------------------------------------------------------------
  4754. * def file_mod_time(filepath): # <<<<<<<<<<<<<<
  4755. * try:
  4756. * import time
  4757. */
  4758. /* Python wrapper */
  4759. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_31file_mod_time(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/
  4760. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_31file_mod_time = {__Pyx_NAMESTR("file_mod_time"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_31file_mod_time, METH_O, __Pyx_DOCSTR(0)};
  4761. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_31file_mod_time(PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  4762. PyObject *__pyx_r = 0;
  4763. __Pyx_RefNannyDeclarations
  4764. __Pyx_RefNannySetupContext("file_mod_time (wrapper)", 0);
  4765. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_30file_mod_time(__pyx_self, ((PyObject *)__pyx_v_filepath));
  4766. /* function exit code */
  4767. __Pyx_RefNannyFinishContext();
  4768. return __pyx_r;
  4769. }
  4770. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_30file_mod_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  4771. PyObject *__pyx_v_time = NULL;
  4772. PyObject *__pyx_v_e = NULL;
  4773. PyObject *__pyx_r = NULL;
  4774. __Pyx_RefNannyDeclarations
  4775. PyObject *__pyx_t_1 = NULL;
  4776. PyObject *__pyx_t_2 = NULL;
  4777. PyObject *__pyx_t_3 = NULL;
  4778. PyObject *__pyx_t_4 = NULL;
  4779. PyObject *__pyx_t_5 = NULL;
  4780. PyObject *__pyx_t_6 = NULL;
  4781. PyObject *__pyx_t_7 = NULL;
  4782. int __pyx_t_8;
  4783. int __pyx_t_9;
  4784. PyObject *__pyx_t_10 = NULL;
  4785. int __pyx_lineno = 0;
  4786. const char *__pyx_filename = NULL;
  4787. int __pyx_clineno = 0;
  4788. __Pyx_RefNannySetupContext("file_mod_time", 0);
  4789. /* "lib/Naked/toolshed/c/system.pyx":283
  4790. * #------------------------------------------------------------------------------
  4791. * def file_mod_time(filepath):
  4792. * try: # <<<<<<<<<<<<<<
  4793. * import time
  4794. * return time.ctime(os.path.getmtime(filepath))
  4795. */
  4796. {
  4797. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  4798. __Pyx_XGOTREF(__pyx_t_1);
  4799. __Pyx_XGOTREF(__pyx_t_2);
  4800. __Pyx_XGOTREF(__pyx_t_3);
  4801. /*try:*/ {
  4802. /* "lib/Naked/toolshed/c/system.pyx":284
  4803. * def file_mod_time(filepath):
  4804. * try:
  4805. * import time # <<<<<<<<<<<<<<
  4806. * return time.ctime(os.path.getmtime(filepath))
  4807. * except Exception as e:
  4808. */
  4809. __pyx_t_4 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4810. __Pyx_GOTREF(__pyx_t_4);
  4811. __pyx_v_time = __pyx_t_4;
  4812. __pyx_t_4 = 0;
  4813. /* "lib/Naked/toolshed/c/system.pyx":285
  4814. * try:
  4815. * import time
  4816. * return time.ctime(os.path.getmtime(filepath)) # <<<<<<<<<<<<<<
  4817. * except Exception as e:
  4818. * if DEBUG_FLAG:
  4819. */
  4820. __Pyx_XDECREF(__pyx_r);
  4821. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_ctime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4822. __Pyx_GOTREF(__pyx_t_4);
  4823. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4824. __Pyx_GOTREF(__pyx_t_5);
  4825. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4826. __Pyx_GOTREF(__pyx_t_6);
  4827. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4828. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getmtime); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4829. __Pyx_GOTREF(__pyx_t_5);
  4830. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4831. __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4832. __Pyx_GOTREF(__pyx_t_6);
  4833. __Pyx_INCREF(__pyx_v_filepath);
  4834. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_filepath);
  4835. __Pyx_GIVEREF(__pyx_v_filepath);
  4836. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4837. __Pyx_GOTREF(__pyx_t_7);
  4838. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4839. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4840. __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4841. __Pyx_GOTREF(__pyx_t_6);
  4842. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
  4843. __Pyx_GIVEREF(__pyx_t_7);
  4844. __pyx_t_7 = 0;
  4845. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4846. __Pyx_GOTREF(__pyx_t_7);
  4847. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4848. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4849. __pyx_r = __pyx_t_7;
  4850. __pyx_t_7 = 0;
  4851. goto __pyx_L7_try_return;
  4852. }
  4853. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  4854. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  4855. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4856. goto __pyx_L10_try_end;
  4857. __pyx_L3_error:;
  4858. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4859. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  4860. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  4861. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  4862. /* "lib/Naked/toolshed/c/system.pyx":286
  4863. * import time
  4864. * return time.ctime(os.path.getmtime(filepath))
  4865. * except Exception as e: # <<<<<<<<<<<<<<
  4866. * if DEBUG_FLAG:
  4867. * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).")
  4868. */
  4869. __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  4870. if (__pyx_t_8) {
  4871. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_mod_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4872. if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4873. __Pyx_GOTREF(__pyx_t_7);
  4874. __Pyx_GOTREF(__pyx_t_6);
  4875. __Pyx_GOTREF(__pyx_t_4);
  4876. __Pyx_INCREF(__pyx_t_6);
  4877. __pyx_v_e = __pyx_t_6;
  4878. /* "lib/Naked/toolshed/c/system.pyx":287
  4879. * return time.ctime(os.path.getmtime(filepath))
  4880. * except Exception as e:
  4881. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  4882. * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).")
  4883. * raise e
  4884. */
  4885. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4886. __Pyx_GOTREF(__pyx_t_5);
  4887. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4888. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4889. if (__pyx_t_9) {
  4890. /* "lib/Naked/toolshed/c/system.pyx":288
  4891. * except Exception as e:
  4892. * if DEBUG_FLAG:
  4893. * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  4894. * raise e
  4895. *
  4896. */
  4897. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4898. __Pyx_GOTREF(__pyx_t_5);
  4899. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4900. __Pyx_GOTREF(__pyx_t_10);
  4901. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4902. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4903. __Pyx_GOTREF(__pyx_t_5);
  4904. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4905. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4906. __Pyx_GOTREF(__pyx_t_10);
  4907. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4908. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  4909. goto __pyx_L13;
  4910. }
  4911. __pyx_L13:;
  4912. /* "lib/Naked/toolshed/c/system.pyx":289
  4913. * if DEBUG_FLAG:
  4914. * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).")
  4915. * raise e # <<<<<<<<<<<<<<
  4916. *
  4917. * #------------------------------------------------------------------------------
  4918. */
  4919. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  4920. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  4921. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4922. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  4923. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4924. goto __pyx_L4_exception_handled;
  4925. }
  4926. goto __pyx_L5_except_error;
  4927. __pyx_L5_except_error:;
  4928. __Pyx_XGIVEREF(__pyx_t_1);
  4929. __Pyx_XGIVEREF(__pyx_t_2);
  4930. __Pyx_XGIVEREF(__pyx_t_3);
  4931. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4932. goto __pyx_L1_error;
  4933. __pyx_L7_try_return:;
  4934. __Pyx_XGIVEREF(__pyx_t_1);
  4935. __Pyx_XGIVEREF(__pyx_t_2);
  4936. __Pyx_XGIVEREF(__pyx_t_3);
  4937. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4938. goto __pyx_L0;
  4939. __pyx_L4_exception_handled:;
  4940. __Pyx_XGIVEREF(__pyx_t_1);
  4941. __Pyx_XGIVEREF(__pyx_t_2);
  4942. __Pyx_XGIVEREF(__pyx_t_3);
  4943. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  4944. __pyx_L10_try_end:;
  4945. }
  4946. /* "lib/Naked/toolshed/c/system.pyx":282
  4947. * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod
  4948. * #------------------------------------------------------------------------------
  4949. * def file_mod_time(filepath): # <<<<<<<<<<<<<<
  4950. * try:
  4951. * import time
  4952. */
  4953. /* function exit code */
  4954. __pyx_L1_error:;
  4955. __Pyx_XDECREF(__pyx_t_4);
  4956. __Pyx_XDECREF(__pyx_t_5);
  4957. __Pyx_XDECREF(__pyx_t_6);
  4958. __Pyx_XDECREF(__pyx_t_7);
  4959. __Pyx_XDECREF(__pyx_t_10);
  4960. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_mod_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4961. __pyx_r = NULL;
  4962. __pyx_L0:;
  4963. __Pyx_XDECREF(__pyx_v_time);
  4964. __Pyx_XDECREF(__pyx_v_e);
  4965. __Pyx_XGIVEREF(__pyx_r);
  4966. __Pyx_RefNannyFinishContext();
  4967. return __pyx_r;
  4968. }
  4969. /* "lib/Naked/toolshed/c/system.pyx":302
  4970. * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir
  4971. * #------------------------------------------------------------------------------
  4972. * def list_all_files(dir): # <<<<<<<<<<<<<<
  4973. * try:
  4974. * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))]
  4975. */
  4976. /* Python wrapper */
  4977. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_33list_all_files(PyObject *__pyx_self, PyObject *__pyx_v_dir); /*proto*/
  4978. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_33list_all_files = {__Pyx_NAMESTR("list_all_files"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_33list_all_files, METH_O, __Pyx_DOCSTR(0)};
  4979. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_33list_all_files(PyObject *__pyx_self, PyObject *__pyx_v_dir) {
  4980. PyObject *__pyx_r = 0;
  4981. __Pyx_RefNannyDeclarations
  4982. __Pyx_RefNannySetupContext("list_all_files (wrapper)", 0);
  4983. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_32list_all_files(__pyx_self, ((PyObject *)__pyx_v_dir));
  4984. /* function exit code */
  4985. __Pyx_RefNannyFinishContext();
  4986. return __pyx_r;
  4987. }
  4988. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_32list_all_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir) {
  4989. PyObject *__pyx_v_filenames = NULL;
  4990. PyObject *__pyx_v_e = NULL;
  4991. PyObject *__pyx_v_name = NULL;
  4992. PyObject *__pyx_r = NULL;
  4993. __Pyx_RefNannyDeclarations
  4994. PyObject *__pyx_t_1 = NULL;
  4995. PyObject *__pyx_t_2 = NULL;
  4996. PyObject *__pyx_t_3 = NULL;
  4997. PyObject *__pyx_t_4 = NULL;
  4998. PyObject *__pyx_t_5 = NULL;
  4999. PyObject *__pyx_t_6 = NULL;
  5000. PyObject *__pyx_t_7 = NULL;
  5001. Py_ssize_t __pyx_t_8;
  5002. PyObject *(*__pyx_t_9)(PyObject *);
  5003. PyObject *__pyx_t_10 = NULL;
  5004. PyObject *__pyx_t_11 = NULL;
  5005. int __pyx_t_12;
  5006. int __pyx_t_13;
  5007. int __pyx_lineno = 0;
  5008. const char *__pyx_filename = NULL;
  5009. int __pyx_clineno = 0;
  5010. __Pyx_RefNannySetupContext("list_all_files", 0);
  5011. /* "lib/Naked/toolshed/c/system.pyx":303
  5012. * #------------------------------------------------------------------------------
  5013. * def list_all_files(dir):
  5014. * try: # <<<<<<<<<<<<<<
  5015. * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))]
  5016. * return filenames
  5017. */
  5018. {
  5019. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  5020. __Pyx_XGOTREF(__pyx_t_1);
  5021. __Pyx_XGOTREF(__pyx_t_2);
  5022. __Pyx_XGOTREF(__pyx_t_3);
  5023. /*try:*/ {
  5024. /* "lib/Naked/toolshed/c/system.pyx":304
  5025. * def list_all_files(dir):
  5026. * try:
  5027. * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] # <<<<<<<<<<<<<<
  5028. * return filenames
  5029. * except Exception as e:
  5030. */
  5031. __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5032. __Pyx_GOTREF(__pyx_t_4);
  5033. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5034. __Pyx_GOTREF(__pyx_t_5);
  5035. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_listdir); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5036. __Pyx_GOTREF(__pyx_t_6);
  5037. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5038. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5039. __Pyx_GOTREF(__pyx_t_5);
  5040. __Pyx_INCREF(__pyx_v_dir);
  5041. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dir);
  5042. __Pyx_GIVEREF(__pyx_v_dir);
  5043. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5044. __Pyx_GOTREF(__pyx_t_7);
  5045. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  5046. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5047. if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
  5048. __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
  5049. __pyx_t_9 = NULL;
  5050. } else {
  5051. __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5052. __Pyx_GOTREF(__pyx_t_5);
  5053. __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
  5054. }
  5055. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  5056. for (;;) {
  5057. if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) {
  5058. if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
  5059. #if CYTHON_COMPILING_IN_CPYTHON
  5060. __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5061. #else
  5062. __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5063. #endif
  5064. } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) {
  5065. if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
  5066. #if CYTHON_COMPILING_IN_CPYTHON
  5067. __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5068. #else
  5069. __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5070. #endif
  5071. } else {
  5072. __pyx_t_7 = __pyx_t_9(__pyx_t_5);
  5073. if (unlikely(!__pyx_t_7)) {
  5074. PyObject* exc_type = PyErr_Occurred();
  5075. if (exc_type) {
  5076. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  5077. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5078. }
  5079. break;
  5080. }
  5081. __Pyx_GOTREF(__pyx_t_7);
  5082. }
  5083. __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7);
  5084. __pyx_t_7 = 0;
  5085. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5086. __Pyx_GOTREF(__pyx_t_7);
  5087. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5088. __Pyx_GOTREF(__pyx_t_6);
  5089. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  5090. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isfile); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5091. __Pyx_GOTREF(__pyx_t_7);
  5092. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  5093. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5094. __Pyx_GOTREF(__pyx_t_6);
  5095. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5096. __Pyx_GOTREF(__pyx_t_10);
  5097. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  5098. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5099. __Pyx_GOTREF(__pyx_t_6);
  5100. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  5101. __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5102. __Pyx_GOTREF(__pyx_t_10);
  5103. __Pyx_INCREF(__pyx_v_dir);
  5104. PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_dir);
  5105. __Pyx_GIVEREF(__pyx_v_dir);
  5106. __Pyx_INCREF(__pyx_v_name);
  5107. PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_name);
  5108. __Pyx_GIVEREF(__pyx_v_name);
  5109. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5110. __Pyx_GOTREF(__pyx_t_11);
  5111. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  5112. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  5113. __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5114. __Pyx_GOTREF(__pyx_t_10);
  5115. PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
  5116. __Pyx_GIVEREF(__pyx_t_11);
  5117. __pyx_t_11 = 0;
  5118. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5119. __Pyx_GOTREF(__pyx_t_11);
  5120. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  5121. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  5122. __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5123. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  5124. if (__pyx_t_12) {
  5125. if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_name))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5126. goto __pyx_L13;
  5127. }
  5128. __pyx_L13:;
  5129. }
  5130. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5131. __pyx_v_filenames = ((PyObject*)__pyx_t_4);
  5132. __pyx_t_4 = 0;
  5133. /* "lib/Naked/toolshed/c/system.pyx":305
  5134. * try:
  5135. * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))]
  5136. * return filenames # <<<<<<<<<<<<<<
  5137. * except Exception as e:
  5138. * if DEBUG_FLAG:
  5139. */
  5140. __Pyx_XDECREF(__pyx_r);
  5141. __Pyx_INCREF(__pyx_v_filenames);
  5142. __pyx_r = __pyx_v_filenames;
  5143. goto __pyx_L7_try_return;
  5144. }
  5145. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  5146. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  5147. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  5148. goto __pyx_L10_try_end;
  5149. __pyx_L3_error:;
  5150. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  5151. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  5152. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  5153. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  5154. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5155. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  5156. /* "lib/Naked/toolshed/c/system.pyx":306
  5157. * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))]
  5158. * return filenames
  5159. * except Exception as e: # <<<<<<<<<<<<<<
  5160. * if DEBUG_FLAG:
  5161. * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).")
  5162. */
  5163. __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  5164. if (__pyx_t_13) {
  5165. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5166. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5167. __Pyx_GOTREF(__pyx_t_4);
  5168. __Pyx_GOTREF(__pyx_t_5);
  5169. __Pyx_GOTREF(__pyx_t_11);
  5170. __Pyx_INCREF(__pyx_t_5);
  5171. __pyx_v_e = __pyx_t_5;
  5172. /* "lib/Naked/toolshed/c/system.pyx":307
  5173. * return filenames
  5174. * except Exception as e:
  5175. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  5176. * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).")
  5177. * raise e
  5178. */
  5179. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5180. __Pyx_GOTREF(__pyx_t_10);
  5181. __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5182. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  5183. if (__pyx_t_12) {
  5184. /* "lib/Naked/toolshed/c/system.pyx":308
  5185. * except Exception as e:
  5186. * if DEBUG_FLAG:
  5187. * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  5188. * raise e
  5189. *
  5190. */
  5191. __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5192. __Pyx_GOTREF(__pyx_t_10);
  5193. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5194. __Pyx_GOTREF(__pyx_t_7);
  5195. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  5196. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5197. __Pyx_GOTREF(__pyx_t_10);
  5198. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  5199. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5200. __Pyx_GOTREF(__pyx_t_7);
  5201. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  5202. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  5203. goto __pyx_L16;
  5204. }
  5205. __pyx_L16:;
  5206. /* "lib/Naked/toolshed/c/system.pyx":309
  5207. * if DEBUG_FLAG:
  5208. * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).")
  5209. * raise e # <<<<<<<<<<<<<<
  5210. *
  5211. * #------------------------------------------------------------------------------
  5212. */
  5213. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  5214. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5215. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5216. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5217. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  5218. goto __pyx_L4_exception_handled;
  5219. }
  5220. goto __pyx_L5_except_error;
  5221. __pyx_L5_except_error:;
  5222. __Pyx_XGIVEREF(__pyx_t_1);
  5223. __Pyx_XGIVEREF(__pyx_t_2);
  5224. __Pyx_XGIVEREF(__pyx_t_3);
  5225. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  5226. goto __pyx_L1_error;
  5227. __pyx_L7_try_return:;
  5228. __Pyx_XGIVEREF(__pyx_t_1);
  5229. __Pyx_XGIVEREF(__pyx_t_2);
  5230. __Pyx_XGIVEREF(__pyx_t_3);
  5231. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  5232. goto __pyx_L0;
  5233. __pyx_L4_exception_handled:;
  5234. __Pyx_XGIVEREF(__pyx_t_1);
  5235. __Pyx_XGIVEREF(__pyx_t_2);
  5236. __Pyx_XGIVEREF(__pyx_t_3);
  5237. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  5238. __pyx_L10_try_end:;
  5239. }
  5240. /* "lib/Naked/toolshed/c/system.pyx":302
  5241. * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir
  5242. * #------------------------------------------------------------------------------
  5243. * def list_all_files(dir): # <<<<<<<<<<<<<<
  5244. * try:
  5245. * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))]
  5246. */
  5247. /* function exit code */
  5248. __pyx_L1_error:;
  5249. __Pyx_XDECREF(__pyx_t_4);
  5250. __Pyx_XDECREF(__pyx_t_5);
  5251. __Pyx_XDECREF(__pyx_t_6);
  5252. __Pyx_XDECREF(__pyx_t_7);
  5253. __Pyx_XDECREF(__pyx_t_10);
  5254. __Pyx_XDECREF(__pyx_t_11);
  5255. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5256. __pyx_r = NULL;
  5257. __pyx_L0:;
  5258. __Pyx_XDECREF(__pyx_v_filenames);
  5259. __Pyx_XDECREF(__pyx_v_e);
  5260. __Pyx_XDECREF(__pyx_v_name);
  5261. __Pyx_XGIVEREF(__pyx_r);
  5262. __Pyx_RefNannyFinishContext();
  5263. return __pyx_r;
  5264. }
  5265. /* "lib/Naked/toolshed/c/system.pyx":318
  5266. * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch
  5267. * #------------------------------------------------------------------------------
  5268. * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<<
  5269. * try:
  5270. * if not extension_filter.startswith("."):
  5271. */
  5272. /* Python wrapper */
  5273. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_35list_filter_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5274. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_35list_filter_files = {__Pyx_NAMESTR("list_filter_files"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_35list_filter_files, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  5275. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_35list_filter_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5276. PyObject *__pyx_v_extension_filter = 0;
  5277. PyObject *__pyx_v_dir = 0;
  5278. int __pyx_lineno = 0;
  5279. const char *__pyx_filename = NULL;
  5280. int __pyx_clineno = 0;
  5281. PyObject *__pyx_r = 0;
  5282. __Pyx_RefNannyDeclarations
  5283. __Pyx_RefNannySetupContext("list_filter_files (wrapper)", 0);
  5284. {
  5285. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_extension_filter,&__pyx_n_s_dir,0};
  5286. PyObject* values[2] = {0,0};
  5287. if (unlikely(__pyx_kwds)) {
  5288. Py_ssize_t kw_args;
  5289. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5290. switch (pos_args) {
  5291. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5292. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5293. case 0: break;
  5294. default: goto __pyx_L5_argtuple_error;
  5295. }
  5296. kw_args = PyDict_Size(__pyx_kwds);
  5297. switch (pos_args) {
  5298. case 0:
  5299. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extension_filter)) != 0)) kw_args--;
  5300. else goto __pyx_L5_argtuple_error;
  5301. case 1:
  5302. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir)) != 0)) kw_args--;
  5303. else {
  5304. __Pyx_RaiseArgtupleInvalid("list_filter_files", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5305. }
  5306. }
  5307. if (unlikely(kw_args > 0)) {
  5308. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_filter_files") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5309. }
  5310. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5311. goto __pyx_L5_argtuple_error;
  5312. } else {
  5313. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5314. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5315. }
  5316. __pyx_v_extension_filter = values[0];
  5317. __pyx_v_dir = values[1];
  5318. }
  5319. goto __pyx_L4_argument_unpacking_done;
  5320. __pyx_L5_argtuple_error:;
  5321. __Pyx_RaiseArgtupleInvalid("list_filter_files", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5322. __pyx_L3_error:;
  5323. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5324. __Pyx_RefNannyFinishContext();
  5325. return NULL;
  5326. __pyx_L4_argument_unpacking_done:;
  5327. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_34list_filter_files(__pyx_self, __pyx_v_extension_filter, __pyx_v_dir);
  5328. /* function exit code */
  5329. __Pyx_RefNannyFinishContext();
  5330. return __pyx_r;
  5331. }
  5332. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_34list_filter_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_dir) {
  5333. PyObject *__pyx_v_filenames = NULL;
  5334. PyObject *__pyx_v_e = NULL;
  5335. PyObject *__pyx_v_name = NULL;
  5336. PyObject *__pyx_r = NULL;
  5337. __Pyx_RefNannyDeclarations
  5338. PyObject *__pyx_t_1 = NULL;
  5339. PyObject *__pyx_t_2 = NULL;
  5340. PyObject *__pyx_t_3 = NULL;
  5341. PyObject *__pyx_t_4 = NULL;
  5342. PyObject *__pyx_t_5 = NULL;
  5343. int __pyx_t_6;
  5344. int __pyx_t_7;
  5345. PyObject *__pyx_t_8 = NULL;
  5346. PyObject *__pyx_t_9 = NULL;
  5347. Py_ssize_t __pyx_t_10;
  5348. PyObject *(*__pyx_t_11)(PyObject *);
  5349. PyObject *__pyx_t_12 = NULL;
  5350. int __pyx_t_13;
  5351. int __pyx_lineno = 0;
  5352. const char *__pyx_filename = NULL;
  5353. int __pyx_clineno = 0;
  5354. __Pyx_RefNannySetupContext("list_filter_files", 0);
  5355. __Pyx_INCREF(__pyx_v_extension_filter);
  5356. /* "lib/Naked/toolshed/c/system.pyx":319
  5357. * #------------------------------------------------------------------------------
  5358. * def list_filter_files(extension_filter, dir):
  5359. * try: # <<<<<<<<<<<<<<
  5360. * if not extension_filter.startswith("."):
  5361. * extension_filter = "." + extension_filter
  5362. */
  5363. {
  5364. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  5365. __Pyx_XGOTREF(__pyx_t_1);
  5366. __Pyx_XGOTREF(__pyx_t_2);
  5367. __Pyx_XGOTREF(__pyx_t_3);
  5368. /*try:*/ {
  5369. /* "lib/Naked/toolshed/c/system.pyx":320
  5370. * def list_filter_files(extension_filter, dir):
  5371. * try:
  5372. * if not extension_filter.startswith("."): # <<<<<<<<<<<<<<
  5373. * extension_filter = "." + extension_filter
  5374. * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)]
  5375. */
  5376. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_extension_filter, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5377. __Pyx_GOTREF(__pyx_t_4);
  5378. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5379. __Pyx_GOTREF(__pyx_t_5);
  5380. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5381. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5382. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5383. __pyx_t_7 = ((!__pyx_t_6) != 0);
  5384. if (__pyx_t_7) {
  5385. /* "lib/Naked/toolshed/c/system.pyx":321
  5386. * try:
  5387. * if not extension_filter.startswith("."):
  5388. * extension_filter = "." + extension_filter # <<<<<<<<<<<<<<
  5389. * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)]
  5390. * return filenames
  5391. */
  5392. __pyx_t_5 = PyNumber_Add(__pyx_kp_s__24, __pyx_v_extension_filter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5393. __Pyx_GOTREF(__pyx_t_5);
  5394. __Pyx_DECREF_SET(__pyx_v_extension_filter, __pyx_t_5);
  5395. __pyx_t_5 = 0;
  5396. goto __pyx_L11;
  5397. }
  5398. __pyx_L11:;
  5399. /* "lib/Naked/toolshed/c/system.pyx":322
  5400. * if not extension_filter.startswith("."):
  5401. * extension_filter = "." + extension_filter
  5402. * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] # <<<<<<<<<<<<<<
  5403. * return filenames
  5404. * except Exception as e:
  5405. */
  5406. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5407. __Pyx_GOTREF(__pyx_t_5);
  5408. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5409. __Pyx_GOTREF(__pyx_t_4);
  5410. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_listdir); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5411. __Pyx_GOTREF(__pyx_t_8);
  5412. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5413. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5414. __Pyx_GOTREF(__pyx_t_4);
  5415. __Pyx_INCREF(__pyx_v_dir);
  5416. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_dir);
  5417. __Pyx_GIVEREF(__pyx_v_dir);
  5418. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5419. __Pyx_GOTREF(__pyx_t_9);
  5420. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5421. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5422. if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
  5423. __pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
  5424. __pyx_t_11 = NULL;
  5425. } else {
  5426. __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5427. __Pyx_GOTREF(__pyx_t_4);
  5428. __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
  5429. }
  5430. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5431. for (;;) {
  5432. if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) {
  5433. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
  5434. #if CYTHON_COMPILING_IN_CPYTHON
  5435. __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5436. #else
  5437. __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5438. #endif
  5439. } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) {
  5440. if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  5441. #if CYTHON_COMPILING_IN_CPYTHON
  5442. __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5443. #else
  5444. __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5445. #endif
  5446. } else {
  5447. __pyx_t_9 = __pyx_t_11(__pyx_t_4);
  5448. if (unlikely(!__pyx_t_9)) {
  5449. PyObject* exc_type = PyErr_Occurred();
  5450. if (exc_type) {
  5451. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  5452. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5453. }
  5454. break;
  5455. }
  5456. __Pyx_GOTREF(__pyx_t_9);
  5457. }
  5458. __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_9);
  5459. __pyx_t_9 = 0;
  5460. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5461. __Pyx_GOTREF(__pyx_t_9);
  5462. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5463. __Pyx_GOTREF(__pyx_t_8);
  5464. __Pyx_INCREF(__pyx_v_extension_filter);
  5465. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_extension_filter);
  5466. __Pyx_GIVEREF(__pyx_v_extension_filter);
  5467. __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5468. __Pyx_GOTREF(__pyx_t_12);
  5469. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5470. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5471. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5472. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  5473. if (__pyx_t_7) {
  5474. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_v_name))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5475. goto __pyx_L14;
  5476. }
  5477. __pyx_L14:;
  5478. }
  5479. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5480. __pyx_v_filenames = ((PyObject*)__pyx_t_5);
  5481. __pyx_t_5 = 0;
  5482. /* "lib/Naked/toolshed/c/system.pyx":323
  5483. * extension_filter = "." + extension_filter
  5484. * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)]
  5485. * return filenames # <<<<<<<<<<<<<<
  5486. * except Exception as e:
  5487. * if DEBUG_FLAG:
  5488. */
  5489. __Pyx_XDECREF(__pyx_r);
  5490. __Pyx_INCREF(__pyx_v_filenames);
  5491. __pyx_r = __pyx_v_filenames;
  5492. goto __pyx_L7_try_return;
  5493. }
  5494. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  5495. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  5496. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  5497. goto __pyx_L10_try_end;
  5498. __pyx_L3_error:;
  5499. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  5500. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  5501. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  5502. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  5503. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5504. /* "lib/Naked/toolshed/c/system.pyx":324
  5505. * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)]
  5506. * return filenames
  5507. * except Exception as e: # <<<<<<<<<<<<<<
  5508. * if DEBUG_FLAG:
  5509. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).")
  5510. */
  5511. __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  5512. if (__pyx_t_13) {
  5513. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5514. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5515. __Pyx_GOTREF(__pyx_t_5);
  5516. __Pyx_GOTREF(__pyx_t_4);
  5517. __Pyx_GOTREF(__pyx_t_12);
  5518. __Pyx_INCREF(__pyx_t_4);
  5519. __pyx_v_e = __pyx_t_4;
  5520. /* "lib/Naked/toolshed/c/system.pyx":325
  5521. * return filenames
  5522. * except Exception as e:
  5523. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  5524. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).")
  5525. * raise e
  5526. */
  5527. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5528. __Pyx_GOTREF(__pyx_t_8);
  5529. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5530. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5531. if (__pyx_t_7) {
  5532. /* "lib/Naked/toolshed/c/system.pyx":326
  5533. * except Exception as e:
  5534. * if DEBUG_FLAG:
  5535. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  5536. * raise e
  5537. *
  5538. */
  5539. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5540. __Pyx_GOTREF(__pyx_t_8);
  5541. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5542. __Pyx_GOTREF(__pyx_t_9);
  5543. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5544. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5545. __Pyx_GOTREF(__pyx_t_8);
  5546. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5547. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5548. __Pyx_GOTREF(__pyx_t_9);
  5549. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5550. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5551. goto __pyx_L17;
  5552. }
  5553. __pyx_L17:;
  5554. /* "lib/Naked/toolshed/c/system.pyx":327
  5555. * if DEBUG_FLAG:
  5556. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).")
  5557. * raise e # <<<<<<<<<<<<<<
  5558. *
  5559. * #------------------------------------------------------------------------------
  5560. */
  5561. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  5562. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5563. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5564. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5565. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  5566. goto __pyx_L4_exception_handled;
  5567. }
  5568. goto __pyx_L5_except_error;
  5569. __pyx_L5_except_error:;
  5570. __Pyx_XGIVEREF(__pyx_t_1);
  5571. __Pyx_XGIVEREF(__pyx_t_2);
  5572. __Pyx_XGIVEREF(__pyx_t_3);
  5573. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  5574. goto __pyx_L1_error;
  5575. __pyx_L7_try_return:;
  5576. __Pyx_XGIVEREF(__pyx_t_1);
  5577. __Pyx_XGIVEREF(__pyx_t_2);
  5578. __Pyx_XGIVEREF(__pyx_t_3);
  5579. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  5580. goto __pyx_L0;
  5581. __pyx_L4_exception_handled:;
  5582. __Pyx_XGIVEREF(__pyx_t_1);
  5583. __Pyx_XGIVEREF(__pyx_t_2);
  5584. __Pyx_XGIVEREF(__pyx_t_3);
  5585. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  5586. __pyx_L10_try_end:;
  5587. }
  5588. /* "lib/Naked/toolshed/c/system.pyx":318
  5589. * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch
  5590. * #------------------------------------------------------------------------------
  5591. * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<<
  5592. * try:
  5593. * if not extension_filter.startswith("."):
  5594. */
  5595. /* function exit code */
  5596. __pyx_L1_error:;
  5597. __Pyx_XDECREF(__pyx_t_4);
  5598. __Pyx_XDECREF(__pyx_t_5);
  5599. __Pyx_XDECREF(__pyx_t_8);
  5600. __Pyx_XDECREF(__pyx_t_9);
  5601. __Pyx_XDECREF(__pyx_t_12);
  5602. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5603. __pyx_r = NULL;
  5604. __pyx_L0:;
  5605. __Pyx_XDECREF(__pyx_v_filenames);
  5606. __Pyx_XDECREF(__pyx_v_e);
  5607. __Pyx_XDECREF(__pyx_v_name);
  5608. __Pyx_XDECREF(__pyx_v_extension_filter);
  5609. __Pyx_XGIVEREF(__pyx_r);
  5610. __Pyx_RefNannyFinishContext();
  5611. return __pyx_r;
  5612. }
  5613. /* "lib/Naked/toolshed/c/system.pyx":338
  5614. * #------------------------------------------------------------------------------
  5615. * @currentdir_firstparam
  5616. * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<<
  5617. * try:
  5618. * return list_all_files(dir)
  5619. */
  5620. /* Python wrapper */
  5621. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5622. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd = {__Pyx_NAMESTR("list_all_files_cwd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  5623. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5624. PyObject *__pyx_v_dir = 0;
  5625. int __pyx_lineno = 0;
  5626. const char *__pyx_filename = NULL;
  5627. int __pyx_clineno = 0;
  5628. PyObject *__pyx_r = 0;
  5629. __Pyx_RefNannyDeclarations
  5630. __Pyx_RefNannySetupContext("list_all_files_cwd (wrapper)", 0);
  5631. {
  5632. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir,0};
  5633. PyObject* values[1] = {0};
  5634. values[0] = ((PyObject *)__pyx_kp_s__8);
  5635. if (unlikely(__pyx_kwds)) {
  5636. Py_ssize_t kw_args;
  5637. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5638. switch (pos_args) {
  5639. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5640. case 0: break;
  5641. default: goto __pyx_L5_argtuple_error;
  5642. }
  5643. kw_args = PyDict_Size(__pyx_kwds);
  5644. switch (pos_args) {
  5645. case 0:
  5646. if (kw_args > 0) {
  5647. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir);
  5648. if (value) { values[0] = value; kw_args--; }
  5649. }
  5650. }
  5651. if (unlikely(kw_args > 0)) {
  5652. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_all_files_cwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5653. }
  5654. } else {
  5655. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5656. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5657. case 0: break;
  5658. default: goto __pyx_L5_argtuple_error;
  5659. }
  5660. }
  5661. __pyx_v_dir = values[0];
  5662. }
  5663. goto __pyx_L4_argument_unpacking_done;
  5664. __pyx_L5_argtuple_error:;
  5665. __Pyx_RaiseArgtupleInvalid("list_all_files_cwd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5666. __pyx_L3_error:;
  5667. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5668. __Pyx_RefNannyFinishContext();
  5669. return NULL;
  5670. __pyx_L4_argument_unpacking_done:;
  5671. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_36list_all_files_cwd(__pyx_self, __pyx_v_dir);
  5672. /* function exit code */
  5673. __Pyx_RefNannyFinishContext();
  5674. return __pyx_r;
  5675. }
  5676. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_36list_all_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir) {
  5677. PyObject *__pyx_v_e = NULL;
  5678. PyObject *__pyx_r = NULL;
  5679. __Pyx_RefNannyDeclarations
  5680. PyObject *__pyx_t_1 = NULL;
  5681. PyObject *__pyx_t_2 = NULL;
  5682. PyObject *__pyx_t_3 = NULL;
  5683. PyObject *__pyx_t_4 = NULL;
  5684. PyObject *__pyx_t_5 = NULL;
  5685. PyObject *__pyx_t_6 = NULL;
  5686. int __pyx_t_7;
  5687. PyObject *__pyx_t_8 = NULL;
  5688. int __pyx_t_9;
  5689. PyObject *__pyx_t_10 = NULL;
  5690. int __pyx_lineno = 0;
  5691. const char *__pyx_filename = NULL;
  5692. int __pyx_clineno = 0;
  5693. __Pyx_RefNannySetupContext("list_all_files_cwd", 0);
  5694. /* "lib/Naked/toolshed/c/system.pyx":339
  5695. * @currentdir_firstparam
  5696. * def list_all_files_cwd(dir=""):
  5697. * try: # <<<<<<<<<<<<<<
  5698. * return list_all_files(dir)
  5699. * except Exception as e:
  5700. */
  5701. {
  5702. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  5703. __Pyx_XGOTREF(__pyx_t_1);
  5704. __Pyx_XGOTREF(__pyx_t_2);
  5705. __Pyx_XGOTREF(__pyx_t_3);
  5706. /*try:*/ {
  5707. /* "lib/Naked/toolshed/c/system.pyx":340
  5708. * def list_all_files_cwd(dir=""):
  5709. * try:
  5710. * return list_all_files(dir) # <<<<<<<<<<<<<<
  5711. * except Exception as e:
  5712. * if DEBUG_FLAG:
  5713. */
  5714. __Pyx_XDECREF(__pyx_r);
  5715. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_all_files); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5716. __Pyx_GOTREF(__pyx_t_4);
  5717. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5718. __Pyx_GOTREF(__pyx_t_5);
  5719. __Pyx_INCREF(__pyx_v_dir);
  5720. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dir);
  5721. __Pyx_GIVEREF(__pyx_v_dir);
  5722. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5723. __Pyx_GOTREF(__pyx_t_6);
  5724. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5725. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5726. __pyx_r = __pyx_t_6;
  5727. __pyx_t_6 = 0;
  5728. goto __pyx_L7_try_return;
  5729. }
  5730. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  5731. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  5732. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  5733. goto __pyx_L10_try_end;
  5734. __pyx_L3_error:;
  5735. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  5736. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5737. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  5738. /* "lib/Naked/toolshed/c/system.pyx":341
  5739. * try:
  5740. * return list_all_files(dir)
  5741. * except Exception as e: # <<<<<<<<<<<<<<
  5742. * if DEBUG_FLAG:
  5743. * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).")
  5744. */
  5745. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  5746. if (__pyx_t_7) {
  5747. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5748. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5749. __Pyx_GOTREF(__pyx_t_6);
  5750. __Pyx_GOTREF(__pyx_t_5);
  5751. __Pyx_GOTREF(__pyx_t_4);
  5752. __Pyx_INCREF(__pyx_t_5);
  5753. __pyx_v_e = __pyx_t_5;
  5754. /* "lib/Naked/toolshed/c/system.pyx":342
  5755. * return list_all_files(dir)
  5756. * except Exception as e:
  5757. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  5758. * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).")
  5759. * raise e
  5760. */
  5761. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5762. __Pyx_GOTREF(__pyx_t_8);
  5763. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5764. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5765. if (__pyx_t_9) {
  5766. /* "lib/Naked/toolshed/c/system.pyx":343
  5767. * except Exception as e:
  5768. * if DEBUG_FLAG:
  5769. * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  5770. * raise e
  5771. *
  5772. */
  5773. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5774. __Pyx_GOTREF(__pyx_t_8);
  5775. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5776. __Pyx_GOTREF(__pyx_t_10);
  5777. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5778. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5779. __Pyx_GOTREF(__pyx_t_8);
  5780. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  5781. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5782. __Pyx_GOTREF(__pyx_t_10);
  5783. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5784. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  5785. goto __pyx_L13;
  5786. }
  5787. __pyx_L13:;
  5788. /* "lib/Naked/toolshed/c/system.pyx":344
  5789. * if DEBUG_FLAG:
  5790. * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).")
  5791. * raise e # <<<<<<<<<<<<<<
  5792. *
  5793. * #------------------------------------------------------------------------------
  5794. */
  5795. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  5796. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5797. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  5798. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5799. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5800. goto __pyx_L4_exception_handled;
  5801. }
  5802. goto __pyx_L5_except_error;
  5803. __pyx_L5_except_error:;
  5804. __Pyx_XGIVEREF(__pyx_t_1);
  5805. __Pyx_XGIVEREF(__pyx_t_2);
  5806. __Pyx_XGIVEREF(__pyx_t_3);
  5807. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  5808. goto __pyx_L1_error;
  5809. __pyx_L7_try_return:;
  5810. __Pyx_XGIVEREF(__pyx_t_1);
  5811. __Pyx_XGIVEREF(__pyx_t_2);
  5812. __Pyx_XGIVEREF(__pyx_t_3);
  5813. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  5814. goto __pyx_L0;
  5815. __pyx_L4_exception_handled:;
  5816. __Pyx_XGIVEREF(__pyx_t_1);
  5817. __Pyx_XGIVEREF(__pyx_t_2);
  5818. __Pyx_XGIVEREF(__pyx_t_3);
  5819. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  5820. __pyx_L10_try_end:;
  5821. }
  5822. /* "lib/Naked/toolshed/c/system.pyx":338
  5823. * #------------------------------------------------------------------------------
  5824. * @currentdir_firstparam
  5825. * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<<
  5826. * try:
  5827. * return list_all_files(dir)
  5828. */
  5829. /* function exit code */
  5830. __pyx_L1_error:;
  5831. __Pyx_XDECREF(__pyx_t_4);
  5832. __Pyx_XDECREF(__pyx_t_5);
  5833. __Pyx_XDECREF(__pyx_t_6);
  5834. __Pyx_XDECREF(__pyx_t_8);
  5835. __Pyx_XDECREF(__pyx_t_10);
  5836. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5837. __pyx_r = NULL;
  5838. __pyx_L0:;
  5839. __Pyx_XDECREF(__pyx_v_e);
  5840. __Pyx_XGIVEREF(__pyx_r);
  5841. __Pyx_RefNannyFinishContext();
  5842. return __pyx_r;
  5843. }
  5844. /* "lib/Naked/toolshed/c/system.pyx":355
  5845. * #------------------------------------------------------------------------------
  5846. * @currentdir_lastparam
  5847. * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<<
  5848. * try:
  5849. * return list_filter_files(extension_filter, current_dir)
  5850. */
  5851. /* Python wrapper */
  5852. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5853. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd = {__Pyx_NAMESTR("list_filter_files_cwd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  5854. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5855. PyObject *__pyx_v_extension_filter = 0;
  5856. PyObject *__pyx_v_current_dir = 0;
  5857. int __pyx_lineno = 0;
  5858. const char *__pyx_filename = NULL;
  5859. int __pyx_clineno = 0;
  5860. PyObject *__pyx_r = 0;
  5861. __Pyx_RefNannyDeclarations
  5862. __Pyx_RefNannySetupContext("list_filter_files_cwd (wrapper)", 0);
  5863. {
  5864. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_extension_filter,&__pyx_n_s_current_dir,0};
  5865. PyObject* values[2] = {0,0};
  5866. values[1] = ((PyObject *)__pyx_kp_s__8);
  5867. if (unlikely(__pyx_kwds)) {
  5868. Py_ssize_t kw_args;
  5869. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5870. switch (pos_args) {
  5871. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5872. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5873. case 0: break;
  5874. default: goto __pyx_L5_argtuple_error;
  5875. }
  5876. kw_args = PyDict_Size(__pyx_kwds);
  5877. switch (pos_args) {
  5878. case 0:
  5879. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extension_filter)) != 0)) kw_args--;
  5880. else goto __pyx_L5_argtuple_error;
  5881. case 1:
  5882. if (kw_args > 0) {
  5883. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_current_dir);
  5884. if (value) { values[1] = value; kw_args--; }
  5885. }
  5886. }
  5887. if (unlikely(kw_args > 0)) {
  5888. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_filter_files_cwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5889. }
  5890. } else {
  5891. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5892. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5893. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5894. break;
  5895. default: goto __pyx_L5_argtuple_error;
  5896. }
  5897. }
  5898. __pyx_v_extension_filter = values[0];
  5899. __pyx_v_current_dir = values[1];
  5900. }
  5901. goto __pyx_L4_argument_unpacking_done;
  5902. __pyx_L5_argtuple_error:;
  5903. __Pyx_RaiseArgtupleInvalid("list_filter_files_cwd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5904. __pyx_L3_error:;
  5905. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5906. __Pyx_RefNannyFinishContext();
  5907. return NULL;
  5908. __pyx_L4_argument_unpacking_done:;
  5909. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_38list_filter_files_cwd(__pyx_self, __pyx_v_extension_filter, __pyx_v_current_dir);
  5910. /* function exit code */
  5911. __Pyx_RefNannyFinishContext();
  5912. return __pyx_r;
  5913. }
  5914. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_38list_filter_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_current_dir) {
  5915. PyObject *__pyx_v_e = NULL;
  5916. PyObject *__pyx_r = NULL;
  5917. __Pyx_RefNannyDeclarations
  5918. PyObject *__pyx_t_1 = NULL;
  5919. PyObject *__pyx_t_2 = NULL;
  5920. PyObject *__pyx_t_3 = NULL;
  5921. PyObject *__pyx_t_4 = NULL;
  5922. PyObject *__pyx_t_5 = NULL;
  5923. PyObject *__pyx_t_6 = NULL;
  5924. int __pyx_t_7;
  5925. PyObject *__pyx_t_8 = NULL;
  5926. int __pyx_t_9;
  5927. PyObject *__pyx_t_10 = NULL;
  5928. int __pyx_lineno = 0;
  5929. const char *__pyx_filename = NULL;
  5930. int __pyx_clineno = 0;
  5931. __Pyx_RefNannySetupContext("list_filter_files_cwd", 0);
  5932. /* "lib/Naked/toolshed/c/system.pyx":356
  5933. * @currentdir_lastparam
  5934. * def list_filter_files_cwd(extension_filter, current_dir=""):
  5935. * try: # <<<<<<<<<<<<<<
  5936. * return list_filter_files(extension_filter, current_dir)
  5937. * except Exception as e:
  5938. */
  5939. {
  5940. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  5941. __Pyx_XGOTREF(__pyx_t_1);
  5942. __Pyx_XGOTREF(__pyx_t_2);
  5943. __Pyx_XGOTREF(__pyx_t_3);
  5944. /*try:*/ {
  5945. /* "lib/Naked/toolshed/c/system.pyx":357
  5946. * def list_filter_files_cwd(extension_filter, current_dir=""):
  5947. * try:
  5948. * return list_filter_files(extension_filter, current_dir) # <<<<<<<<<<<<<<
  5949. * except Exception as e:
  5950. * if DEBUG_FLAG:
  5951. */
  5952. __Pyx_XDECREF(__pyx_r);
  5953. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_filter_files); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5954. __Pyx_GOTREF(__pyx_t_4);
  5955. __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5956. __Pyx_GOTREF(__pyx_t_5);
  5957. __Pyx_INCREF(__pyx_v_extension_filter);
  5958. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_extension_filter);
  5959. __Pyx_GIVEREF(__pyx_v_extension_filter);
  5960. __Pyx_INCREF(__pyx_v_current_dir);
  5961. PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_current_dir);
  5962. __Pyx_GIVEREF(__pyx_v_current_dir);
  5963. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5964. __Pyx_GOTREF(__pyx_t_6);
  5965. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5966. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5967. __pyx_r = __pyx_t_6;
  5968. __pyx_t_6 = 0;
  5969. goto __pyx_L7_try_return;
  5970. }
  5971. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  5972. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  5973. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  5974. goto __pyx_L10_try_end;
  5975. __pyx_L3_error:;
  5976. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  5977. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5978. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  5979. /* "lib/Naked/toolshed/c/system.pyx":358
  5980. * try:
  5981. * return list_filter_files(extension_filter, current_dir)
  5982. * except Exception as e: # <<<<<<<<<<<<<<
  5983. * if DEBUG_FLAG:
  5984. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).")
  5985. */
  5986. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  5987. if (__pyx_t_7) {
  5988. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5989. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  5990. __Pyx_GOTREF(__pyx_t_6);
  5991. __Pyx_GOTREF(__pyx_t_5);
  5992. __Pyx_GOTREF(__pyx_t_4);
  5993. __Pyx_INCREF(__pyx_t_5);
  5994. __pyx_v_e = __pyx_t_5;
  5995. /* "lib/Naked/toolshed/c/system.pyx":359
  5996. * return list_filter_files(extension_filter, current_dir)
  5997. * except Exception as e:
  5998. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  5999. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).")
  6000. * raise e
  6001. */
  6002. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6003. __Pyx_GOTREF(__pyx_t_8);
  6004. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6005. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6006. if (__pyx_t_9) {
  6007. /* "lib/Naked/toolshed/c/system.pyx":360
  6008. * except Exception as e:
  6009. * if DEBUG_FLAG:
  6010. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  6011. * raise e
  6012. *
  6013. */
  6014. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6015. __Pyx_GOTREF(__pyx_t_8);
  6016. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6017. __Pyx_GOTREF(__pyx_t_10);
  6018. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6019. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6020. __Pyx_GOTREF(__pyx_t_8);
  6021. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  6022. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6023. __Pyx_GOTREF(__pyx_t_10);
  6024. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6025. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  6026. goto __pyx_L13;
  6027. }
  6028. __pyx_L13:;
  6029. /* "lib/Naked/toolshed/c/system.pyx":361
  6030. * if DEBUG_FLAG:
  6031. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).")
  6032. * raise e # <<<<<<<<<<<<<<
  6033. *
  6034. *
  6035. */
  6036. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  6037. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6038. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  6039. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6040. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6041. goto __pyx_L4_exception_handled;
  6042. }
  6043. goto __pyx_L5_except_error;
  6044. __pyx_L5_except_error:;
  6045. __Pyx_XGIVEREF(__pyx_t_1);
  6046. __Pyx_XGIVEREF(__pyx_t_2);
  6047. __Pyx_XGIVEREF(__pyx_t_3);
  6048. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6049. goto __pyx_L1_error;
  6050. __pyx_L7_try_return:;
  6051. __Pyx_XGIVEREF(__pyx_t_1);
  6052. __Pyx_XGIVEREF(__pyx_t_2);
  6053. __Pyx_XGIVEREF(__pyx_t_3);
  6054. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6055. goto __pyx_L0;
  6056. __pyx_L4_exception_handled:;
  6057. __Pyx_XGIVEREF(__pyx_t_1);
  6058. __Pyx_XGIVEREF(__pyx_t_2);
  6059. __Pyx_XGIVEREF(__pyx_t_3);
  6060. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6061. __pyx_L10_try_end:;
  6062. }
  6063. /* "lib/Naked/toolshed/c/system.pyx":355
  6064. * #------------------------------------------------------------------------------
  6065. * @currentdir_lastparam
  6066. * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<<
  6067. * try:
  6068. * return list_filter_files(extension_filter, current_dir)
  6069. */
  6070. /* function exit code */
  6071. __pyx_L1_error:;
  6072. __Pyx_XDECREF(__pyx_t_4);
  6073. __Pyx_XDECREF(__pyx_t_5);
  6074. __Pyx_XDECREF(__pyx_t_6);
  6075. __Pyx_XDECREF(__pyx_t_8);
  6076. __Pyx_XDECREF(__pyx_t_10);
  6077. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6078. __pyx_r = NULL;
  6079. __pyx_L0:;
  6080. __Pyx_XDECREF(__pyx_v_e);
  6081. __Pyx_XGIVEREF(__pyx_r);
  6082. __Pyx_RefNannyFinishContext();
  6083. return __pyx_r;
  6084. }
  6085. /* "lib/Naked/toolshed/c/system.pyx":373
  6086. * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath
  6087. * #------------------------------------------------------------------------------
  6088. * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<<
  6089. * try:
  6090. * from glob import glob
  6091. */
  6092. /* Python wrapper */
  6093. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_41list_match_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6094. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_41list_match_files = {__Pyx_NAMESTR("list_match_files"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_41list_match_files, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  6095. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_41list_match_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6096. PyObject *__pyx_v_match_pattern = 0;
  6097. PyObject *__pyx_v_full_path = 0;
  6098. int __pyx_lineno = 0;
  6099. const char *__pyx_filename = NULL;
  6100. int __pyx_clineno = 0;
  6101. PyObject *__pyx_r = 0;
  6102. __Pyx_RefNannyDeclarations
  6103. __Pyx_RefNannySetupContext("list_match_files (wrapper)", 0);
  6104. {
  6105. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_match_pattern,&__pyx_n_s_full_path,0};
  6106. PyObject* values[2] = {0,0};
  6107. values[1] = ((PyObject *)Py_False);
  6108. if (unlikely(__pyx_kwds)) {
  6109. Py_ssize_t kw_args;
  6110. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6111. switch (pos_args) {
  6112. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6113. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6114. case 0: break;
  6115. default: goto __pyx_L5_argtuple_error;
  6116. }
  6117. kw_args = PyDict_Size(__pyx_kwds);
  6118. switch (pos_args) {
  6119. case 0:
  6120. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_match_pattern)) != 0)) kw_args--;
  6121. else goto __pyx_L5_argtuple_error;
  6122. case 1:
  6123. if (kw_args > 0) {
  6124. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_full_path);
  6125. if (value) { values[1] = value; kw_args--; }
  6126. }
  6127. }
  6128. if (unlikely(kw_args > 0)) {
  6129. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_match_files") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6130. }
  6131. } else {
  6132. switch (PyTuple_GET_SIZE(__pyx_args)) {
  6133. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6134. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6135. break;
  6136. default: goto __pyx_L5_argtuple_error;
  6137. }
  6138. }
  6139. __pyx_v_match_pattern = values[0];
  6140. __pyx_v_full_path = values[1];
  6141. }
  6142. goto __pyx_L4_argument_unpacking_done;
  6143. __pyx_L5_argtuple_error:;
  6144. __Pyx_RaiseArgtupleInvalid("list_match_files", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6145. __pyx_L3_error:;
  6146. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_match_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6147. __Pyx_RefNannyFinishContext();
  6148. return NULL;
  6149. __pyx_L4_argument_unpacking_done:;
  6150. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_40list_match_files(__pyx_self, __pyx_v_match_pattern, __pyx_v_full_path);
  6151. /* function exit code */
  6152. __Pyx_RefNannyFinishContext();
  6153. return __pyx_r;
  6154. }
  6155. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_40list_match_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_match_pattern, PyObject *__pyx_v_full_path) {
  6156. PyObject *__pyx_v_glob = NULL;
  6157. PyObject *__pyx_v_filenames = NULL;
  6158. PyObject *__pyx_v_filenames_fullpath = NULL;
  6159. PyObject *__pyx_v_cwd = NULL;
  6160. PyObject *__pyx_v_name = NULL;
  6161. PyObject *__pyx_v_e = NULL;
  6162. PyObject *__pyx_r = NULL;
  6163. __Pyx_RefNannyDeclarations
  6164. PyObject *__pyx_t_1 = NULL;
  6165. PyObject *__pyx_t_2 = NULL;
  6166. PyObject *__pyx_t_3 = NULL;
  6167. PyObject *__pyx_t_4 = NULL;
  6168. PyObject *__pyx_t_5 = NULL;
  6169. int __pyx_t_6;
  6170. Py_ssize_t __pyx_t_7;
  6171. PyObject *(*__pyx_t_8)(PyObject *);
  6172. PyObject *__pyx_t_9 = NULL;
  6173. PyObject *__pyx_t_10 = NULL;
  6174. int __pyx_t_11;
  6175. int __pyx_t_12;
  6176. PyObject *__pyx_t_13 = NULL;
  6177. int __pyx_lineno = 0;
  6178. const char *__pyx_filename = NULL;
  6179. int __pyx_clineno = 0;
  6180. __Pyx_RefNannySetupContext("list_match_files", 0);
  6181. /* "lib/Naked/toolshed/c/system.pyx":374
  6182. * #------------------------------------------------------------------------------
  6183. * def list_match_files(match_pattern, full_path = False):
  6184. * try: # <<<<<<<<<<<<<<
  6185. * from glob import glob
  6186. * filenames = glob(match_pattern)
  6187. */
  6188. {
  6189. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  6190. __Pyx_XGOTREF(__pyx_t_1);
  6191. __Pyx_XGOTREF(__pyx_t_2);
  6192. __Pyx_XGOTREF(__pyx_t_3);
  6193. /*try:*/ {
  6194. /* "lib/Naked/toolshed/c/system.pyx":375
  6195. * def list_match_files(match_pattern, full_path = False):
  6196. * try:
  6197. * from glob import glob # <<<<<<<<<<<<<<
  6198. * filenames = glob(match_pattern)
  6199. * if full_path:
  6200. */
  6201. __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6202. __Pyx_GOTREF(__pyx_t_4);
  6203. __Pyx_INCREF(__pyx_n_s_glob);
  6204. PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_glob);
  6205. __Pyx_GIVEREF(__pyx_n_s_glob);
  6206. __pyx_t_5 = __Pyx_Import(__pyx_n_s_glob, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6207. __Pyx_GOTREF(__pyx_t_5);
  6208. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6209. __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_glob); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6210. __Pyx_GOTREF(__pyx_t_4);
  6211. __Pyx_INCREF(__pyx_t_4);
  6212. __pyx_v_glob = __pyx_t_4;
  6213. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6214. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6215. /* "lib/Naked/toolshed/c/system.pyx":376
  6216. * try:
  6217. * from glob import glob
  6218. * filenames = glob(match_pattern) # <<<<<<<<<<<<<<
  6219. * if full_path:
  6220. * filenames_fullpath = []
  6221. */
  6222. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6223. __Pyx_GOTREF(__pyx_t_5);
  6224. __Pyx_INCREF(__pyx_v_match_pattern);
  6225. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_match_pattern);
  6226. __Pyx_GIVEREF(__pyx_v_match_pattern);
  6227. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_glob, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6228. __Pyx_GOTREF(__pyx_t_4);
  6229. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6230. __pyx_v_filenames = __pyx_t_4;
  6231. __pyx_t_4 = 0;
  6232. /* "lib/Naked/toolshed/c/system.pyx":377
  6233. * from glob import glob
  6234. * filenames = glob(match_pattern)
  6235. * if full_path: # <<<<<<<<<<<<<<
  6236. * filenames_fullpath = []
  6237. * cwd = os.getcwd()
  6238. */
  6239. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_full_path); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6240. if (__pyx_t_6) {
  6241. /* "lib/Naked/toolshed/c/system.pyx":378
  6242. * filenames = glob(match_pattern)
  6243. * if full_path:
  6244. * filenames_fullpath = [] # <<<<<<<<<<<<<<
  6245. * cwd = os.getcwd()
  6246. * for name in filenames:
  6247. */
  6248. __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6249. __Pyx_GOTREF(__pyx_t_4);
  6250. __pyx_v_filenames_fullpath = ((PyObject*)__pyx_t_4);
  6251. __pyx_t_4 = 0;
  6252. /* "lib/Naked/toolshed/c/system.pyx":379
  6253. * if full_path:
  6254. * filenames_fullpath = []
  6255. * cwd = os.getcwd() # <<<<<<<<<<<<<<
  6256. * for name in filenames:
  6257. * name = os.path.join(cwd, name) #make the full path to the file
  6258. */
  6259. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6260. __Pyx_GOTREF(__pyx_t_4);
  6261. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6262. __Pyx_GOTREF(__pyx_t_5);
  6263. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6264. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6265. __Pyx_GOTREF(__pyx_t_4);
  6266. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6267. __pyx_v_cwd = __pyx_t_4;
  6268. __pyx_t_4 = 0;
  6269. /* "lib/Naked/toolshed/c/system.pyx":380
  6270. * filenames_fullpath = []
  6271. * cwd = os.getcwd()
  6272. * for name in filenames: # <<<<<<<<<<<<<<
  6273. * name = os.path.join(cwd, name) #make the full path to the file
  6274. * filenames_fullpath.append(name) #add to the new list
  6275. */
  6276. if (PyList_CheckExact(__pyx_v_filenames) || PyTuple_CheckExact(__pyx_v_filenames)) {
  6277. __pyx_t_4 = __pyx_v_filenames; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
  6278. __pyx_t_8 = NULL;
  6279. } else {
  6280. __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_filenames); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6281. __Pyx_GOTREF(__pyx_t_4);
  6282. __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext;
  6283. }
  6284. for (;;) {
  6285. if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) {
  6286. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
  6287. #if CYTHON_COMPILING_IN_CPYTHON
  6288. __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6289. #else
  6290. __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6291. #endif
  6292. } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) {
  6293. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  6294. #if CYTHON_COMPILING_IN_CPYTHON
  6295. __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6296. #else
  6297. __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6298. #endif
  6299. } else {
  6300. __pyx_t_5 = __pyx_t_8(__pyx_t_4);
  6301. if (unlikely(!__pyx_t_5)) {
  6302. PyObject* exc_type = PyErr_Occurred();
  6303. if (exc_type) {
  6304. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  6305. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6306. }
  6307. break;
  6308. }
  6309. __Pyx_GOTREF(__pyx_t_5);
  6310. }
  6311. __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
  6312. __pyx_t_5 = 0;
  6313. /* "lib/Naked/toolshed/c/system.pyx":381
  6314. * cwd = os.getcwd()
  6315. * for name in filenames:
  6316. * name = os.path.join(cwd, name) #make the full path to the file # <<<<<<<<<<<<<<
  6317. * filenames_fullpath.append(name) #add to the new list
  6318. * return filenames_fullpath #then return that list
  6319. */
  6320. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6321. __Pyx_GOTREF(__pyx_t_5);
  6322. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6323. __Pyx_GOTREF(__pyx_t_9);
  6324. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6325. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6326. __Pyx_GOTREF(__pyx_t_5);
  6327. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6328. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6329. __Pyx_GOTREF(__pyx_t_9);
  6330. __Pyx_INCREF(__pyx_v_cwd);
  6331. PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_cwd);
  6332. __Pyx_GIVEREF(__pyx_v_cwd);
  6333. __Pyx_INCREF(__pyx_v_name);
  6334. PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_name);
  6335. __Pyx_GIVEREF(__pyx_v_name);
  6336. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6337. __Pyx_GOTREF(__pyx_t_10);
  6338. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6339. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6340. __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_10);
  6341. __pyx_t_10 = 0;
  6342. /* "lib/Naked/toolshed/c/system.pyx":382
  6343. * for name in filenames:
  6344. * name = os.path.join(cwd, name) #make the full path to the file
  6345. * filenames_fullpath.append(name) #add to the new list # <<<<<<<<<<<<<<
  6346. * return filenames_fullpath #then return that list
  6347. * else:
  6348. */
  6349. __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_filenames_fullpath, __pyx_v_name); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6350. }
  6351. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6352. /* "lib/Naked/toolshed/c/system.pyx":383
  6353. * name = os.path.join(cwd, name) #make the full path to the file
  6354. * filenames_fullpath.append(name) #add to the new list
  6355. * return filenames_fullpath #then return that list # <<<<<<<<<<<<<<
  6356. * else:
  6357. * return filenames
  6358. */
  6359. __Pyx_XDECREF(__pyx_r);
  6360. __Pyx_INCREF(__pyx_v_filenames_fullpath);
  6361. __pyx_r = __pyx_v_filenames_fullpath;
  6362. goto __pyx_L7_try_return;
  6363. }
  6364. /*else*/ {
  6365. /* "lib/Naked/toolshed/c/system.pyx":385
  6366. * return filenames_fullpath #then return that list
  6367. * else:
  6368. * return filenames # <<<<<<<<<<<<<<
  6369. * except Exception as e:
  6370. * if DEBUG_FLAG:
  6371. */
  6372. __Pyx_XDECREF(__pyx_r);
  6373. __Pyx_INCREF(__pyx_v_filenames);
  6374. __pyx_r = __pyx_v_filenames;
  6375. goto __pyx_L7_try_return;
  6376. }
  6377. }
  6378. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  6379. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  6380. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  6381. goto __pyx_L10_try_end;
  6382. __pyx_L3_error:;
  6383. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  6384. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  6385. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  6386. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  6387. /* "lib/Naked/toolshed/c/system.pyx":386
  6388. * else:
  6389. * return filenames
  6390. * except Exception as e: # <<<<<<<<<<<<<<
  6391. * if DEBUG_FLAG:
  6392. * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).")
  6393. */
  6394. __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  6395. if (__pyx_t_12) {
  6396. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_match_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6397. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6398. __Pyx_GOTREF(__pyx_t_4);
  6399. __Pyx_GOTREF(__pyx_t_10);
  6400. __Pyx_GOTREF(__pyx_t_9);
  6401. __Pyx_INCREF(__pyx_t_10);
  6402. __pyx_v_e = __pyx_t_10;
  6403. /* "lib/Naked/toolshed/c/system.pyx":387
  6404. * return filenames
  6405. * except Exception as e:
  6406. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  6407. * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).")
  6408. * raise e
  6409. */
  6410. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6411. __Pyx_GOTREF(__pyx_t_5);
  6412. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6413. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6414. if (__pyx_t_6) {
  6415. /* "lib/Naked/toolshed/c/system.pyx":388
  6416. * except Exception as e:
  6417. * if DEBUG_FLAG:
  6418. * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  6419. * raise e
  6420. *
  6421. */
  6422. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6423. __Pyx_GOTREF(__pyx_t_5);
  6424. __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 = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6425. __Pyx_GOTREF(__pyx_t_13);
  6426. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6427. __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 = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6428. __Pyx_GOTREF(__pyx_t_5);
  6429. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  6430. __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6431. __Pyx_GOTREF(__pyx_t_13);
  6432. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6433. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  6434. goto __pyx_L16;
  6435. }
  6436. __pyx_L16:;
  6437. /* "lib/Naked/toolshed/c/system.pyx":389
  6438. * if DEBUG_FLAG:
  6439. * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).")
  6440. * raise e # <<<<<<<<<<<<<<
  6441. *
  6442. * #------------------------------------------------------------------------------
  6443. */
  6444. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  6445. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6446. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6447. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  6448. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6449. goto __pyx_L4_exception_handled;
  6450. }
  6451. goto __pyx_L5_except_error;
  6452. __pyx_L5_except_error:;
  6453. __Pyx_XGIVEREF(__pyx_t_1);
  6454. __Pyx_XGIVEREF(__pyx_t_2);
  6455. __Pyx_XGIVEREF(__pyx_t_3);
  6456. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6457. goto __pyx_L1_error;
  6458. __pyx_L7_try_return:;
  6459. __Pyx_XGIVEREF(__pyx_t_1);
  6460. __Pyx_XGIVEREF(__pyx_t_2);
  6461. __Pyx_XGIVEREF(__pyx_t_3);
  6462. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6463. goto __pyx_L0;
  6464. __pyx_L4_exception_handled:;
  6465. __Pyx_XGIVEREF(__pyx_t_1);
  6466. __Pyx_XGIVEREF(__pyx_t_2);
  6467. __Pyx_XGIVEREF(__pyx_t_3);
  6468. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6469. __pyx_L10_try_end:;
  6470. }
  6471. /* "lib/Naked/toolshed/c/system.pyx":373
  6472. * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath
  6473. * #------------------------------------------------------------------------------
  6474. * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<<
  6475. * try:
  6476. * from glob import glob
  6477. */
  6478. /* function exit code */
  6479. __pyx_L1_error:;
  6480. __Pyx_XDECREF(__pyx_t_4);
  6481. __Pyx_XDECREF(__pyx_t_5);
  6482. __Pyx_XDECREF(__pyx_t_9);
  6483. __Pyx_XDECREF(__pyx_t_10);
  6484. __Pyx_XDECREF(__pyx_t_13);
  6485. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_match_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6486. __pyx_r = NULL;
  6487. __pyx_L0:;
  6488. __Pyx_XDECREF(__pyx_v_glob);
  6489. __Pyx_XDECREF(__pyx_v_filenames);
  6490. __Pyx_XDECREF(__pyx_v_filenames_fullpath);
  6491. __Pyx_XDECREF(__pyx_v_cwd);
  6492. __Pyx_XDECREF(__pyx_v_name);
  6493. __Pyx_XDECREF(__pyx_v_e);
  6494. __Pyx_XGIVEREF(__pyx_r);
  6495. __Pyx_RefNannyFinishContext();
  6496. return __pyx_r;
  6497. }
  6498. /* "lib/Naked/toolshed/c/system.pyx":401
  6499. * # return boolean indicating whether the path is a symbolic link
  6500. * #------------------------------------------------------------------------------
  6501. * def is_link(filepath): # <<<<<<<<<<<<<<
  6502. * try:
  6503. * return os.path.islink(filepath)
  6504. */
  6505. /* Python wrapper */
  6506. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_43is_link(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/
  6507. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_43is_link = {__Pyx_NAMESTR("is_link"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_43is_link, METH_O, __Pyx_DOCSTR(0)};
  6508. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_43is_link(PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  6509. PyObject *__pyx_r = 0;
  6510. __Pyx_RefNannyDeclarations
  6511. __Pyx_RefNannySetupContext("is_link (wrapper)", 0);
  6512. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_42is_link(__pyx_self, ((PyObject *)__pyx_v_filepath));
  6513. /* function exit code */
  6514. __Pyx_RefNannyFinishContext();
  6515. return __pyx_r;
  6516. }
  6517. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_42is_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  6518. PyObject *__pyx_v_e = NULL;
  6519. PyObject *__pyx_r = NULL;
  6520. __Pyx_RefNannyDeclarations
  6521. PyObject *__pyx_t_1 = NULL;
  6522. PyObject *__pyx_t_2 = NULL;
  6523. PyObject *__pyx_t_3 = NULL;
  6524. PyObject *__pyx_t_4 = NULL;
  6525. PyObject *__pyx_t_5 = NULL;
  6526. PyObject *__pyx_t_6 = NULL;
  6527. int __pyx_t_7;
  6528. PyObject *__pyx_t_8 = NULL;
  6529. int __pyx_t_9;
  6530. PyObject *__pyx_t_10 = NULL;
  6531. int __pyx_lineno = 0;
  6532. const char *__pyx_filename = NULL;
  6533. int __pyx_clineno = 0;
  6534. __Pyx_RefNannySetupContext("is_link", 0);
  6535. /* "lib/Naked/toolshed/c/system.pyx":402
  6536. * #------------------------------------------------------------------------------
  6537. * def is_link(filepath):
  6538. * try: # <<<<<<<<<<<<<<
  6539. * return os.path.islink(filepath)
  6540. * except Exception as e:
  6541. */
  6542. {
  6543. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  6544. __Pyx_XGOTREF(__pyx_t_1);
  6545. __Pyx_XGOTREF(__pyx_t_2);
  6546. __Pyx_XGOTREF(__pyx_t_3);
  6547. /*try:*/ {
  6548. /* "lib/Naked/toolshed/c/system.pyx":403
  6549. * def is_link(filepath):
  6550. * try:
  6551. * return os.path.islink(filepath) # <<<<<<<<<<<<<<
  6552. * except Exception as e:
  6553. * if DEBUG_FLAG:
  6554. */
  6555. __Pyx_XDECREF(__pyx_r);
  6556. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6557. __Pyx_GOTREF(__pyx_t_4);
  6558. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6559. __Pyx_GOTREF(__pyx_t_5);
  6560. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6561. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_islink); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6562. __Pyx_GOTREF(__pyx_t_4);
  6563. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6564. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6565. __Pyx_GOTREF(__pyx_t_5);
  6566. __Pyx_INCREF(__pyx_v_filepath);
  6567. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath);
  6568. __Pyx_GIVEREF(__pyx_v_filepath);
  6569. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6570. __Pyx_GOTREF(__pyx_t_6);
  6571. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6572. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6573. __pyx_r = __pyx_t_6;
  6574. __pyx_t_6 = 0;
  6575. goto __pyx_L7_try_return;
  6576. }
  6577. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  6578. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  6579. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  6580. goto __pyx_L10_try_end;
  6581. __pyx_L3_error:;
  6582. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  6583. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  6584. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  6585. /* "lib/Naked/toolshed/c/system.pyx":404
  6586. * try:
  6587. * return os.path.islink(filepath)
  6588. * except Exception as e: # <<<<<<<<<<<<<<
  6589. * if DEBUG_FLAG:
  6590. * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).")
  6591. */
  6592. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  6593. if (__pyx_t_7) {
  6594. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_link", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6595. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6596. __Pyx_GOTREF(__pyx_t_6);
  6597. __Pyx_GOTREF(__pyx_t_5);
  6598. __Pyx_GOTREF(__pyx_t_4);
  6599. __Pyx_INCREF(__pyx_t_5);
  6600. __pyx_v_e = __pyx_t_5;
  6601. /* "lib/Naked/toolshed/c/system.pyx":405
  6602. * return os.path.islink(filepath)
  6603. * except Exception as e:
  6604. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  6605. * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).")
  6606. * raise e
  6607. */
  6608. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6609. __Pyx_GOTREF(__pyx_t_8);
  6610. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6611. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6612. if (__pyx_t_9) {
  6613. /* "lib/Naked/toolshed/c/system.pyx":406
  6614. * except Exception as e:
  6615. * if DEBUG_FLAG:
  6616. * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  6617. * raise e
  6618. *
  6619. */
  6620. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6621. __Pyx_GOTREF(__pyx_t_8);
  6622. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6623. __Pyx_GOTREF(__pyx_t_10);
  6624. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6625. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6626. __Pyx_GOTREF(__pyx_t_8);
  6627. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  6628. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6629. __Pyx_GOTREF(__pyx_t_10);
  6630. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6631. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  6632. goto __pyx_L13;
  6633. }
  6634. __pyx_L13:;
  6635. /* "lib/Naked/toolshed/c/system.pyx":407
  6636. * if DEBUG_FLAG:
  6637. * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).")
  6638. * raise e # <<<<<<<<<<<<<<
  6639. *
  6640. * #------------------------------------------------------------------------------
  6641. */
  6642. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  6643. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6644. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  6645. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6646. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6647. goto __pyx_L4_exception_handled;
  6648. }
  6649. goto __pyx_L5_except_error;
  6650. __pyx_L5_except_error:;
  6651. __Pyx_XGIVEREF(__pyx_t_1);
  6652. __Pyx_XGIVEREF(__pyx_t_2);
  6653. __Pyx_XGIVEREF(__pyx_t_3);
  6654. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6655. goto __pyx_L1_error;
  6656. __pyx_L7_try_return:;
  6657. __Pyx_XGIVEREF(__pyx_t_1);
  6658. __Pyx_XGIVEREF(__pyx_t_2);
  6659. __Pyx_XGIVEREF(__pyx_t_3);
  6660. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6661. goto __pyx_L0;
  6662. __pyx_L4_exception_handled:;
  6663. __Pyx_XGIVEREF(__pyx_t_1);
  6664. __Pyx_XGIVEREF(__pyx_t_2);
  6665. __Pyx_XGIVEREF(__pyx_t_3);
  6666. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6667. __pyx_L10_try_end:;
  6668. }
  6669. /* "lib/Naked/toolshed/c/system.pyx":401
  6670. * # return boolean indicating whether the path is a symbolic link
  6671. * #------------------------------------------------------------------------------
  6672. * def is_link(filepath): # <<<<<<<<<<<<<<
  6673. * try:
  6674. * return os.path.islink(filepath)
  6675. */
  6676. /* function exit code */
  6677. __pyx_L1_error:;
  6678. __Pyx_XDECREF(__pyx_t_4);
  6679. __Pyx_XDECREF(__pyx_t_5);
  6680. __Pyx_XDECREF(__pyx_t_6);
  6681. __Pyx_XDECREF(__pyx_t_8);
  6682. __Pyx_XDECREF(__pyx_t_10);
  6683. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_link", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6684. __pyx_r = NULL;
  6685. __pyx_L0:;
  6686. __Pyx_XDECREF(__pyx_v_e);
  6687. __Pyx_XGIVEREF(__pyx_r);
  6688. __Pyx_RefNannyFinishContext();
  6689. return __pyx_r;
  6690. }
  6691. /* "lib/Naked/toolshed/c/system.pyx":413
  6692. * # return the real file path pointed to by a symbolic link
  6693. * #------------------------------------------------------------------------------
  6694. * def real_path(filepath): # <<<<<<<<<<<<<<
  6695. * try:
  6696. * return os.path.realpath(filepath)
  6697. */
  6698. /* Python wrapper */
  6699. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_45real_path(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/
  6700. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_45real_path = {__Pyx_NAMESTR("real_path"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_45real_path, METH_O, __Pyx_DOCSTR(0)};
  6701. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_45real_path(PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  6702. PyObject *__pyx_r = 0;
  6703. __Pyx_RefNannyDeclarations
  6704. __Pyx_RefNannySetupContext("real_path (wrapper)", 0);
  6705. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_44real_path(__pyx_self, ((PyObject *)__pyx_v_filepath));
  6706. /* function exit code */
  6707. __Pyx_RefNannyFinishContext();
  6708. return __pyx_r;
  6709. }
  6710. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_44real_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) {
  6711. PyObject *__pyx_v_e = NULL;
  6712. PyObject *__pyx_r = NULL;
  6713. __Pyx_RefNannyDeclarations
  6714. PyObject *__pyx_t_1 = NULL;
  6715. PyObject *__pyx_t_2 = NULL;
  6716. PyObject *__pyx_t_3 = NULL;
  6717. PyObject *__pyx_t_4 = NULL;
  6718. PyObject *__pyx_t_5 = NULL;
  6719. PyObject *__pyx_t_6 = NULL;
  6720. int __pyx_t_7;
  6721. PyObject *__pyx_t_8 = NULL;
  6722. int __pyx_t_9;
  6723. PyObject *__pyx_t_10 = NULL;
  6724. int __pyx_lineno = 0;
  6725. const char *__pyx_filename = NULL;
  6726. int __pyx_clineno = 0;
  6727. __Pyx_RefNannySetupContext("real_path", 0);
  6728. /* "lib/Naked/toolshed/c/system.pyx":414
  6729. * #------------------------------------------------------------------------------
  6730. * def real_path(filepath):
  6731. * try: # <<<<<<<<<<<<<<
  6732. * return os.path.realpath(filepath)
  6733. * except Exception as e:
  6734. */
  6735. {
  6736. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  6737. __Pyx_XGOTREF(__pyx_t_1);
  6738. __Pyx_XGOTREF(__pyx_t_2);
  6739. __Pyx_XGOTREF(__pyx_t_3);
  6740. /*try:*/ {
  6741. /* "lib/Naked/toolshed/c/system.pyx":415
  6742. * def real_path(filepath):
  6743. * try:
  6744. * return os.path.realpath(filepath) # <<<<<<<<<<<<<<
  6745. * except Exception as e:
  6746. * if DEBUG_FLAG:
  6747. */
  6748. __Pyx_XDECREF(__pyx_r);
  6749. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6750. __Pyx_GOTREF(__pyx_t_4);
  6751. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6752. __Pyx_GOTREF(__pyx_t_5);
  6753. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6754. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_realpath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6755. __Pyx_GOTREF(__pyx_t_4);
  6756. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6757. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6758. __Pyx_GOTREF(__pyx_t_5);
  6759. __Pyx_INCREF(__pyx_v_filepath);
  6760. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath);
  6761. __Pyx_GIVEREF(__pyx_v_filepath);
  6762. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6763. __Pyx_GOTREF(__pyx_t_6);
  6764. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6765. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6766. __pyx_r = __pyx_t_6;
  6767. __pyx_t_6 = 0;
  6768. goto __pyx_L7_try_return;
  6769. }
  6770. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  6771. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  6772. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  6773. goto __pyx_L10_try_end;
  6774. __pyx_L3_error:;
  6775. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  6776. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  6777. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  6778. /* "lib/Naked/toolshed/c/system.pyx":416
  6779. * try:
  6780. * return os.path.realpath(filepath)
  6781. * except Exception as e: # <<<<<<<<<<<<<<
  6782. * if DEBUG_FLAG:
  6783. * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).")
  6784. */
  6785. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  6786. if (__pyx_t_7) {
  6787. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.real_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6788. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6789. __Pyx_GOTREF(__pyx_t_6);
  6790. __Pyx_GOTREF(__pyx_t_5);
  6791. __Pyx_GOTREF(__pyx_t_4);
  6792. __Pyx_INCREF(__pyx_t_5);
  6793. __pyx_v_e = __pyx_t_5;
  6794. /* "lib/Naked/toolshed/c/system.pyx":417
  6795. * return os.path.realpath(filepath)
  6796. * except Exception as e:
  6797. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  6798. * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).")
  6799. * raise e
  6800. */
  6801. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6802. __Pyx_GOTREF(__pyx_t_8);
  6803. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6804. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6805. if (__pyx_t_9) {
  6806. /* "lib/Naked/toolshed/c/system.pyx":418
  6807. * except Exception as e:
  6808. * if DEBUG_FLAG:
  6809. * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  6810. * raise e
  6811. *
  6812. */
  6813. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6814. __Pyx_GOTREF(__pyx_t_8);
  6815. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6816. __Pyx_GOTREF(__pyx_t_10);
  6817. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6818. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6819. __Pyx_GOTREF(__pyx_t_8);
  6820. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  6821. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6822. __Pyx_GOTREF(__pyx_t_10);
  6823. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6824. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  6825. goto __pyx_L13;
  6826. }
  6827. __pyx_L13:;
  6828. /* "lib/Naked/toolshed/c/system.pyx":419
  6829. * if DEBUG_FLAG:
  6830. * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).")
  6831. * raise e # <<<<<<<<<<<<<<
  6832. *
  6833. * #------------------------------------------------------------------------------
  6834. */
  6835. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  6836. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6837. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  6838. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6839. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6840. goto __pyx_L4_exception_handled;
  6841. }
  6842. goto __pyx_L5_except_error;
  6843. __pyx_L5_except_error:;
  6844. __Pyx_XGIVEREF(__pyx_t_1);
  6845. __Pyx_XGIVEREF(__pyx_t_2);
  6846. __Pyx_XGIVEREF(__pyx_t_3);
  6847. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6848. goto __pyx_L1_error;
  6849. __pyx_L7_try_return:;
  6850. __Pyx_XGIVEREF(__pyx_t_1);
  6851. __Pyx_XGIVEREF(__pyx_t_2);
  6852. __Pyx_XGIVEREF(__pyx_t_3);
  6853. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6854. goto __pyx_L0;
  6855. __pyx_L4_exception_handled:;
  6856. __Pyx_XGIVEREF(__pyx_t_1);
  6857. __Pyx_XGIVEREF(__pyx_t_2);
  6858. __Pyx_XGIVEREF(__pyx_t_3);
  6859. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6860. __pyx_L10_try_end:;
  6861. }
  6862. /* "lib/Naked/toolshed/c/system.pyx":413
  6863. * # return the real file path pointed to by a symbolic link
  6864. * #------------------------------------------------------------------------------
  6865. * def real_path(filepath): # <<<<<<<<<<<<<<
  6866. * try:
  6867. * return os.path.realpath(filepath)
  6868. */
  6869. /* function exit code */
  6870. __pyx_L1_error:;
  6871. __Pyx_XDECREF(__pyx_t_4);
  6872. __Pyx_XDECREF(__pyx_t_5);
  6873. __Pyx_XDECREF(__pyx_t_6);
  6874. __Pyx_XDECREF(__pyx_t_8);
  6875. __Pyx_XDECREF(__pyx_t_10);
  6876. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.real_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6877. __pyx_r = NULL;
  6878. __pyx_L0:;
  6879. __Pyx_XDECREF(__pyx_v_e);
  6880. __Pyx_XGIVEREF(__pyx_r);
  6881. __Pyx_RefNannyFinishContext();
  6882. return __pyx_r;
  6883. }
  6884. /* "lib/Naked/toolshed/c/system.pyx":431
  6885. * # print to std output stream
  6886. * #------------------------------------------------------------------------------
  6887. * def stdout(text): # <<<<<<<<<<<<<<
  6888. * try:
  6889. * print(text)
  6890. */
  6891. /* Python wrapper */
  6892. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_47stdout(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
  6893. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_47stdout = {__Pyx_NAMESTR("stdout"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_47stdout, METH_O, __Pyx_DOCSTR(0)};
  6894. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_47stdout(PyObject *__pyx_self, PyObject *__pyx_v_text) {
  6895. PyObject *__pyx_r = 0;
  6896. __Pyx_RefNannyDeclarations
  6897. __Pyx_RefNannySetupContext("stdout (wrapper)", 0);
  6898. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_46stdout(__pyx_self, ((PyObject *)__pyx_v_text));
  6899. /* function exit code */
  6900. __Pyx_RefNannyFinishContext();
  6901. return __pyx_r;
  6902. }
  6903. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_46stdout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) {
  6904. PyObject *__pyx_v_e = NULL;
  6905. PyObject *__pyx_r = NULL;
  6906. __Pyx_RefNannyDeclarations
  6907. PyObject *__pyx_t_1 = NULL;
  6908. PyObject *__pyx_t_2 = NULL;
  6909. PyObject *__pyx_t_3 = NULL;
  6910. int __pyx_t_4;
  6911. PyObject *__pyx_t_5 = NULL;
  6912. PyObject *__pyx_t_6 = NULL;
  6913. PyObject *__pyx_t_7 = NULL;
  6914. PyObject *__pyx_t_8 = NULL;
  6915. int __pyx_t_9;
  6916. PyObject *__pyx_t_10 = NULL;
  6917. int __pyx_lineno = 0;
  6918. const char *__pyx_filename = NULL;
  6919. int __pyx_clineno = 0;
  6920. __Pyx_RefNannySetupContext("stdout", 0);
  6921. /* "lib/Naked/toolshed/c/system.pyx":432
  6922. * #------------------------------------------------------------------------------
  6923. * def stdout(text):
  6924. * try: # <<<<<<<<<<<<<<
  6925. * print(text)
  6926. * except Exception as e:
  6927. */
  6928. {
  6929. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  6930. __Pyx_XGOTREF(__pyx_t_1);
  6931. __Pyx_XGOTREF(__pyx_t_2);
  6932. __Pyx_XGOTREF(__pyx_t_3);
  6933. /*try:*/ {
  6934. /* "lib/Naked/toolshed/c/system.pyx":433
  6935. * def stdout(text):
  6936. * try:
  6937. * print(text) # <<<<<<<<<<<<<<
  6938. * except Exception as e:
  6939. * if DEBUG_FLAG:
  6940. */
  6941. if (__Pyx_PrintOne(0, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  6942. }
  6943. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  6944. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  6945. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  6946. goto __pyx_L10_try_end;
  6947. __pyx_L3_error:;
  6948. /* "lib/Naked/toolshed/c/system.pyx":434
  6949. * try:
  6950. * print(text)
  6951. * except Exception as e: # <<<<<<<<<<<<<<
  6952. * if DEBUG_FLAG:
  6953. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).")
  6954. */
  6955. __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  6956. if (__pyx_t_4) {
  6957. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6958. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6959. __Pyx_GOTREF(__pyx_t_5);
  6960. __Pyx_GOTREF(__pyx_t_6);
  6961. __Pyx_GOTREF(__pyx_t_7);
  6962. __Pyx_INCREF(__pyx_t_6);
  6963. __pyx_v_e = __pyx_t_6;
  6964. /* "lib/Naked/toolshed/c/system.pyx":435
  6965. * print(text)
  6966. * except Exception as e:
  6967. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  6968. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).")
  6969. * raise e
  6970. */
  6971. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6972. __Pyx_GOTREF(__pyx_t_8);
  6973. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6974. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6975. if (__pyx_t_9) {
  6976. /* "lib/Naked/toolshed/c/system.pyx":436
  6977. * except Exception as e:
  6978. * if DEBUG_FLAG:
  6979. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  6980. * raise e
  6981. *
  6982. */
  6983. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6984. __Pyx_GOTREF(__pyx_t_8);
  6985. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6986. __Pyx_GOTREF(__pyx_t_10);
  6987. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6988. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6989. __Pyx_GOTREF(__pyx_t_8);
  6990. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  6991. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  6992. __Pyx_GOTREF(__pyx_t_10);
  6993. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6994. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  6995. goto __pyx_L13;
  6996. }
  6997. __pyx_L13:;
  6998. /* "lib/Naked/toolshed/c/system.pyx":437
  6999. * if DEBUG_FLAG:
  7000. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).")
  7001. * raise e # <<<<<<<<<<<<<<
  7002. *
  7003. * #------------------------------------------------------------------------------
  7004. */
  7005. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  7006. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7007. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7008. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  7009. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7010. goto __pyx_L4_exception_handled;
  7011. }
  7012. goto __pyx_L5_except_error;
  7013. __pyx_L5_except_error:;
  7014. __Pyx_XGIVEREF(__pyx_t_1);
  7015. __Pyx_XGIVEREF(__pyx_t_2);
  7016. __Pyx_XGIVEREF(__pyx_t_3);
  7017. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7018. goto __pyx_L1_error;
  7019. __pyx_L4_exception_handled:;
  7020. __Pyx_XGIVEREF(__pyx_t_1);
  7021. __Pyx_XGIVEREF(__pyx_t_2);
  7022. __Pyx_XGIVEREF(__pyx_t_3);
  7023. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7024. __pyx_L10_try_end:;
  7025. }
  7026. /* "lib/Naked/toolshed/c/system.pyx":431
  7027. * # print to std output stream
  7028. * #------------------------------------------------------------------------------
  7029. * def stdout(text): # <<<<<<<<<<<<<<
  7030. * try:
  7031. * print(text)
  7032. */
  7033. /* function exit code */
  7034. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  7035. goto __pyx_L0;
  7036. __pyx_L1_error:;
  7037. __Pyx_XDECREF(__pyx_t_5);
  7038. __Pyx_XDECREF(__pyx_t_6);
  7039. __Pyx_XDECREF(__pyx_t_7);
  7040. __Pyx_XDECREF(__pyx_t_8);
  7041. __Pyx_XDECREF(__pyx_t_10);
  7042. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7043. __pyx_r = NULL;
  7044. __pyx_L0:;
  7045. __Pyx_XDECREF(__pyx_v_e);
  7046. __Pyx_XGIVEREF(__pyx_r);
  7047. __Pyx_RefNannyFinishContext();
  7048. return __pyx_r;
  7049. }
  7050. /* "lib/Naked/toolshed/c/system.pyx":443
  7051. * # print to std output stream without a newline
  7052. * #------------------------------------------------------------------------------
  7053. * def stdout_xnl(text): # <<<<<<<<<<<<<<
  7054. * try:
  7055. * sys.stdout.write(text)
  7056. */
  7057. /* Python wrapper */
  7058. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
  7059. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl = {__Pyx_NAMESTR("stdout_xnl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl, METH_O, __Pyx_DOCSTR(0)};
  7060. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl(PyObject *__pyx_self, PyObject *__pyx_v_text) {
  7061. PyObject *__pyx_r = 0;
  7062. __Pyx_RefNannyDeclarations
  7063. __Pyx_RefNannySetupContext("stdout_xnl (wrapper)", 0);
  7064. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_48stdout_xnl(__pyx_self, ((PyObject *)__pyx_v_text));
  7065. /* function exit code */
  7066. __Pyx_RefNannyFinishContext();
  7067. return __pyx_r;
  7068. }
  7069. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_48stdout_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) {
  7070. PyObject *__pyx_v_e = NULL;
  7071. PyObject *__pyx_r = NULL;
  7072. __Pyx_RefNannyDeclarations
  7073. PyObject *__pyx_t_1 = NULL;
  7074. PyObject *__pyx_t_2 = NULL;
  7075. PyObject *__pyx_t_3 = NULL;
  7076. PyObject *__pyx_t_4 = NULL;
  7077. PyObject *__pyx_t_5 = NULL;
  7078. PyObject *__pyx_t_6 = NULL;
  7079. int __pyx_t_7;
  7080. PyObject *__pyx_t_8 = NULL;
  7081. int __pyx_t_9;
  7082. PyObject *__pyx_t_10 = NULL;
  7083. int __pyx_lineno = 0;
  7084. const char *__pyx_filename = NULL;
  7085. int __pyx_clineno = 0;
  7086. __Pyx_RefNannySetupContext("stdout_xnl", 0);
  7087. /* "lib/Naked/toolshed/c/system.pyx":444
  7088. * #------------------------------------------------------------------------------
  7089. * def stdout_xnl(text):
  7090. * try: # <<<<<<<<<<<<<<
  7091. * sys.stdout.write(text)
  7092. * except Exception as e:
  7093. */
  7094. {
  7095. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  7096. __Pyx_XGOTREF(__pyx_t_1);
  7097. __Pyx_XGOTREF(__pyx_t_2);
  7098. __Pyx_XGOTREF(__pyx_t_3);
  7099. /*try:*/ {
  7100. /* "lib/Naked/toolshed/c/system.pyx":445
  7101. * def stdout_xnl(text):
  7102. * try:
  7103. * sys.stdout.write(text) # <<<<<<<<<<<<<<
  7104. * except Exception as e:
  7105. * if DEBUG_FLAG:
  7106. */
  7107. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7108. __Pyx_GOTREF(__pyx_t_4);
  7109. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7110. __Pyx_GOTREF(__pyx_t_5);
  7111. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7112. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7113. __Pyx_GOTREF(__pyx_t_4);
  7114. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7115. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7116. __Pyx_GOTREF(__pyx_t_5);
  7117. __Pyx_INCREF(__pyx_v_text);
  7118. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text);
  7119. __Pyx_GIVEREF(__pyx_v_text);
  7120. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7121. __Pyx_GOTREF(__pyx_t_6);
  7122. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7123. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7124. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  7125. }
  7126. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  7127. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  7128. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7129. goto __pyx_L10_try_end;
  7130. __pyx_L3_error:;
  7131. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  7132. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  7133. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  7134. /* "lib/Naked/toolshed/c/system.pyx":446
  7135. * try:
  7136. * sys.stdout.write(text)
  7137. * except Exception as e: # <<<<<<<<<<<<<<
  7138. * if DEBUG_FLAG:
  7139. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).")
  7140. */
  7141. __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  7142. if (__pyx_t_7) {
  7143. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7144. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7145. __Pyx_GOTREF(__pyx_t_6);
  7146. __Pyx_GOTREF(__pyx_t_5);
  7147. __Pyx_GOTREF(__pyx_t_4);
  7148. __Pyx_INCREF(__pyx_t_5);
  7149. __pyx_v_e = __pyx_t_5;
  7150. /* "lib/Naked/toolshed/c/system.pyx":447
  7151. * sys.stdout.write(text)
  7152. * except Exception as e:
  7153. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  7154. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).")
  7155. * raise e
  7156. */
  7157. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7158. __Pyx_GOTREF(__pyx_t_8);
  7159. __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7160. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7161. if (__pyx_t_9) {
  7162. /* "lib/Naked/toolshed/c/system.pyx":448
  7163. * except Exception as e:
  7164. * if DEBUG_FLAG:
  7165. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  7166. * raise e
  7167. *
  7168. */
  7169. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7170. __Pyx_GOTREF(__pyx_t_8);
  7171. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7172. __Pyx_GOTREF(__pyx_t_10);
  7173. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7174. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7175. __Pyx_GOTREF(__pyx_t_8);
  7176. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7177. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7178. __Pyx_GOTREF(__pyx_t_10);
  7179. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7180. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7181. goto __pyx_L13;
  7182. }
  7183. __pyx_L13:;
  7184. /* "lib/Naked/toolshed/c/system.pyx":449
  7185. * if DEBUG_FLAG:
  7186. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).")
  7187. * raise e # <<<<<<<<<<<<<<
  7188. *
  7189. * #------------------------------------------------------------------------------
  7190. */
  7191. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  7192. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7193. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  7194. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7195. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7196. goto __pyx_L4_exception_handled;
  7197. }
  7198. goto __pyx_L5_except_error;
  7199. __pyx_L5_except_error:;
  7200. __Pyx_XGIVEREF(__pyx_t_1);
  7201. __Pyx_XGIVEREF(__pyx_t_2);
  7202. __Pyx_XGIVEREF(__pyx_t_3);
  7203. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7204. goto __pyx_L1_error;
  7205. __pyx_L4_exception_handled:;
  7206. __Pyx_XGIVEREF(__pyx_t_1);
  7207. __Pyx_XGIVEREF(__pyx_t_2);
  7208. __Pyx_XGIVEREF(__pyx_t_3);
  7209. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7210. __pyx_L10_try_end:;
  7211. }
  7212. /* "lib/Naked/toolshed/c/system.pyx":443
  7213. * # print to std output stream without a newline
  7214. * #------------------------------------------------------------------------------
  7215. * def stdout_xnl(text): # <<<<<<<<<<<<<<
  7216. * try:
  7217. * sys.stdout.write(text)
  7218. */
  7219. /* function exit code */
  7220. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  7221. goto __pyx_L0;
  7222. __pyx_L1_error:;
  7223. __Pyx_XDECREF(__pyx_t_4);
  7224. __Pyx_XDECREF(__pyx_t_5);
  7225. __Pyx_XDECREF(__pyx_t_6);
  7226. __Pyx_XDECREF(__pyx_t_8);
  7227. __Pyx_XDECREF(__pyx_t_10);
  7228. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7229. __pyx_r = NULL;
  7230. __pyx_L0:;
  7231. __Pyx_XDECREF(__pyx_v_e);
  7232. __Pyx_XGIVEREF(__pyx_r);
  7233. __Pyx_RefNannyFinishContext();
  7234. return __pyx_r;
  7235. }
  7236. /* "lib/Naked/toolshed/c/system.pyx":455
  7237. * # print items in an iterable to the standard output stream with newlines after each string
  7238. * #------------------------------------------------------------------------------
  7239. * def stdout_iter(iter): # <<<<<<<<<<<<<<
  7240. * try:
  7241. * for x in iter:
  7242. */
  7243. /* Python wrapper */
  7244. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_51stdout_iter(PyObject *__pyx_self, PyObject *__pyx_v_iter); /*proto*/
  7245. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_51stdout_iter = {__Pyx_NAMESTR("stdout_iter"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_51stdout_iter, METH_O, __Pyx_DOCSTR(0)};
  7246. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_51stdout_iter(PyObject *__pyx_self, PyObject *__pyx_v_iter) {
  7247. PyObject *__pyx_r = 0;
  7248. __Pyx_RefNannyDeclarations
  7249. __Pyx_RefNannySetupContext("stdout_iter (wrapper)", 0);
  7250. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_50stdout_iter(__pyx_self, ((PyObject *)__pyx_v_iter));
  7251. /* function exit code */
  7252. __Pyx_RefNannyFinishContext();
  7253. return __pyx_r;
  7254. }
  7255. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_50stdout_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter) {
  7256. PyObject *__pyx_v_x = NULL;
  7257. PyObject *__pyx_v_e = NULL;
  7258. PyObject *__pyx_r = NULL;
  7259. __Pyx_RefNannyDeclarations
  7260. PyObject *__pyx_t_1 = NULL;
  7261. PyObject *__pyx_t_2 = NULL;
  7262. PyObject *__pyx_t_3 = NULL;
  7263. PyObject *__pyx_t_4 = NULL;
  7264. Py_ssize_t __pyx_t_5;
  7265. PyObject *(*__pyx_t_6)(PyObject *);
  7266. PyObject *__pyx_t_7 = NULL;
  7267. PyObject *__pyx_t_8 = NULL;
  7268. PyObject *__pyx_t_9 = NULL;
  7269. int __pyx_t_10;
  7270. int __pyx_t_11;
  7271. PyObject *__pyx_t_12 = NULL;
  7272. int __pyx_lineno = 0;
  7273. const char *__pyx_filename = NULL;
  7274. int __pyx_clineno = 0;
  7275. __Pyx_RefNannySetupContext("stdout_iter", 0);
  7276. /* "lib/Naked/toolshed/c/system.pyx":456
  7277. * #------------------------------------------------------------------------------
  7278. * def stdout_iter(iter):
  7279. * try: # <<<<<<<<<<<<<<
  7280. * for x in iter:
  7281. * stdout(x)
  7282. */
  7283. {
  7284. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  7285. __Pyx_XGOTREF(__pyx_t_1);
  7286. __Pyx_XGOTREF(__pyx_t_2);
  7287. __Pyx_XGOTREF(__pyx_t_3);
  7288. /*try:*/ {
  7289. /* "lib/Naked/toolshed/c/system.pyx":457
  7290. * def stdout_iter(iter):
  7291. * try:
  7292. * for x in iter: # <<<<<<<<<<<<<<
  7293. * stdout(x)
  7294. * except Exception as e:
  7295. */
  7296. if (PyList_CheckExact(__pyx_v_iter) || PyTuple_CheckExact(__pyx_v_iter)) {
  7297. __pyx_t_4 = __pyx_v_iter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
  7298. __pyx_t_6 = NULL;
  7299. } else {
  7300. __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_iter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7301. __Pyx_GOTREF(__pyx_t_4);
  7302. __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  7303. }
  7304. for (;;) {
  7305. if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
  7306. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
  7307. #if CYTHON_COMPILING_IN_CPYTHON
  7308. __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7309. #else
  7310. __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7311. #endif
  7312. } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
  7313. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  7314. #if CYTHON_COMPILING_IN_CPYTHON
  7315. __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7316. #else
  7317. __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7318. #endif
  7319. } else {
  7320. __pyx_t_7 = __pyx_t_6(__pyx_t_4);
  7321. if (unlikely(!__pyx_t_7)) {
  7322. PyObject* exc_type = PyErr_Occurred();
  7323. if (exc_type) {
  7324. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7325. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7326. }
  7327. break;
  7328. }
  7329. __Pyx_GOTREF(__pyx_t_7);
  7330. }
  7331. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7);
  7332. __pyx_t_7 = 0;
  7333. /* "lib/Naked/toolshed/c/system.pyx":458
  7334. * try:
  7335. * for x in iter:
  7336. * stdout(x) # <<<<<<<<<<<<<<
  7337. * except Exception as e:
  7338. * if DEBUG_FLAG:
  7339. */
  7340. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_stdout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7341. __Pyx_GOTREF(__pyx_t_7);
  7342. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7343. __Pyx_GOTREF(__pyx_t_8);
  7344. __Pyx_INCREF(__pyx_v_x);
  7345. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_x);
  7346. __Pyx_GIVEREF(__pyx_v_x);
  7347. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7348. __Pyx_GOTREF(__pyx_t_9);
  7349. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7350. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7351. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7352. }
  7353. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7354. }
  7355. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  7356. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  7357. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7358. goto __pyx_L10_try_end;
  7359. __pyx_L3_error:;
  7360. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  7361. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  7362. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7363. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  7364. /* "lib/Naked/toolshed/c/system.pyx":459
  7365. * for x in iter:
  7366. * stdout(x)
  7367. * except Exception as e: # <<<<<<<<<<<<<<
  7368. * if DEBUG_FLAG:
  7369. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).")
  7370. */
  7371. __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  7372. if (__pyx_t_10) {
  7373. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7374. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7375. __Pyx_GOTREF(__pyx_t_4);
  7376. __Pyx_GOTREF(__pyx_t_9);
  7377. __Pyx_GOTREF(__pyx_t_8);
  7378. __Pyx_INCREF(__pyx_t_9);
  7379. __pyx_v_e = __pyx_t_9;
  7380. /* "lib/Naked/toolshed/c/system.pyx":460
  7381. * stdout(x)
  7382. * except Exception as e:
  7383. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  7384. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).")
  7385. * raise e
  7386. */
  7387. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7388. __Pyx_GOTREF(__pyx_t_7);
  7389. __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7390. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7391. if (__pyx_t_11) {
  7392. /* "lib/Naked/toolshed/c/system.pyx":461
  7393. * except Exception as e:
  7394. * if DEBUG_FLAG:
  7395. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  7396. * raise e
  7397. *
  7398. */
  7399. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7400. __Pyx_GOTREF(__pyx_t_7);
  7401. __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7402. __Pyx_GOTREF(__pyx_t_12);
  7403. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7404. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7405. __Pyx_GOTREF(__pyx_t_7);
  7406. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  7407. __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7408. __Pyx_GOTREF(__pyx_t_12);
  7409. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7410. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  7411. goto __pyx_L15;
  7412. }
  7413. __pyx_L15:;
  7414. /* "lib/Naked/toolshed/c/system.pyx":462
  7415. * if DEBUG_FLAG:
  7416. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).")
  7417. * raise e # <<<<<<<<<<<<<<
  7418. *
  7419. *
  7420. */
  7421. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  7422. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7423. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7424. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7425. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7426. goto __pyx_L4_exception_handled;
  7427. }
  7428. goto __pyx_L5_except_error;
  7429. __pyx_L5_except_error:;
  7430. __Pyx_XGIVEREF(__pyx_t_1);
  7431. __Pyx_XGIVEREF(__pyx_t_2);
  7432. __Pyx_XGIVEREF(__pyx_t_3);
  7433. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7434. goto __pyx_L1_error;
  7435. __pyx_L4_exception_handled:;
  7436. __Pyx_XGIVEREF(__pyx_t_1);
  7437. __Pyx_XGIVEREF(__pyx_t_2);
  7438. __Pyx_XGIVEREF(__pyx_t_3);
  7439. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7440. __pyx_L10_try_end:;
  7441. }
  7442. /* "lib/Naked/toolshed/c/system.pyx":455
  7443. * # print items in an iterable to the standard output stream with newlines after each string
  7444. * #------------------------------------------------------------------------------
  7445. * def stdout_iter(iter): # <<<<<<<<<<<<<<
  7446. * try:
  7447. * for x in iter:
  7448. */
  7449. /* function exit code */
  7450. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  7451. goto __pyx_L0;
  7452. __pyx_L1_error:;
  7453. __Pyx_XDECREF(__pyx_t_4);
  7454. __Pyx_XDECREF(__pyx_t_7);
  7455. __Pyx_XDECREF(__pyx_t_8);
  7456. __Pyx_XDECREF(__pyx_t_9);
  7457. __Pyx_XDECREF(__pyx_t_12);
  7458. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7459. __pyx_r = NULL;
  7460. __pyx_L0:;
  7461. __Pyx_XDECREF(__pyx_v_x);
  7462. __Pyx_XDECREF(__pyx_v_e);
  7463. __Pyx_XGIVEREF(__pyx_r);
  7464. __Pyx_RefNannyFinishContext();
  7465. return __pyx_r;
  7466. }
  7467. /* "lib/Naked/toolshed/c/system.pyx":469
  7468. * # print items in an iterable to the standard output stream without newlines after each string
  7469. * #------------------------------------------------------------------------------
  7470. * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<<
  7471. * try:
  7472. * for x in iter:
  7473. */
  7474. /* Python wrapper */
  7475. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl(PyObject *__pyx_self, PyObject *__pyx_v_iter); /*proto*/
  7476. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl = {__Pyx_NAMESTR("stdout_iter_xnl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl, METH_O, __Pyx_DOCSTR(0)};
  7477. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl(PyObject *__pyx_self, PyObject *__pyx_v_iter) {
  7478. PyObject *__pyx_r = 0;
  7479. __Pyx_RefNannyDeclarations
  7480. __Pyx_RefNannySetupContext("stdout_iter_xnl (wrapper)", 0);
  7481. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_52stdout_iter_xnl(__pyx_self, ((PyObject *)__pyx_v_iter));
  7482. /* function exit code */
  7483. __Pyx_RefNannyFinishContext();
  7484. return __pyx_r;
  7485. }
  7486. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_52stdout_iter_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter) {
  7487. PyObject *__pyx_v_x = NULL;
  7488. PyObject *__pyx_v_e = NULL;
  7489. PyObject *__pyx_r = NULL;
  7490. __Pyx_RefNannyDeclarations
  7491. PyObject *__pyx_t_1 = NULL;
  7492. PyObject *__pyx_t_2 = NULL;
  7493. PyObject *__pyx_t_3 = NULL;
  7494. PyObject *__pyx_t_4 = NULL;
  7495. Py_ssize_t __pyx_t_5;
  7496. PyObject *(*__pyx_t_6)(PyObject *);
  7497. PyObject *__pyx_t_7 = NULL;
  7498. PyObject *__pyx_t_8 = NULL;
  7499. PyObject *__pyx_t_9 = NULL;
  7500. int __pyx_t_10;
  7501. int __pyx_t_11;
  7502. PyObject *__pyx_t_12 = NULL;
  7503. int __pyx_lineno = 0;
  7504. const char *__pyx_filename = NULL;
  7505. int __pyx_clineno = 0;
  7506. __Pyx_RefNannySetupContext("stdout_iter_xnl", 0);
  7507. /* "lib/Naked/toolshed/c/system.pyx":470
  7508. * #------------------------------------------------------------------------------
  7509. * def stdout_iter_xnl(iter):
  7510. * try: # <<<<<<<<<<<<<<
  7511. * for x in iter:
  7512. * stdout_xnl(x)
  7513. */
  7514. {
  7515. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  7516. __Pyx_XGOTREF(__pyx_t_1);
  7517. __Pyx_XGOTREF(__pyx_t_2);
  7518. __Pyx_XGOTREF(__pyx_t_3);
  7519. /*try:*/ {
  7520. /* "lib/Naked/toolshed/c/system.pyx":471
  7521. * def stdout_iter_xnl(iter):
  7522. * try:
  7523. * for x in iter: # <<<<<<<<<<<<<<
  7524. * stdout_xnl(x)
  7525. * except Exception as e:
  7526. */
  7527. if (PyList_CheckExact(__pyx_v_iter) || PyTuple_CheckExact(__pyx_v_iter)) {
  7528. __pyx_t_4 = __pyx_v_iter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
  7529. __pyx_t_6 = NULL;
  7530. } else {
  7531. __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_iter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7532. __Pyx_GOTREF(__pyx_t_4);
  7533. __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  7534. }
  7535. for (;;) {
  7536. if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
  7537. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
  7538. #if CYTHON_COMPILING_IN_CPYTHON
  7539. __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7540. #else
  7541. __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7542. #endif
  7543. } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
  7544. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  7545. #if CYTHON_COMPILING_IN_CPYTHON
  7546. __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7547. #else
  7548. __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7549. #endif
  7550. } else {
  7551. __pyx_t_7 = __pyx_t_6(__pyx_t_4);
  7552. if (unlikely(!__pyx_t_7)) {
  7553. PyObject* exc_type = PyErr_Occurred();
  7554. if (exc_type) {
  7555. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7556. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7557. }
  7558. break;
  7559. }
  7560. __Pyx_GOTREF(__pyx_t_7);
  7561. }
  7562. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7);
  7563. __pyx_t_7 = 0;
  7564. /* "lib/Naked/toolshed/c/system.pyx":472
  7565. * try:
  7566. * for x in iter:
  7567. * stdout_xnl(x) # <<<<<<<<<<<<<<
  7568. * except Exception as e:
  7569. * if DEBUG_FLAG:
  7570. */
  7571. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_stdout_xnl); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7572. __Pyx_GOTREF(__pyx_t_7);
  7573. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7574. __Pyx_GOTREF(__pyx_t_8);
  7575. __Pyx_INCREF(__pyx_v_x);
  7576. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_x);
  7577. __Pyx_GIVEREF(__pyx_v_x);
  7578. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7579. __Pyx_GOTREF(__pyx_t_9);
  7580. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7581. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7582. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7583. }
  7584. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7585. }
  7586. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  7587. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  7588. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7589. goto __pyx_L10_try_end;
  7590. __pyx_L3_error:;
  7591. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  7592. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  7593. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7594. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  7595. /* "lib/Naked/toolshed/c/system.pyx":473
  7596. * for x in iter:
  7597. * stdout_xnl(x)
  7598. * except Exception as e: # <<<<<<<<<<<<<<
  7599. * if DEBUG_FLAG:
  7600. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).")
  7601. */
  7602. __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  7603. if (__pyx_t_10) {
  7604. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7605. if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7606. __Pyx_GOTREF(__pyx_t_4);
  7607. __Pyx_GOTREF(__pyx_t_9);
  7608. __Pyx_GOTREF(__pyx_t_8);
  7609. __Pyx_INCREF(__pyx_t_9);
  7610. __pyx_v_e = __pyx_t_9;
  7611. /* "lib/Naked/toolshed/c/system.pyx":474
  7612. * stdout_xnl(x)
  7613. * except Exception as e:
  7614. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  7615. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).")
  7616. * raise e
  7617. */
  7618. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7619. __Pyx_GOTREF(__pyx_t_7);
  7620. __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7621. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7622. if (__pyx_t_11) {
  7623. /* "lib/Naked/toolshed/c/system.pyx":475
  7624. * except Exception as e:
  7625. * if DEBUG_FLAG:
  7626. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  7627. * raise e
  7628. *
  7629. */
  7630. __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7631. __Pyx_GOTREF(__pyx_t_7);
  7632. __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7633. __Pyx_GOTREF(__pyx_t_12);
  7634. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7635. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7636. __Pyx_GOTREF(__pyx_t_7);
  7637. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  7638. __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7639. __Pyx_GOTREF(__pyx_t_12);
  7640. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7641. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  7642. goto __pyx_L15;
  7643. }
  7644. __pyx_L15:;
  7645. /* "lib/Naked/toolshed/c/system.pyx":476
  7646. * if DEBUG_FLAG:
  7647. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).")
  7648. * raise e # <<<<<<<<<<<<<<
  7649. *
  7650. * #------------------------------------------------------------------------------
  7651. */
  7652. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  7653. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7654. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7655. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7656. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7657. goto __pyx_L4_exception_handled;
  7658. }
  7659. goto __pyx_L5_except_error;
  7660. __pyx_L5_except_error:;
  7661. __Pyx_XGIVEREF(__pyx_t_1);
  7662. __Pyx_XGIVEREF(__pyx_t_2);
  7663. __Pyx_XGIVEREF(__pyx_t_3);
  7664. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7665. goto __pyx_L1_error;
  7666. __pyx_L4_exception_handled:;
  7667. __Pyx_XGIVEREF(__pyx_t_1);
  7668. __Pyx_XGIVEREF(__pyx_t_2);
  7669. __Pyx_XGIVEREF(__pyx_t_3);
  7670. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7671. __pyx_L10_try_end:;
  7672. }
  7673. /* "lib/Naked/toolshed/c/system.pyx":469
  7674. * # print items in an iterable to the standard output stream without newlines after each string
  7675. * #------------------------------------------------------------------------------
  7676. * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<<
  7677. * try:
  7678. * for x in iter:
  7679. */
  7680. /* function exit code */
  7681. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  7682. goto __pyx_L0;
  7683. __pyx_L1_error:;
  7684. __Pyx_XDECREF(__pyx_t_4);
  7685. __Pyx_XDECREF(__pyx_t_7);
  7686. __Pyx_XDECREF(__pyx_t_8);
  7687. __Pyx_XDECREF(__pyx_t_9);
  7688. __Pyx_XDECREF(__pyx_t_12);
  7689. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7690. __pyx_r = NULL;
  7691. __pyx_L0:;
  7692. __Pyx_XDECREF(__pyx_v_x);
  7693. __Pyx_XDECREF(__pyx_v_e);
  7694. __Pyx_XGIVEREF(__pyx_r);
  7695. __Pyx_RefNannyFinishContext();
  7696. return __pyx_r;
  7697. }
  7698. /* "lib/Naked/toolshed/c/system.pyx":483
  7699. * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code
  7700. * #------------------------------------------------------------------------------
  7701. * def stderr(text, exit=0): # <<<<<<<<<<<<<<
  7702. * try:
  7703. * sys.stderr.write(text + "\n")
  7704. */
  7705. /* Python wrapper */
  7706. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_55stderr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7707. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_55stderr = {__Pyx_NAMESTR("stderr"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_55stderr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  7708. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_55stderr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7709. PyObject *__pyx_v_text = 0;
  7710. PyObject *__pyx_v_exit = 0;
  7711. int __pyx_lineno = 0;
  7712. const char *__pyx_filename = NULL;
  7713. int __pyx_clineno = 0;
  7714. PyObject *__pyx_r = 0;
  7715. __Pyx_RefNannyDeclarations
  7716. __Pyx_RefNannySetupContext("stderr (wrapper)", 0);
  7717. {
  7718. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_exit,0};
  7719. PyObject* values[2] = {0,0};
  7720. values[1] = ((PyObject *)__pyx_int_0);
  7721. if (unlikely(__pyx_kwds)) {
  7722. Py_ssize_t kw_args;
  7723. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7724. switch (pos_args) {
  7725. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7726. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7727. case 0: break;
  7728. default: goto __pyx_L5_argtuple_error;
  7729. }
  7730. kw_args = PyDict_Size(__pyx_kwds);
  7731. switch (pos_args) {
  7732. case 0:
  7733. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--;
  7734. else goto __pyx_L5_argtuple_error;
  7735. case 1:
  7736. if (kw_args > 0) {
  7737. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exit);
  7738. if (value) { values[1] = value; kw_args--; }
  7739. }
  7740. }
  7741. if (unlikely(kw_args > 0)) {
  7742. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stderr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7743. }
  7744. } else {
  7745. switch (PyTuple_GET_SIZE(__pyx_args)) {
  7746. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7747. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7748. break;
  7749. default: goto __pyx_L5_argtuple_error;
  7750. }
  7751. }
  7752. __pyx_v_text = values[0];
  7753. __pyx_v_exit = values[1];
  7754. }
  7755. goto __pyx_L4_argument_unpacking_done;
  7756. __pyx_L5_argtuple_error:;
  7757. __Pyx_RaiseArgtupleInvalid("stderr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7758. __pyx_L3_error:;
  7759. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7760. __Pyx_RefNannyFinishContext();
  7761. return NULL;
  7762. __pyx_L4_argument_unpacking_done:;
  7763. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_54stderr(__pyx_self, __pyx_v_text, __pyx_v_exit);
  7764. /* function exit code */
  7765. __Pyx_RefNannyFinishContext();
  7766. return __pyx_r;
  7767. }
  7768. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_54stderr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit) {
  7769. PyObject *__pyx_v_e = NULL;
  7770. PyObject *__pyx_r = NULL;
  7771. __Pyx_RefNannyDeclarations
  7772. PyObject *__pyx_t_1 = NULL;
  7773. PyObject *__pyx_t_2 = NULL;
  7774. PyObject *__pyx_t_3 = NULL;
  7775. PyObject *__pyx_t_4 = NULL;
  7776. PyObject *__pyx_t_5 = NULL;
  7777. PyObject *__pyx_t_6 = NULL;
  7778. int __pyx_t_7;
  7779. int __pyx_t_8;
  7780. PyObject *__pyx_t_9 = NULL;
  7781. PyObject *__pyx_t_10 = NULL;
  7782. int __pyx_lineno = 0;
  7783. const char *__pyx_filename = NULL;
  7784. int __pyx_clineno = 0;
  7785. __Pyx_RefNannySetupContext("stderr", 0);
  7786. /* "lib/Naked/toolshed/c/system.pyx":484
  7787. * #------------------------------------------------------------------------------
  7788. * def stderr(text, exit=0):
  7789. * try: # <<<<<<<<<<<<<<
  7790. * sys.stderr.write(text + "\n")
  7791. * if exit:
  7792. */
  7793. {
  7794. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  7795. __Pyx_XGOTREF(__pyx_t_1);
  7796. __Pyx_XGOTREF(__pyx_t_2);
  7797. __Pyx_XGOTREF(__pyx_t_3);
  7798. /*try:*/ {
  7799. /* "lib/Naked/toolshed/c/system.pyx":485
  7800. * def stderr(text, exit=0):
  7801. * try:
  7802. * sys.stderr.write(text + "\n") # <<<<<<<<<<<<<<
  7803. * if exit:
  7804. * raise SystemExit(exit)
  7805. */
  7806. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7807. __Pyx_GOTREF(__pyx_t_4);
  7808. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7809. __Pyx_GOTREF(__pyx_t_5);
  7810. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7811. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7812. __Pyx_GOTREF(__pyx_t_4);
  7813. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7814. __pyx_t_5 = PyNumber_Add(__pyx_v_text, __pyx_kp_s__36); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7815. __Pyx_GOTREF(__pyx_t_5);
  7816. __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7817. __Pyx_GOTREF(__pyx_t_6);
  7818. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  7819. __Pyx_GIVEREF(__pyx_t_5);
  7820. __pyx_t_5 = 0;
  7821. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7822. __Pyx_GOTREF(__pyx_t_5);
  7823. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7824. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  7825. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7826. /* "lib/Naked/toolshed/c/system.pyx":486
  7827. * try:
  7828. * sys.stderr.write(text + "\n")
  7829. * if exit: # <<<<<<<<<<<<<<
  7830. * raise SystemExit(exit)
  7831. * except Exception as e:
  7832. */
  7833. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exit); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7834. if (__pyx_t_7) {
  7835. /* "lib/Naked/toolshed/c/system.pyx":487
  7836. * sys.stderr.write(text + "\n")
  7837. * if exit:
  7838. * raise SystemExit(exit) # <<<<<<<<<<<<<<
  7839. * except Exception as e:
  7840. * if DEBUG_FLAG:
  7841. */
  7842. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7843. __Pyx_GOTREF(__pyx_t_5);
  7844. __Pyx_INCREF(__pyx_v_exit);
  7845. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_exit);
  7846. __Pyx_GIVEREF(__pyx_v_exit);
  7847. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7848. __Pyx_GOTREF(__pyx_t_6);
  7849. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7850. __Pyx_Raise(__pyx_t_6, 0, 0, 0);
  7851. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  7852. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7853. }
  7854. }
  7855. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  7856. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  7857. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7858. goto __pyx_L10_try_end;
  7859. __pyx_L3_error:;
  7860. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  7861. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  7862. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  7863. /* "lib/Naked/toolshed/c/system.pyx":488
  7864. * if exit:
  7865. * raise SystemExit(exit)
  7866. * except Exception as e: # <<<<<<<<<<<<<<
  7867. * if DEBUG_FLAG:
  7868. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).")
  7869. */
  7870. __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  7871. if (__pyx_t_8) {
  7872. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7873. if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7874. __Pyx_GOTREF(__pyx_t_6);
  7875. __Pyx_GOTREF(__pyx_t_5);
  7876. __Pyx_GOTREF(__pyx_t_4);
  7877. __Pyx_INCREF(__pyx_t_5);
  7878. __pyx_v_e = __pyx_t_5;
  7879. /* "lib/Naked/toolshed/c/system.pyx":489
  7880. * raise SystemExit(exit)
  7881. * except Exception as e:
  7882. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  7883. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).")
  7884. * raise e
  7885. */
  7886. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7887. __Pyx_GOTREF(__pyx_t_9);
  7888. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7889. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7890. if (__pyx_t_7) {
  7891. /* "lib/Naked/toolshed/c/system.pyx":490
  7892. * except Exception as e:
  7893. * if DEBUG_FLAG:
  7894. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  7895. * raise e
  7896. *
  7897. */
  7898. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7899. __Pyx_GOTREF(__pyx_t_9);
  7900. __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 = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7901. __Pyx_GOTREF(__pyx_t_10);
  7902. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7903. __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 = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7904. __Pyx_GOTREF(__pyx_t_9);
  7905. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7906. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7907. __Pyx_GOTREF(__pyx_t_10);
  7908. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7909. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7910. goto __pyx_L14;
  7911. }
  7912. __pyx_L14:;
  7913. /* "lib/Naked/toolshed/c/system.pyx":491
  7914. * if DEBUG_FLAG:
  7915. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).")
  7916. * raise e # <<<<<<<<<<<<<<
  7917. *
  7918. * #------------------------------------------------------------------------------
  7919. */
  7920. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  7921. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  7922. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  7923. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7924. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7925. goto __pyx_L4_exception_handled;
  7926. }
  7927. goto __pyx_L5_except_error;
  7928. __pyx_L5_except_error:;
  7929. __Pyx_XGIVEREF(__pyx_t_1);
  7930. __Pyx_XGIVEREF(__pyx_t_2);
  7931. __Pyx_XGIVEREF(__pyx_t_3);
  7932. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7933. goto __pyx_L1_error;
  7934. __pyx_L4_exception_handled:;
  7935. __Pyx_XGIVEREF(__pyx_t_1);
  7936. __Pyx_XGIVEREF(__pyx_t_2);
  7937. __Pyx_XGIVEREF(__pyx_t_3);
  7938. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  7939. __pyx_L10_try_end:;
  7940. }
  7941. /* "lib/Naked/toolshed/c/system.pyx":483
  7942. * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code
  7943. * #------------------------------------------------------------------------------
  7944. * def stderr(text, exit=0): # <<<<<<<<<<<<<<
  7945. * try:
  7946. * sys.stderr.write(text + "\n")
  7947. */
  7948. /* function exit code */
  7949. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  7950. goto __pyx_L0;
  7951. __pyx_L1_error:;
  7952. __Pyx_XDECREF(__pyx_t_4);
  7953. __Pyx_XDECREF(__pyx_t_5);
  7954. __Pyx_XDECREF(__pyx_t_6);
  7955. __Pyx_XDECREF(__pyx_t_9);
  7956. __Pyx_XDECREF(__pyx_t_10);
  7957. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7958. __pyx_r = NULL;
  7959. __pyx_L0:;
  7960. __Pyx_XDECREF(__pyx_v_e);
  7961. __Pyx_XGIVEREF(__pyx_r);
  7962. __Pyx_RefNannyFinishContext();
  7963. return __pyx_r;
  7964. }
  7965. /* "lib/Naked/toolshed/c/system.pyx":497
  7966. * # print to the standard error stream without a newline character after the `text` string
  7967. * #------------------------------------------------------------------------------
  7968. * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<<
  7969. * try:
  7970. * sys.stderr.write(text)
  7971. */
  7972. /* Python wrapper */
  7973. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7974. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl = {__Pyx_NAMESTR("stderr_xnl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  7975. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7976. PyObject *__pyx_v_text = 0;
  7977. PyObject *__pyx_v_exit = 0;
  7978. int __pyx_lineno = 0;
  7979. const char *__pyx_filename = NULL;
  7980. int __pyx_clineno = 0;
  7981. PyObject *__pyx_r = 0;
  7982. __Pyx_RefNannyDeclarations
  7983. __Pyx_RefNannySetupContext("stderr_xnl (wrapper)", 0);
  7984. {
  7985. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_exit,0};
  7986. PyObject* values[2] = {0,0};
  7987. values[1] = ((PyObject *)__pyx_int_0);
  7988. if (unlikely(__pyx_kwds)) {
  7989. Py_ssize_t kw_args;
  7990. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7991. switch (pos_args) {
  7992. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7993. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7994. case 0: break;
  7995. default: goto __pyx_L5_argtuple_error;
  7996. }
  7997. kw_args = PyDict_Size(__pyx_kwds);
  7998. switch (pos_args) {
  7999. case 0:
  8000. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--;
  8001. else goto __pyx_L5_argtuple_error;
  8002. case 1:
  8003. if (kw_args > 0) {
  8004. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exit);
  8005. if (value) { values[1] = value; kw_args--; }
  8006. }
  8007. }
  8008. if (unlikely(kw_args > 0)) {
  8009. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stderr_xnl") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8010. }
  8011. } else {
  8012. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8013. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8014. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8015. break;
  8016. default: goto __pyx_L5_argtuple_error;
  8017. }
  8018. }
  8019. __pyx_v_text = values[0];
  8020. __pyx_v_exit = values[1];
  8021. }
  8022. goto __pyx_L4_argument_unpacking_done;
  8023. __pyx_L5_argtuple_error:;
  8024. __Pyx_RaiseArgtupleInvalid("stderr_xnl", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8025. __pyx_L3_error:;
  8026. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8027. __Pyx_RefNannyFinishContext();
  8028. return NULL;
  8029. __pyx_L4_argument_unpacking_done:;
  8030. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_56stderr_xnl(__pyx_self, __pyx_v_text, __pyx_v_exit);
  8031. /* function exit code */
  8032. __Pyx_RefNannyFinishContext();
  8033. return __pyx_r;
  8034. }
  8035. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_56stderr_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit) {
  8036. PyObject *__pyx_v_e = NULL;
  8037. PyObject *__pyx_r = NULL;
  8038. __Pyx_RefNannyDeclarations
  8039. PyObject *__pyx_t_1 = NULL;
  8040. PyObject *__pyx_t_2 = NULL;
  8041. PyObject *__pyx_t_3 = NULL;
  8042. PyObject *__pyx_t_4 = NULL;
  8043. PyObject *__pyx_t_5 = NULL;
  8044. PyObject *__pyx_t_6 = NULL;
  8045. int __pyx_t_7;
  8046. int __pyx_t_8;
  8047. PyObject *__pyx_t_9 = NULL;
  8048. PyObject *__pyx_t_10 = NULL;
  8049. int __pyx_lineno = 0;
  8050. const char *__pyx_filename = NULL;
  8051. int __pyx_clineno = 0;
  8052. __Pyx_RefNannySetupContext("stderr_xnl", 0);
  8053. /* "lib/Naked/toolshed/c/system.pyx":498
  8054. * #------------------------------------------------------------------------------
  8055. * def stderr_xnl(text, exit=0):
  8056. * try: # <<<<<<<<<<<<<<
  8057. * sys.stderr.write(text)
  8058. * if exit:
  8059. */
  8060. {
  8061. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  8062. __Pyx_XGOTREF(__pyx_t_1);
  8063. __Pyx_XGOTREF(__pyx_t_2);
  8064. __Pyx_XGOTREF(__pyx_t_3);
  8065. /*try:*/ {
  8066. /* "lib/Naked/toolshed/c/system.pyx":499
  8067. * def stderr_xnl(text, exit=0):
  8068. * try:
  8069. * sys.stderr.write(text) # <<<<<<<<<<<<<<
  8070. * if exit:
  8071. * raise SystemExit(exit)
  8072. */
  8073. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8074. __Pyx_GOTREF(__pyx_t_4);
  8075. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8076. __Pyx_GOTREF(__pyx_t_5);
  8077. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8078. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8079. __Pyx_GOTREF(__pyx_t_4);
  8080. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  8081. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8082. __Pyx_GOTREF(__pyx_t_5);
  8083. __Pyx_INCREF(__pyx_v_text);
  8084. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text);
  8085. __Pyx_GIVEREF(__pyx_v_text);
  8086. __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8087. __Pyx_GOTREF(__pyx_t_6);
  8088. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8089. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  8090. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8091. /* "lib/Naked/toolshed/c/system.pyx":500
  8092. * try:
  8093. * sys.stderr.write(text)
  8094. * if exit: # <<<<<<<<<<<<<<
  8095. * raise SystemExit(exit)
  8096. * except Exception as e:
  8097. */
  8098. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exit); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8099. if (__pyx_t_7) {
  8100. /* "lib/Naked/toolshed/c/system.pyx":501
  8101. * sys.stderr.write(text)
  8102. * if exit:
  8103. * raise SystemExit(exit) # <<<<<<<<<<<<<<
  8104. * except Exception as e:
  8105. * if DEBUG_FLAG:
  8106. */
  8107. __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8108. __Pyx_GOTREF(__pyx_t_6);
  8109. __Pyx_INCREF(__pyx_v_exit);
  8110. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_exit);
  8111. __Pyx_GIVEREF(__pyx_v_exit);
  8112. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8113. __Pyx_GOTREF(__pyx_t_5);
  8114. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8115. __Pyx_Raise(__pyx_t_5, 0, 0, 0);
  8116. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  8117. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8118. }
  8119. }
  8120. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  8121. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  8122. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8123. goto __pyx_L10_try_end;
  8124. __pyx_L3_error:;
  8125. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8126. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8127. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  8128. /* "lib/Naked/toolshed/c/system.pyx":502
  8129. * if exit:
  8130. * raise SystemExit(exit)
  8131. * except Exception as e: # <<<<<<<<<<<<<<
  8132. * if DEBUG_FLAG:
  8133. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).")
  8134. */
  8135. __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
  8136. if (__pyx_t_8) {
  8137. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8138. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  8139. __Pyx_GOTREF(__pyx_t_5);
  8140. __Pyx_GOTREF(__pyx_t_6);
  8141. __Pyx_GOTREF(__pyx_t_4);
  8142. __Pyx_INCREF(__pyx_t_6);
  8143. __pyx_v_e = __pyx_t_6;
  8144. /* "lib/Naked/toolshed/c/system.pyx":503
  8145. * raise SystemExit(exit)
  8146. * except Exception as e:
  8147. * if DEBUG_FLAG: # <<<<<<<<<<<<<<
  8148. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).")
  8149. * raise e
  8150. */
  8151. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  8152. __Pyx_GOTREF(__pyx_t_9);
  8153. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  8154. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8155. if (__pyx_t_7) {
  8156. /* "lib/Naked/toolshed/c/system.pyx":504
  8157. * except Exception as e:
  8158. * if DEBUG_FLAG:
  8159. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  8160. * raise e
  8161. *
  8162. */
  8163. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  8164. __Pyx_GOTREF(__pyx_t_9);
  8165. __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 = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  8166. __Pyx_GOTREF(__pyx_t_10);
  8167. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8168. __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 = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  8169. __Pyx_GOTREF(__pyx_t_9);
  8170. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8171. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  8172. __Pyx_GOTREF(__pyx_t_10);
  8173. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8174. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8175. goto __pyx_L14;
  8176. }
  8177. __pyx_L14:;
  8178. /* "lib/Naked/toolshed/c/system.pyx":505
  8179. * if DEBUG_FLAG:
  8180. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).")
  8181. * raise e # <<<<<<<<<<<<<<
  8182. *
  8183. * #------------------------------------------------------------------------------
  8184. */
  8185. __Pyx_Raise(__pyx_v_e, 0, 0, 0);
  8186. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
  8187. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  8188. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8189. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8190. goto __pyx_L4_exception_handled;
  8191. }
  8192. goto __pyx_L5_except_error;
  8193. __pyx_L5_except_error:;
  8194. __Pyx_XGIVEREF(__pyx_t_1);
  8195. __Pyx_XGIVEREF(__pyx_t_2);
  8196. __Pyx_XGIVEREF(__pyx_t_3);
  8197. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  8198. goto __pyx_L1_error;
  8199. __pyx_L4_exception_handled:;
  8200. __Pyx_XGIVEREF(__pyx_t_1);
  8201. __Pyx_XGIVEREF(__pyx_t_2);
  8202. __Pyx_XGIVEREF(__pyx_t_3);
  8203. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  8204. __pyx_L10_try_end:;
  8205. }
  8206. /* "lib/Naked/toolshed/c/system.pyx":497
  8207. * # print to the standard error stream without a newline character after the `text` string
  8208. * #------------------------------------------------------------------------------
  8209. * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<<
  8210. * try:
  8211. * sys.stderr.write(text)
  8212. */
  8213. /* function exit code */
  8214. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  8215. goto __pyx_L0;
  8216. __pyx_L1_error:;
  8217. __Pyx_XDECREF(__pyx_t_4);
  8218. __Pyx_XDECREF(__pyx_t_5);
  8219. __Pyx_XDECREF(__pyx_t_6);
  8220. __Pyx_XDECREF(__pyx_t_9);
  8221. __Pyx_XDECREF(__pyx_t_10);
  8222. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8223. __pyx_r = NULL;
  8224. __pyx_L0:;
  8225. __Pyx_XDECREF(__pyx_v_e);
  8226. __Pyx_XGIVEREF(__pyx_r);
  8227. __Pyx_RefNannyFinishContext();
  8228. return __pyx_r;
  8229. }
  8230. /* "lib/Naked/toolshed/c/system.pyx":519
  8231. * # Tests: test_SYSTEM.py :: test_sys_exit_with_code
  8232. * #------------------------------------------------------------------------------
  8233. * def exit_with_status(exit=0): # <<<<<<<<<<<<<<
  8234. * raise SystemExit(exit)
  8235. *
  8236. */
  8237. /* Python wrapper */
  8238. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_59exit_with_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8239. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_59exit_with_status = {__Pyx_NAMESTR("exit_with_status"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_59exit_with_status, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  8240. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_59exit_with_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8241. PyObject *__pyx_v_exit = 0;
  8242. int __pyx_lineno = 0;
  8243. const char *__pyx_filename = NULL;
  8244. int __pyx_clineno = 0;
  8245. PyObject *__pyx_r = 0;
  8246. __Pyx_RefNannyDeclarations
  8247. __Pyx_RefNannySetupContext("exit_with_status (wrapper)", 0);
  8248. {
  8249. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exit,0};
  8250. PyObject* values[1] = {0};
  8251. values[0] = ((PyObject *)__pyx_int_0);
  8252. if (unlikely(__pyx_kwds)) {
  8253. Py_ssize_t kw_args;
  8254. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8255. switch (pos_args) {
  8256. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8257. case 0: break;
  8258. default: goto __pyx_L5_argtuple_error;
  8259. }
  8260. kw_args = PyDict_Size(__pyx_kwds);
  8261. switch (pos_args) {
  8262. case 0:
  8263. if (kw_args > 0) {
  8264. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exit);
  8265. if (value) { values[0] = value; kw_args--; }
  8266. }
  8267. }
  8268. if (unlikely(kw_args > 0)) {
  8269. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "exit_with_status") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8270. }
  8271. } else {
  8272. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8273. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8274. case 0: break;
  8275. default: goto __pyx_L5_argtuple_error;
  8276. }
  8277. }
  8278. __pyx_v_exit = values[0];
  8279. }
  8280. goto __pyx_L4_argument_unpacking_done;
  8281. __pyx_L5_argtuple_error:;
  8282. __Pyx_RaiseArgtupleInvalid("exit_with_status", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8283. __pyx_L3_error:;
  8284. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_with_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8285. __Pyx_RefNannyFinishContext();
  8286. return NULL;
  8287. __pyx_L4_argument_unpacking_done:;
  8288. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_58exit_with_status(__pyx_self, __pyx_v_exit);
  8289. /* function exit code */
  8290. __Pyx_RefNannyFinishContext();
  8291. return __pyx_r;
  8292. }
  8293. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_58exit_with_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exit) {
  8294. PyObject *__pyx_r = NULL;
  8295. __Pyx_RefNannyDeclarations
  8296. PyObject *__pyx_t_1 = NULL;
  8297. PyObject *__pyx_t_2 = NULL;
  8298. int __pyx_lineno = 0;
  8299. const char *__pyx_filename = NULL;
  8300. int __pyx_clineno = 0;
  8301. __Pyx_RefNannySetupContext("exit_with_status", 0);
  8302. /* "lib/Naked/toolshed/c/system.pyx":520
  8303. * #------------------------------------------------------------------------------
  8304. * def exit_with_status(exit=0):
  8305. * raise SystemExit(exit) # <<<<<<<<<<<<<<
  8306. *
  8307. * #------------------------------------------------------------------------------
  8308. */
  8309. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8310. __Pyx_GOTREF(__pyx_t_1);
  8311. __Pyx_INCREF(__pyx_v_exit);
  8312. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_exit);
  8313. __Pyx_GIVEREF(__pyx_v_exit);
  8314. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8315. __Pyx_GOTREF(__pyx_t_2);
  8316. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8317. __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  8318. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8319. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8320. /* "lib/Naked/toolshed/c/system.pyx":519
  8321. * # Tests: test_SYSTEM.py :: test_sys_exit_with_code
  8322. * #------------------------------------------------------------------------------
  8323. * def exit_with_status(exit=0): # <<<<<<<<<<<<<<
  8324. * raise SystemExit(exit)
  8325. *
  8326. */
  8327. /* function exit code */
  8328. __pyx_L1_error:;
  8329. __Pyx_XDECREF(__pyx_t_1);
  8330. __Pyx_XDECREF(__pyx_t_2);
  8331. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_with_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8332. __pyx_r = NULL;
  8333. __Pyx_XGIVEREF(__pyx_r);
  8334. __Pyx_RefNannyFinishContext();
  8335. return __pyx_r;
  8336. }
  8337. /* "lib/Naked/toolshed/c/system.pyx":527
  8338. * # Tests: test_SYSTEM.py :: test_sys_exit_failure
  8339. * #------------------------------------------------------------------------------
  8340. * def exit_fail(): # <<<<<<<<<<<<<<
  8341. * raise SystemExit(1)
  8342. *
  8343. */
  8344. /* Python wrapper */
  8345. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_61exit_fail(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  8346. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_61exit_fail = {__Pyx_NAMESTR("exit_fail"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_61exit_fail, METH_NOARGS, __Pyx_DOCSTR(0)};
  8347. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_61exit_fail(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  8348. PyObject *__pyx_r = 0;
  8349. __Pyx_RefNannyDeclarations
  8350. __Pyx_RefNannySetupContext("exit_fail (wrapper)", 0);
  8351. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_60exit_fail(__pyx_self);
  8352. /* function exit code */
  8353. __Pyx_RefNannyFinishContext();
  8354. return __pyx_r;
  8355. }
  8356. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_60exit_fail(CYTHON_UNUSED PyObject *__pyx_self) {
  8357. PyObject *__pyx_r = NULL;
  8358. __Pyx_RefNannyDeclarations
  8359. PyObject *__pyx_t_1 = NULL;
  8360. int __pyx_lineno = 0;
  8361. const char *__pyx_filename = NULL;
  8362. int __pyx_clineno = 0;
  8363. __Pyx_RefNannySetupContext("exit_fail", 0);
  8364. /* "lib/Naked/toolshed/c/system.pyx":528
  8365. * #------------------------------------------------------------------------------
  8366. * def exit_fail():
  8367. * raise SystemExit(1) # <<<<<<<<<<<<<<
  8368. *
  8369. * #------------------------------------------------------------------------------
  8370. */
  8371. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8372. __Pyx_GOTREF(__pyx_t_1);
  8373. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  8374. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8375. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8376. /* "lib/Naked/toolshed/c/system.pyx":527
  8377. * # Tests: test_SYSTEM.py :: test_sys_exit_failure
  8378. * #------------------------------------------------------------------------------
  8379. * def exit_fail(): # <<<<<<<<<<<<<<
  8380. * raise SystemExit(1)
  8381. *
  8382. */
  8383. /* function exit code */
  8384. __pyx_L1_error:;
  8385. __Pyx_XDECREF(__pyx_t_1);
  8386. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_fail", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8387. __pyx_r = NULL;
  8388. __Pyx_XGIVEREF(__pyx_r);
  8389. __Pyx_RefNannyFinishContext();
  8390. return __pyx_r;
  8391. }
  8392. /* "lib/Naked/toolshed/c/system.pyx":535
  8393. * # Tests: test_SYSTEM.py :: test_sys_exit_success
  8394. * #------------------------------------------------------------------------------
  8395. * def exit_success(): # <<<<<<<<<<<<<<
  8396. * raise SystemExit(0)
  8397. *
  8398. */
  8399. /* Python wrapper */
  8400. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_63exit_success(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  8401. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_63exit_success = {__Pyx_NAMESTR("exit_success"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_63exit_success, METH_NOARGS, __Pyx_DOCSTR(0)};
  8402. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_63exit_success(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  8403. PyObject *__pyx_r = 0;
  8404. __Pyx_RefNannyDeclarations
  8405. __Pyx_RefNannySetupContext("exit_success (wrapper)", 0);
  8406. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_62exit_success(__pyx_self);
  8407. /* function exit code */
  8408. __Pyx_RefNannyFinishContext();
  8409. return __pyx_r;
  8410. }
  8411. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_62exit_success(CYTHON_UNUSED PyObject *__pyx_self) {
  8412. PyObject *__pyx_r = NULL;
  8413. __Pyx_RefNannyDeclarations
  8414. PyObject *__pyx_t_1 = NULL;
  8415. int __pyx_lineno = 0;
  8416. const char *__pyx_filename = NULL;
  8417. int __pyx_clineno = 0;
  8418. __Pyx_RefNannySetupContext("exit_success", 0);
  8419. /* "lib/Naked/toolshed/c/system.pyx":536
  8420. * #------------------------------------------------------------------------------
  8421. * def exit_success():
  8422. * raise SystemExit(0) # <<<<<<<<<<<<<<
  8423. *
  8424. *
  8425. */
  8426. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8427. __Pyx_GOTREF(__pyx_t_1);
  8428. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  8429. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8430. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8431. /* "lib/Naked/toolshed/c/system.pyx":535
  8432. * # Tests: test_SYSTEM.py :: test_sys_exit_success
  8433. * #------------------------------------------------------------------------------
  8434. * def exit_success(): # <<<<<<<<<<<<<<
  8435. * raise SystemExit(0)
  8436. *
  8437. */
  8438. /* function exit code */
  8439. __pyx_L1_error:;
  8440. __Pyx_XDECREF(__pyx_t_1);
  8441. __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_success", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8442. __pyx_r = NULL;
  8443. __Pyx_XGIVEREF(__pyx_r);
  8444. __Pyx_RefNannyFinishContext();
  8445. return __pyx_r;
  8446. }
  8447. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile[8];
  8448. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = 0;
  8449. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  8450. PyObject *o;
  8451. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile)))) {
  8452. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile[--__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile];
  8453. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile));
  8454. (void) PyObject_INIT(o, t);
  8455. PyObject_GC_Track(o);
  8456. } else {
  8457. o = (*t->tp_alloc)(t, 0);
  8458. if (unlikely(!o)) return 0;
  8459. }
  8460. return o;
  8461. }
  8462. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyObject *o) {
  8463. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o;
  8464. PyObject_GC_UnTrack(o);
  8465. Py_CLEAR(p->__pyx_v_func);
  8466. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile))) {
  8467. __pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile[__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o);
  8468. } else {
  8469. (*Py_TYPE(o)->tp_free)(o);
  8470. }
  8471. }
  8472. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyObject *o, visitproc v, void *a) {
  8473. int e;
  8474. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o;
  8475. if (p->__pyx_v_func) {
  8476. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  8477. }
  8478. return 0;
  8479. }
  8480. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyObject *o) {
  8481. PyObject* tmp;
  8482. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o;
  8483. tmp = ((PyObject*)p->__pyx_v_func);
  8484. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  8485. Py_XDECREF(tmp);
  8486. return 0;
  8487. }
  8488. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = {
  8489. PyVarObject_HEAD_INIT(0, 0)
  8490. __Pyx_NAMESTR("lib.Naked.toolshed.c.system.__pyx_scope_struct__currentdir_to_basefile"), /*tp_name*/
  8491. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile), /*tp_basicsize*/
  8492. 0, /*tp_itemsize*/
  8493. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_dealloc*/
  8494. 0, /*tp_print*/
  8495. 0, /*tp_getattr*/
  8496. 0, /*tp_setattr*/
  8497. #if PY_MAJOR_VERSION < 3
  8498. 0, /*tp_compare*/
  8499. #else
  8500. 0, /*reserved*/
  8501. #endif
  8502. 0, /*tp_repr*/
  8503. 0, /*tp_as_number*/
  8504. 0, /*tp_as_sequence*/
  8505. 0, /*tp_as_mapping*/
  8506. 0, /*tp_hash*/
  8507. 0, /*tp_call*/
  8508. 0, /*tp_str*/
  8509. 0, /*tp_getattro*/
  8510. 0, /*tp_setattro*/
  8511. 0, /*tp_as_buffer*/
  8512. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  8513. 0, /*tp_doc*/
  8514. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_traverse*/
  8515. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_clear*/
  8516. 0, /*tp_richcompare*/
  8517. 0, /*tp_weaklistoffset*/
  8518. 0, /*tp_iter*/
  8519. 0, /*tp_iternext*/
  8520. 0, /*tp_methods*/
  8521. 0, /*tp_members*/
  8522. 0, /*tp_getset*/
  8523. 0, /*tp_base*/
  8524. 0, /*tp_dict*/
  8525. 0, /*tp_descr_get*/
  8526. 0, /*tp_descr_set*/
  8527. 0, /*tp_dictoffset*/
  8528. 0, /*tp_init*/
  8529. 0, /*tp_alloc*/
  8530. __pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_new*/
  8531. 0, /*tp_free*/
  8532. 0, /*tp_is_gc*/
  8533. 0, /*tp_bases*/
  8534. 0, /*tp_mro*/
  8535. 0, /*tp_cache*/
  8536. 0, /*tp_subclasses*/
  8537. 0, /*tp_weaklist*/
  8538. 0, /*tp_del*/
  8539. #if PY_VERSION_HEX >= 0x02060000
  8540. 0, /*tp_version_tag*/
  8541. #endif
  8542. #if PY_VERSION_HEX >= 0x030400a1
  8543. 0, /*tp_finalize*/
  8544. #endif
  8545. };
  8546. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam[8];
  8547. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = 0;
  8548. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  8549. PyObject *o;
  8550. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam)))) {
  8551. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam[--__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam];
  8552. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam));
  8553. (void) PyObject_INIT(o, t);
  8554. PyObject_GC_Track(o);
  8555. } else {
  8556. o = (*t->tp_alloc)(t, 0);
  8557. if (unlikely(!o)) return 0;
  8558. }
  8559. return o;
  8560. }
  8561. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyObject *o) {
  8562. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o;
  8563. PyObject_GC_UnTrack(o);
  8564. Py_CLEAR(p->__pyx_v_func);
  8565. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam))) {
  8566. __pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam[__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o);
  8567. } else {
  8568. (*Py_TYPE(o)->tp_free)(o);
  8569. }
  8570. }
  8571. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyObject *o, visitproc v, void *a) {
  8572. int e;
  8573. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o;
  8574. if (p->__pyx_v_func) {
  8575. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  8576. }
  8577. return 0;
  8578. }
  8579. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyObject *o) {
  8580. PyObject* tmp;
  8581. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o;
  8582. tmp = ((PyObject*)p->__pyx_v_func);
  8583. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  8584. Py_XDECREF(tmp);
  8585. return 0;
  8586. }
  8587. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = {
  8588. PyVarObject_HEAD_INIT(0, 0)
  8589. __Pyx_NAMESTR("lib.Naked.toolshed.c.system.__pyx_scope_struct_1_currentdir_firstparam"), /*tp_name*/
  8590. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam), /*tp_basicsize*/
  8591. 0, /*tp_itemsize*/
  8592. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_dealloc*/
  8593. 0, /*tp_print*/
  8594. 0, /*tp_getattr*/
  8595. 0, /*tp_setattr*/
  8596. #if PY_MAJOR_VERSION < 3
  8597. 0, /*tp_compare*/
  8598. #else
  8599. 0, /*reserved*/
  8600. #endif
  8601. 0, /*tp_repr*/
  8602. 0, /*tp_as_number*/
  8603. 0, /*tp_as_sequence*/
  8604. 0, /*tp_as_mapping*/
  8605. 0, /*tp_hash*/
  8606. 0, /*tp_call*/
  8607. 0, /*tp_str*/
  8608. 0, /*tp_getattro*/
  8609. 0, /*tp_setattro*/
  8610. 0, /*tp_as_buffer*/
  8611. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  8612. 0, /*tp_doc*/
  8613. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_traverse*/
  8614. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_clear*/
  8615. 0, /*tp_richcompare*/
  8616. 0, /*tp_weaklistoffset*/
  8617. 0, /*tp_iter*/
  8618. 0, /*tp_iternext*/
  8619. 0, /*tp_methods*/
  8620. 0, /*tp_members*/
  8621. 0, /*tp_getset*/
  8622. 0, /*tp_base*/
  8623. 0, /*tp_dict*/
  8624. 0, /*tp_descr_get*/
  8625. 0, /*tp_descr_set*/
  8626. 0, /*tp_dictoffset*/
  8627. 0, /*tp_init*/
  8628. 0, /*tp_alloc*/
  8629. __pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_new*/
  8630. 0, /*tp_free*/
  8631. 0, /*tp_is_gc*/
  8632. 0, /*tp_bases*/
  8633. 0, /*tp_mro*/
  8634. 0, /*tp_cache*/
  8635. 0, /*tp_subclasses*/
  8636. 0, /*tp_weaklist*/
  8637. 0, /*tp_del*/
  8638. #if PY_VERSION_HEX >= 0x02060000
  8639. 0, /*tp_version_tag*/
  8640. #endif
  8641. #if PY_VERSION_HEX >= 0x030400a1
  8642. 0, /*tp_finalize*/
  8643. #endif
  8644. };
  8645. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam[8];
  8646. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = 0;
  8647. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  8648. PyObject *o;
  8649. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam)))) {
  8650. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam[--__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam];
  8651. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam));
  8652. (void) PyObject_INIT(o, t);
  8653. PyObject_GC_Track(o);
  8654. } else {
  8655. o = (*t->tp_alloc)(t, 0);
  8656. if (unlikely(!o)) return 0;
  8657. }
  8658. return o;
  8659. }
  8660. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyObject *o) {
  8661. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o;
  8662. PyObject_GC_UnTrack(o);
  8663. Py_CLEAR(p->__pyx_v_func);
  8664. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam))) {
  8665. __pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam[__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o);
  8666. } else {
  8667. (*Py_TYPE(o)->tp_free)(o);
  8668. }
  8669. }
  8670. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyObject *o, visitproc v, void *a) {
  8671. int e;
  8672. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o;
  8673. if (p->__pyx_v_func) {
  8674. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  8675. }
  8676. return 0;
  8677. }
  8678. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyObject *o) {
  8679. PyObject* tmp;
  8680. struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o;
  8681. tmp = ((PyObject*)p->__pyx_v_func);
  8682. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  8683. Py_XDECREF(tmp);
  8684. return 0;
  8685. }
  8686. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = {
  8687. PyVarObject_HEAD_INIT(0, 0)
  8688. __Pyx_NAMESTR("lib.Naked.toolshed.c.system.__pyx_scope_struct_2_currentdir_lastparam"), /*tp_name*/
  8689. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam), /*tp_basicsize*/
  8690. 0, /*tp_itemsize*/
  8691. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_dealloc*/
  8692. 0, /*tp_print*/
  8693. 0, /*tp_getattr*/
  8694. 0, /*tp_setattr*/
  8695. #if PY_MAJOR_VERSION < 3
  8696. 0, /*tp_compare*/
  8697. #else
  8698. 0, /*reserved*/
  8699. #endif
  8700. 0, /*tp_repr*/
  8701. 0, /*tp_as_number*/
  8702. 0, /*tp_as_sequence*/
  8703. 0, /*tp_as_mapping*/
  8704. 0, /*tp_hash*/
  8705. 0, /*tp_call*/
  8706. 0, /*tp_str*/
  8707. 0, /*tp_getattro*/
  8708. 0, /*tp_setattro*/
  8709. 0, /*tp_as_buffer*/
  8710. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  8711. 0, /*tp_doc*/
  8712. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_traverse*/
  8713. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_clear*/
  8714. 0, /*tp_richcompare*/
  8715. 0, /*tp_weaklistoffset*/
  8716. 0, /*tp_iter*/
  8717. 0, /*tp_iternext*/
  8718. 0, /*tp_methods*/
  8719. 0, /*tp_members*/
  8720. 0, /*tp_getset*/
  8721. 0, /*tp_base*/
  8722. 0, /*tp_dict*/
  8723. 0, /*tp_descr_get*/
  8724. 0, /*tp_descr_set*/
  8725. 0, /*tp_dictoffset*/
  8726. 0, /*tp_init*/
  8727. 0, /*tp_alloc*/
  8728. __pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_new*/
  8729. 0, /*tp_free*/
  8730. 0, /*tp_is_gc*/
  8731. 0, /*tp_bases*/
  8732. 0, /*tp_mro*/
  8733. 0, /*tp_cache*/
  8734. 0, /*tp_subclasses*/
  8735. 0, /*tp_weaklist*/
  8736. 0, /*tp_del*/
  8737. #if PY_VERSION_HEX >= 0x02060000
  8738. 0, /*tp_version_tag*/
  8739. #endif
  8740. #if PY_VERSION_HEX >= 0x030400a1
  8741. 0, /*tp_finalize*/
  8742. #endif
  8743. };
  8744. static PyMethodDef __pyx_methods[] = {
  8745. {0, 0, 0, 0}
  8746. };
  8747. #if PY_MAJOR_VERSION >= 3
  8748. static struct PyModuleDef __pyx_moduledef = {
  8749. #if PY_VERSION_HEX < 0x03020000
  8750. { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  8751. #else
  8752. PyModuleDef_HEAD_INIT,
  8753. #endif
  8754. __Pyx_NAMESTR("system"),
  8755. 0, /* m_doc */
  8756. -1, /* m_size */
  8757. __pyx_methods /* m_methods */,
  8758. NULL, /* m_reload */
  8759. NULL, /* m_traverse */
  8760. NULL, /* m_clear */
  8761. NULL /* m_free */
  8762. };
  8763. #endif
  8764. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  8765. {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1},
  8766. {&__pyx_n_s_EEXIST, __pyx_k_EEXIST, sizeof(__pyx_k_EEXIST), 0, 0, 1, 1},
  8767. {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  8768. {&__pyx_kp_s_Naked_Framework_Error_Could_not, __pyx_k_Naked_Framework_Error_Could_not, sizeof(__pyx_k_Naked_Framework_Error_Could_not), 0, 0, 1, 0},
  8769. {&__pyx_kp_s_Naked_Framework_Error_error_with, __pyx_k_Naked_Framework_Error_error_with, sizeof(__pyx_k_Naked_Framework_Error_error_with), 0, 0, 1, 0},
  8770. {&__pyx_kp_s_Naked_Framework_Error_error_with_2, __pyx_k_Naked_Framework_Error_error_with_2, sizeof(__pyx_k_Naked_Framework_Error_error_with_2), 0, 0, 1, 0},
  8771. {&__pyx_kp_s_Naked_Framework_Error_error_with_3, __pyx_k_Naked_Framework_Error_error_with_3, sizeof(__pyx_k_Naked_Framework_Error_error_with_3), 0, 0, 1, 0},
  8772. {&__pyx_kp_s_Naked_Framework_Error_error_with_4, __pyx_k_Naked_Framework_Error_error_with_4, sizeof(__pyx_k_Naked_Framework_Error_error_with_4), 0, 0, 1, 0},
  8773. {&__pyx_kp_s_Naked_Framework_Error_error_with_5, __pyx_k_Naked_Framework_Error_error_with_5, sizeof(__pyx_k_Naked_Framework_Error_error_with_5), 0, 0, 1, 0},
  8774. {&__pyx_kp_s_Naked_Framework_Error_error_with_6, __pyx_k_Naked_Framework_Error_error_with_6, sizeof(__pyx_k_Naked_Framework_Error_error_with_6), 0, 0, 1, 0},
  8775. {&__pyx_kp_s_Naked_Framework_Error_error_with_7, __pyx_k_Naked_Framework_Error_error_with_7, sizeof(__pyx_k_Naked_Framework_Error_error_with_7), 0, 0, 1, 0},
  8776. {&__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},
  8777. {&__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},
  8778. {&__pyx_kp_s_Naked_Framework_Error_unable_to_11, __pyx_k_Naked_Framework_Error_unable_to_11, sizeof(__pyx_k_Naked_Framework_Error_unable_to_11), 0, 0, 1, 0},
  8779. {&__pyx_kp_s_Naked_Framework_Error_unable_to_12, __pyx_k_Naked_Framework_Error_unable_to_12, sizeof(__pyx_k_Naked_Framework_Error_unable_to_12), 0, 0, 1, 0},
  8780. {&__pyx_kp_s_Naked_Framework_Error_unable_to_13, __pyx_k_Naked_Framework_Error_unable_to_13, sizeof(__pyx_k_Naked_Framework_Error_unable_to_13), 0, 0, 1, 0},
  8781. {&__pyx_kp_s_Naked_Framework_Error_unable_to_14, __pyx_k_Naked_Framework_Error_unable_to_14, sizeof(__pyx_k_Naked_Framework_Error_unable_to_14), 0, 0, 1, 0},
  8782. {&__pyx_kp_s_Naked_Framework_Error_unable_to_15, __pyx_k_Naked_Framework_Error_unable_to_15, sizeof(__pyx_k_Naked_Framework_Error_unable_to_15), 0, 0, 1, 0},
  8783. {&__pyx_kp_s_Naked_Framework_Error_unable_to_16, __pyx_k_Naked_Framework_Error_unable_to_16, sizeof(__pyx_k_Naked_Framework_Error_unable_to_16), 0, 0, 1, 0},
  8784. {&__pyx_kp_s_Naked_Framework_Error_unable_to_17, __pyx_k_Naked_Framework_Error_unable_to_17, sizeof(__pyx_k_Naked_Framework_Error_unable_to_17), 0, 0, 1, 0},
  8785. {&__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},
  8786. {&__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},
  8787. {&__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},
  8788. {&__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},
  8789. {&__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},
  8790. {&__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},
  8791. {&__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},
  8792. {&__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},
  8793. {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1},
  8794. {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1},
  8795. {&__pyx_n_s_SystemExit, __pyx_k_SystemExit, sizeof(__pyx_k_SystemExit), 0, 0, 1, 1},
  8796. {&__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},
  8797. {&__pyx_kp_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 0},
  8798. {&__pyx_kp_s__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 1, 0},
  8799. {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0},
  8800. {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  8801. {&__pyx_n_s_basename, __pyx_k_basename, sizeof(__pyx_k_basename), 0, 0, 1, 1},
  8802. {&__pyx_n_s_ctime, __pyx_k_ctime, sizeof(__pyx_k_ctime), 0, 0, 1, 1},
  8803. {&__pyx_n_s_current_dir, __pyx_k_current_dir, sizeof(__pyx_k_current_dir), 0, 0, 1, 1},
  8804. {&__pyx_n_s_current_directory, __pyx_k_current_directory, sizeof(__pyx_k_current_directory), 0, 0, 1, 1},
  8805. {&__pyx_n_s_currentdir_firstparam, __pyx_k_currentdir_firstparam, sizeof(__pyx_k_currentdir_firstparam), 0, 0, 1, 1},
  8806. {&__pyx_n_s_currentdir_firstparam_locals_wra, __pyx_k_currentdir_firstparam_locals_wra, sizeof(__pyx_k_currentdir_firstparam_locals_wra), 0, 0, 1, 1},
  8807. {&__pyx_n_s_currentdir_lastparam, __pyx_k_currentdir_lastparam, sizeof(__pyx_k_currentdir_lastparam), 0, 0, 1, 1},
  8808. {&__pyx_n_s_currentdir_lastparam_locals_wrap, __pyx_k_currentdir_lastparam_locals_wrap, sizeof(__pyx_k_currentdir_lastparam_locals_wrap), 0, 0, 1, 1},
  8809. {&__pyx_n_s_currentdir_to_basefile, __pyx_k_currentdir_to_basefile, sizeof(__pyx_k_currentdir_to_basefile), 0, 0, 1, 1},
  8810. {&__pyx_n_s_currentdir_to_basefile_locals_wr, __pyx_k_currentdir_to_basefile_locals_wr, sizeof(__pyx_k_currentdir_to_basefile_locals_wr), 0, 0, 1, 1},
  8811. {&__pyx_n_s_cwd, __pyx_k_cwd, sizeof(__pyx_k_cwd), 0, 0, 1, 1},
  8812. {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
  8813. {&__pyx_n_s_dir, __pyx_k_dir, sizeof(__pyx_k_dir), 0, 0, 1, 1},
  8814. {&__pyx_n_s_dir_exists, __pyx_k_dir_exists, sizeof(__pyx_k_dir_exists), 0, 0, 1, 1},
  8815. {&__pyx_n_s_directory, __pyx_k_directory, sizeof(__pyx_k_directory), 0, 0, 1, 1},
  8816. {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  8817. {&__pyx_n_s_dirpath, __pyx_k_dirpath, sizeof(__pyx_k_dirpath), 0, 0, 1, 1},
  8818. {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  8819. {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  8820. {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
  8821. {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1},
  8822. {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
  8823. {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  8824. {&__pyx_n_s_exit_fail, __pyx_k_exit_fail, sizeof(__pyx_k_exit_fail), 0, 0, 1, 1},
  8825. {&__pyx_n_s_exit_success, __pyx_k_exit_success, sizeof(__pyx_k_exit_success), 0, 0, 1, 1},
  8826. {&__pyx_n_s_exit_with_status, __pyx_k_exit_with_status, sizeof(__pyx_k_exit_with_status), 0, 0, 1, 1},
  8827. {&__pyx_n_s_extension_filter, __pyx_k_extension_filter, sizeof(__pyx_k_extension_filter), 0, 0, 1, 1},
  8828. {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  8829. {&__pyx_n_s_file_exists, __pyx_k_file_exists, sizeof(__pyx_k_file_exists), 0, 0, 1, 1},
  8830. {&__pyx_n_s_file_extension, __pyx_k_file_extension, sizeof(__pyx_k_file_extension), 0, 0, 1, 1},
  8831. {&__pyx_n_s_file_mod_time, __pyx_k_file_mod_time, sizeof(__pyx_k_file_mod_time), 0, 0, 1, 1},
  8832. {&__pyx_n_s_file_name, __pyx_k_file_name, sizeof(__pyx_k_file_name), 0, 0, 1, 1},
  8833. {&__pyx_n_s_file_size, __pyx_k_file_size, sizeof(__pyx_k_file_size), 0, 0, 1, 1},
  8834. {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
  8835. {&__pyx_n_s_filenames, __pyx_k_filenames, sizeof(__pyx_k_filenames), 0, 0, 1, 1},
  8836. {&__pyx_n_s_filenames_fullpath, __pyx_k_filenames_fullpath, sizeof(__pyx_k_filenames_fullpath), 0, 0, 1, 1},
  8837. {&__pyx_n_s_filepath, __pyx_k_filepath, sizeof(__pyx_k_filepath), 0, 0, 1, 1},
  8838. {&__pyx_n_s_full_path, __pyx_k_full_path, sizeof(__pyx_k_full_path), 0, 0, 1, 1},
  8839. {&__pyx_n_s_fullpath, __pyx_k_fullpath, sizeof(__pyx_k_fullpath), 0, 0, 1, 1},
  8840. {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  8841. {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
  8842. {&__pyx_n_s_getcwd, __pyx_k_getcwd, sizeof(__pyx_k_getcwd), 0, 0, 1, 1},
  8843. {&__pyx_n_s_getmtime, __pyx_k_getmtime, sizeof(__pyx_k_getmtime), 0, 0, 1, 1},
  8844. {&__pyx_n_s_getsize, __pyx_k_getsize, sizeof(__pyx_k_getsize), 0, 0, 1, 1},
  8845. {&__pyx_n_s_glob, __pyx_k_glob, sizeof(__pyx_k_glob), 0, 0, 1, 1},
  8846. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  8847. {&__pyx_n_s_is_dir, __pyx_k_is_dir, sizeof(__pyx_k_is_dir), 0, 0, 1, 1},
  8848. {&__pyx_n_s_is_file, __pyx_k_is_file, sizeof(__pyx_k_is_file), 0, 0, 1, 1},
  8849. {&__pyx_n_s_is_link, __pyx_k_is_link, sizeof(__pyx_k_is_link), 0, 0, 1, 1},
  8850. {&__pyx_n_s_isdir, __pyx_k_isdir, sizeof(__pyx_k_isdir), 0, 0, 1, 1},
  8851. {&__pyx_n_s_isfile, __pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 0, 1, 1},
  8852. {&__pyx_n_s_islink, __pyx_k_islink, sizeof(__pyx_k_islink), 0, 0, 1, 1},
  8853. {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
  8854. {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  8855. {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  8856. {&__pyx_n_s_lib_Naked_toolshed_c_system, __pyx_k_lib_Naked_toolshed_c_system, sizeof(__pyx_k_lib_Naked_toolshed_c_system), 0, 0, 1, 1},
  8857. {&__pyx_n_s_list_all_files, __pyx_k_list_all_files, sizeof(__pyx_k_list_all_files), 0, 0, 1, 1},
  8858. {&__pyx_n_s_list_all_files_cwd, __pyx_k_list_all_files_cwd, sizeof(__pyx_k_list_all_files_cwd), 0, 0, 1, 1},
  8859. {&__pyx_n_s_list_filter_files, __pyx_k_list_filter_files, sizeof(__pyx_k_list_filter_files), 0, 0, 1, 1},
  8860. {&__pyx_n_s_list_filter_files_cwd, __pyx_k_list_filter_files_cwd, sizeof(__pyx_k_list_filter_files_cwd), 0, 0, 1, 1},
  8861. {&__pyx_n_s_list_match_files, __pyx_k_list_match_files, sizeof(__pyx_k_list_match_files), 0, 0, 1, 1},
  8862. {&__pyx_n_s_listdir, __pyx_k_listdir, sizeof(__pyx_k_listdir), 0, 0, 1, 1},
  8863. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  8864. {&__pyx_n_s_make_dirs, __pyx_k_make_dirs, sizeof(__pyx_k_make_dirs), 0, 0, 1, 1},
  8865. {&__pyx_n_s_make_path, __pyx_k_make_path, sizeof(__pyx_k_make_path), 0, 0, 1, 1},
  8866. {&__pyx_n_s_makedirs, __pyx_k_makedirs, sizeof(__pyx_k_makedirs), 0, 0, 1, 1},
  8867. {&__pyx_n_s_match_pattern, __pyx_k_match_pattern, sizeof(__pyx_k_match_pattern), 0, 0, 1, 1},
  8868. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  8869. {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  8870. {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  8871. {&__pyx_n_s_ose, __pyx_k_ose, sizeof(__pyx_k_ose), 0, 0, 1, 1},
  8872. {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  8873. {&__pyx_n_s_path_list, __pyx_k_path_list, sizeof(__pyx_k_path_list), 0, 0, 1, 1},
  8874. {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  8875. {&__pyx_n_s_real_path, __pyx_k_real_path, sizeof(__pyx_k_real_path), 0, 0, 1, 1},
  8876. {&__pyx_n_s_realpath, __pyx_k_realpath, sizeof(__pyx_k_realpath), 0, 0, 1, 1},
  8877. {&__pyx_n_s_splitext, __pyx_k_splitext, sizeof(__pyx_k_splitext), 0, 0, 1, 1},
  8878. {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  8879. {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
  8880. {&__pyx_n_s_stderr_xnl, __pyx_k_stderr_xnl, sizeof(__pyx_k_stderr_xnl), 0, 0, 1, 1},
  8881. {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  8882. {&__pyx_n_s_stdout_iter, __pyx_k_stdout_iter, sizeof(__pyx_k_stdout_iter), 0, 0, 1, 1},
  8883. {&__pyx_n_s_stdout_iter_xnl, __pyx_k_stdout_iter_xnl, sizeof(__pyx_k_stdout_iter_xnl), 0, 0, 1, 1},
  8884. {&__pyx_n_s_stdout_xnl, __pyx_k_stdout_xnl, sizeof(__pyx_k_stdout_xnl), 0, 0, 1, 1},
  8885. {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  8886. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  8887. {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
  8888. {&__pyx_n_s_the_cwd, __pyx_k_the_cwd, sizeof(__pyx_k_the_cwd), 0, 0, 1, 1},
  8889. {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  8890. {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1},
  8891. {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1},
  8892. {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  8893. {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  8894. {0, 0, 0, 0, 0, 0, 0}
  8895. };
  8896. static int __Pyx_InitCachedBuiltins(void) {
  8897. __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8898. __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8899. __pyx_builtin_SystemExit = __Pyx_GetBuiltinName(__pyx_n_s_SystemExit); if (!__pyx_builtin_SystemExit) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8900. return 0;
  8901. __pyx_L1_error:;
  8902. return -1;
  8903. }
  8904. static int __Pyx_InitCachedConstants(void) {
  8905. __Pyx_RefNannyDeclarations
  8906. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  8907. /* "lib/Naked/toolshed/c/system.pyx":25
  8908. * except Exception as e:
  8909. * if DEBUG_FLAG:
  8910. * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  8911. * raise e
  8912. *
  8913. */
  8914. __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8915. __Pyx_GOTREF(__pyx_tuple_);
  8916. __Pyx_GIVEREF(__pyx_tuple_);
  8917. /* "lib/Naked/toolshed/c/system.pyx":38
  8918. * except Exception as e:
  8919. * if DEBUG_FLAG:
  8920. * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  8921. * raise e
  8922. *
  8923. */
  8924. __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8925. __Pyx_GOTREF(__pyx_tuple__2);
  8926. __Pyx_GIVEREF(__pyx_tuple__2);
  8927. /* "lib/Naked/toolshed/c/system.pyx":52
  8928. * except Exception as e:
  8929. * if DEBUG_FLAG:
  8930. * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  8931. * raise e
  8932. *
  8933. */
  8934. __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_3); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8935. __Pyx_GOTREF(__pyx_tuple__3);
  8936. __Pyx_GIVEREF(__pyx_tuple__3);
  8937. /* "lib/Naked/toolshed/c/system.pyx":65
  8938. * except Exception as e:
  8939. * if DEBUG_FLAG:
  8940. * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  8941. * raise e
  8942. *
  8943. */
  8944. __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8945. __Pyx_GOTREF(__pyx_tuple__4);
  8946. __Pyx_GIVEREF(__pyx_tuple__4);
  8947. /* "lib/Naked/toolshed/c/system.pyx":79
  8948. *
  8949. * @wraps(func)
  8950. * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<<
  8951. * current_directory = os.getcwd() #get current working directory path
  8952. * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path
  8953. */
  8954. __pyx_tuple__5 = PyTuple_Pack(5, __pyx_n_s_file_name, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_current_directory, __pyx_n_s_full_path); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8955. __Pyx_GOTREF(__pyx_tuple__5);
  8956. __Pyx_GIVEREF(__pyx_tuple__5);
  8957. __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8958. /* "lib/Naked/toolshed/c/system.pyx":86
  8959. * except Exception as e:
  8960. * if DEBUG_FLAG:
  8961. * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  8962. * raise e
  8963. *
  8964. */
  8965. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8966. __Pyx_GOTREF(__pyx_tuple__7);
  8967. __Pyx_GIVEREF(__pyx_tuple__7);
  8968. /* "lib/Naked/toolshed/c/system.pyx":99
  8969. *
  8970. * @wraps(func)
  8971. * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<<
  8972. * current_directory = os.getcwd()
  8973. * return func(current_directory, *args, **kwargs)
  8974. */
  8975. __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_dir, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_current_directory); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8976. __Pyx_GOTREF(__pyx_tuple__9);
  8977. __Pyx_GIVEREF(__pyx_tuple__9);
  8978. __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8979. __pyx_tuple__11 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s__8)); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8980. __Pyx_GOTREF(__pyx_tuple__11);
  8981. __Pyx_GIVEREF(__pyx_tuple__11);
  8982. /* "lib/Naked/toolshed/c/system.pyx":105
  8983. * except Exception as e:
  8984. * if DEBUG_FLAG:
  8985. * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  8986. * raise e
  8987. *
  8988. */
  8989. __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_2); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8990. __Pyx_GOTREF(__pyx_tuple__12);
  8991. __Pyx_GIVEREF(__pyx_tuple__12);
  8992. /* "lib/Naked/toolshed/c/system.pyx":121
  8993. *
  8994. * @wraps(func)
  8995. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  8996. * the_cwd = os.getcwd()
  8997. * return func(*args, current_dir=the_cwd)
  8998. */
  8999. __pyx_tuple__13 = PyTuple_Pack(3, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_the_cwd); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9000. __Pyx_GOTREF(__pyx_tuple__13);
  9001. __Pyx_GIVEREF(__pyx_tuple__13);
  9002. __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9003. /* "lib/Naked/toolshed/c/system.pyx":127
  9004. * except Exception as e:
  9005. * if DEBUG_FLAG:
  9006. * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9007. * raise e
  9008. *
  9009. */
  9010. __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_3); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9011. __Pyx_GOTREF(__pyx_tuple__15);
  9012. __Pyx_GIVEREF(__pyx_tuple__15);
  9013. /* "lib/Naked/toolshed/c/system.pyx":185
  9014. * if ose.errno != errno.EEXIST: # directory already exists
  9015. * if DEBUG_FLAG:
  9016. * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9017. * raise ose
  9018. * else:
  9019. */
  9020. __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Could_not); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9021. __Pyx_GOTREF(__pyx_tuple__16);
  9022. __Pyx_GIVEREF(__pyx_tuple__16);
  9023. /* "lib/Naked/toolshed/c/system.pyx":211
  9024. * except Exception as e:
  9025. * if DEBUG_FLAG:
  9026. * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9027. * raise e
  9028. *
  9029. */
  9030. __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_4); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9031. __Pyx_GOTREF(__pyx_tuple__17);
  9032. __Pyx_GIVEREF(__pyx_tuple__17);
  9033. /* "lib/Naked/toolshed/c/system.pyx":225
  9034. * except Exception as e:
  9035. * if DEBUG_FLAG:
  9036. * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9037. * raise e
  9038. *
  9039. */
  9040. __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_5); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9041. __Pyx_GOTREF(__pyx_tuple__18);
  9042. __Pyx_GIVEREF(__pyx_tuple__18);
  9043. /* "lib/Naked/toolshed/c/system.pyx":241
  9044. * except Exception as e:
  9045. * if DEBUG_FLAG:
  9046. * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9047. * raise e
  9048. *
  9049. */
  9050. __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_6); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9051. __Pyx_GOTREF(__pyx_tuple__19);
  9052. __Pyx_GIVEREF(__pyx_tuple__19);
  9053. /* "lib/Naked/toolshed/c/system.pyx":255
  9054. * except Exception as e:
  9055. * if DEBUG_FLAG:
  9056. * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9057. * raise e
  9058. *
  9059. */
  9060. __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_7); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9061. __Pyx_GOTREF(__pyx_tuple__20);
  9062. __Pyx_GIVEREF(__pyx_tuple__20);
  9063. /* "lib/Naked/toolshed/c/system.pyx":274
  9064. * except Exception as e:
  9065. * if DEBUG_FLAG:
  9066. * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9067. * raise e
  9068. *
  9069. */
  9070. __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_5); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9071. __Pyx_GOTREF(__pyx_tuple__21);
  9072. __Pyx_GIVEREF(__pyx_tuple__21);
  9073. /* "lib/Naked/toolshed/c/system.pyx":288
  9074. * except Exception as e:
  9075. * if DEBUG_FLAG:
  9076. * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9077. * raise e
  9078. *
  9079. */
  9080. __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_6); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9081. __Pyx_GOTREF(__pyx_tuple__22);
  9082. __Pyx_GIVEREF(__pyx_tuple__22);
  9083. /* "lib/Naked/toolshed/c/system.pyx":308
  9084. * except Exception as e:
  9085. * if DEBUG_FLAG:
  9086. * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9087. * raise e
  9088. *
  9089. */
  9090. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_7); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9091. __Pyx_GOTREF(__pyx_tuple__23);
  9092. __Pyx_GIVEREF(__pyx_tuple__23);
  9093. /* "lib/Naked/toolshed/c/system.pyx":320
  9094. * def list_filter_files(extension_filter, dir):
  9095. * try:
  9096. * if not extension_filter.startswith("."): # <<<<<<<<<<<<<<
  9097. * extension_filter = "." + extension_filter
  9098. * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)]
  9099. */
  9100. __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s__24); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9101. __Pyx_GOTREF(__pyx_tuple__25);
  9102. __Pyx_GIVEREF(__pyx_tuple__25);
  9103. /* "lib/Naked/toolshed/c/system.pyx":326
  9104. * except Exception as e:
  9105. * if DEBUG_FLAG:
  9106. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9107. * raise e
  9108. *
  9109. */
  9110. __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_8); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9111. __Pyx_GOTREF(__pyx_tuple__26);
  9112. __Pyx_GIVEREF(__pyx_tuple__26);
  9113. /* "lib/Naked/toolshed/c/system.pyx":343
  9114. * except Exception as e:
  9115. * if DEBUG_FLAG:
  9116. * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9117. * raise e
  9118. *
  9119. */
  9120. __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_9); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9121. __Pyx_GOTREF(__pyx_tuple__27);
  9122. __Pyx_GIVEREF(__pyx_tuple__27);
  9123. /* "lib/Naked/toolshed/c/system.pyx":360
  9124. * except Exception as e:
  9125. * if DEBUG_FLAG:
  9126. * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9127. * raise e
  9128. *
  9129. */
  9130. __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_10); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9131. __Pyx_GOTREF(__pyx_tuple__28);
  9132. __Pyx_GIVEREF(__pyx_tuple__28);
  9133. /* "lib/Naked/toolshed/c/system.pyx":388
  9134. * except Exception as e:
  9135. * if DEBUG_FLAG:
  9136. * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9137. * raise e
  9138. *
  9139. */
  9140. __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_11); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9141. __Pyx_GOTREF(__pyx_tuple__29);
  9142. __Pyx_GIVEREF(__pyx_tuple__29);
  9143. /* "lib/Naked/toolshed/c/system.pyx":406
  9144. * except Exception as e:
  9145. * if DEBUG_FLAG:
  9146. * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9147. * raise e
  9148. *
  9149. */
  9150. __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_12); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9151. __Pyx_GOTREF(__pyx_tuple__30);
  9152. __Pyx_GIVEREF(__pyx_tuple__30);
  9153. /* "lib/Naked/toolshed/c/system.pyx":418
  9154. * except Exception as e:
  9155. * if DEBUG_FLAG:
  9156. * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9157. * raise e
  9158. *
  9159. */
  9160. __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_13); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9161. __Pyx_GOTREF(__pyx_tuple__31);
  9162. __Pyx_GIVEREF(__pyx_tuple__31);
  9163. /* "lib/Naked/toolshed/c/system.pyx":436
  9164. * except Exception as e:
  9165. * if DEBUG_FLAG:
  9166. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9167. * raise e
  9168. *
  9169. */
  9170. __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_14); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9171. __Pyx_GOTREF(__pyx_tuple__32);
  9172. __Pyx_GIVEREF(__pyx_tuple__32);
  9173. /* "lib/Naked/toolshed/c/system.pyx":448
  9174. * except Exception as e:
  9175. * if DEBUG_FLAG:
  9176. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9177. * raise e
  9178. *
  9179. */
  9180. __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_15); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9181. __Pyx_GOTREF(__pyx_tuple__33);
  9182. __Pyx_GIVEREF(__pyx_tuple__33);
  9183. /* "lib/Naked/toolshed/c/system.pyx":461
  9184. * except Exception as e:
  9185. * if DEBUG_FLAG:
  9186. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9187. * raise e
  9188. *
  9189. */
  9190. __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_16); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9191. __Pyx_GOTREF(__pyx_tuple__34);
  9192. __Pyx_GIVEREF(__pyx_tuple__34);
  9193. /* "lib/Naked/toolshed/c/system.pyx":475
  9194. * except Exception as e:
  9195. * if DEBUG_FLAG:
  9196. * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9197. * raise e
  9198. *
  9199. */
  9200. __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_16); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9201. __Pyx_GOTREF(__pyx_tuple__35);
  9202. __Pyx_GIVEREF(__pyx_tuple__35);
  9203. /* "lib/Naked/toolshed/c/system.pyx":490
  9204. * except Exception as e:
  9205. * if DEBUG_FLAG:
  9206. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9207. * raise e
  9208. *
  9209. */
  9210. __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_17); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9211. __Pyx_GOTREF(__pyx_tuple__37);
  9212. __Pyx_GIVEREF(__pyx_tuple__37);
  9213. /* "lib/Naked/toolshed/c/system.pyx":504
  9214. * except Exception as e:
  9215. * if DEBUG_FLAG:
  9216. * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<<
  9217. * raise e
  9218. *
  9219. */
  9220. __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_17); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9221. __Pyx_GOTREF(__pyx_tuple__38);
  9222. __Pyx_GIVEREF(__pyx_tuple__38);
  9223. /* "lib/Naked/toolshed/c/system.pyx":528
  9224. * #------------------------------------------------------------------------------
  9225. * def exit_fail():
  9226. * raise SystemExit(1) # <<<<<<<<<<<<<<
  9227. *
  9228. * #------------------------------------------------------------------------------
  9229. */
  9230. __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9231. __Pyx_GOTREF(__pyx_tuple__39);
  9232. __Pyx_GIVEREF(__pyx_tuple__39);
  9233. /* "lib/Naked/toolshed/c/system.pyx":536
  9234. * #------------------------------------------------------------------------------
  9235. * def exit_success():
  9236. * raise SystemExit(0) # <<<<<<<<<<<<<<
  9237. *
  9238. *
  9239. */
  9240. __pyx_tuple__40 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9241. __Pyx_GOTREF(__pyx_tuple__40);
  9242. __Pyx_GIVEREF(__pyx_tuple__40);
  9243. /* "lib/Naked/toolshed/c/system.pyx":20
  9244. * # Tests: test_SYSTEM.py :: test_sys_filename
  9245. * #------------------------------------------------------------------------------
  9246. * def filename(filepath): # <<<<<<<<<<<<<<
  9247. * try:
  9248. * return os.path.basename(filepath)
  9249. */
  9250. __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9251. __Pyx_GOTREF(__pyx_tuple__41);
  9252. __Pyx_GIVEREF(__pyx_tuple__41);
  9253. __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_filename, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9254. /* "lib/Naked/toolshed/c/system.pyx":33
  9255. * # Tests: test_SYSTEM.py :: test_sys_file_extension
  9256. * #------------------------------------------------------------------------------
  9257. * def file_extension(filepath): # <<<<<<<<<<<<<<
  9258. * try:
  9259. * return os.path.splitext(filepath)[1]
  9260. */
  9261. __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9262. __Pyx_GOTREF(__pyx_tuple__43);
  9263. __Pyx_GIVEREF(__pyx_tuple__43);
  9264. __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_extension, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9265. /* "lib/Naked/toolshed/c/system.pyx":47
  9266. * # Tests: test_SYSTEM.py :: test_sys_dir_path
  9267. * #------------------------------------------------------------------------------
  9268. * def directory(filepath): # <<<<<<<<<<<<<<
  9269. * try:
  9270. * return os.path.dirname(filepath)
  9271. */
  9272. __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9273. __Pyx_GOTREF(__pyx_tuple__45);
  9274. __Pyx_GIVEREF(__pyx_tuple__45);
  9275. __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_directory, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9276. /* "lib/Naked/toolshed/c/system.pyx":60
  9277. * # Tests: test_SYSTEM.py :: test_sys_make_filepath
  9278. * #------------------------------------------------------------------------------
  9279. * def make_path(*path_list): # <<<<<<<<<<<<<<
  9280. * try:
  9281. * return os.path.join(*path_list)
  9282. */
  9283. __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_path_list, __pyx_n_s_e); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9284. __Pyx_GOTREF(__pyx_tuple__47);
  9285. __Pyx_GIVEREF(__pyx_tuple__47);
  9286. __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_make_path, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9287. /* "lib/Naked/toolshed/c/system.pyx":74
  9288. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile
  9289. * #------------------------------------------------------------------------------
  9290. * def currentdir_to_basefile(func): # <<<<<<<<<<<<<<
  9291. * try:
  9292. * from functools import wraps
  9293. */
  9294. __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_wraps, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_e); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9295. __Pyx_GOTREF(__pyx_tuple__49);
  9296. __Pyx_GIVEREF(__pyx_tuple__49);
  9297. __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_currentdir_to_basefile, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9298. /* "lib/Naked/toolshed/c/system.pyx":94
  9299. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg
  9300. * #------------------------------------------------------------------------------
  9301. * def currentdir_firstparam(func): # <<<<<<<<<<<<<<
  9302. * try:
  9303. * from functools import wraps
  9304. */
  9305. __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_wraps, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_e); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9306. __Pyx_GOTREF(__pyx_tuple__51);
  9307. __Pyx_GIVEREF(__pyx_tuple__51);
  9308. __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_currentdir_firstparam, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9309. /* "lib/Naked/toolshed/c/system.pyx":116
  9310. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg
  9311. * #------------------------------------------------------------------------------
  9312. * def currentdir_lastparam(func): # <<<<<<<<<<<<<<
  9313. * try:
  9314. * from functools import wraps
  9315. */
  9316. __pyx_tuple__53 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_wraps, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_e); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9317. __Pyx_GOTREF(__pyx_tuple__53);
  9318. __Pyx_GIVEREF(__pyx_tuple__53);
  9319. __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_currentdir_lastparam, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9320. /* "lib/Naked/toolshed/c/system.pyx":139
  9321. * #------------------------------------------------------------------------------
  9322. * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function
  9323. * def fullpath(file_name): # <<<<<<<<<<<<<<
  9324. * try:
  9325. * return file_name
  9326. */
  9327. __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_file_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9328. __Pyx_GOTREF(__pyx_tuple__55);
  9329. __Pyx_GIVEREF(__pyx_tuple__55);
  9330. __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_fullpath, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9331. /* "lib/Naked/toolshed/c/system.pyx":156
  9332. * #------------------------------------------------------------------------------
  9333. * @currentdir_firstparam
  9334. * def cwd(dir=""): # <<<<<<<<<<<<<<
  9335. * try:
  9336. * return dir
  9337. */
  9338. __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_dir, __pyx_n_s_e); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9339. __Pyx_GOTREF(__pyx_tuple__57);
  9340. __Pyx_GIVEREF(__pyx_tuple__57);
  9341. __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_cwd, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9342. /* "lib/Naked/toolshed/c/system.pyx":176
  9343. * # DOES NOT already exist
  9344. * #------------------------------------------------------------------------------
  9345. * def make_dirs(dirpath): # <<<<<<<<<<<<<<
  9346. * try:
  9347. * import os
  9348. */
  9349. __pyx_tuple__59 = PyTuple_Pack(5, __pyx_n_s_dirpath, __pyx_n_s_os, __pyx_n_s_errno, __pyx_n_s_ose, __pyx_n_s_e); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9350. __Pyx_GOTREF(__pyx_tuple__59);
  9351. __Pyx_GIVEREF(__pyx_tuple__59);
  9352. __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_make_dirs, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9353. /* "lib/Naked/toolshed/c/system.pyx":203
  9354. * # Tests: test_SYSTEM.py :: test_file_exists
  9355. * #------------------------------------------------------------------------------
  9356. * def file_exists(filepath): # <<<<<<<<<<<<<<
  9357. * try:
  9358. * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file
  9359. */
  9360. __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9361. __Pyx_GOTREF(__pyx_tuple__61);
  9362. __Pyx_GIVEREF(__pyx_tuple__61);
  9363. __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_exists, 203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9364. /* "lib/Naked/toolshed/c/system.pyx":220
  9365. * # test_sys_is_file_when_dir
  9366. * #------------------------------------------------------------------------------
  9367. * def is_file(filepath): # <<<<<<<<<<<<<<
  9368. * try:
  9369. * return os.path.isfile(filepath)
  9370. */
  9371. __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9372. __Pyx_GOTREF(__pyx_tuple__63);
  9373. __Pyx_GIVEREF(__pyx_tuple__63);
  9374. __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_file, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9375. /* "lib/Naked/toolshed/c/system.pyx":233
  9376. * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir
  9377. * #------------------------------------------------------------------------------
  9378. * def dir_exists(dirpath): # <<<<<<<<<<<<<<
  9379. * try:
  9380. * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory
  9381. */
  9382. __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_dirpath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9383. __Pyx_GOTREF(__pyx_tuple__65);
  9384. __Pyx_GIVEREF(__pyx_tuple__65);
  9385. __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_dir_exists, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9386. /* "lib/Naked/toolshed/c/system.pyx":250
  9387. * # test_sys_dir_is_dir_when_missing
  9388. * #------------------------------------------------------------------------------
  9389. * def is_dir(dirpath): # <<<<<<<<<<<<<<
  9390. * try:
  9391. * return os.path.isdir(dirpath)
  9392. */
  9393. __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_dirpath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9394. __Pyx_GOTREF(__pyx_tuple__67);
  9395. __Pyx_GIVEREF(__pyx_tuple__67);
  9396. __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_dir, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9397. /* "lib/Naked/toolshed/c/system.pyx":269
  9398. * # Tests: test_SYSTEM.py :: test_sys_meta_file_size
  9399. * #------------------------------------------------------------------------------
  9400. * def file_size(filepath): # <<<<<<<<<<<<<<
  9401. * try:
  9402. * return os.path.getsize(filepath)
  9403. */
  9404. __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9405. __Pyx_GOTREF(__pyx_tuple__69);
  9406. __Pyx_GIVEREF(__pyx_tuple__69);
  9407. __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_size, 269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9408. /* "lib/Naked/toolshed/c/system.pyx":282
  9409. * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod
  9410. * #------------------------------------------------------------------------------
  9411. * def file_mod_time(filepath): # <<<<<<<<<<<<<<
  9412. * try:
  9413. * import time
  9414. */
  9415. __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_filepath, __pyx_n_s_time, __pyx_n_s_e); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9416. __Pyx_GOTREF(__pyx_tuple__71);
  9417. __Pyx_GIVEREF(__pyx_tuple__71);
  9418. __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_mod_time, 282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9419. /* "lib/Naked/toolshed/c/system.pyx":302
  9420. * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir
  9421. * #------------------------------------------------------------------------------
  9422. * def list_all_files(dir): # <<<<<<<<<<<<<<
  9423. * try:
  9424. * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))]
  9425. */
  9426. __pyx_tuple__73 = PyTuple_Pack(4, __pyx_n_s_dir, __pyx_n_s_filenames, __pyx_n_s_e, __pyx_n_s_name); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9427. __Pyx_GOTREF(__pyx_tuple__73);
  9428. __Pyx_GIVEREF(__pyx_tuple__73);
  9429. __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_all_files, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9430. /* "lib/Naked/toolshed/c/system.pyx":318
  9431. * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch
  9432. * #------------------------------------------------------------------------------
  9433. * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<<
  9434. * try:
  9435. * if not extension_filter.startswith("."):
  9436. */
  9437. __pyx_tuple__75 = PyTuple_Pack(5, __pyx_n_s_extension_filter, __pyx_n_s_dir, __pyx_n_s_filenames, __pyx_n_s_e, __pyx_n_s_name); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9438. __Pyx_GOTREF(__pyx_tuple__75);
  9439. __Pyx_GIVEREF(__pyx_tuple__75);
  9440. __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_filter_files, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9441. /* "lib/Naked/toolshed/c/system.pyx":338
  9442. * #------------------------------------------------------------------------------
  9443. * @currentdir_firstparam
  9444. * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<<
  9445. * try:
  9446. * return list_all_files(dir)
  9447. */
  9448. __pyx_tuple__77 = PyTuple_Pack(2, __pyx_n_s_dir, __pyx_n_s_e); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9449. __Pyx_GOTREF(__pyx_tuple__77);
  9450. __Pyx_GIVEREF(__pyx_tuple__77);
  9451. __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_all_files_cwd, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9452. /* "lib/Naked/toolshed/c/system.pyx":355
  9453. * #------------------------------------------------------------------------------
  9454. * @currentdir_lastparam
  9455. * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<<
  9456. * try:
  9457. * return list_filter_files(extension_filter, current_dir)
  9458. */
  9459. __pyx_tuple__79 = PyTuple_Pack(3, __pyx_n_s_extension_filter, __pyx_n_s_current_dir, __pyx_n_s_e); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9460. __Pyx_GOTREF(__pyx_tuple__79);
  9461. __Pyx_GIVEREF(__pyx_tuple__79);
  9462. __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_filter_files_cwd, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9463. /* "lib/Naked/toolshed/c/system.pyx":373
  9464. * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath
  9465. * #------------------------------------------------------------------------------
  9466. * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<<
  9467. * try:
  9468. * from glob import glob
  9469. */
  9470. __pyx_tuple__81 = PyTuple_Pack(8, __pyx_n_s_match_pattern, __pyx_n_s_full_path, __pyx_n_s_glob, __pyx_n_s_filenames, __pyx_n_s_filenames_fullpath, __pyx_n_s_cwd, __pyx_n_s_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9471. __Pyx_GOTREF(__pyx_tuple__81);
  9472. __Pyx_GIVEREF(__pyx_tuple__81);
  9473. __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_match_files, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9474. /* "lib/Naked/toolshed/c/system.pyx":401
  9475. * # return boolean indicating whether the path is a symbolic link
  9476. * #------------------------------------------------------------------------------
  9477. * def is_link(filepath): # <<<<<<<<<<<<<<
  9478. * try:
  9479. * return os.path.islink(filepath)
  9480. */
  9481. __pyx_tuple__83 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9482. __Pyx_GOTREF(__pyx_tuple__83);
  9483. __Pyx_GIVEREF(__pyx_tuple__83);
  9484. __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_link, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9485. /* "lib/Naked/toolshed/c/system.pyx":413
  9486. * # return the real file path pointed to by a symbolic link
  9487. * #------------------------------------------------------------------------------
  9488. * def real_path(filepath): # <<<<<<<<<<<<<<
  9489. * try:
  9490. * return os.path.realpath(filepath)
  9491. */
  9492. __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9493. __Pyx_GOTREF(__pyx_tuple__85);
  9494. __Pyx_GIVEREF(__pyx_tuple__85);
  9495. __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_real_path, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9496. /* "lib/Naked/toolshed/c/system.pyx":431
  9497. * # print to std output stream
  9498. * #------------------------------------------------------------------------------
  9499. * def stdout(text): # <<<<<<<<<<<<<<
  9500. * try:
  9501. * print(text)
  9502. */
  9503. __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9504. __Pyx_GOTREF(__pyx_tuple__87);
  9505. __Pyx_GIVEREF(__pyx_tuple__87);
  9506. __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9507. /* "lib/Naked/toolshed/c/system.pyx":443
  9508. * # print to std output stream without a newline
  9509. * #------------------------------------------------------------------------------
  9510. * def stdout_xnl(text): # <<<<<<<<<<<<<<
  9511. * try:
  9512. * sys.stdout.write(text)
  9513. */
  9514. __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9515. __Pyx_GOTREF(__pyx_tuple__89);
  9516. __Pyx_GIVEREF(__pyx_tuple__89);
  9517. __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout_xnl, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9518. /* "lib/Naked/toolshed/c/system.pyx":455
  9519. * # print items in an iterable to the standard output stream with newlines after each string
  9520. * #------------------------------------------------------------------------------
  9521. * def stdout_iter(iter): # <<<<<<<<<<<<<<
  9522. * try:
  9523. * for x in iter:
  9524. */
  9525. __pyx_tuple__91 = PyTuple_Pack(3, __pyx_n_s_iter, __pyx_n_s_x, __pyx_n_s_e); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9526. __Pyx_GOTREF(__pyx_tuple__91);
  9527. __Pyx_GIVEREF(__pyx_tuple__91);
  9528. __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout_iter, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9529. /* "lib/Naked/toolshed/c/system.pyx":469
  9530. * # print items in an iterable to the standard output stream without newlines after each string
  9531. * #------------------------------------------------------------------------------
  9532. * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<<
  9533. * try:
  9534. * for x in iter:
  9535. */
  9536. __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_iter, __pyx_n_s_x, __pyx_n_s_e); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9537. __Pyx_GOTREF(__pyx_tuple__93);
  9538. __Pyx_GIVEREF(__pyx_tuple__93);
  9539. __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout_iter_xnl, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9540. /* "lib/Naked/toolshed/c/system.pyx":483
  9541. * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code
  9542. * #------------------------------------------------------------------------------
  9543. * def stderr(text, exit=0): # <<<<<<<<<<<<<<
  9544. * try:
  9545. * sys.stderr.write(text + "\n")
  9546. */
  9547. __pyx_tuple__95 = PyTuple_Pack(3, __pyx_n_s_text, __pyx_n_s_exit, __pyx_n_s_e); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9548. __Pyx_GOTREF(__pyx_tuple__95);
  9549. __Pyx_GIVEREF(__pyx_tuple__95);
  9550. __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stderr, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9551. /* "lib/Naked/toolshed/c/system.pyx":497
  9552. * # print to the standard error stream without a newline character after the `text` string
  9553. * #------------------------------------------------------------------------------
  9554. * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<<
  9555. * try:
  9556. * sys.stderr.write(text)
  9557. */
  9558. __pyx_tuple__97 = PyTuple_Pack(3, __pyx_n_s_text, __pyx_n_s_exit, __pyx_n_s_e); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9559. __Pyx_GOTREF(__pyx_tuple__97);
  9560. __Pyx_GIVEREF(__pyx_tuple__97);
  9561. __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stderr_xnl, 497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9562. /* "lib/Naked/toolshed/c/system.pyx":519
  9563. * # Tests: test_SYSTEM.py :: test_sys_exit_with_code
  9564. * #------------------------------------------------------------------------------
  9565. * def exit_with_status(exit=0): # <<<<<<<<<<<<<<
  9566. * raise SystemExit(exit)
  9567. *
  9568. */
  9569. __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_s_exit); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9570. __Pyx_GOTREF(__pyx_tuple__99);
  9571. __Pyx_GIVEREF(__pyx_tuple__99);
  9572. __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_exit_with_status, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9573. /* "lib/Naked/toolshed/c/system.pyx":527
  9574. * # Tests: test_SYSTEM.py :: test_sys_exit_failure
  9575. * #------------------------------------------------------------------------------
  9576. * def exit_fail(): # <<<<<<<<<<<<<<
  9577. * raise SystemExit(1)
  9578. *
  9579. */
  9580. __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_exit_fail, 527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9581. /* "lib/Naked/toolshed/c/system.pyx":535
  9582. * # Tests: test_SYSTEM.py :: test_sys_exit_success
  9583. * #------------------------------------------------------------------------------
  9584. * def exit_success(): # <<<<<<<<<<<<<<
  9585. * raise SystemExit(0)
  9586. *
  9587. */
  9588. __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_exit_success, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9589. __Pyx_RefNannyFinishContext();
  9590. return 0;
  9591. __pyx_L1_error:;
  9592. __Pyx_RefNannyFinishContext();
  9593. return -1;
  9594. }
  9595. static int __Pyx_InitGlobals(void) {
  9596. if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  9597. __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;}
  9598. __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;}
  9599. return 0;
  9600. __pyx_L1_error:;
  9601. return -1;
  9602. }
  9603. #if PY_MAJOR_VERSION < 3
  9604. PyMODINIT_FUNC initsystem(void); /*proto*/
  9605. PyMODINIT_FUNC initsystem(void)
  9606. #else
  9607. PyMODINIT_FUNC PyInit_system(void); /*proto*/
  9608. PyMODINIT_FUNC PyInit_system(void)
  9609. #endif
  9610. {
  9611. PyObject *__pyx_t_1 = NULL;
  9612. PyObject *__pyx_t_2 = NULL;
  9613. PyObject *__pyx_t_3 = NULL;
  9614. int __pyx_t_4;
  9615. int __pyx_lineno = 0;
  9616. const char *__pyx_filename = NULL;
  9617. int __pyx_clineno = 0;
  9618. __Pyx_RefNannyDeclarations
  9619. #if CYTHON_REFNANNY
  9620. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  9621. if (!__Pyx_RefNanny) {
  9622. PyErr_Clear();
  9623. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  9624. if (!__Pyx_RefNanny)
  9625. Py_FatalError("failed to import 'refnanny' module");
  9626. }
  9627. #endif
  9628. __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_system(void)", 0);
  9629. if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9630. __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;}
  9631. __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;}
  9632. #ifdef __Pyx_CyFunction_USED
  9633. if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9634. #endif
  9635. #ifdef __Pyx_FusedFunction_USED
  9636. if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9637. #endif
  9638. #ifdef __Pyx_Generator_USED
  9639. if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9640. #endif
  9641. /*--- Library function declarations ---*/
  9642. /*--- Threads initialization code ---*/
  9643. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  9644. #ifdef WITH_THREAD /* Python build with threading support? */
  9645. PyEval_InitThreads();
  9646. #endif
  9647. #endif
  9648. /*--- Module creation code ---*/
  9649. #if PY_MAJOR_VERSION < 3
  9650. __pyx_m = Py_InitModule4(__Pyx_NAMESTR("system"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  9651. #else
  9652. __pyx_m = PyModule_Create(&__pyx_moduledef);
  9653. #endif
  9654. if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9655. __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;}
  9656. Py_INCREF(__pyx_d);
  9657. __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;}
  9658. #if CYTHON_COMPILING_IN_PYPY
  9659. Py_INCREF(__pyx_b);
  9660. #endif
  9661. if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  9662. /*--- Initialize various global constants etc. ---*/
  9663. if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9664. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  9665. if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9666. #endif
  9667. if (__pyx_module_is_main_lib__Naked__toolshed__c__system) {
  9668. 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;};
  9669. }
  9670. #if PY_MAJOR_VERSION >= 3
  9671. {
  9672. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9673. if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.system")) {
  9674. if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.system", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9675. }
  9676. }
  9677. #endif
  9678. /*--- Builtin init code ---*/
  9679. if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9680. /*--- Constants init code ---*/
  9681. if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9682. /*--- Global init code ---*/
  9683. /*--- Variable export code ---*/
  9684. /*--- Function export code ---*/
  9685. /*--- Type init code ---*/
  9686. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9687. __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile.tp_print = 0;
  9688. __pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = &__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile;
  9689. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9690. __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam.tp_print = 0;
  9691. __pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = &__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam;
  9692. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9693. __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam.tp_print = 0;
  9694. __pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = &__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam;
  9695. /*--- Type import code ---*/
  9696. /*--- Variable import code ---*/
  9697. /*--- Function import code ---*/
  9698. /*--- Execution code ---*/
  9699. /* "lib/Naked/toolshed/c/system.pyx":5
  9700. * # cython: profile=False
  9701. *
  9702. * import sys # <<<<<<<<<<<<<<
  9703. * import os
  9704. * from Naked.settings import debug as DEBUG_FLAG
  9705. */
  9706. __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9707. __Pyx_GOTREF(__pyx_t_1);
  9708. if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9709. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9710. /* "lib/Naked/toolshed/c/system.pyx":6
  9711. *
  9712. * import sys
  9713. * import os # <<<<<<<<<<<<<<
  9714. * from Naked.settings import debug as DEBUG_FLAG
  9715. *
  9716. */
  9717. __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9718. __Pyx_GOTREF(__pyx_t_1);
  9719. if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9720. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9721. /* "lib/Naked/toolshed/c/system.pyx":7
  9722. * import sys
  9723. * import os
  9724. * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<<
  9725. *
  9726. * #------------------------------------------------------------------------------
  9727. */
  9728. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9729. __Pyx_GOTREF(__pyx_t_1);
  9730. __Pyx_INCREF(__pyx_n_s_debug);
  9731. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug);
  9732. __Pyx_GIVEREF(__pyx_n_s_debug);
  9733. __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 = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9734. __Pyx_GOTREF(__pyx_t_2);
  9735. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9736. __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9737. __Pyx_GOTREF(__pyx_t_1);
  9738. if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9739. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9740. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9741. /* "lib/Naked/toolshed/c/system.pyx":20
  9742. * # Tests: test_SYSTEM.py :: test_sys_filename
  9743. * #------------------------------------------------------------------------------
  9744. * def filename(filepath): # <<<<<<<<<<<<<<
  9745. * try:
  9746. * return os.path.basename(filepath)
  9747. */
  9748. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_1filename, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9749. __Pyx_GOTREF(__pyx_t_2);
  9750. if (PyDict_SetItem(__pyx_d, __pyx_n_s_filename, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9751. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9752. /* "lib/Naked/toolshed/c/system.pyx":33
  9753. * # Tests: test_SYSTEM.py :: test_sys_file_extension
  9754. * #------------------------------------------------------------------------------
  9755. * def file_extension(filepath): # <<<<<<<<<<<<<<
  9756. * try:
  9757. * return os.path.splitext(filepath)[1]
  9758. */
  9759. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_3file_extension, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9760. __Pyx_GOTREF(__pyx_t_2);
  9761. if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_extension, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9762. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9763. /* "lib/Naked/toolshed/c/system.pyx":47
  9764. * # Tests: test_SYSTEM.py :: test_sys_dir_path
  9765. * #------------------------------------------------------------------------------
  9766. * def directory(filepath): # <<<<<<<<<<<<<<
  9767. * try:
  9768. * return os.path.dirname(filepath)
  9769. */
  9770. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_5directory, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9771. __Pyx_GOTREF(__pyx_t_2);
  9772. if (PyDict_SetItem(__pyx_d, __pyx_n_s_directory, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9773. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9774. /* "lib/Naked/toolshed/c/system.pyx":60
  9775. * # Tests: test_SYSTEM.py :: test_sys_make_filepath
  9776. * #------------------------------------------------------------------------------
  9777. * def make_path(*path_list): # <<<<<<<<<<<<<<
  9778. * try:
  9779. * return os.path.join(*path_list)
  9780. */
  9781. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_7make_path, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9782. __Pyx_GOTREF(__pyx_t_2);
  9783. if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_path, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9784. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9785. /* "lib/Naked/toolshed/c/system.pyx":74
  9786. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile
  9787. * #------------------------------------------------------------------------------
  9788. * def currentdir_to_basefile(func): # <<<<<<<<<<<<<<
  9789. * try:
  9790. * from functools import wraps
  9791. */
  9792. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9793. __Pyx_GOTREF(__pyx_t_2);
  9794. if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentdir_to_basefile, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9795. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9796. /* "lib/Naked/toolshed/c/system.pyx":94
  9797. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg
  9798. * #------------------------------------------------------------------------------
  9799. * def currentdir_firstparam(func): # <<<<<<<<<<<<<<
  9800. * try:
  9801. * from functools import wraps
  9802. */
  9803. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9804. __Pyx_GOTREF(__pyx_t_2);
  9805. if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentdir_firstparam, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9806. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9807. /* "lib/Naked/toolshed/c/system.pyx":116
  9808. * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg
  9809. * #------------------------------------------------------------------------------
  9810. * def currentdir_lastparam(func): # <<<<<<<<<<<<<<
  9811. * try:
  9812. * from functools import wraps
  9813. */
  9814. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9815. __Pyx_GOTREF(__pyx_t_2);
  9816. if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentdir_lastparam, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9817. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9818. /* "lib/Naked/toolshed/c/system.pyx":138
  9819. * # Tests: test_SYSTEM.py :: test_sys_full_path_to_file
  9820. * #------------------------------------------------------------------------------
  9821. * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function # <<<<<<<<<<<<<<
  9822. * def fullpath(file_name):
  9823. * try:
  9824. */
  9825. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_to_basefile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9826. __Pyx_GOTREF(__pyx_t_2);
  9827. /* "lib/Naked/toolshed/c/system.pyx":139
  9828. * #------------------------------------------------------------------------------
  9829. * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function
  9830. * def fullpath(file_name): # <<<<<<<<<<<<<<
  9831. * try:
  9832. * return file_name
  9833. */
  9834. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_15fullpath, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9835. __Pyx_GOTREF(__pyx_t_1);
  9836. /* "lib/Naked/toolshed/c/system.pyx":138
  9837. * # Tests: test_SYSTEM.py :: test_sys_full_path_to_file
  9838. * #------------------------------------------------------------------------------
  9839. * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function # <<<<<<<<<<<<<<
  9840. * def fullpath(file_name):
  9841. * try:
  9842. */
  9843. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9844. __Pyx_GOTREF(__pyx_t_3);
  9845. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  9846. __Pyx_GIVEREF(__pyx_t_1);
  9847. __pyx_t_1 = 0;
  9848. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9849. __Pyx_GOTREF(__pyx_t_1);
  9850. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9851. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9852. if (PyDict_SetItem(__pyx_d, __pyx_n_s_fullpath, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9853. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9854. /* "lib/Naked/toolshed/c/system.pyx":155
  9855. * # Tests: test_SYSTEM.py :: test_sys_cwd_path
  9856. * #------------------------------------------------------------------------------
  9857. * @currentdir_firstparam # <<<<<<<<<<<<<<
  9858. * def cwd(dir=""):
  9859. * try:
  9860. */
  9861. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_firstparam); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9862. __Pyx_GOTREF(__pyx_t_1);
  9863. /* "lib/Naked/toolshed/c/system.pyx":156
  9864. * #------------------------------------------------------------------------------
  9865. * @currentdir_firstparam
  9866. * def cwd(dir=""): # <<<<<<<<<<<<<<
  9867. * try:
  9868. * return dir
  9869. */
  9870. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_17cwd, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9871. __Pyx_GOTREF(__pyx_t_3);
  9872. /* "lib/Naked/toolshed/c/system.pyx":155
  9873. * # Tests: test_SYSTEM.py :: test_sys_cwd_path
  9874. * #------------------------------------------------------------------------------
  9875. * @currentdir_firstparam # <<<<<<<<<<<<<<
  9876. * def cwd(dir=""):
  9877. * try:
  9878. */
  9879. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9880. __Pyx_GOTREF(__pyx_t_2);
  9881. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  9882. __Pyx_GIVEREF(__pyx_t_3);
  9883. __pyx_t_3 = 0;
  9884. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9885. __Pyx_GOTREF(__pyx_t_3);
  9886. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9887. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9888. if (PyDict_SetItem(__pyx_d, __pyx_n_s_cwd, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9889. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9890. /* "lib/Naked/toolshed/c/system.pyx":176
  9891. * # DOES NOT already exist
  9892. * #------------------------------------------------------------------------------
  9893. * def make_dirs(dirpath): # <<<<<<<<<<<<<<
  9894. * try:
  9895. * import os
  9896. */
  9897. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_19make_dirs, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9898. __Pyx_GOTREF(__pyx_t_3);
  9899. if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_dirs, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9900. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9901. /* "lib/Naked/toolshed/c/system.pyx":203
  9902. * # Tests: test_SYSTEM.py :: test_file_exists
  9903. * #------------------------------------------------------------------------------
  9904. * def file_exists(filepath): # <<<<<<<<<<<<<<
  9905. * try:
  9906. * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file
  9907. */
  9908. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21file_exists, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9909. __Pyx_GOTREF(__pyx_t_3);
  9910. if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_exists, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9911. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9912. /* "lib/Naked/toolshed/c/system.pyx":220
  9913. * # test_sys_is_file_when_dir
  9914. * #------------------------------------------------------------------------------
  9915. * def is_file(filepath): # <<<<<<<<<<<<<<
  9916. * try:
  9917. * return os.path.isfile(filepath)
  9918. */
  9919. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_23is_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9920. __Pyx_GOTREF(__pyx_t_3);
  9921. if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_file, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9922. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9923. /* "lib/Naked/toolshed/c/system.pyx":233
  9924. * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir
  9925. * #------------------------------------------------------------------------------
  9926. * def dir_exists(dirpath): # <<<<<<<<<<<<<<
  9927. * try:
  9928. * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory
  9929. */
  9930. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_25dir_exists, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9931. __Pyx_GOTREF(__pyx_t_3);
  9932. if (PyDict_SetItem(__pyx_d, __pyx_n_s_dir_exists, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9933. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9934. /* "lib/Naked/toolshed/c/system.pyx":250
  9935. * # test_sys_dir_is_dir_when_missing
  9936. * #------------------------------------------------------------------------------
  9937. * def is_dir(dirpath): # <<<<<<<<<<<<<<
  9938. * try:
  9939. * return os.path.isdir(dirpath)
  9940. */
  9941. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_27is_dir, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9942. __Pyx_GOTREF(__pyx_t_3);
  9943. if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_dir, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9944. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9945. /* "lib/Naked/toolshed/c/system.pyx":269
  9946. * # Tests: test_SYSTEM.py :: test_sys_meta_file_size
  9947. * #------------------------------------------------------------------------------
  9948. * def file_size(filepath): # <<<<<<<<<<<<<<
  9949. * try:
  9950. * return os.path.getsize(filepath)
  9951. */
  9952. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_29file_size, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9953. __Pyx_GOTREF(__pyx_t_3);
  9954. if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_size, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9955. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9956. /* "lib/Naked/toolshed/c/system.pyx":282
  9957. * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod
  9958. * #------------------------------------------------------------------------------
  9959. * def file_mod_time(filepath): # <<<<<<<<<<<<<<
  9960. * try:
  9961. * import time
  9962. */
  9963. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_31file_mod_time, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9964. __Pyx_GOTREF(__pyx_t_3);
  9965. if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_mod_time, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9966. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9967. /* "lib/Naked/toolshed/c/system.pyx":302
  9968. * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir
  9969. * #------------------------------------------------------------------------------
  9970. * def list_all_files(dir): # <<<<<<<<<<<<<<
  9971. * try:
  9972. * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))]
  9973. */
  9974. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_33list_all_files, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9975. __Pyx_GOTREF(__pyx_t_3);
  9976. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_all_files, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9977. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9978. /* "lib/Naked/toolshed/c/system.pyx":318
  9979. * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch
  9980. * #------------------------------------------------------------------------------
  9981. * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<<
  9982. * try:
  9983. * if not extension_filter.startswith("."):
  9984. */
  9985. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_35list_filter_files, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9986. __Pyx_GOTREF(__pyx_t_3);
  9987. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_filter_files, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9988. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9989. /* "lib/Naked/toolshed/c/system.pyx":337
  9990. * # Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd
  9991. * #------------------------------------------------------------------------------
  9992. * @currentdir_firstparam # <<<<<<<<<<<<<<
  9993. * def list_all_files_cwd(dir=""):
  9994. * try:
  9995. */
  9996. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_firstparam); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9997. __Pyx_GOTREF(__pyx_t_3);
  9998. /* "lib/Naked/toolshed/c/system.pyx":338
  9999. * #------------------------------------------------------------------------------
  10000. * @currentdir_firstparam
  10001. * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<<
  10002. * try:
  10003. * return list_all_files(dir)
  10004. */
  10005. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10006. __Pyx_GOTREF(__pyx_t_2);
  10007. /* "lib/Naked/toolshed/c/system.pyx":337
  10008. * # Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd
  10009. * #------------------------------------------------------------------------------
  10010. * @currentdir_firstparam # <<<<<<<<<<<<<<
  10011. * def list_all_files_cwd(dir=""):
  10012. * try:
  10013. */
  10014. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10015. __Pyx_GOTREF(__pyx_t_1);
  10016. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  10017. __Pyx_GIVEREF(__pyx_t_2);
  10018. __pyx_t_2 = 0;
  10019. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10020. __Pyx_GOTREF(__pyx_t_2);
  10021. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10022. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10023. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_all_files_cwd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10024. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10025. /* "lib/Naked/toolshed/c/system.pyx":354
  10026. * # Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch
  10027. * #------------------------------------------------------------------------------
  10028. * @currentdir_lastparam # <<<<<<<<<<<<<<
  10029. * def list_filter_files_cwd(extension_filter, current_dir=""):
  10030. * try:
  10031. */
  10032. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_lastparam); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10033. __Pyx_GOTREF(__pyx_t_2);
  10034. /* "lib/Naked/toolshed/c/system.pyx":355
  10035. * #------------------------------------------------------------------------------
  10036. * @currentdir_lastparam
  10037. * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<<
  10038. * try:
  10039. * return list_filter_files(extension_filter, current_dir)
  10040. */
  10041. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10042. __Pyx_GOTREF(__pyx_t_1);
  10043. /* "lib/Naked/toolshed/c/system.pyx":354
  10044. * # Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch
  10045. * #------------------------------------------------------------------------------
  10046. * @currentdir_lastparam # <<<<<<<<<<<<<<
  10047. * def list_filter_files_cwd(extension_filter, current_dir=""):
  10048. * try:
  10049. */
  10050. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10051. __Pyx_GOTREF(__pyx_t_3);
  10052. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  10053. __Pyx_GIVEREF(__pyx_t_1);
  10054. __pyx_t_1 = 0;
  10055. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10056. __Pyx_GOTREF(__pyx_t_1);
  10057. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10058. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10059. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_filter_files_cwd, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10060. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10061. /* "lib/Naked/toolshed/c/system.pyx":373
  10062. * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath
  10063. * #------------------------------------------------------------------------------
  10064. * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<<
  10065. * try:
  10066. * from glob import glob
  10067. */
  10068. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_41list_match_files, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10069. __Pyx_GOTREF(__pyx_t_1);
  10070. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_match_files, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10071. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10072. /* "lib/Naked/toolshed/c/system.pyx":401
  10073. * # return boolean indicating whether the path is a symbolic link
  10074. * #------------------------------------------------------------------------------
  10075. * def is_link(filepath): # <<<<<<<<<<<<<<
  10076. * try:
  10077. * return os.path.islink(filepath)
  10078. */
  10079. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_43is_link, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10080. __Pyx_GOTREF(__pyx_t_1);
  10081. if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_link, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10082. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10083. /* "lib/Naked/toolshed/c/system.pyx":413
  10084. * # return the real file path pointed to by a symbolic link
  10085. * #------------------------------------------------------------------------------
  10086. * def real_path(filepath): # <<<<<<<<<<<<<<
  10087. * try:
  10088. * return os.path.realpath(filepath)
  10089. */
  10090. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_45real_path, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10091. __Pyx_GOTREF(__pyx_t_1);
  10092. if (PyDict_SetItem(__pyx_d, __pyx_n_s_real_path, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10093. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10094. /* "lib/Naked/toolshed/c/system.pyx":431
  10095. * # print to std output stream
  10096. * #------------------------------------------------------------------------------
  10097. * def stdout(text): # <<<<<<<<<<<<<<
  10098. * try:
  10099. * print(text)
  10100. */
  10101. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_47stdout, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10102. __Pyx_GOTREF(__pyx_t_1);
  10103. if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10104. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10105. /* "lib/Naked/toolshed/c/system.pyx":443
  10106. * # print to std output stream without a newline
  10107. * #------------------------------------------------------------------------------
  10108. * def stdout_xnl(text): # <<<<<<<<<<<<<<
  10109. * try:
  10110. * sys.stdout.write(text)
  10111. */
  10112. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10113. __Pyx_GOTREF(__pyx_t_1);
  10114. if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_xnl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10115. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10116. /* "lib/Naked/toolshed/c/system.pyx":455
  10117. * # print items in an iterable to the standard output stream with newlines after each string
  10118. * #------------------------------------------------------------------------------
  10119. * def stdout_iter(iter): # <<<<<<<<<<<<<<
  10120. * try:
  10121. * for x in iter:
  10122. */
  10123. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_51stdout_iter, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10124. __Pyx_GOTREF(__pyx_t_1);
  10125. if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_iter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10126. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10127. /* "lib/Naked/toolshed/c/system.pyx":469
  10128. * # print items in an iterable to the standard output stream without newlines after each string
  10129. * #------------------------------------------------------------------------------
  10130. * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<<
  10131. * try:
  10132. * for x in iter:
  10133. */
  10134. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10135. __Pyx_GOTREF(__pyx_t_1);
  10136. if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_iter_xnl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10137. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10138. /* "lib/Naked/toolshed/c/system.pyx":483
  10139. * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code
  10140. * #------------------------------------------------------------------------------
  10141. * def stderr(text, exit=0): # <<<<<<<<<<<<<<
  10142. * try:
  10143. * sys.stderr.write(text + "\n")
  10144. */
  10145. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_55stderr, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10146. __Pyx_GOTREF(__pyx_t_1);
  10147. if (PyDict_SetItem(__pyx_d, __pyx_n_s_stderr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10148. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10149. /* "lib/Naked/toolshed/c/system.pyx":497
  10150. * # print to the standard error stream without a newline character after the `text` string
  10151. * #------------------------------------------------------------------------------
  10152. * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<<
  10153. * try:
  10154. * sys.stderr.write(text)
  10155. */
  10156. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10157. __Pyx_GOTREF(__pyx_t_1);
  10158. if (PyDict_SetItem(__pyx_d, __pyx_n_s_stderr_xnl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10159. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10160. /* "lib/Naked/toolshed/c/system.pyx":519
  10161. * # Tests: test_SYSTEM.py :: test_sys_exit_with_code
  10162. * #------------------------------------------------------------------------------
  10163. * def exit_with_status(exit=0): # <<<<<<<<<<<<<<
  10164. * raise SystemExit(exit)
  10165. *
  10166. */
  10167. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_59exit_with_status, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10168. __Pyx_GOTREF(__pyx_t_1);
  10169. if (PyDict_SetItem(__pyx_d, __pyx_n_s_exit_with_status, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10170. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10171. /* "lib/Naked/toolshed/c/system.pyx":527
  10172. * # Tests: test_SYSTEM.py :: test_sys_exit_failure
  10173. * #------------------------------------------------------------------------------
  10174. * def exit_fail(): # <<<<<<<<<<<<<<
  10175. * raise SystemExit(1)
  10176. *
  10177. */
  10178. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_61exit_fail, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10179. __Pyx_GOTREF(__pyx_t_1);
  10180. if (PyDict_SetItem(__pyx_d, __pyx_n_s_exit_fail, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10181. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10182. /* "lib/Naked/toolshed/c/system.pyx":535
  10183. * # Tests: test_SYSTEM.py :: test_sys_exit_success
  10184. * #------------------------------------------------------------------------------
  10185. * def exit_success(): # <<<<<<<<<<<<<<
  10186. * raise SystemExit(0)
  10187. *
  10188. */
  10189. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_63exit_success, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10190. __Pyx_GOTREF(__pyx_t_1);
  10191. if (PyDict_SetItem(__pyx_d, __pyx_n_s_exit_success, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10192. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10193. /* "lib/Naked/toolshed/c/system.pyx":540
  10194. *
  10195. *
  10196. * if __name__ == '__main__': # <<<<<<<<<<<<<<
  10197. * pass
  10198. * # #------------------------------------------------------------------------------
  10199. */
  10200. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10201. __Pyx_GOTREF(__pyx_t_1);
  10202. __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10203. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10204. if (__pyx_t_4) {
  10205. goto __pyx_L2;
  10206. }
  10207. __pyx_L2:;
  10208. /* "lib/Naked/toolshed/c/system.pyx":1
  10209. * #!/usr/bin/env python # <<<<<<<<<<<<<<
  10210. * # encoding: utf-8
  10211. * # cython: profile=False
  10212. */
  10213. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10214. __Pyx_GOTREF(__pyx_t_1);
  10215. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10216. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10217. goto __pyx_L0;
  10218. __pyx_L1_error:;
  10219. __Pyx_XDECREF(__pyx_t_1);
  10220. __Pyx_XDECREF(__pyx_t_2);
  10221. __Pyx_XDECREF(__pyx_t_3);
  10222. if (__pyx_m) {
  10223. __Pyx_AddTraceback("init lib.Naked.toolshed.c.system", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10224. Py_DECREF(__pyx_m); __pyx_m = 0;
  10225. } else if (!PyErr_Occurred()) {
  10226. PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.system");
  10227. }
  10228. __pyx_L0:;
  10229. __Pyx_RefNannyFinishContext();
  10230. #if PY_MAJOR_VERSION < 3
  10231. return;
  10232. #else
  10233. return __pyx_m;
  10234. #endif
  10235. }
  10236. /* Runtime support code */
  10237. #if CYTHON_REFNANNY
  10238. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  10239. PyObject *m = NULL, *p = NULL;
  10240. void *r = NULL;
  10241. m = PyImport_ImportModule((char *)modname);
  10242. if (!m) goto end;
  10243. p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  10244. if (!p) goto end;
  10245. r = PyLong_AsVoidPtr(p);
  10246. end:
  10247. Py_XDECREF(p);
  10248. Py_XDECREF(m);
  10249. return (__Pyx_RefNannyAPIStruct *)r;
  10250. }
  10251. #endif /* CYTHON_REFNANNY */
  10252. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  10253. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  10254. if (unlikely(!result)) {
  10255. PyErr_Format(PyExc_NameError,
  10256. #if PY_MAJOR_VERSION >= 3
  10257. "name '%U' is not defined", name);
  10258. #else
  10259. "name '%.200s' is not defined", PyString_AS_STRING(name));
  10260. #endif
  10261. }
  10262. return result;
  10263. }
  10264. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
  10265. PyObject *result;
  10266. #if CYTHON_COMPILING_IN_CPYTHON
  10267. result = PyDict_GetItem(__pyx_d, name);
  10268. if (result) {
  10269. Py_INCREF(result);
  10270. } else {
  10271. #else
  10272. result = PyObject_GetItem(__pyx_d, name);
  10273. if (!result) {
  10274. PyErr_Clear();
  10275. #endif
  10276. result = __Pyx_GetBuiltinName(name);
  10277. }
  10278. return result;
  10279. }
  10280. #if CYTHON_COMPILING_IN_CPYTHON
  10281. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  10282. PyObject *result;
  10283. ternaryfunc call = func->ob_type->tp_call;
  10284. if (unlikely(!call))
  10285. return PyObject_Call(func, arg, kw);
  10286. #if PY_VERSION_HEX >= 0x02060000
  10287. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  10288. return NULL;
  10289. #endif
  10290. result = (*call)(func, arg, kw);
  10291. #if PY_VERSION_HEX >= 0x02060000
  10292. Py_LeaveRecursiveCall();
  10293. #endif
  10294. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  10295. PyErr_SetString(
  10296. PyExc_SystemError,
  10297. "NULL result without error in PyObject_Call");
  10298. }
  10299. return result;
  10300. }
  10301. #endif
  10302. static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
  10303. #if CYTHON_COMPILING_IN_CPYTHON
  10304. PyThreadState *tstate = PyThreadState_GET();
  10305. *type = tstate->exc_type;
  10306. *value = tstate->exc_value;
  10307. *tb = tstate->exc_traceback;
  10308. Py_XINCREF(*type);
  10309. Py_XINCREF(*value);
  10310. Py_XINCREF(*tb);
  10311. #else
  10312. PyErr_GetExcInfo(type, value, tb);
  10313. #endif
  10314. }
  10315. static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
  10316. #if CYTHON_COMPILING_IN_CPYTHON
  10317. PyObject *tmp_type, *tmp_value, *tmp_tb;
  10318. PyThreadState *tstate = PyThreadState_GET();
  10319. tmp_type = tstate->exc_type;
  10320. tmp_value = tstate->exc_value;
  10321. tmp_tb = tstate->exc_traceback;
  10322. tstate->exc_type = type;
  10323. tstate->exc_value = value;
  10324. tstate->exc_traceback = tb;
  10325. Py_XDECREF(tmp_type);
  10326. Py_XDECREF(tmp_value);
  10327. Py_XDECREF(tmp_tb);
  10328. #else
  10329. PyErr_SetExcInfo(type, value, tb);
  10330. #endif
  10331. }
  10332. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
  10333. PyObject *local_type, *local_value, *local_tb;
  10334. #if CYTHON_COMPILING_IN_CPYTHON
  10335. PyObject *tmp_type, *tmp_value, *tmp_tb;
  10336. PyThreadState *tstate = PyThreadState_GET();
  10337. local_type = tstate->curexc_type;
  10338. local_value = tstate->curexc_value;
  10339. local_tb = tstate->curexc_traceback;
  10340. tstate->curexc_type = 0;
  10341. tstate->curexc_value = 0;
  10342. tstate->curexc_traceback = 0;
  10343. #else
  10344. PyErr_Fetch(&local_type, &local_value, &local_tb);
  10345. #endif
  10346. PyErr_NormalizeException(&local_type, &local_value, &local_tb);
  10347. #if CYTHON_COMPILING_IN_CPYTHON
  10348. if (unlikely(tstate->curexc_type))
  10349. #else
  10350. if (unlikely(PyErr_Occurred()))
  10351. #endif
  10352. goto bad;
  10353. #if PY_MAJOR_VERSION >= 3
  10354. if (local_tb) {
  10355. if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
  10356. goto bad;
  10357. }
  10358. #endif
  10359. Py_XINCREF(local_tb);
  10360. Py_XINCREF(local_type);
  10361. Py_XINCREF(local_value);
  10362. *type = local_type;
  10363. *value = local_value;
  10364. *tb = local_tb;
  10365. #if CYTHON_COMPILING_IN_CPYTHON
  10366. tmp_type = tstate->exc_type;
  10367. tmp_value = tstate->exc_value;
  10368. tmp_tb = tstate->exc_traceback;
  10369. tstate->exc_type = local_type;
  10370. tstate->exc_value = local_value;
  10371. tstate->exc_traceback = local_tb;
  10372. Py_XDECREF(tmp_type);
  10373. Py_XDECREF(tmp_value);
  10374. Py_XDECREF(tmp_tb);
  10375. #else
  10376. PyErr_SetExcInfo(local_type, local_value, local_tb);
  10377. #endif
  10378. return 0;
  10379. bad:
  10380. *type = 0;
  10381. *value = 0;
  10382. *tb = 0;
  10383. Py_XDECREF(local_type);
  10384. Py_XDECREF(local_value);
  10385. Py_XDECREF(local_tb);
  10386. return -1;
  10387. }
  10388. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
  10389. #if CYTHON_COMPILING_IN_CPYTHON
  10390. PyObject *tmp_type, *tmp_value, *tmp_tb;
  10391. PyThreadState *tstate = PyThreadState_GET();
  10392. tmp_type = tstate->curexc_type;
  10393. tmp_value = tstate->curexc_value;
  10394. tmp_tb = tstate->curexc_traceback;
  10395. tstate->curexc_type = type;
  10396. tstate->curexc_value = value;
  10397. tstate->curexc_traceback = tb;
  10398. Py_XDECREF(tmp_type);
  10399. Py_XDECREF(tmp_value);
  10400. Py_XDECREF(tmp_tb);
  10401. #else
  10402. PyErr_Restore(type, value, tb);
  10403. #endif
  10404. }
  10405. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
  10406. #if CYTHON_COMPILING_IN_CPYTHON
  10407. PyThreadState *tstate = PyThreadState_GET();
  10408. *type = tstate->curexc_type;
  10409. *value = tstate->curexc_value;
  10410. *tb = tstate->curexc_traceback;
  10411. tstate->curexc_type = 0;
  10412. tstate->curexc_value = 0;
  10413. tstate->curexc_traceback = 0;
  10414. #else
  10415. PyErr_Fetch(type, value, tb);
  10416. #endif
  10417. }
  10418. #if PY_MAJOR_VERSION < 3
  10419. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  10420. CYTHON_UNUSED PyObject *cause) {
  10421. Py_XINCREF(type);
  10422. if (!value || value == Py_None)
  10423. value = NULL;
  10424. else
  10425. Py_INCREF(value);
  10426. if (!tb || tb == Py_None)
  10427. tb = NULL;
  10428. else {
  10429. Py_INCREF(tb);
  10430. if (!PyTraceBack_Check(tb)) {
  10431. PyErr_SetString(PyExc_TypeError,
  10432. "raise: arg 3 must be a traceback or None");
  10433. goto raise_error;
  10434. }
  10435. }
  10436. #if PY_VERSION_HEX < 0x02050000
  10437. if (PyClass_Check(type)) {
  10438. #else
  10439. if (PyType_Check(type)) {
  10440. #endif
  10441. #if CYTHON_COMPILING_IN_PYPY
  10442. if (!value) {
  10443. Py_INCREF(Py_None);
  10444. value = Py_None;
  10445. }
  10446. #endif
  10447. PyErr_NormalizeException(&type, &value, &tb);
  10448. } else {
  10449. if (value) {
  10450. PyErr_SetString(PyExc_TypeError,
  10451. "instance exception may not have a separate value");
  10452. goto raise_error;
  10453. }
  10454. value = type;
  10455. #if PY_VERSION_HEX < 0x02050000
  10456. if (PyInstance_Check(type)) {
  10457. type = (PyObject*) ((PyInstanceObject*)type)->in_class;
  10458. Py_INCREF(type);
  10459. } else {
  10460. type = 0;
  10461. PyErr_SetString(PyExc_TypeError,
  10462. "raise: exception must be an old-style class or instance");
  10463. goto raise_error;
  10464. }
  10465. #else
  10466. type = (PyObject*) Py_TYPE(type);
  10467. Py_INCREF(type);
  10468. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  10469. PyErr_SetString(PyExc_TypeError,
  10470. "raise: exception class must be a subclass of BaseException");
  10471. goto raise_error;
  10472. }
  10473. #endif
  10474. }
  10475. __Pyx_ErrRestore(type, value, tb);
  10476. return;
  10477. raise_error:
  10478. Py_XDECREF(value);
  10479. Py_XDECREF(type);
  10480. Py_XDECREF(tb);
  10481. return;
  10482. }
  10483. #else /* Python 3+ */
  10484. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  10485. PyObject* owned_instance = NULL;
  10486. if (tb == Py_None) {
  10487. tb = 0;
  10488. } else if (tb && !PyTraceBack_Check(tb)) {
  10489. PyErr_SetString(PyExc_TypeError,
  10490. "raise: arg 3 must be a traceback or None");
  10491. goto bad;
  10492. }
  10493. if (value == Py_None)
  10494. value = 0;
  10495. if (PyExceptionInstance_Check(type)) {
  10496. if (value) {
  10497. PyErr_SetString(PyExc_TypeError,
  10498. "instance exception may not have a separate value");
  10499. goto bad;
  10500. }
  10501. value = type;
  10502. type = (PyObject*) Py_TYPE(value);
  10503. } else if (PyExceptionClass_Check(type)) {
  10504. PyObject *instance_class = NULL;
  10505. if (value && PyExceptionInstance_Check(value)) {
  10506. instance_class = (PyObject*) Py_TYPE(value);
  10507. if (instance_class != type) {
  10508. if (PyObject_IsSubclass(instance_class, type)) {
  10509. type = instance_class;
  10510. } else {
  10511. instance_class = NULL;
  10512. }
  10513. }
  10514. }
  10515. if (!instance_class) {
  10516. PyObject *args;
  10517. if (!value)
  10518. args = PyTuple_New(0);
  10519. else if (PyTuple_Check(value)) {
  10520. Py_INCREF(value);
  10521. args = value;
  10522. } else
  10523. args = PyTuple_Pack(1, value);
  10524. if (!args)
  10525. goto bad;
  10526. owned_instance = PyObject_Call(type, args, NULL);
  10527. Py_DECREF(args);
  10528. if (!owned_instance)
  10529. goto bad;
  10530. value = owned_instance;
  10531. if (!PyExceptionInstance_Check(value)) {
  10532. PyErr_Format(PyExc_TypeError,
  10533. "calling %R should have returned an instance of "
  10534. "BaseException, not %R",
  10535. type, Py_TYPE(value));
  10536. goto bad;
  10537. }
  10538. }
  10539. } else {
  10540. PyErr_SetString(PyExc_TypeError,
  10541. "raise: exception class must be a subclass of BaseException");
  10542. goto bad;
  10543. }
  10544. #if PY_VERSION_HEX >= 0x03030000
  10545. if (cause) {
  10546. #else
  10547. if (cause && cause != Py_None) {
  10548. #endif
  10549. PyObject *fixed_cause;
  10550. if (cause == Py_None) {
  10551. fixed_cause = NULL;
  10552. } else if (PyExceptionClass_Check(cause)) {
  10553. fixed_cause = PyObject_CallObject(cause, NULL);
  10554. if (fixed_cause == NULL)
  10555. goto bad;
  10556. } else if (PyExceptionInstance_Check(cause)) {
  10557. fixed_cause = cause;
  10558. Py_INCREF(fixed_cause);
  10559. } else {
  10560. PyErr_SetString(PyExc_TypeError,
  10561. "exception causes must derive from "
  10562. "BaseException");
  10563. goto bad;
  10564. }
  10565. PyException_SetCause(value, fixed_cause);
  10566. }
  10567. PyErr_SetObject(type, value);
  10568. if (tb) {
  10569. PyThreadState *tstate = PyThreadState_GET();
  10570. PyObject* tmp_tb = tstate->curexc_traceback;
  10571. if (tb != tmp_tb) {
  10572. Py_INCREF(tb);
  10573. tstate->curexc_traceback = tb;
  10574. Py_XDECREF(tmp_tb);
  10575. }
  10576. }
  10577. bad:
  10578. Py_XDECREF(owned_instance);
  10579. return;
  10580. }
  10581. #endif
  10582. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  10583. PyObject *r;
  10584. if (!j) return NULL;
  10585. r = PyObject_GetItem(o, j);
  10586. Py_DECREF(j);
  10587. return r;
  10588. }
  10589. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  10590. int wraparound, int boundscheck) {
  10591. #if CYTHON_COMPILING_IN_CPYTHON
  10592. if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
  10593. if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
  10594. PyObject *r = PyList_GET_ITEM(o, i);
  10595. Py_INCREF(r);
  10596. return r;
  10597. }
  10598. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  10599. #else
  10600. return PySequence_GetItem(o, i);
  10601. #endif
  10602. }
  10603. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  10604. int wraparound, int boundscheck) {
  10605. #if CYTHON_COMPILING_IN_CPYTHON
  10606. if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
  10607. if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
  10608. PyObject *r = PyTuple_GET_ITEM(o, i);
  10609. Py_INCREF(r);
  10610. return r;
  10611. }
  10612. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  10613. #else
  10614. return PySequence_GetItem(o, i);
  10615. #endif
  10616. }
  10617. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  10618. int is_list, int wraparound, int boundscheck) {
  10619. #if CYTHON_COMPILING_IN_CPYTHON
  10620. if (is_list || PyList_CheckExact(o)) {
  10621. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  10622. if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
  10623. PyObject *r = PyList_GET_ITEM(o, n);
  10624. Py_INCREF(r);
  10625. return r;
  10626. }
  10627. }
  10628. else if (PyTuple_CheckExact(o)) {
  10629. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  10630. if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
  10631. PyObject *r = PyTuple_GET_ITEM(o, n);
  10632. Py_INCREF(r);
  10633. return r;
  10634. }
  10635. } else {
  10636. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  10637. if (likely(m && m->sq_item)) {
  10638. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  10639. Py_ssize_t l = m->sq_length(o);
  10640. if (likely(l >= 0)) {
  10641. i += l;
  10642. } else {
  10643. if (PyErr_ExceptionMatches(PyExc_OverflowError))
  10644. PyErr_Clear();
  10645. else
  10646. return NULL;
  10647. }
  10648. }
  10649. return m->sq_item(o, i);
  10650. }
  10651. }
  10652. #else
  10653. if (is_list || PySequence_Check(o)) {
  10654. return PySequence_GetItem(o, i);
  10655. }
  10656. #endif
  10657. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  10658. }
  10659. static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
  10660. PyObject *kwdict,
  10661. const char* function_name,
  10662. int kw_allowed)
  10663. {
  10664. PyObject* key = 0;
  10665. Py_ssize_t pos = 0;
  10666. #if CPYTHON_COMPILING_IN_PYPY
  10667. if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
  10668. goto invalid_keyword;
  10669. return 1;
  10670. #else
  10671. while (PyDict_Next(kwdict, &pos, &key, 0)) {
  10672. #if PY_MAJOR_VERSION < 3
  10673. if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
  10674. #endif
  10675. if (unlikely(!PyUnicode_Check(key)))
  10676. goto invalid_keyword_type;
  10677. }
  10678. if ((!kw_allowed) && unlikely(key))
  10679. goto invalid_keyword;
  10680. return 1;
  10681. invalid_keyword_type:
  10682. PyErr_Format(PyExc_TypeError,
  10683. "%.200s() keywords must be strings", function_name);
  10684. return 0;
  10685. #endif
  10686. invalid_keyword:
  10687. PyErr_Format(PyExc_TypeError,
  10688. #if PY_MAJOR_VERSION < 3
  10689. "%.200s() got an unexpected keyword argument '%.200s'",
  10690. function_name, PyString_AsString(key));
  10691. #else
  10692. "%s() got an unexpected keyword argument '%U'",
  10693. function_name, key);
  10694. #endif
  10695. return 0;
  10696. }
  10697. static void __Pyx_RaiseDoubleKeywordsError(
  10698. const char* func_name,
  10699. PyObject* kw_name)
  10700. {
  10701. PyErr_Format(PyExc_TypeError,
  10702. #if PY_MAJOR_VERSION >= 3
  10703. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  10704. #else
  10705. "%s() got multiple values for keyword argument '%s'", func_name,
  10706. PyString_AsString(kw_name));
  10707. #endif
  10708. }
  10709. static int __Pyx_ParseOptionalKeywords(
  10710. PyObject *kwds,
  10711. PyObject **argnames[],
  10712. PyObject *kwds2,
  10713. PyObject *values[],
  10714. Py_ssize_t num_pos_args,
  10715. const char* function_name)
  10716. {
  10717. PyObject *key = 0, *value = 0;
  10718. Py_ssize_t pos = 0;
  10719. PyObject*** name;
  10720. PyObject*** first_kw_arg = argnames + num_pos_args;
  10721. while (PyDict_Next(kwds, &pos, &key, &value)) {
  10722. name = first_kw_arg;
  10723. while (*name && (**name != key)) name++;
  10724. if (*name) {
  10725. values[name-argnames] = value;
  10726. continue;
  10727. }
  10728. name = first_kw_arg;
  10729. #if PY_MAJOR_VERSION < 3
  10730. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  10731. while (*name) {
  10732. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  10733. && _PyString_Eq(**name, key)) {
  10734. values[name-argnames] = value;
  10735. break;
  10736. }
  10737. name++;
  10738. }
  10739. if (*name) continue;
  10740. else {
  10741. PyObject*** argname = argnames;
  10742. while (argname != first_kw_arg) {
  10743. if ((**argname == key) || (
  10744. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  10745. && _PyString_Eq(**argname, key))) {
  10746. goto arg_passed_twice;
  10747. }
  10748. argname++;
  10749. }
  10750. }
  10751. } else
  10752. #endif
  10753. if (likely(PyUnicode_Check(key))) {
  10754. while (*name) {
  10755. int cmp = (**name == key) ? 0 :
  10756. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  10757. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  10758. #endif
  10759. PyUnicode_Compare(**name, key);
  10760. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  10761. if (cmp == 0) {
  10762. values[name-argnames] = value;
  10763. break;
  10764. }
  10765. name++;
  10766. }
  10767. if (*name) continue;
  10768. else {
  10769. PyObject*** argname = argnames;
  10770. while (argname != first_kw_arg) {
  10771. int cmp = (**argname == key) ? 0 :
  10772. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  10773. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  10774. #endif
  10775. PyUnicode_Compare(**argname, key);
  10776. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  10777. if (cmp == 0) goto arg_passed_twice;
  10778. argname++;
  10779. }
  10780. }
  10781. } else
  10782. goto invalid_keyword_type;
  10783. if (kwds2) {
  10784. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  10785. } else {
  10786. goto invalid_keyword;
  10787. }
  10788. }
  10789. return 0;
  10790. arg_passed_twice:
  10791. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  10792. goto bad;
  10793. invalid_keyword_type:
  10794. PyErr_Format(PyExc_TypeError,
  10795. "%.200s() keywords must be strings", function_name);
  10796. goto bad;
  10797. invalid_keyword:
  10798. PyErr_Format(PyExc_TypeError,
  10799. #if PY_MAJOR_VERSION < 3
  10800. "%.200s() got an unexpected keyword argument '%.200s'",
  10801. function_name, PyString_AsString(key));
  10802. #else
  10803. "%s() got an unexpected keyword argument '%U'",
  10804. function_name, key);
  10805. #endif
  10806. bad:
  10807. return -1;
  10808. }
  10809. static void __Pyx_RaiseArgtupleInvalid(
  10810. const char* func_name,
  10811. int exact,
  10812. Py_ssize_t num_min,
  10813. Py_ssize_t num_max,
  10814. Py_ssize_t num_found)
  10815. {
  10816. Py_ssize_t num_expected;
  10817. const char *more_or_less;
  10818. if (num_found < num_min) {
  10819. num_expected = num_min;
  10820. more_or_less = "at least";
  10821. } else {
  10822. num_expected = num_max;
  10823. more_or_less = "at most";
  10824. }
  10825. if (exact) {
  10826. more_or_less = "exactly";
  10827. }
  10828. PyErr_Format(PyExc_TypeError,
  10829. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  10830. func_name, more_or_less, num_expected,
  10831. (num_expected == 1) ? "" : "s", num_found);
  10832. }
  10833. static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
  10834. PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
  10835. }
  10836. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  10837. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  10838. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  10839. PyErr_Format(PyExc_ImportError,
  10840. #if PY_MAJOR_VERSION < 3
  10841. "cannot import name %.230s", PyString_AS_STRING(name));
  10842. #else
  10843. "cannot import name %S", name);
  10844. #endif
  10845. }
  10846. return value;
  10847. }
  10848. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
  10849. PyObject* fake_module;
  10850. PyTypeObject* cached_type = NULL;
  10851. fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
  10852. if (!fake_module) return NULL;
  10853. Py_INCREF(fake_module);
  10854. cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
  10855. if (cached_type) {
  10856. if (!PyType_Check((PyObject*)cached_type)) {
  10857. PyErr_Format(PyExc_TypeError,
  10858. "Shared Cython type %.200s is not a type object",
  10859. type->tp_name);
  10860. goto bad;
  10861. }
  10862. if (cached_type->tp_basicsize != type->tp_basicsize) {
  10863. PyErr_Format(PyExc_TypeError,
  10864. "Shared Cython type %.200s has the wrong size, try recompiling",
  10865. type->tp_name);
  10866. goto bad;
  10867. }
  10868. } else {
  10869. if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
  10870. PyErr_Clear();
  10871. if (PyType_Ready(type) < 0) goto bad;
  10872. if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
  10873. goto bad;
  10874. Py_INCREF(type);
  10875. cached_type = type;
  10876. }
  10877. done:
  10878. Py_DECREF(fake_module);
  10879. return cached_type;
  10880. bad:
  10881. Py_XDECREF(cached_type);
  10882. cached_type = NULL;
  10883. goto done;
  10884. }
  10885. static PyObject *
  10886. __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
  10887. {
  10888. if (unlikely(op->func_doc == NULL)) {
  10889. if (op->func.m_ml->ml_doc) {
  10890. #if PY_MAJOR_VERSION >= 3
  10891. op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
  10892. #else
  10893. op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
  10894. #endif
  10895. if (unlikely(op->func_doc == NULL))
  10896. return NULL;
  10897. } else {
  10898. Py_INCREF(Py_None);
  10899. return Py_None;
  10900. }
  10901. }
  10902. Py_INCREF(op->func_doc);
  10903. return op->func_doc;
  10904. }
  10905. static int
  10906. __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
  10907. {
  10908. PyObject *tmp = op->func_doc;
  10909. if (value == NULL)
  10910. value = Py_None; /* Mark as deleted */
  10911. Py_INCREF(value);
  10912. op->func_doc = value;
  10913. Py_XDECREF(tmp);
  10914. return 0;
  10915. }
  10916. static PyObject *
  10917. __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
  10918. {
  10919. if (unlikely(op->func_name == NULL)) {
  10920. #if PY_MAJOR_VERSION >= 3
  10921. op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
  10922. #else
  10923. op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
  10924. #endif
  10925. if (unlikely(op->func_name == NULL))
  10926. return NULL;
  10927. }
  10928. Py_INCREF(op->func_name);
  10929. return op->func_name;
  10930. }
  10931. static int
  10932. __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
  10933. {
  10934. PyObject *tmp;
  10935. #if PY_MAJOR_VERSION >= 3
  10936. if (unlikely(value == NULL || !PyUnicode_Check(value))) {
  10937. #else
  10938. if (unlikely(value == NULL || !PyString_Check(value))) {
  10939. #endif
  10940. PyErr_SetString(PyExc_TypeError,
  10941. "__name__ must be set to a string object");
  10942. return -1;
  10943. }
  10944. tmp = op->func_name;
  10945. Py_INCREF(value);
  10946. op->func_name = value;
  10947. Py_XDECREF(tmp);
  10948. return 0;
  10949. }
  10950. static PyObject *
  10951. __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
  10952. {
  10953. Py_INCREF(op->func_qualname);
  10954. return op->func_qualname;
  10955. }
  10956. static int
  10957. __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
  10958. {
  10959. PyObject *tmp;
  10960. #if PY_MAJOR_VERSION >= 3
  10961. if (unlikely(value == NULL || !PyUnicode_Check(value))) {
  10962. #else
  10963. if (unlikely(value == NULL || !PyString_Check(value))) {
  10964. #endif
  10965. PyErr_SetString(PyExc_TypeError,
  10966. "__qualname__ must be set to a string object");
  10967. return -1;
  10968. }
  10969. tmp = op->func_qualname;
  10970. Py_INCREF(value);
  10971. op->func_qualname = value;
  10972. Py_XDECREF(tmp);
  10973. return 0;
  10974. }
  10975. static PyObject *
  10976. __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
  10977. {
  10978. PyObject *self;
  10979. self = m->func_closure;
  10980. if (self == NULL)
  10981. self = Py_None;
  10982. Py_INCREF(self);
  10983. return self;
  10984. }
  10985. static PyObject *
  10986. __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
  10987. {
  10988. if (unlikely(op->func_dict == NULL)) {
  10989. op->func_dict = PyDict_New();
  10990. if (unlikely(op->func_dict == NULL))
  10991. return NULL;
  10992. }
  10993. Py_INCREF(op->func_dict);
  10994. return op->func_dict;
  10995. }
  10996. static int
  10997. __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
  10998. {
  10999. PyObject *tmp;
  11000. if (unlikely(value == NULL)) {
  11001. PyErr_SetString(PyExc_TypeError,
  11002. "function's dictionary may not be deleted");
  11003. return -1;
  11004. }
  11005. if (unlikely(!PyDict_Check(value))) {
  11006. PyErr_SetString(PyExc_TypeError,
  11007. "setting function's dictionary to a non-dict");
  11008. return -1;
  11009. }
  11010. tmp = op->func_dict;
  11011. Py_INCREF(value);
  11012. op->func_dict = value;
  11013. Py_XDECREF(tmp);
  11014. return 0;
  11015. }
  11016. static PyObject *
  11017. __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
  11018. {
  11019. Py_INCREF(op->func_globals);
  11020. return op->func_globals;
  11021. }
  11022. static PyObject *
  11023. __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
  11024. {
  11025. Py_INCREF(Py_None);
  11026. return Py_None;
  11027. }
  11028. static PyObject *
  11029. __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
  11030. {
  11031. PyObject* result = (op->func_code) ? op->func_code : Py_None;
  11032. Py_INCREF(result);
  11033. return result;
  11034. }
  11035. static int
  11036. __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
  11037. PyObject *res = op->defaults_getter((PyObject *) op);
  11038. if (unlikely(!res))
  11039. return -1;
  11040. op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
  11041. Py_INCREF(op->defaults_tuple);
  11042. op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
  11043. Py_INCREF(op->defaults_kwdict);
  11044. Py_DECREF(res);
  11045. return 0;
  11046. }
  11047. static int
  11048. __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
  11049. PyObject* tmp;
  11050. if (!value) {
  11051. value = Py_None;
  11052. } else if (value != Py_None && !PyTuple_Check(value)) {
  11053. PyErr_SetString(PyExc_TypeError,
  11054. "__defaults__ must be set to a tuple object");
  11055. return -1;
  11056. }
  11057. Py_INCREF(value);
  11058. tmp = op->defaults_tuple;
  11059. op->defaults_tuple = value;
  11060. Py_XDECREF(tmp);
  11061. return 0;
  11062. }
  11063. static PyObject *
  11064. __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
  11065. PyObject* result = op->defaults_tuple;
  11066. if (unlikely(!result)) {
  11067. if (op->defaults_getter) {
  11068. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  11069. result = op->defaults_tuple;
  11070. } else {
  11071. result = Py_None;
  11072. }
  11073. }
  11074. Py_INCREF(result);
  11075. return result;
  11076. }
  11077. static int
  11078. __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
  11079. PyObject* tmp;
  11080. if (!value) {
  11081. value = Py_None;
  11082. } else if (value != Py_None && !PyDict_Check(value)) {
  11083. PyErr_SetString(PyExc_TypeError,
  11084. "__kwdefaults__ must be set to a dict object");
  11085. return -1;
  11086. }
  11087. Py_INCREF(value);
  11088. tmp = op->defaults_kwdict;
  11089. op->defaults_kwdict = value;
  11090. Py_XDECREF(tmp);
  11091. return 0;
  11092. }
  11093. static PyObject *
  11094. __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
  11095. PyObject* result = op->defaults_kwdict;
  11096. if (unlikely(!result)) {
  11097. if (op->defaults_getter) {
  11098. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  11099. result = op->defaults_kwdict;
  11100. } else {
  11101. result = Py_None;
  11102. }
  11103. }
  11104. Py_INCREF(result);
  11105. return result;
  11106. }
  11107. static int
  11108. __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
  11109. PyObject* tmp;
  11110. if (!value || value == Py_None) {
  11111. value = NULL;
  11112. } else if (!PyDict_Check(value)) {
  11113. PyErr_SetString(PyExc_TypeError,
  11114. "__annotations__ must be set to a dict object");
  11115. return -1;
  11116. }
  11117. Py_XINCREF(value);
  11118. tmp = op->func_annotations;
  11119. op->func_annotations = value;
  11120. Py_XDECREF(tmp);
  11121. return 0;
  11122. }
  11123. static PyObject *
  11124. __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
  11125. PyObject* result = op->func_annotations;
  11126. if (unlikely(!result)) {
  11127. result = PyDict_New();
  11128. if (unlikely(!result)) return NULL;
  11129. op->func_annotations = result;
  11130. }
  11131. Py_INCREF(result);
  11132. return result;
  11133. }
  11134. static PyGetSetDef __pyx_CyFunction_getsets[] = {
  11135. {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  11136. {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  11137. {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  11138. {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  11139. {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  11140. {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
  11141. {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  11142. {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  11143. {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  11144. {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  11145. {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  11146. {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  11147. {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  11148. {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  11149. {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  11150. {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  11151. {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
  11152. {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
  11153. {0, 0, 0, 0, 0}
  11154. };
  11155. #ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
  11156. #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
  11157. #endif
  11158. static PyMemberDef __pyx_CyFunction_members[] = {
  11159. {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
  11160. {0, 0, 0, 0, 0}
  11161. };
  11162. static PyObject *
  11163. __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
  11164. {
  11165. #if PY_MAJOR_VERSION >= 3
  11166. return PyUnicode_FromString(m->func.m_ml->ml_name);
  11167. #else
  11168. return PyString_FromString(m->func.m_ml->ml_name);
  11169. #endif
  11170. }
  11171. static PyMethodDef __pyx_CyFunction_methods[] = {
  11172. {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
  11173. {0, 0, 0, 0}
  11174. };
  11175. static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
  11176. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  11177. __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
  11178. if (op == NULL)
  11179. return NULL;
  11180. op->flags = flags;
  11181. op->func_weakreflist = NULL;
  11182. op->func.m_ml = ml;
  11183. op->func.m_self = (PyObject *) op;
  11184. Py_XINCREF(closure);
  11185. op->func_closure = closure;
  11186. Py_XINCREF(module);
  11187. op->func.m_module = module;
  11188. op->func_dict = NULL;
  11189. op->func_name = NULL;
  11190. Py_INCREF(qualname);
  11191. op->func_qualname = qualname;
  11192. op->func_doc = NULL;
  11193. op->func_classobj = NULL;
  11194. op->func_globals = globals;
  11195. Py_INCREF(op->func_globals);
  11196. Py_XINCREF(code);
  11197. op->func_code = code;
  11198. op->defaults_pyobjects = 0;
  11199. op->defaults = NULL;
  11200. op->defaults_tuple = NULL;
  11201. op->defaults_kwdict = NULL;
  11202. op->defaults_getter = NULL;
  11203. op->func_annotations = NULL;
  11204. PyObject_GC_Track(op);
  11205. return (PyObject *) op;
  11206. }
  11207. static int
  11208. __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  11209. {
  11210. Py_CLEAR(m->func_closure);
  11211. Py_CLEAR(m->func.m_module);
  11212. Py_CLEAR(m->func_dict);
  11213. Py_CLEAR(m->func_name);
  11214. Py_CLEAR(m->func_qualname);
  11215. Py_CLEAR(m->func_doc);
  11216. Py_CLEAR(m->func_globals);
  11217. Py_CLEAR(m->func_code);
  11218. Py_CLEAR(m->func_classobj);
  11219. Py_CLEAR(m->defaults_tuple);
  11220. Py_CLEAR(m->defaults_kwdict);
  11221. Py_CLEAR(m->func_annotations);
  11222. if (m->defaults) {
  11223. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  11224. int i;
  11225. for (i = 0; i < m->defaults_pyobjects; i++)
  11226. Py_XDECREF(pydefaults[i]);
  11227. PyMem_Free(m->defaults);
  11228. m->defaults = NULL;
  11229. }
  11230. return 0;
  11231. }
  11232. static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  11233. {
  11234. PyObject_GC_UnTrack(m);
  11235. if (m->func_weakreflist != NULL)
  11236. PyObject_ClearWeakRefs((PyObject *) m);
  11237. __Pyx_CyFunction_clear(m);
  11238. PyObject_GC_Del(m);
  11239. }
  11240. static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  11241. {
  11242. Py_VISIT(m->func_closure);
  11243. Py_VISIT(m->func.m_module);
  11244. Py_VISIT(m->func_dict);
  11245. Py_VISIT(m->func_name);
  11246. Py_VISIT(m->func_qualname);
  11247. Py_VISIT(m->func_doc);
  11248. Py_VISIT(m->func_globals);
  11249. Py_VISIT(m->func_code);
  11250. Py_VISIT(m->func_classobj);
  11251. Py_VISIT(m->defaults_tuple);
  11252. Py_VISIT(m->defaults_kwdict);
  11253. if (m->defaults) {
  11254. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  11255. int i;
  11256. for (i = 0; i < m->defaults_pyobjects; i++)
  11257. Py_VISIT(pydefaults[i]);
  11258. }
  11259. return 0;
  11260. }
  11261. static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
  11262. {
  11263. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  11264. if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
  11265. Py_INCREF(func);
  11266. return func;
  11267. }
  11268. if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
  11269. if (type == NULL)
  11270. type = (PyObject *)(Py_TYPE(obj));
  11271. return PyMethod_New(func,
  11272. type, (PyObject *)(Py_TYPE(type)));
  11273. }
  11274. if (obj == Py_None)
  11275. obj = NULL;
  11276. return PyMethod_New(func, obj, type);
  11277. }
  11278. static PyObject*
  11279. __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  11280. {
  11281. #if PY_MAJOR_VERSION >= 3
  11282. return PyUnicode_FromFormat("<cyfunction %U at %p>",
  11283. op->func_qualname, (void *)op);
  11284. #else
  11285. return PyString_FromFormat("<cyfunction %s at %p>",
  11286. PyString_AsString(op->func_qualname), (void *)op);
  11287. #endif
  11288. }
  11289. #if CYTHON_COMPILING_IN_PYPY
  11290. static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  11291. PyCFunctionObject* f = (PyCFunctionObject*)func;
  11292. PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  11293. PyObject *self = PyCFunction_GET_SELF(func);
  11294. Py_ssize_t size;
  11295. switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
  11296. case METH_VARARGS:
  11297. if (likely(kw == NULL) || PyDict_Size(kw) == 0)
  11298. return (*meth)(self, arg);
  11299. break;
  11300. case METH_VARARGS | METH_KEYWORDS:
  11301. return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
  11302. case METH_NOARGS:
  11303. if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
  11304. size = PyTuple_GET_SIZE(arg);
  11305. if (size == 0)
  11306. return (*meth)(self, NULL);
  11307. PyErr_Format(PyExc_TypeError,
  11308. "%.200s() takes no arguments (%zd given)",
  11309. f->m_ml->ml_name, size);
  11310. return NULL;
  11311. }
  11312. break;
  11313. case METH_O:
  11314. if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
  11315. size = PyTuple_GET_SIZE(arg);
  11316. if (size == 1)
  11317. return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
  11318. PyErr_Format(PyExc_TypeError,
  11319. "%.200s() takes exactly one argument (%zd given)",
  11320. f->m_ml->ml_name, size);
  11321. return NULL;
  11322. }
  11323. break;
  11324. default:
  11325. PyErr_SetString(PyExc_SystemError, "Bad call flags in "
  11326. "__Pyx_CyFunction_Call. METH_OLDARGS is no "
  11327. "longer supported!");
  11328. return NULL;
  11329. }
  11330. PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
  11331. f->m_ml->ml_name);
  11332. return NULL;
  11333. }
  11334. #else
  11335. static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  11336. return PyCFunction_Call(func, arg, kw);
  11337. }
  11338. #endif
  11339. static PyTypeObject __pyx_CyFunctionType_type = {
  11340. PyVarObject_HEAD_INIT(0, 0)
  11341. __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
  11342. sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/
  11343. 0, /*tp_itemsize*/
  11344. (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
  11345. 0, /*tp_print*/
  11346. 0, /*tp_getattr*/
  11347. 0, /*tp_setattr*/
  11348. #if PY_MAJOR_VERSION < 3
  11349. 0, /*tp_compare*/
  11350. #else
  11351. 0, /*reserved*/
  11352. #endif
  11353. (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/
  11354. 0, /*tp_as_number*/
  11355. 0, /*tp_as_sequence*/
  11356. 0, /*tp_as_mapping*/
  11357. 0, /*tp_hash*/
  11358. __Pyx_CyFunction_Call, /*tp_call*/
  11359. 0, /*tp_str*/
  11360. 0, /*tp_getattro*/
  11361. 0, /*tp_setattro*/
  11362. 0, /*tp_as_buffer*/
  11363. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
  11364. 0, /*tp_doc*/
  11365. (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/
  11366. (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/
  11367. 0, /*tp_richcompare*/
  11368. offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
  11369. 0, /*tp_iter*/
  11370. 0, /*tp_iternext*/
  11371. __pyx_CyFunction_methods, /*tp_methods*/
  11372. __pyx_CyFunction_members, /*tp_members*/
  11373. __pyx_CyFunction_getsets, /*tp_getset*/
  11374. 0, /*tp_base*/
  11375. 0, /*tp_dict*/
  11376. __Pyx_CyFunction_descr_get, /*tp_descr_get*/
  11377. 0, /*tp_descr_set*/
  11378. offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
  11379. 0, /*tp_init*/
  11380. 0, /*tp_alloc*/
  11381. 0, /*tp_new*/
  11382. 0, /*tp_free*/
  11383. 0, /*tp_is_gc*/
  11384. 0, /*tp_bases*/
  11385. 0, /*tp_mro*/
  11386. 0, /*tp_cache*/
  11387. 0, /*tp_subclasses*/
  11388. 0, /*tp_weaklist*/
  11389. 0, /*tp_del*/
  11390. #if PY_VERSION_HEX >= 0x02060000
  11391. 0, /*tp_version_tag*/
  11392. #endif
  11393. #if PY_VERSION_HEX >= 0x030400a1
  11394. 0, /*tp_finalize*/
  11395. #endif
  11396. };
  11397. static int __Pyx_CyFunction_init(void) {
  11398. #if !CYTHON_COMPILING_IN_PYPY
  11399. __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
  11400. #endif
  11401. __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
  11402. if (__pyx_CyFunctionType == NULL) {
  11403. return -1;
  11404. }
  11405. return 0;
  11406. }
  11407. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
  11408. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  11409. m->defaults = PyMem_Malloc(size);
  11410. if (!m->defaults)
  11411. return PyErr_NoMemory();
  11412. memset(m->defaults, 0, size);
  11413. m->defaults_pyobjects = pyobjects;
  11414. return m->defaults;
  11415. }
  11416. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
  11417. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  11418. m->defaults_tuple = tuple;
  11419. Py_INCREF(tuple);
  11420. }
  11421. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
  11422. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  11423. m->defaults_kwdict = dict;
  11424. Py_INCREF(dict);
  11425. }
  11426. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
  11427. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  11428. m->func_annotations = dict;
  11429. Py_INCREF(dict);
  11430. }
  11431. static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
  11432. PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
  11433. }
  11434. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
  11435. #if CYTHON_COMPILING_IN_PYPY
  11436. return PyObject_RichCompareBool(s1, s2, equals);
  11437. #else
  11438. if (s1 == s2) {
  11439. return (equals == Py_EQ);
  11440. } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
  11441. const char *ps1, *ps2;
  11442. Py_ssize_t length = PyBytes_GET_SIZE(s1);
  11443. if (length != PyBytes_GET_SIZE(s2))
  11444. return (equals == Py_NE);
  11445. ps1 = PyBytes_AS_STRING(s1);
  11446. ps2 = PyBytes_AS_STRING(s2);
  11447. if (ps1[0] != ps2[0]) {
  11448. return (equals == Py_NE);
  11449. } else if (length == 1) {
  11450. return (equals == Py_EQ);
  11451. } else {
  11452. int result = memcmp(ps1, ps2, (size_t)length);
  11453. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  11454. }
  11455. } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
  11456. return (equals == Py_NE);
  11457. } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
  11458. return (equals == Py_NE);
  11459. } else {
  11460. int result;
  11461. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  11462. if (!py_result)
  11463. return -1;
  11464. result = __Pyx_PyObject_IsTrue(py_result);
  11465. Py_DECREF(py_result);
  11466. return result;
  11467. }
  11468. #endif
  11469. }
  11470. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
  11471. #if CYTHON_COMPILING_IN_PYPY
  11472. return PyObject_RichCompareBool(s1, s2, equals);
  11473. #else
  11474. #if PY_MAJOR_VERSION < 3
  11475. PyObject* owned_ref = NULL;
  11476. #endif
  11477. int s1_is_unicode, s2_is_unicode;
  11478. if (s1 == s2) {
  11479. goto return_eq;
  11480. }
  11481. s1_is_unicode = PyUnicode_CheckExact(s1);
  11482. s2_is_unicode = PyUnicode_CheckExact(s2);
  11483. #if PY_MAJOR_VERSION < 3
  11484. if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
  11485. owned_ref = PyUnicode_FromObject(s2);
  11486. if (unlikely(!owned_ref))
  11487. return -1;
  11488. s2 = owned_ref;
  11489. s2_is_unicode = 1;
  11490. } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
  11491. owned_ref = PyUnicode_FromObject(s1);
  11492. if (unlikely(!owned_ref))
  11493. return -1;
  11494. s1 = owned_ref;
  11495. s1_is_unicode = 1;
  11496. } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
  11497. return __Pyx_PyBytes_Equals(s1, s2, equals);
  11498. }
  11499. #endif
  11500. if (s1_is_unicode & s2_is_unicode) {
  11501. Py_ssize_t length;
  11502. int kind;
  11503. void *data1, *data2;
  11504. #if CYTHON_PEP393_ENABLED
  11505. if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
  11506. return -1;
  11507. #endif
  11508. length = __Pyx_PyUnicode_GET_LENGTH(s1);
  11509. if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
  11510. goto return_ne;
  11511. }
  11512. kind = __Pyx_PyUnicode_KIND(s1);
  11513. if (kind != __Pyx_PyUnicode_KIND(s2)) {
  11514. goto return_ne;
  11515. }
  11516. data1 = __Pyx_PyUnicode_DATA(s1);
  11517. data2 = __Pyx_PyUnicode_DATA(s2);
  11518. if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
  11519. goto return_ne;
  11520. } else if (length == 1) {
  11521. goto return_eq;
  11522. } else {
  11523. int result = memcmp(data1, data2, length * kind);
  11524. #if PY_MAJOR_VERSION < 3
  11525. Py_XDECREF(owned_ref);
  11526. #endif
  11527. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  11528. }
  11529. } else if ((s1 == Py_None) & s2_is_unicode) {
  11530. goto return_ne;
  11531. } else if ((s2 == Py_None) & s1_is_unicode) {
  11532. goto return_ne;
  11533. } else {
  11534. int result;
  11535. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  11536. if (!py_result)
  11537. return -1;
  11538. result = __Pyx_PyObject_IsTrue(py_result);
  11539. Py_DECREF(py_result);
  11540. return result;
  11541. }
  11542. return_eq:
  11543. #if PY_MAJOR_VERSION < 3
  11544. Py_XDECREF(owned_ref);
  11545. #endif
  11546. return (equals == Py_EQ);
  11547. return_ne:
  11548. #if PY_MAJOR_VERSION < 3
  11549. Py_XDECREF(owned_ref);
  11550. #endif
  11551. return (equals == Py_NE);
  11552. #endif
  11553. }
  11554. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  11555. PyObject *empty_list = 0;
  11556. PyObject *module = 0;
  11557. PyObject *global_dict = 0;
  11558. PyObject *empty_dict = 0;
  11559. PyObject *list;
  11560. #if PY_VERSION_HEX < 0x03030000
  11561. PyObject *py_import;
  11562. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  11563. if (!py_import)
  11564. goto bad;
  11565. #endif
  11566. if (from_list)
  11567. list = from_list;
  11568. else {
  11569. empty_list = PyList_New(0);
  11570. if (!empty_list)
  11571. goto bad;
  11572. list = empty_list;
  11573. }
  11574. global_dict = PyModule_GetDict(__pyx_m);
  11575. if (!global_dict)
  11576. goto bad;
  11577. empty_dict = PyDict_New();
  11578. if (!empty_dict)
  11579. goto bad;
  11580. #if PY_VERSION_HEX >= 0x02050000
  11581. {
  11582. #if PY_MAJOR_VERSION >= 3
  11583. if (level == -1) {
  11584. if (strchr(__Pyx_MODULE_NAME, '.')) {
  11585. #if PY_VERSION_HEX < 0x03030000
  11586. PyObject *py_level = PyInt_FromLong(1);
  11587. if (!py_level)
  11588. goto bad;
  11589. module = PyObject_CallFunctionObjArgs(py_import,
  11590. name, global_dict, empty_dict, list, py_level, NULL);
  11591. Py_DECREF(py_level);
  11592. #else
  11593. module = PyImport_ImportModuleLevelObject(
  11594. name, global_dict, empty_dict, list, 1);
  11595. #endif
  11596. if (!module) {
  11597. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  11598. goto bad;
  11599. PyErr_Clear();
  11600. }
  11601. }
  11602. level = 0; /* try absolute import on failure */
  11603. }
  11604. #endif
  11605. if (!module) {
  11606. #if PY_VERSION_HEX < 0x03030000
  11607. PyObject *py_level = PyInt_FromLong(level);
  11608. if (!py_level)
  11609. goto bad;
  11610. module = PyObject_CallFunctionObjArgs(py_import,
  11611. name, global_dict, empty_dict, list, py_level, NULL);
  11612. Py_DECREF(py_level);
  11613. #else
  11614. module = PyImport_ImportModuleLevelObject(
  11615. name, global_dict, empty_dict, list, level);
  11616. #endif
  11617. }
  11618. }
  11619. #else
  11620. if (level>0) {
  11621. PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
  11622. goto bad;
  11623. }
  11624. module = PyObject_CallFunctionObjArgs(py_import,
  11625. name, global_dict, empty_dict, list, NULL);
  11626. #endif
  11627. bad:
  11628. #if PY_VERSION_HEX < 0x03030000
  11629. Py_XDECREF(py_import);
  11630. #endif
  11631. Py_XDECREF(empty_list);
  11632. Py_XDECREF(empty_dict);
  11633. return module;
  11634. }
  11635. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  11636. const long neg_one = (long) -1, const_zero = 0;
  11637. const int is_unsigned = neg_one > const_zero;
  11638. if (is_unsigned) {
  11639. if (sizeof(long) < sizeof(long)) {
  11640. return PyInt_FromLong((long) value);
  11641. } else if (sizeof(long) <= sizeof(unsigned long)) {
  11642. return PyLong_FromUnsignedLong((unsigned long) value);
  11643. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  11644. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  11645. }
  11646. } else {
  11647. if (sizeof(long) <= sizeof(long)) {
  11648. return PyInt_FromLong((long) value);
  11649. } else if (sizeof(long) <= sizeof(long long)) {
  11650. return PyLong_FromLongLong((long long) value);
  11651. }
  11652. }
  11653. {
  11654. int one = 1; int little = (int)*(unsigned char *)&one;
  11655. unsigned char *bytes = (unsigned char *)&value;
  11656. return _PyLong_FromByteArray(bytes, sizeof(long),
  11657. little, !is_unsigned);
  11658. }
  11659. }
  11660. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
  11661. static PyObject *__Pyx_GetStdout(void) {
  11662. PyObject *f = PySys_GetObject((char *)"stdout");
  11663. if (!f) {
  11664. PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
  11665. }
  11666. return f;
  11667. }
  11668. static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
  11669. int i;
  11670. if (!f) {
  11671. if (!(f = __Pyx_GetStdout()))
  11672. return -1;
  11673. }
  11674. Py_INCREF(f);
  11675. for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
  11676. PyObject* v;
  11677. if (PyFile_SoftSpace(f, 1)) {
  11678. if (PyFile_WriteString(" ", f) < 0)
  11679. goto error;
  11680. }
  11681. v = PyTuple_GET_ITEM(arg_tuple, i);
  11682. if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
  11683. goto error;
  11684. if (PyString_Check(v)) {
  11685. char *s = PyString_AsString(v);
  11686. Py_ssize_t len = PyString_Size(v);
  11687. if (len > 0) {
  11688. switch (s[len-1]) {
  11689. case ' ': break;
  11690. case '\f': case '\r': case '\n': case '\t': case '\v':
  11691. PyFile_SoftSpace(f, 0);
  11692. break;
  11693. default: break;
  11694. }
  11695. }
  11696. }
  11697. }
  11698. if (newline) {
  11699. if (PyFile_WriteString("\n", f) < 0)
  11700. goto error;
  11701. PyFile_SoftSpace(f, 0);
  11702. }
  11703. Py_DECREF(f);
  11704. return 0;
  11705. error:
  11706. Py_DECREF(f);
  11707. return -1;
  11708. }
  11709. #else /* Python 3 has a print function */
  11710. static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
  11711. PyObject* kwargs = 0;
  11712. PyObject* result = 0;
  11713. PyObject* end_string;
  11714. if (unlikely(!__pyx_print)) {
  11715. __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
  11716. if (!__pyx_print)
  11717. return -1;
  11718. }
  11719. if (stream) {
  11720. kwargs = PyDict_New();
  11721. if (unlikely(!kwargs))
  11722. return -1;
  11723. if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
  11724. goto bad;
  11725. if (!newline) {
  11726. end_string = PyUnicode_FromStringAndSize(" ", 1);
  11727. if (unlikely(!end_string))
  11728. goto bad;
  11729. if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
  11730. Py_DECREF(end_string);
  11731. goto bad;
  11732. }
  11733. Py_DECREF(end_string);
  11734. }
  11735. } else if (!newline) {
  11736. if (unlikely(!__pyx_print_kwargs)) {
  11737. __pyx_print_kwargs = PyDict_New();
  11738. if (unlikely(!__pyx_print_kwargs))
  11739. return -1;
  11740. end_string = PyUnicode_FromStringAndSize(" ", 1);
  11741. if (unlikely(!end_string))
  11742. return -1;
  11743. if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
  11744. Py_DECREF(end_string);
  11745. return -1;
  11746. }
  11747. Py_DECREF(end_string);
  11748. }
  11749. kwargs = __pyx_print_kwargs;
  11750. }
  11751. result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
  11752. if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
  11753. Py_DECREF(kwargs);
  11754. if (!result)
  11755. return -1;
  11756. Py_DECREF(result);
  11757. return 0;
  11758. bad:
  11759. if (kwargs != __pyx_print_kwargs)
  11760. Py_XDECREF(kwargs);
  11761. return -1;
  11762. }
  11763. #endif
  11764. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
  11765. static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
  11766. if (!f) {
  11767. if (!(f = __Pyx_GetStdout()))
  11768. return -1;
  11769. }
  11770. Py_INCREF(f);
  11771. if (PyFile_SoftSpace(f, 0)) {
  11772. if (PyFile_WriteString(" ", f) < 0)
  11773. goto error;
  11774. }
  11775. if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
  11776. goto error;
  11777. if (PyFile_WriteString("\n", f) < 0)
  11778. goto error;
  11779. Py_DECREF(f);
  11780. return 0;
  11781. error:
  11782. Py_DECREF(f);
  11783. return -1;
  11784. /* the line below is just to avoid C compiler
  11785. * warnings about unused functions */
  11786. return __Pyx_Print(f, NULL, 0);
  11787. }
  11788. #else /* Python 3 has a print function */
  11789. static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
  11790. int res;
  11791. PyObject* arg_tuple = PyTuple_Pack(1, o);
  11792. if (unlikely(!arg_tuple))
  11793. return -1;
  11794. res = __Pyx_Print(stream, arg_tuple, 1);
  11795. Py_DECREF(arg_tuple);
  11796. return res;
  11797. }
  11798. #endif
  11799. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
  11800. { \
  11801. func_type value = func(x); \
  11802. if (sizeof(target_type) < sizeof(func_type)) { \
  11803. if (unlikely(value != (func_type) (target_type) value)) { \
  11804. func_type zero = 0; \
  11805. PyErr_SetString(PyExc_OverflowError, \
  11806. (is_unsigned && unlikely(value < zero)) ? \
  11807. "can't convert negative value to " #target_type : \
  11808. "value too large to convert to " #target_type); \
  11809. return (target_type) -1; \
  11810. } \
  11811. } \
  11812. return (target_type) value; \
  11813. }
  11814. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  11815. #if CYTHON_USE_PYLONG_INTERNALS
  11816. #include "longintrepr.h"
  11817. #endif
  11818. #endif
  11819. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  11820. const long neg_one = (long) -1, const_zero = 0;
  11821. const int is_unsigned = neg_one > const_zero;
  11822. #if PY_MAJOR_VERSION < 3
  11823. if (likely(PyInt_Check(x))) {
  11824. if (sizeof(long) < sizeof(long)) {
  11825. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
  11826. } else {
  11827. long val = PyInt_AS_LONG(x);
  11828. if (is_unsigned && unlikely(val < 0)) {
  11829. PyErr_SetString(PyExc_OverflowError,
  11830. "can't convert negative value to long");
  11831. return (long) -1;
  11832. }
  11833. return (long) val;
  11834. }
  11835. } else
  11836. #endif
  11837. if (likely(PyLong_Check(x))) {
  11838. if (is_unsigned) {
  11839. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  11840. #if CYTHON_USE_PYLONG_INTERNALS
  11841. if (sizeof(digit) <= sizeof(long)) {
  11842. switch (Py_SIZE(x)) {
  11843. case 0: return 0;
  11844. case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
  11845. }
  11846. }
  11847. #endif
  11848. #endif
  11849. if (unlikely(Py_SIZE(x) < 0)) {
  11850. PyErr_SetString(PyExc_OverflowError,
  11851. "can't convert negative value to long");
  11852. return (long) -1;
  11853. }
  11854. if (sizeof(long) <= sizeof(unsigned long)) {
  11855. __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
  11856. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  11857. __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
  11858. }
  11859. } else {
  11860. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  11861. #if CYTHON_USE_PYLONG_INTERNALS
  11862. if (sizeof(digit) <= sizeof(long)) {
  11863. switch (Py_SIZE(x)) {
  11864. case 0: return 0;
  11865. case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
  11866. case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
  11867. }
  11868. }
  11869. #endif
  11870. #endif
  11871. if (sizeof(long) <= sizeof(long)) {
  11872. __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
  11873. } else if (sizeof(long) <= sizeof(long long)) {
  11874. __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
  11875. }
  11876. }
  11877. {
  11878. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  11879. PyErr_SetString(PyExc_RuntimeError,
  11880. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  11881. #else
  11882. long val;
  11883. PyObject *v = __Pyx_PyNumber_Int(x);
  11884. #if PY_MAJOR_VERSION < 3
  11885. if (likely(v) && !PyLong_Check(v)) {
  11886. PyObject *tmp = v;
  11887. v = PyNumber_Long(tmp);
  11888. Py_DECREF(tmp);
  11889. }
  11890. #endif
  11891. if (likely(v)) {
  11892. int one = 1; int is_little = (int)*(unsigned char *)&one;
  11893. unsigned char *bytes = (unsigned char *)&val;
  11894. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  11895. bytes, sizeof(val),
  11896. is_little, !is_unsigned);
  11897. Py_DECREF(v);
  11898. if (likely(!ret))
  11899. return val;
  11900. }
  11901. #endif
  11902. return (long) -1;
  11903. }
  11904. } else {
  11905. long val;
  11906. PyObject *tmp = __Pyx_PyNumber_Int(x);
  11907. if (!tmp) return (long) -1;
  11908. val = __Pyx_PyInt_As_long(tmp);
  11909. Py_DECREF(tmp);
  11910. return val;
  11911. }
  11912. }
  11913. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  11914. #if CYTHON_USE_PYLONG_INTERNALS
  11915. #include "longintrepr.h"
  11916. #endif
  11917. #endif
  11918. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  11919. const int neg_one = (int) -1, const_zero = 0;
  11920. const int is_unsigned = neg_one > const_zero;
  11921. #if PY_MAJOR_VERSION < 3
  11922. if (likely(PyInt_Check(x))) {
  11923. if (sizeof(int) < sizeof(long)) {
  11924. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
  11925. } else {
  11926. long val = PyInt_AS_LONG(x);
  11927. if (is_unsigned && unlikely(val < 0)) {
  11928. PyErr_SetString(PyExc_OverflowError,
  11929. "can't convert negative value to int");
  11930. return (int) -1;
  11931. }
  11932. return (int) val;
  11933. }
  11934. } else
  11935. #endif
  11936. if (likely(PyLong_Check(x))) {
  11937. if (is_unsigned) {
  11938. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  11939. #if CYTHON_USE_PYLONG_INTERNALS
  11940. if (sizeof(digit) <= sizeof(int)) {
  11941. switch (Py_SIZE(x)) {
  11942. case 0: return 0;
  11943. case 1: return (int) ((PyLongObject*)x)->ob_digit[0];
  11944. }
  11945. }
  11946. #endif
  11947. #endif
  11948. if (unlikely(Py_SIZE(x) < 0)) {
  11949. PyErr_SetString(PyExc_OverflowError,
  11950. "can't convert negative value to int");
  11951. return (int) -1;
  11952. }
  11953. if (sizeof(int) <= sizeof(unsigned long)) {
  11954. __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
  11955. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  11956. __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
  11957. }
  11958. } else {
  11959. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  11960. #if CYTHON_USE_PYLONG_INTERNALS
  11961. if (sizeof(digit) <= sizeof(int)) {
  11962. switch (Py_SIZE(x)) {
  11963. case 0: return 0;
  11964. case 1: return +(int) ((PyLongObject*)x)->ob_digit[0];
  11965. case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
  11966. }
  11967. }
  11968. #endif
  11969. #endif
  11970. if (sizeof(int) <= sizeof(long)) {
  11971. __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
  11972. } else if (sizeof(int) <= sizeof(long long)) {
  11973. __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
  11974. }
  11975. }
  11976. {
  11977. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  11978. PyErr_SetString(PyExc_RuntimeError,
  11979. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  11980. #else
  11981. int val;
  11982. PyObject *v = __Pyx_PyNumber_Int(x);
  11983. #if PY_MAJOR_VERSION < 3
  11984. if (likely(v) && !PyLong_Check(v)) {
  11985. PyObject *tmp = v;
  11986. v = PyNumber_Long(tmp);
  11987. Py_DECREF(tmp);
  11988. }
  11989. #endif
  11990. if (likely(v)) {
  11991. int one = 1; int is_little = (int)*(unsigned char *)&one;
  11992. unsigned char *bytes = (unsigned char *)&val;
  11993. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  11994. bytes, sizeof(val),
  11995. is_little, !is_unsigned);
  11996. Py_DECREF(v);
  11997. if (likely(!ret))
  11998. return val;
  11999. }
  12000. #endif
  12001. return (int) -1;
  12002. }
  12003. } else {
  12004. int val;
  12005. PyObject *tmp = __Pyx_PyNumber_Int(x);
  12006. if (!tmp) return (int) -1;
  12007. val = __Pyx_PyInt_As_int(tmp);
  12008. Py_DECREF(tmp);
  12009. return val;
  12010. }
  12011. }
  12012. static int __Pyx_check_binary_version(void) {
  12013. char ctversion[4], rtversion[4];
  12014. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  12015. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  12016. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  12017. char message[200];
  12018. PyOS_snprintf(message, sizeof(message),
  12019. "compiletime version %s of module '%.100s' "
  12020. "does not match runtime version %s",
  12021. ctversion, __Pyx_MODULE_NAME, rtversion);
  12022. #if PY_VERSION_HEX < 0x02050000
  12023. return PyErr_Warn(NULL, message);
  12024. #else
  12025. return PyErr_WarnEx(NULL, message, 1);
  12026. #endif
  12027. }
  12028. return 0;
  12029. }
  12030. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  12031. int start = 0, mid = 0, end = count - 1;
  12032. if (end >= 0 && code_line > entries[end].code_line) {
  12033. return count;
  12034. }
  12035. while (start < end) {
  12036. mid = (start + end) / 2;
  12037. if (code_line < entries[mid].code_line) {
  12038. end = mid;
  12039. } else if (code_line > entries[mid].code_line) {
  12040. start = mid + 1;
  12041. } else {
  12042. return mid;
  12043. }
  12044. }
  12045. if (code_line <= entries[mid].code_line) {
  12046. return mid;
  12047. } else {
  12048. return mid + 1;
  12049. }
  12050. }
  12051. static PyCodeObject *__pyx_find_code_object(int code_line) {
  12052. PyCodeObject* code_object;
  12053. int pos;
  12054. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  12055. return NULL;
  12056. }
  12057. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  12058. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  12059. return NULL;
  12060. }
  12061. code_object = __pyx_code_cache.entries[pos].code_object;
  12062. Py_INCREF(code_object);
  12063. return code_object;
  12064. }
  12065. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  12066. int pos, i;
  12067. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  12068. if (unlikely(!code_line)) {
  12069. return;
  12070. }
  12071. if (unlikely(!entries)) {
  12072. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  12073. if (likely(entries)) {
  12074. __pyx_code_cache.entries = entries;
  12075. __pyx_code_cache.max_count = 64;
  12076. __pyx_code_cache.count = 1;
  12077. entries[0].code_line = code_line;
  12078. entries[0].code_object = code_object;
  12079. Py_INCREF(code_object);
  12080. }
  12081. return;
  12082. }
  12083. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  12084. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  12085. PyCodeObject* tmp = entries[pos].code_object;
  12086. entries[pos].code_object = code_object;
  12087. Py_DECREF(tmp);
  12088. return;
  12089. }
  12090. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  12091. int new_max = __pyx_code_cache.max_count + 64;
  12092. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  12093. __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  12094. if (unlikely(!entries)) {
  12095. return;
  12096. }
  12097. __pyx_code_cache.entries = entries;
  12098. __pyx_code_cache.max_count = new_max;
  12099. }
  12100. for (i=__pyx_code_cache.count; i>pos; i--) {
  12101. entries[i] = entries[i-1];
  12102. }
  12103. entries[pos].code_line = code_line;
  12104. entries[pos].code_object = code_object;
  12105. __pyx_code_cache.count++;
  12106. Py_INCREF(code_object);
  12107. }
  12108. #include "compile.h"
  12109. #include "frameobject.h"
  12110. #include "traceback.h"
  12111. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  12112. const char *funcname, int c_line,
  12113. int py_line, const char *filename) {
  12114. PyCodeObject *py_code = 0;
  12115. PyObject *py_srcfile = 0;
  12116. PyObject *py_funcname = 0;
  12117. #if PY_MAJOR_VERSION < 3
  12118. py_srcfile = PyString_FromString(filename);
  12119. #else
  12120. py_srcfile = PyUnicode_FromString(filename);
  12121. #endif
  12122. if (!py_srcfile) goto bad;
  12123. if (c_line) {
  12124. #if PY_MAJOR_VERSION < 3
  12125. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  12126. #else
  12127. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  12128. #endif
  12129. }
  12130. else {
  12131. #if PY_MAJOR_VERSION < 3
  12132. py_funcname = PyString_FromString(funcname);
  12133. #else
  12134. py_funcname = PyUnicode_FromString(funcname);
  12135. #endif
  12136. }
  12137. if (!py_funcname) goto bad;
  12138. py_code = __Pyx_PyCode_New(
  12139. 0, /*int argcount,*/
  12140. 0, /*int kwonlyargcount,*/
  12141. 0, /*int nlocals,*/
  12142. 0, /*int stacksize,*/
  12143. 0, /*int flags,*/
  12144. __pyx_empty_bytes, /*PyObject *code,*/
  12145. __pyx_empty_tuple, /*PyObject *consts,*/
  12146. __pyx_empty_tuple, /*PyObject *names,*/
  12147. __pyx_empty_tuple, /*PyObject *varnames,*/
  12148. __pyx_empty_tuple, /*PyObject *freevars,*/
  12149. __pyx_empty_tuple, /*PyObject *cellvars,*/
  12150. py_srcfile, /*PyObject *filename,*/
  12151. py_funcname, /*PyObject *name,*/
  12152. py_line, /*int firstlineno,*/
  12153. __pyx_empty_bytes /*PyObject *lnotab*/
  12154. );
  12155. Py_DECREF(py_srcfile);
  12156. Py_DECREF(py_funcname);
  12157. return py_code;
  12158. bad:
  12159. Py_XDECREF(py_srcfile);
  12160. Py_XDECREF(py_funcname);
  12161. return NULL;
  12162. }
  12163. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  12164. int py_line, const char *filename) {
  12165. PyCodeObject *py_code = 0;
  12166. PyObject *py_globals = 0;
  12167. PyFrameObject *py_frame = 0;
  12168. py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  12169. if (!py_code) {
  12170. py_code = __Pyx_CreateCodeObjectForTraceback(
  12171. funcname, c_line, py_line, filename);
  12172. if (!py_code) goto bad;
  12173. __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  12174. }
  12175. py_globals = PyModule_GetDict(__pyx_m);
  12176. if (!py_globals) goto bad;
  12177. py_frame = PyFrame_New(
  12178. PyThreadState_GET(), /*PyThreadState *tstate,*/
  12179. py_code, /*PyCodeObject *code,*/
  12180. py_globals, /*PyObject *globals,*/
  12181. 0 /*PyObject *locals*/
  12182. );
  12183. if (!py_frame) goto bad;
  12184. py_frame->f_lineno = py_line;
  12185. PyTraceBack_Here(py_frame);
  12186. bad:
  12187. Py_XDECREF(py_code);
  12188. Py_XDECREF(py_frame);
  12189. }
  12190. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  12191. while (t->p) {
  12192. #if PY_MAJOR_VERSION < 3
  12193. if (t->is_unicode) {
  12194. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  12195. } else if (t->intern) {
  12196. *t->p = PyString_InternFromString(t->s);
  12197. } else {
  12198. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  12199. }
  12200. #else /* Python 3+ has unicode identifiers */
  12201. if (t->is_unicode | t->is_str) {
  12202. if (t->intern) {
  12203. *t->p = PyUnicode_InternFromString(t->s);
  12204. } else if (t->encoding) {
  12205. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  12206. } else {
  12207. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  12208. }
  12209. } else {
  12210. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  12211. }
  12212. #endif
  12213. if (!*t->p)
  12214. return -1;
  12215. ++t;
  12216. }
  12217. return 0;
  12218. }
  12219. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
  12220. return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
  12221. }
  12222. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
  12223. Py_ssize_t ignore;
  12224. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  12225. }
  12226. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  12227. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  12228. if (
  12229. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  12230. __Pyx_sys_getdefaultencoding_not_ascii &&
  12231. #endif
  12232. PyUnicode_Check(o)) {
  12233. #if PY_VERSION_HEX < 0x03030000
  12234. char* defenc_c;
  12235. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  12236. if (!defenc) return NULL;
  12237. defenc_c = PyBytes_AS_STRING(defenc);
  12238. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  12239. {
  12240. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  12241. char* c;
  12242. for (c = defenc_c; c < end; c++) {
  12243. if ((unsigned char) (*c) >= 128) {
  12244. PyUnicode_AsASCIIString(o);
  12245. return NULL;
  12246. }
  12247. }
  12248. }
  12249. #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
  12250. *length = PyBytes_GET_SIZE(defenc);
  12251. return defenc_c;
  12252. #else /* PY_VERSION_HEX < 0x03030000 */
  12253. if (PyUnicode_READY(o) == -1) return NULL;
  12254. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  12255. if (PyUnicode_IS_ASCII(o)) {
  12256. *length = PyUnicode_GET_DATA_SIZE(o);
  12257. return PyUnicode_AsUTF8(o);
  12258. } else {
  12259. PyUnicode_AsASCIIString(o);
  12260. return NULL;
  12261. }
  12262. #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  12263. return PyUnicode_AsUTF8AndSize(o, length);
  12264. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  12265. #endif /* PY_VERSION_HEX < 0x03030000 */
  12266. } else
  12267. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
  12268. #if !CYTHON_COMPILING_IN_PYPY
  12269. #if PY_VERSION_HEX >= 0x02060000
  12270. if (PyByteArray_Check(o)) {
  12271. *length = PyByteArray_GET_SIZE(o);
  12272. return PyByteArray_AS_STRING(o);
  12273. } else
  12274. #endif
  12275. #endif
  12276. {
  12277. char* result;
  12278. int r = PyBytes_AsStringAndSize(o, &result, length);
  12279. if (unlikely(r < 0)) {
  12280. return NULL;
  12281. } else {
  12282. return result;
  12283. }
  12284. }
  12285. }
  12286. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  12287. int is_true = x == Py_True;
  12288. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  12289. else return PyObject_IsTrue(x);
  12290. }
  12291. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  12292. PyNumberMethods *m;
  12293. const char *name = NULL;
  12294. PyObject *res = NULL;
  12295. #if PY_MAJOR_VERSION < 3
  12296. if (PyInt_Check(x) || PyLong_Check(x))
  12297. #else
  12298. if (PyLong_Check(x))
  12299. #endif
  12300. return Py_INCREF(x), x;
  12301. m = Py_TYPE(x)->tp_as_number;
  12302. #if PY_MAJOR_VERSION < 3
  12303. if (m && m->nb_int) {
  12304. name = "int";
  12305. res = PyNumber_Int(x);
  12306. }
  12307. else if (m && m->nb_long) {
  12308. name = "long";
  12309. res = PyNumber_Long(x);
  12310. }
  12311. #else
  12312. if (m && m->nb_int) {
  12313. name = "int";
  12314. res = PyNumber_Long(x);
  12315. }
  12316. #endif
  12317. if (res) {
  12318. #if PY_MAJOR_VERSION < 3
  12319. if (!PyInt_Check(res) && !PyLong_Check(res)) {
  12320. #else
  12321. if (!PyLong_Check(res)) {
  12322. #endif
  12323. PyErr_Format(PyExc_TypeError,
  12324. "__%.4s__ returned non-%.4s (type %.200s)",
  12325. name, name, Py_TYPE(res)->tp_name);
  12326. Py_DECREF(res);
  12327. return NULL;
  12328. }
  12329. }
  12330. else if (!PyErr_Occurred()) {
  12331. PyErr_SetString(PyExc_TypeError,
  12332. "an integer is required");
  12333. }
  12334. return res;
  12335. }
  12336. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  12337. #if CYTHON_USE_PYLONG_INTERNALS
  12338. #include "longintrepr.h"
  12339. #endif
  12340. #endif
  12341. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  12342. Py_ssize_t ival;
  12343. PyObject *x;
  12344. #if PY_MAJOR_VERSION < 3
  12345. if (likely(PyInt_CheckExact(b)))
  12346. return PyInt_AS_LONG(b);
  12347. #endif
  12348. if (likely(PyLong_CheckExact(b))) {
  12349. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  12350. #if CYTHON_USE_PYLONG_INTERNALS
  12351. switch (Py_SIZE(b)) {
  12352. case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
  12353. case 0: return 0;
  12354. case 1: return ((PyLongObject*)b)->ob_digit[0];
  12355. }
  12356. #endif
  12357. #endif
  12358. #if PY_VERSION_HEX < 0x02060000
  12359. return PyInt_AsSsize_t(b);
  12360. #else
  12361. return PyLong_AsSsize_t(b);
  12362. #endif
  12363. }
  12364. x = PyNumber_Index(b);
  12365. if (!x) return -1;
  12366. ival = PyInt_AsSsize_t(x);
  12367. Py_DECREF(x);
  12368. return ival;
  12369. }
  12370. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  12371. #if PY_VERSION_HEX < 0x02050000
  12372. if (ival <= LONG_MAX)
  12373. return PyInt_FromLong((long)ival);
  12374. else {
  12375. unsigned char *bytes = (unsigned char *) &ival;
  12376. int one = 1; int little = (int)*(unsigned char*)&one;
  12377. return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
  12378. }
  12379. #else
  12380. return PyInt_FromSize_t(ival);
  12381. #endif
  12382. }
  12383. #endif /* Py_PYTHON_H */