2320387fb4b86ccd1c1153c32968d50981734c38

Author
Ajeet D'Souza <98ajeet@gmail.com>
Committer
Ajeet D'Souza <98ajeet@gmail.com>
Date

Message

Initial commit

Diff

This diff is truncated to protect this page.

  1diff --git a/.gitignore b/.gitignore
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..7f59f75193a8203b1053bc71c9fea942fe709360
  4--- /dev/null
  5+++ b/.gitignore
  6@@ -0,0 +1,9 @@
  7+/.idea/
  8+/build/
  9+/dist/
 10+/nerdfonts/icons.py
 11+
 12+**/__pycache__/
 13+
 14+*.egg-info
 15+*.pyc
 16diff --git a/LICENSE b/LICENSE
 17new file mode 100644
 18index 0000000000000000000000000000000000000000..f288702d2fa16d3cdf0035b15a9fcbc552cd88e7
 19--- /dev/null
 20+++ b/LICENSE
 21@@ -0,0 +1,674 @@
 22+                    GNU GENERAL PUBLIC LICENSE
 23+                       Version 3, 29 June 2007
 24+
 25+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 26+ Everyone is permitted to copy and distribute verbatim copies
 27+ of this license document, but changing it is not allowed.
 28+
 29+                            Preamble
 30+
 31+  The GNU General Public License is a free, copyleft license for
 32+software and other kinds of works.
 33+
 34+  The licenses for most software and other practical works are designed
 35+to take away your freedom to share and change the works.  By contrast,
 36+the GNU General Public License is intended to guarantee your freedom to
 37+share and change all versions of a program--to make sure it remains free
 38+software for all its users.  We, the Free Software Foundation, use the
 39+GNU General Public License for most of our software; it applies also to
 40+any other work released this way by its authors.  You can apply it to
 41+your programs, too.
 42+
 43+  When we speak of free software, we are referring to freedom, not
 44+price.  Our General Public Licenses are designed to make sure that you
 45+have the freedom to distribute copies of free software (and charge for
 46+them if you wish), that you receive source code or can get it if you
 47+want it, that you can change the software or use pieces of it in new
 48+free programs, and that you know you can do these things.
 49+
 50+  To protect your rights, we need to prevent others from denying you
 51+these rights or asking you to surrender the rights.  Therefore, you have
 52+certain responsibilities if you distribute copies of the software, or if
 53+you modify it: responsibilities to respect the freedom of others.
 54+
 55+  For example, if you distribute copies of such a program, whether
 56+gratis or for a fee, you must pass on to the recipients the same
 57+freedoms that you received.  You must make sure that they, too, receive
 58+or can get the source code.  And you must show them these terms so they
 59+know their rights.
 60+
 61+  Developers that use the GNU GPL protect your rights with two steps:
 62+(1) assert copyright on the software, and (2) offer you this License
 63+giving you legal permission to copy, distribute and/or modify it.
 64+
 65+  For the developers' and authors' protection, the GPL clearly explains
 66+that there is no warranty for this free software.  For both users' and
 67+authors' sake, the GPL requires that modified versions be marked as
 68+changed, so that their problems will not be attributed erroneously to
 69+authors of previous versions.
 70+
 71+  Some devices are designed to deny users access to install or run
 72+modified versions of the software inside them, although the manufacturer
 73+can do so.  This is fundamentally incompatible with the aim of
 74+protecting users' freedom to change the software.  The systematic
 75+pattern of such abuse occurs in the area of products for individuals to
 76+use, which is precisely where it is most unacceptable.  Therefore, we
 77+have designed this version of the GPL to prohibit the practice for those
 78+products.  If such problems arise substantially in other domains, we
 79+stand ready to extend this provision to those domains in future versions
 80+of the GPL, as needed to protect the freedom of users.
 81+
 82+  Finally, every program is threatened constantly by software patents.
 83+States should not allow patents to restrict development and use of
 84+software on general-purpose computers, but in those that do, we wish to
 85+avoid the special danger that patents applied to a free program could
 86+make it effectively proprietary.  To prevent this, the GPL assures that
 87+patents cannot be used to render the program non-free.
 88+
 89+  The precise terms and conditions for copying, distribution and
 90+modification follow.
 91+
 92+                       TERMS AND CONDITIONS
 93+
 94+  0. Definitions.
 95+
 96+  "This License" refers to version 3 of the GNU General Public License.
 97+
 98+  "Copyright" also means copyright-like laws that apply to other kinds of
 99+works, such as semiconductor masks.
