From 0597a432ee9a169469b02d896f86e3930c6f9672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20Fl=C3=A8che?= Date: Wed, 4 Apr 2018 11:34:24 +0200 Subject: [PATCH 1/5] Add python .gitignore --- .gitignore | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..894a44c --- /dev/null +++ b/.gitignore @@ -0,0 +1,104 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ From 6cd3ef8a2b73e30a4d2cf413f165942be4cf9716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20Fl=C3=A8che?= Date: Wed, 4 Apr 2018 11:38:33 +0200 Subject: [PATCH 2/5] Add PyYAML to requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5500f00 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +PyYAML From 10a493721449cf74ba2ee414ef4cde9da9a134a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20Fl=C3=A8che?= Date: Wed, 4 Apr 2018 11:38:54 +0200 Subject: [PATCH 3/5] Sort colors in colors.json --- build.py | 2 +- colors.json | 422 ++++++++++++++++++++++++++++------------------------ 2 files changed, 225 insertions(+), 199 deletions(-) diff --git a/build.py b/build.py index 1aa8097..580cfa8 100644 --- a/build.py +++ b/build.py @@ -16,4 +16,4 @@ colors = dict((replace_names.get(name, name), color['color']) for name, color in colors.items() if 'color' in color) with open('colors.json', 'w') as f: - json.dump(colors, f, indent=4) + json.dump(colors, f, indent=4, sort_keys=True) diff --git a/colors.json b/colors.json index eb6b8c6..4a5c62d 100644 --- a/colors.json +++ b/colors.json @@ -1,200 +1,226 @@ { - "Mercury": "#ff2b2b", - "TypeScript": "#2b7489", - "PureBasic": "#5a6986", - "Objective-C++": "#6866fb", - "Self": "#0579aa", - "edn": "#db5855", - "NewLisp": "#87AED7", - "Jupyter Notebook": "#DA5B0B", - "Rebol": "#358a5b", - "Frege": "#00cafe", - "Dart": "#00B4AB", - "AspectJ": "#a957b0", - "Shell": "#89e051", - "Web Ontology Language": "#9cc9dd", - "xBase": "#403a40", - "Eiffel": "#946d57", - "Nix": "#7e7eff", - "RAML": "#77d9fb", - "MTML": "#b7e1f4", - "Racket": "#22228f", - "Elixir": "#6e4a7e", - "SAS": "#B34936", - "Agda": "#315665", - "wisp": "#7582D1", - "D": "#ba595e", - "Kotlin": "#F18E33", - "Opal": "#f7ede0", - "Crystal": "#776791", - "Objective-C": "#438eff", - "ColdFusion CFC": "#ed2cd6", - "Oz": "#fab738", - "Mirah": "#c7a938", - "Objective-J": "#ff0c5a", - "Gosu": "#82937f", - "FreeMarker": "#0050b2", - "Ruby": "#701516", - "Component Pascal": "#b0ce4e", - "Arc": "#aa2afe", - "Brainfuck": "#2F2530", - "Nit": "#009917", - "APL": "#5A8164", - "Go": "#375eab", - "Visual Basic": "#945db7", - "PHP": "#4F5D95", - "Cirru": "#ccccff", - "SQF": "#3F3F3F", - "Glyph": "#e4cc98", - "Java": "#b07219", - "MAXScript": "#00a6a6", - "Scala": "#DC322F", - "Makefile": "#427819", - "ColdFusion": "#ed2cd6", - "Perl": "#0298c3", - "Lua": "#000080", - "Vue": "#2c3e50", - "Verilog": "#b2b7f8", - "Factor": "#636746", - "Haxe": "#df7900", - "Pure Data": "#91de79", - "Forth": "#341708", - "Red": "#ee0000", - "Hy": "#7790B2", - "Volt": "#1F1F1F", - "LSL": "#3d9970", - "eC": "#913960", - "CoffeeScript": "#244776", - "HTML": "#e44b23", - "Lex": "#DBCA00", - "API Blueprint": "#2ACCA8", - "Swift": "#ffac45", - "C": "#555555", - "AutoHotkey": "#6594b9", - "Isabelle": "#FEFE00", - "Metal": "#8f14e9", - "Clarion": "#db901e", - "JSONiq": "#40d47e", - "Boo": "#d4bec1", - "AutoIt": "#1C3552", - "Clojure": "#db5855", - "Rust": "#dea584", - "Prolog": "#74283c", - "SourcePawn": "#5c7611", - "AMPL": "#E6EFBB", - "FORTRAN": "#4d41b1", - "ANTLR": "#9DC3FF", - "Harbour": "#0e60e3", - "Tcl": "#e4cc98", - "BlitzMax": "#cd6400", - "PigLatin": "#fcd7de", - "Lasso": "#999999", - "ECL": "#8a1267", - "VHDL": "#adb2cb", - "Elm": "#60B5CC", - "Propeller Spin": "#7fa2a7", - "X10": "#4B6BEF", - "IDL": "#a3522f", - "ATS": "#1ac620", - "Ada": "#02f88c", - "Unity3D Asset": "#ab69a1", - "Nu": "#c9df40", - "LFE": "#004200", - "SuperCollider": "#46390b", - "Oxygene": "#cdd0e3", - "ASP": "#6a40fd", - "Assembly": "#6E4C13", - "Gnuplot": "#f0a9f0", - "JFlex": "#DBCA00", - "NetLinx": "#0aa0ff", - "Turing": "#45f715", - "Vala": "#fbe5cd", - "Processing": "#0096D8", - "Arduino": "#bd79d1", - "FLUX": "#88ccff", - "NetLogo": "#ff6375", - "C Sharp": "#178600", - "CSS": "#563d7c", - "Emacs Lisp": "#c065db", - "Stan": "#b2011d", - "SaltStack": "#646464", - "QML": "#44a51c", - "Pike": "#005390", - "LOLCODE": "#cc9900", - "ooc": "#b0b77e", - "Handlebars": "#01a9d6", - "J": "#9EEDFF", - "Mask": "#f97732", - "EmberScript": "#FFF4F3", - "TeX": "#3D6117", - "Nemerle": "#3d3c6e", - "KRL": "#28431f", - "Ren'Py": "#ff7f7f", - "Unified Parallel C": "#4e3617", - "Golo": "#88562A", - "Fancy": "#7b9db4", - "OCaml": "#3be133", - "Shen": "#120F14", - "Pascal": "#b0ce4e", - "F#": "#b845fc", - "Puppet": "#302B6D", - "ActionScript": "#882B0F", - "Diff": "#88dddd", - "Ragel in Ruby Host": "#9d5200", - "Fantom": "#dbded5", - "Zephir": "#118f9e", - "Click": "#E4E6F3", - "Smalltalk": "#596706", - "DM": "#447265", - "Ioke": "#078193", - "PogoScript": "#d80074", - "LiveScript": "#499886", - "JavaScript": "#f1e05a", - "VimL": "#199f4b", - "PureScript": "#1D222D", - "ABAP": "#E8274B", - "Matlab": "#bb92ac", - "Slash": "#007eff", - "R": "#198ce7", - "Erlang": "#B83998", - "Pan": "#cc0000", - "LookML": "#652B81", - "Eagle": "#814C05", - "Scheme": "#1e4aec", - "PLSQL": "#dad8d8", - "Python": "#3572A5", - "Max": "#c4a79c", - "Common Lisp": "#3fb68b", - "Latte": "#A8FF97", - "XQuery": "#5232e7", - "Omgrofl": "#cabbff", - "XC": "#99DA07", - "Nimrod": "#37775b", - "SystemVerilog": "#DAE1C2", - "Chapel": "#8dc63f", - "Groovy": "#e69f56", - "Dylan": "#6c616e", - "E": "#ccce35", - "Parrot": "#f3ca0a", - "Grammatical Framework": "#79aa7a", - "Game Maker Language": "#8fb200", - "Papyrus": "#6600cc", - "NetLinx+ERB": "#747faa", - "Clean": "#3F85AF", - "Alloy": "#64C800", - "Squirrel": "#800000", - "PAWN": "#dbb284", - "UnrealScript": "#a54c4d", - "Standard ML": "#dc566d", - "Slim": "#ff8f77", - "Perl6": "#0000fb", - "Julia": "#a270ba", - "Haskell": "#29b544", - "NCL": "#28431f", - "Io": "#a9188d", - "Rouge": "#cc0088", - "cpp": "#f34b7d", - "AGS Script": "#B9D9FF", - "Dogescript": "#cca760", - "nesC": "#94B0C7" + "1C Enterprise": "#814CCC", + "ABAP": "#E8274B", + "AGS Script": "#B9D9FF", + "AMPL": "#E6EFBB", + "ANTLR": "#9DC3FF", + "API Blueprint": "#2ACCA8", + "APL": "#5A8164", + "ASP": "#6a40fd", + "ATS": "#1ac620", + "ActionScript": "#882B0F", + "Ada": "#02f88c", + "Agda": "#315665", + "Alloy": "#64C800", + "AngelScript": "#C7D7DC", + "AppleScript": "#101F1F", + "Arc": "#aa2afe", + "AspectJ": "#a957b0", + "Assembly": "#6E4C13", + "AutoHotkey": "#6594b9", + "AutoIt": "#1C3552", + "Ballerina": "#FF5000", + "Batchfile": "#C1F12E", + "BlitzMax": "#cd6400", + "Boo": "#d4bec1", + "Brainfuck": "#2F2530", + "C": "#555555", + "C Sharp": "#178600", + "CSS": "#563d7c", + "Ceylon": "#dfa535", + "Chapel": "#8dc63f", + "Cirru": "#ccccff", + "Clarion": "#db901e", + "Clean": "#3F85AF", + "Click": "#E4E6F3", + "Clojure": "#db5855", + "CoffeeScript": "#244776", + "ColdFusion": "#ed2cd6", + "Common Lisp": "#3fb68b", + "Common Workflow Language": "#B5314C", + "Component Pascal": "#B0CE4E", + "Crystal": "#776791", + "Cuda": "#3A4E3A", + "D": "#ba595e", + "DM": "#447265", + "Dart": "#00B4AB", + "DataWeave": "#003a52", + "Dogescript": "#cca760", + "Dylan": "#6c616e", + "E": "#ccce35", + "ECL": "#8a1267", + "EQ": "#a78649", + "Eiffel": "#946d57", + "Elixir": "#6e4a7e", + "Elm": "#60B5CC", + "Emacs Lisp": "#c065db", + "EmberScript": "#FFF4F3", + "Erlang": "#B83998", + "F#": "#b845fc", + "FLUX": "#88ccff", + "Factor": "#636746", + "Fancy": "#7b9db4", + "Fantom": "#14253c", + "Forth": "#341708", + "Fortran": "#4d41b1", + "FreeMarker": "#0050b2", + "Frege": "#00cafe", + "Game Maker Language": "#8fb200", + "Genie": "#fb855d", + "Gherkin": "#5B2063", + "Glyph": "#e4cc98", + "Gnuplot": "#f0a9f0", + "Go": "#375eab", + "Golo": "#88562A", + "Gosu": "#82937f", + "Grammatical Framework": "#79aa7a", + "Groovy": "#e69f56", + "HTML": "#e34c26", + "Hack": "#878787", + "Harbour": "#0e60e3", + "Haskell": "#5e5086", + "Haxe": "#df7900", + "Hy": "#7790B2", + "IDL": "#a3522f", + "Idris": "#b30000", + "Io": "#a9188d", + "Ioke": "#078193", + "Isabelle": "#FEFE00", + "J": "#9EEDFF", + "JSONiq": "#40d47e", + "Java": "#b07219", + "JavaScript": "#f1e05a", + "Jolie": "#843179", + "Julia": "#a270ba", + "Jupyter Notebook": "#DA5B0B", + "KRL": "#28431f", + "Kotlin": "#F18E33", + "LFE": "#4C3023", + "LLVM": "#185619", + "LOLCODE": "#cc9900", + "LSL": "#3d9970", + "Lasso": "#999999", + "Lex": "#DBCA00", + "LiveScript": "#499886", + "LookML": "#652B81", + "Lua": "#000080", + "MAXScript": "#00a6a6", + "MQL4": "#62A8D6", + "MQL5": "#4A76B8", + "MTML": "#b7e1f4", + "Makefile": "#427819", + "Mask": "#f97732", + "Matlab": "#e16737", + "Max": "#c4a79c", + "Mercury": "#ff2b2b", + "Meson": "#007800", + "Metal": "#8f14e9", + "Mirah": "#c7a938", + "NCL": "#28431f", + "Nearley": "#990000", + "Nemerle": "#3d3c6e", + "NetLinx": "#0aa0ff", + "NetLinx+ERB": "#747faa", + "NetLogo": "#ff6375", + "NewLisp": "#87AED7", + "Nextflow": "#3ac486", + "Nim": "#37775b", + "Nit": "#009917", + "Nix": "#7e7eff", + "Nu": "#c9df40", + "OCaml": "#3be133", + "Objective-C": "#438eff", + "Objective-C++": "#6866fb", + "Objective-J": "#ff0c5a", + "Omgrofl": "#cabbff", + "Opal": "#f7ede0", + "Oxygene": "#cdd0e3", + "Oz": "#fab738", + "P4": "#7055b5", + "PAWN": "#dbb284", + "PHP": "#4F5D95", + "PLSQL": "#dad8d8", + "Pan": "#cc0000", + "Papyrus": "#6600cc", + "Parrot": "#f3ca0a", + "Pascal": "#E3F171", + "Pep8": "#C76F5B", + "Perl": "#0298c3", + "Perl 6": "#0000fb", + "PigLatin": "#fcd7de", + "Pike": "#005390", + "PogoScript": "#d80074", + "PostScript": "#da291c", + "PowerBuilder": "#8f0f8d", + "PowerShell": "#012456", + "Processing": "#0096D8", + "Prolog": "#74283c", + "Propeller Spin": "#7fa2a7", + "Puppet": "#302B6D", + "PureBasic": "#5a6986", + "PureScript": "#1D222D", + "Python": "#3572A5", + "QML": "#44a51c", + "R": "#198CE7", + "RAML": "#77d9fb", + "RUNOFF": "#665a4e", + "Racket": "#22228f", + "Ragel": "#9d5200", + "Rascal": "#fffaa0", + "Rebol": "#358a5b", + "Red": "#f50000", + "Ren'Py": "#ff7f7f", + "Ring": "#0e60e3", + "Roff": "#ecdebe", + "Rouge": "#cc0088", + "Ruby": "#701516", + "Rust": "#dea584", + "SAS": "#B34936", + "SQF": "#3F3F3F", + "SRecode Template": "#348a34", + "SaltStack": "#646464", + "Scala": "#c22d40", + "Scheme": "#1e4aec", + "Self": "#0579aa", + "Shell": "#89e051", + "Shen": "#120F14", + "Slash": "#007eff", + "Smalltalk": "#596706", + "Solidity": "#AA6746", + "SourcePawn": "#5c7611", + "Squirrel": "#800000", + "Stan": "#b2011d", + "Standard ML": "#dc566d", + "SuperCollider": "#46390b", + "Swift": "#ffac45", + "SystemVerilog": "#DAE1C2", + "TI Program": "#A0AA87", + "Tcl": "#e4cc98", + "TeX": "#3D6117", + "Terra": "#00004c", + "Turing": "#cf142b", + "TypeScript": "#2b7489", + "UnrealScript": "#a54c4d", + "VCL": "#0298c3", + "VHDL": "#adb2cb", + "Vala": "#fbe5cd", + "Verilog": "#b2b7f8", + "Vim script": "#199f4b", + "Visual Basic": "#945db7", + "Volt": "#1F1F1F", + "Vue": "#2c3e50", + "WebAssembly": "#04133b", + "X10": "#4B6BEF", + "XC": "#99DA07", + "XQuery": "#5232e7", + "XSLT": "#EB8CEB", + "Yacc": "#4B6C4B", + "Zephir": "#118f9e", + "cpp": "#f34b7d", + "eC": "#913960", + "nesC": "#94B0C7", + "ooc": "#b0b77e", + "wdl": "#42f1f4", + "wisp": "#7582D1", + "xBase": "#403a40" } \ No newline at end of file From ca8a8fce2f57056bd7c80bed4e092590f83957db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20Fl=C3=A8che?= Date: Wed, 4 Apr 2018 11:43:27 +0200 Subject: [PATCH 4/5] Remove trailing whitespace for consistency with python 3 default --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 580cfa8..b9fc626 100644 --- a/build.py +++ b/build.py @@ -16,4 +16,4 @@ colors = dict((replace_names.get(name, name), color['color']) for name, color in colors.items() if 'color' in color) with open('colors.json', 'w') as f: - json.dump(colors, f, indent=4, sort_keys=True) + json.dump(colors, f, indent=4, sort_keys=True, separators=(',', ': ')) From 16e3dc376f4cb79c3e81cbf7cdae27aa6e6b783c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20Fl=C3=A8che?= Date: Wed, 4 Apr 2018 11:54:47 +0200 Subject: [PATCH 5/5] Use requests in place of wget for a pure python implementation --- build.py | 10 +++++----- requirements.txt | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index b9fc626..13bd8f2 100644 --- a/build.py +++ b/build.py @@ -1,18 +1,18 @@ -import subprocess import yaml import json import os +import requests + +languages_url = 'https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml' replace_names = { 'C++': 'cpp', 'C#': 'C Sharp' } -subprocess.call(['wget', 'https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml', '-q']) -with open('languages.yml') as f: - colors = yaml.load(f) -os.remove('languages.yml') +r = requests.get(languages_url) +colors = yaml.load(r.text) colors = dict((replace_names.get(name, name), color['color']) for name, color in colors.items() if 'color' in color) with open('colors.json', 'w') as f: diff --git a/requirements.txt b/requirements.txt index 5500f00..6c9fdba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ PyYAML +requests