Greatly simplify list_langs.py string logic

This commit is contained in:
Luke Deen Taylor 2017-04-04 18:42:59 -04:00
parent 2866063797
commit c605998287
2 changed files with 18 additions and 20 deletions

View File

@ -15,12 +15,12 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
### This repository currently contains "Hello World" programs in the following languages:
* [0815](%23/0815.0815)
* [1c Enterprise](%23/1c-enterprise)
* [2b](%23/2B.2b)
* [4gl](%23/4gl.4gl)
* [4test](%23/4test)
* [4thdimension](%23/4thdimension.4dd)
* [~english](%23/%7EEnglish.ext)
* [1C Enterprise](%23/1c-enterprise)
* [2B](%23/2B.2b)
* [4Gl](%23/4gl.4gl)
* [4Test](%23/4test)
* [4Thdimension](%23/4thdimension.4dd)
* [~English](%23/%7EEnglish.ext)
* [Abap](a/abap.abap)
* [Abc](a/abc.abc)
* [Acidic](a/ACIDIC.acidic)
@ -63,9 +63,9 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
* [Ash](a/ash.ash)
* [Asp](a/asp.asp)
* [Assembler 6502](a/assembler_6502.asm)
* [Assembler 6502appleii](a/assembler_6502appleII.asm)
* [Assembler 6502c64](a/assembler_6502c64.asm)
* [Assembler 6809vectrex](a/assembler_6809vectrex.asm)
* [Assembler 6502Appleii](a/assembler_6502appleII.asm)
* [Assembler 6502C64](a/assembler_6502c64.asm)
* [Assembler 6809Vectrex](a/assembler_6809vectrex.asm)
* [Assembler 8048 Videopac](a/assembler_8048_videopac.asm)
* [Assembler Atari2600](a/assembler_atari2600.asm)
* [Assembler Dcpu16](a/assembler_DCPU16.asm)
@ -83,10 +83,10 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
* [Assembler Nasm Linux](a/assembler_nasm_linux.asm)
* [Assembler Nasm Linux64](a/assembler_nasm_linux64.asm)
* [Assembler Tasm Dos](a/assembler_tasm_dos.asm)
* [Assembler Tms9900 Ti99 4a](a/assembler_tms9900_ti99_4a.asm)
* [Assembler Tms9900 Ti99 4A](a/assembler_tms9900_ti99_4a.asm)
* [Assembler Vax Ultrix](a/assembler_vax_ultrix.asm)
* [Assembler Z80 Knightos](a/assembler_z80_knightos.asm)
* [Assembler Z80 Ti83calculator](a/assembler_z80_ti83calculator.asm)
* [Assembler Z80 Ti83Calculator](a/assembler_z80_ti83calculator.asm)
* [Assembler Z80 Zxspectrum](a/assembler_z80_zxspectrum.asm)
* [Autohotkey](a/autohotkey.ahk)
* [Autoit](a/autoit.au3)
@ -106,10 +106,10 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
* [Bitbitjump](b/BitBitJump.bbj)
* [Blackrum](b/BlackRum.br)
* [Blc](b/BLC.Blc)
* [Blitz3d](b/blitz3d.bb)
* [Blitz3D](b/blitz3d.bb)
* [Blub](b/blub.blub)
* [Boo](b/boo.boo)
* [Brainf Ck 2d](b/brainf-ck-2d.bf2d)
* [Brainf Ck 2D](b/brainf-ck-2d.bf2d)
* [Brainf Ck](b/brainf-ck.bf)
* [Brainloller](b/Brainloller.png)
* [Broccoli](b/broccoli.brocc)
@ -148,7 +148,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
* [Csh](c/csh.csh)
* [Csharp](c/csharp.cs)
* [Css](c/css.css)
* [Cypherneo4j](c/cypherNeo4j.cypher)
* [Cypherneo4J](c/cypherNeo4j.cypher)
* [Hello World](c/hello-world.curry)
* [D](d/d.d)
* [Dark](d/dark.txt)
@ -192,7 +192,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
* [Fjoelnir](f/fjoelnir.fjo)
* [Fob](f/fob.fob)
* [Focal](f/focal.fc)
* [Fog](f/fog.fog.md)
* [Fog.Fog](f/fog.fog.md)
* [Foo](f/foo.foo)
* [Forobj](f/forobj.forobj)
* [Forth](f/forth.fth)
@ -258,7 +258,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
* [Java](j/Java.java)
* [Javascript](j/javascript.js)
* [Jess](j/jess.cpl)
* [Jsf*ck](j/JSF%2Ack.js)
* [Jsf*Ck](j/JSF%2Ack.js)
* [Json](j/json.json)
* [Jsoniq](j/JSONiq)
* [Jsx](j/jsx.js)

View File

@ -18,9 +18,7 @@ for dirname in sorted(os.listdir('.')):
if not (dirname == '.' or dirname == '..' or dirname[0] == '.' or os.path.isfile(dirname)):
for filename in sorted(os.listdir(dirname), key=lambda s: s.lower()):
if os.path.isfile(os.path.join(dirname, filename)):
lang = ''
for name in filename[0:(len(filename) if filename.find('.') == -1 else filename.find('.'))].replace('-', ' ').replace('_', ' ').split():
lang += name.capitalize() + ' '
readme.write('* [{}]({})\n'.format(lang[:-1], quote(os.path.join(dirname, filename)))) # Cut trailing space
lang = os.path.splitext(filename)[0].replace('-', ' ').replace('_', ' ').title()
readme.write('* [{}]({})\n'.format(lang, quote(os.path.join(dirname, filename)))) # Cut trailing space
readme.close()