Merge pull request #401 from clemmyn23/patch-1
Fix readme listings for files with special characters
This commit is contained in:
27
README.md
27
README.md
@@ -20,7 +20,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [4gl](%23/4gl.4gl)
|
||||
* [4test](%23/4test)
|
||||
* [4thdimension](%23/4thdimension.4dd)
|
||||
* [~english](%23/~English.ext)
|
||||
* [~english](%23/%7EEnglish.ext)
|
||||
* [Abap](a/abap.abap)
|
||||
* [Abc](a/abc.abc)
|
||||
* [Acidic](a/ACIDIC.acidic)
|
||||
@@ -104,7 +104,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [Beta](b/beta.bet)
|
||||
* [Bit](b/BIT.bit)
|
||||
* [Bitbitjump](b/BitBitJump.bbj)
|
||||
* [BlackRum](b/BlackRum.br)
|
||||
* [Blackrum](b/BlackRum.br)
|
||||
* [Blc](b/BLC.Blc)
|
||||
* [Blitz3d](b/blitz3d.bb)
|
||||
* [Blub](b/blub.blub)
|
||||
@@ -116,11 +116,11 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [Brzrk](b/BRZRK.brzrk)
|
||||
* [Burlesque](b/burlesque.burlesque)
|
||||
* [Byter](b/byter.byter)
|
||||
* [C++](c/c++.cpp)
|
||||
* [C++](c/c%2B%2B.cpp)
|
||||
* [C](c/c.c)
|
||||
* [Caml](c/caml.ml)
|
||||
* [Cardinal](c/cardinal.cardinal)
|
||||
* [Casio Basic](c/Casio BASIC)
|
||||
* [Casio Basic](c/Casio%20BASIC)
|
||||
* [Cat](c/cat.cat)
|
||||
* [Centura](c/centura.centura)
|
||||
* [Ceylon](c/ceylon.ceylon)
|
||||
@@ -161,12 +161,12 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [Delphi](d/delphi.pas)
|
||||
* [Dis](d/dis.dis)
|
||||
* [Divzeros](d/divzeros.dz)
|
||||
* [Dna#](d/DNA#.dna)
|
||||
* [Dna#](d/DNA%23.dna)
|
||||
* [Dna Sharp](d/DNA-Sharp.dna)
|
||||
* [Dogescript](d/dogescript.djs)
|
||||
* [Dogo](d/DOGO.dogo)
|
||||
* [Dos](d/dos.bat)
|
||||
* [Drive In Window](d/Drive-In Window.diw)
|
||||
* [Drive In Window](d/Drive-In%20Window.diw)
|
||||
* [Dtrace](d/dtrace.d)
|
||||
* [Dup](d/DUP.dup)
|
||||
* [Dylan](d/dylan.dl)
|
||||
@@ -224,12 +224,12 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [Haxe](h/haxe.hx)
|
||||
* [Hex](h/HEX.hex)
|
||||
* [Hexish](h/hexish.hexish)
|
||||
* [Higher Subleq](h/Higher Subleq.higher_subleq)
|
||||
* [Higher Subleq](h/Higher%20Subleq.higher_subleq)
|
||||
* [Hodor](h/hodor.hd)
|
||||
* [Hollow](h/hollow.hollow)
|
||||
* [Homespring](h/homespring.homespring)
|
||||
* [Hop](h/HOP)
|
||||
* [Hq9+](h/hq9+.h)
|
||||
* [Hq9+](h/hq9%2B.h)
|
||||
* [Html](h/html.html)
|
||||
* [Hy](h/hy.hy)
|
||||
* [Hypertalk](h/hypertalk.ht)
|
||||
@@ -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*ck.js)
|
||||
* [Jsf*ck](j/JSF%2Ack.js)
|
||||
* [Json](j/json.json)
|
||||
* [Jsoniq](j/JSONiq)
|
||||
* [Jsx](j/jsx.js)
|
||||
@@ -267,6 +267,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [Karel](k/karel.kl)
|
||||
* [Kiml](k/KimL.kiml)
|
||||
* [Kipple](k/kipple.kipple)
|
||||
* [Kitten](k/kitten.ktn)
|
||||
* [Kotlin](k/kotlin)
|
||||
* [Kotlin](k/kotlin.kt)
|
||||
* [Ksh](k/ksh.ksh)
|
||||
@@ -299,7 +300,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [Meq](m/meq.meq)
|
||||
* [Mercury](m/mercury.m)
|
||||
* [Mirc](m/mirc.mrc)
|
||||
* [Mmmm()](m/Mmmm().mmmm)
|
||||
* [Mmmm()](m/Mmmm%28%29.mmmm)
|
||||
* [Modula 2](m/modula-2.mod)
|
||||
* [Modula 3](m/modula-3.m3)
|
||||
* [Mongo](m/mongo.shell)
|
||||
@@ -349,7 +350,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [Perl](p/perl.cgi)
|
||||
* [Perl](p/perl.pl)
|
||||
* [Perl6](p/perl6.p6)
|
||||
* [Perseus](p/perseus.p++)
|
||||
* [Perseus](p/perseus.p%2B%2B)
|
||||
* [Pharo](p/pharo.st)
|
||||
* [Php](p/php.php)
|
||||
* [Picat](p/picat.pi)
|
||||
@@ -417,7 +418,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [Shell](s/shell.sh)
|
||||
* [Shen](s/shen.shen)
|
||||
* [Sil](s/SIL.SIL)
|
||||
* [Simpl+](s/simpl+.usp)
|
||||
* [Simpl+](s/simpl%2B.usp)
|
||||
* [Simula](s/simula.sim)
|
||||
* [Slashes](s/slashes.slashes)
|
||||
* [Smali](s/smali.smali)
|
||||
@@ -488,7 +489,7 @@ Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-wor
|
||||
* [Wren](w/wren.wren)
|
||||
* [Wsh](w/wsh.vbs)
|
||||
* [X D](x/x-D.xd)
|
||||
* [Xbase++](x/xbase++.prg)
|
||||
* [Xbase++](x/xbase%2B%2B.prg)
|
||||
* [Xbase](x/xbase.dbf)
|
||||
* [Xl](x/xl.xl)
|
||||
* [Xlogo](x/xlogo.lgo)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
from urllib.parse import quote
|
||||
|
||||
readme = open('README.md', 'w')
|
||||
|
||||
@@ -13,13 +14,13 @@ with open('README_nolist.md', 'r') as temp:
|
||||
readme.write('\n### This repository currently contains "Hello World" programs in the following languages:\n')
|
||||
|
||||
# List the available languages
|
||||
for dirname in os.listdir('.'):
|
||||
if not (dirname == '.' or dirname == '..' or dirname[0] == '.' or os.path.isfile(dirname)):
|
||||
for filename in os.listdir(dirname):
|
||||
if os.path.isfile(os.path.join(dirname, filename)):
|
||||
for dir in sorted(os.listdir('.')):
|
||||
if not (dir == '.' or dir == '..' or dir[0] == '.' or os.path.isfile(dir)):
|
||||
for file in sorted(os.listdir(dir), key=lambda s: s.lower()):
|
||||
if os.path.isfile(os.path.join(dir, file)):
|
||||
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], os.path.join(dirname if dirname != "#" else "%23", filename))) # Cut trailing space
|
||||
for str in file[0:(len(file) if file.find('.') == -1 else file.find('.'))].replace('-', ' ').replace('_', ' ').split():
|
||||
lang += str.capitalize() + ' '
|
||||
readme.write('* [{}]({})\n'.format(lang[:-1], quote(os.path.join(dir, file)))) # Cut trailing space
|
||||
|
||||
readme.close()
|
||||
readme.close()
|
||||
Reference in New Issue
Block a user