100+
101+  "The Program" refers to any copyrightable work licensed under this
102+License.  Each licensee is addressed as "you".  "Licensees" and
103+"recipients" may be individuals or organizations.
104+
105+  To "modify" a work means to copy from or adapt all or part of the work
106+in a fashion requiring copyright permission, other than the making of an
107+exact copy.  The resulting work is called a "modified version" of the
108+earlier work or a work "based on" the earlier work.
109+
110+  A "covered work" means either the unmodified Program or a work based
111+on the Program.
112+
113+  To "propagate" a work means to do anything with it that, without
114+permission, would make you directly or secondarily liable for
115+infringement under applicable copyright law, except executing it on a
116+computer or modifying a private copy.  Propagation includes copying,
117+distribution (with or without modification), making available to the
118+public, and in some countries other activities as well.
119+
120+  To "convey" a work means any kind of propagation that enables other
121diff --git a/MANIFEST.in b/MANIFEST.in
122new file mode 100644
123index 0000000000000000000000000000000000000000..1a69f4c1edc94aeafc47d0dc9aecccd07fa2f341
124--- /dev/null
125+++ b/MANIFEST.in
126@@ -0,0 +1 @@
127+include readme.md
128diff --git a/README.md b/README.md
129new file mode 100644
130index 0000000000000000000000000000000000000000..776d074bb0728808a64389de2acc5181031d441f
131--- /dev/null
132+++ b/README.md
133@@ -0,0 +1,36 @@
134+# Nerd Fonts' icons for Python
135+
136+## Installation
137+
138+```sh
139+pip install nerdfonts
140+```
141+
142+## Usage
143+
144+```python
145+import nerdfonts as nf
146+
147+print(nf.icons['fa_thumbs_up'])
148+>>> 
149+```
150+
151+## Build
152+
153+```sh
154+# Run the generate script to download nerd font's character mapping
155+# and generate a python-formatted version of it. Ensure that you have
156+# SVN installed. To change the nerd font version, use something like
157+# `./generate.sh 2.0.0`
158+./fontawesome/generate.py
159+
160+python setup.py build
161+
162+python setup.py install
163+```
164+
165+## License
166+
167+The code in this repository is licensed under [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html)
168+
169+The character codes included with this package are part of the [Nerd Fonts project](https://nerdfonts.com/).
170diff --git a/nerdfonts/__init__.py b/nerdfonts/__init__.py
171new file mode 100644
172index 0000000000000000000000000000000000000000..1ccbb09c54fef902f52b21c2c04e78a084d7a363
173--- /dev/null
174+++ b/nerdfonts/__init__.py
175@@ -0,0 +1 @@
176+from .icons import *
177diff --git a/nerdfonts/generate.sh b/nerdfonts/generate.sh
178new file mode 100755
179index 0000000000000000000000000000000000000000..32685fd2de6c4619b2dbdf91e66abee5f21badc7
180--- /dev/null
181+++ b/nerdfonts/generate.sh
182@@ -0,0 +1,37 @@
183+#!/usr/bin/env bash
184+
185+SOURCE_DIR="$(dirname $0)"
186+SCRIPTS_DIR="$SOURCE_DIR/tmp"
187+OUTPUT_FILE="$SOURCE_DIR/icons.py"
188+
189+if [ -z "$1" ]; then
190+	BRANCH="trunk"
191+	VERSION="latest"
192+else
193+	BRANCH="branches/$1"
194+	VERSION="$1"
195+fi
196+
197+URL="https://github.com/ryanoasis/nerd-fonts/$BRANCH/bin/scripts/lib"
198+
199+rm -rf "$SCRIPTS_DIR"
200+svn checkout "$URL" "$SCRIPTS_DIR"
201+
202+source "$SCRIPTS_DIR/i_all.sh"
203+rm -rf "$SCRIPTS_DIR"
204+
205+echo "VERSION = \"$VERSION\"" >  "$OUTPUT_FILE"
206+echo ""                       >> "$OUTPUT_FILE"
207+echo "icons = {"              >> "$OUTPUT_FILE"
208+
209+INDENT="    "
210+for var in "${!i_@}"; do
211+	name="$(echo $var | cut -c3-)"
212+	eval "icon=\$$var"
213+	echo "$INDENT\"$name\": \"$icon\"," >> "$OUTPUT_FILE"
214+done
215+
216+truncate -s-2 "$OUTPUT_FILE"
217+
218+echo ""  >> "$OUTPUT_FILE"
219+echo "}" >> "$OUTPUT_FILE"
220diff --git a/setup.cfg b/setup.cfg
221new file mode 100644
222index 0000000000000000000000000000000000000000..8c282679934fae697cf760eeec59009701e9b637
223--- /dev/null
224+++ b/setup.cfg
225@@ -0,0 +1,3 @@
226+[metadata]
227+description-file = README.md
228+
229diff --git a/setup.py b/setup.py
230new file mode 100644
231index 0000000000000000000000000000000000000000..cb1d56123951cb66ca51d6e153109a6f3871c03c
232--- /dev/null
233+++ b/setup.py
234@@ -0,0 +1,27 @@
235+import setuptools
236+
237+VERSION = "1.0.1"
238+
239+with open("README.md", "r") as fh:
240+    long_description = fh.read()
241+
242+setuptools.setup(
243+    name="nerdfonts",
244+    packages=setuptools.find_packages(),
245+    version=VERSION,
246+    description="Nerd Fonts for Python",
247+    long_description=long_description,
248+    long_description_content_type="text/markdown",
249+    license="GNU GPLv3",
250+    author="Ajeet D'Souza",
251+    author_email="98ajeet@gmail.com",
252+    maintainer="Ajeet D'Souza",
253+    maintainer_email="98ajeet@gmail.com",
254+    url="https://gitlab.com/ajeetdsouza/nerdfonts-python",
255+    classifiers=[
256+        "Environment :: Console",
257+        "Intended Audience :: Developers",
258+        "Operating System :: POSIX",
259+        "Programming Language :: Python"
260+    ]
261+)