[Python-modules-commits] [pyjokes] 01/07: import pyjokes_0.5.0.orig.tar.gz
Ethan Ward
ethanward-guest at moszumanska.debian.org
Wed Jul 26 17:16:18 UTC 2017
This is an automated email from the git hooks/post-receive script.
ethanward-guest pushed a commit to branch master
in repository pyjokes.
commit 8744d030f9c7d3109c33d7588de1eff332b861d2
Author: Ethan Ward <ethan.ward at mycroft.ai>
Date: Wed Jul 26 11:13:34 2017 -0500
import pyjokes_0.5.0.orig.tar.gz
---
MANIFEST.in | 1 +
PKG-INFO | 110 +++++++++++++++++
README.rst | 94 +++++++++++++++
pyjokes.egg-info/PKG-INFO | 110 +++++++++++++++++
pyjokes.egg-info/SOURCES.txt | 14 +++
pyjokes.egg-info/dependency_links.txt | 1 +
pyjokes.egg-info/top_level.txt | 1 +
pyjokes/__init__.py | 5 +
pyjokes/jokes_de.py | 10 ++
pyjokes/jokes_en.py | 215 ++++++++++++++++++++++++++++++++++
pyjokes/jokes_es.py | 19 +++
pyjokes/pyjokes.py | 64 ++++++++++
scripts/pyjoke | 54 +++++++++
scripts/pyjokes | 11 ++
setup.cfg | 5 +
setup.py | 55 +++++++++
16 files changed, 769 insertions(+)
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..9561fb1
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1 @@
+include README.rst
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..9bbccf8
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,110 @@
+Metadata-Version: 1.1
+Name: pyjokes
+Version: 0.5.0
+Summary: One line jokes for programmers (jokes as a service)
+Home-page: https://github.com/pyjokes/pyjokes
+Author: Pyjokes Society
+Author-email: UNKNOWN
+License: BSD
+Description: .. image:: https://travis-ci.org/pyjokes/pyjokes.svg
+ :target: https://travis-ci.org/pyjokes/pyjokes
+
+ =======
+ pyjokes
+ =======
+
+ One line jokes for programmers (jokes as a service)
+
+ Installation
+ ============
+
+ Install the `pyjokes` module with pip.
+
+ See the `documentation`_ for installation instructions.
+
+ Usage
+ =====
+
+ Once installed, simply call `pyjoke` from the command line.
+
+ Alternatively use the `-c` flag to get jokes from a specific category. Options::
+
+ -c neutral [default] (neutral geek jokes)
+ -c adult (adult geek jokes)
+ -c chuck (Chuck Norris geek jokes)
+ -c all (all jokes)
+
+ You can also access the jokes in your own project by importing `pyjokes` and using the functions `get_joke` and `get_jokes`
+
+ Comprehensive documentation is available at `http://pyjoke.es`_
+
+ Contributors
+ ============
+
+ Development:
+
+ * `Ben Nuttall`_
+ * `Alex Savio`_
+ * `Borja Ayerdi`_
+ * `Oier Etxaniz`_
+
+ Jokes:
+
+ * `Luke Wren`_
+ * `Sarah Bird`_
+ * `Yash Mehrotra`_
+ * `Marc Kirkwood`_
+ * `Gregory Parker`_
+
+ Contributing
+ ============
+
+ * The code is licensed under the `BSD Licence`_
+ * The project source code is hosted on `GitHub`_
+ * Please use `GitHub issues`_ to submit bugs and report issues
+ * Feel free to `contribute`_ to the code
+ * Feel free to contribute jokes (via pull request or `proposal issue`_)
+ * See the `contributing policy`_ on GitHub
+
+ Tests
+ =====
+
+ Install requirements (pytest)
+
+ Run tests::
+
+ python setup.py test
+
+ Pyjokes Society
+ ===============
+
+ This project is was founded at `PySS 2014`_ and is directed by the `Pyjokes Society`_.
+
+
+ .. _documentation: http://pyjoke.es/install/
+ .. _http://pyjoke.es: http://pyjoke.es
+ .. _Ben Nuttall: https://github.com/bennuttall
+ .. _Alex Savio: https://github.com/alexsavio
+ .. _Borja Ayerdi: https://github.com/borjaayerdi
+ .. _Oier Etxaniz: https://github.com/oiertwo
+ .. _Luke Wren: https://github.com/wren6991
+ .. _Sarah Bird: https://github.com/birdsarah
+ .. _Yash Mehrotra: https://github.com/yashmehrotra
+ .. _Marc Kirkwood: https://github.com/trojjer
+ .. _Gregory Parker: https://github.com/ElectronicsGeek
+ .. _BSD Licence: http://opensource.org/licenses/BSD-3-Clause
+ .. _GitHub: https://github.com/pyjokes/pyjokes
+ .. _GitHub Issues: https://github.com/pyjokes/pyjokes/issues
+ .. _contribute: https://github.com/pyjokes/pyjokes/tree/master/CONTRIBUTING.md
+ .. _proposal issue: https://github.com/pyjokes/pyjokes/issues/10
+ .. _contributing policy: https://github.com/pyjokes/pyjokes/tree/master/CONTRIBUTING.md
+ .. _PySS 2014: http://www.pyss.org/
+ .. _Pyjokes Society: http://pyjok.es/society/
+
+Keywords: pyjokes,jokes
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Topic :: Utilities
+Classifier: License :: OSI Approved :: BSD License
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 3
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..d4bcecd
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,94 @@
+.. image:: https://travis-ci.org/pyjokes/pyjokes.svg
+ :target: https://travis-ci.org/pyjokes/pyjokes
+
+=======
+pyjokes
+=======
+
+One line jokes for programmers (jokes as a service)
+
+Installation
+============
+
+Install the `pyjokes` module with pip.
+
+See the `documentation`_ for installation instructions.
+
+Usage
+=====
+
+Once installed, simply call `pyjoke` from the command line.
+
+Alternatively use the `-c` flag to get jokes from a specific category. Options::
+
+ -c neutral [default] (neutral geek jokes)
+ -c adult (adult geek jokes)
+ -c chuck (Chuck Norris geek jokes)
+ -c all (all jokes)
+
+You can also access the jokes in your own project by importing `pyjokes` and using the functions `get_joke` and `get_jokes`
+
+Comprehensive documentation is available at `http://pyjoke.es`_
+
+Contributors
+============
+
+Development:
+
+* `Ben Nuttall`_
+* `Alex Savio`_
+* `Borja Ayerdi`_
+* `Oier Etxaniz`_
+
+Jokes:
+
+* `Luke Wren`_
+* `Sarah Bird`_
+* `Yash Mehrotra`_
+* `Marc Kirkwood`_
+* `Gregory Parker`_
+
+Contributing
+============
+
+* The code is licensed under the `BSD Licence`_
+* The project source code is hosted on `GitHub`_
+* Please use `GitHub issues`_ to submit bugs and report issues
+* Feel free to `contribute`_ to the code
+* Feel free to contribute jokes (via pull request or `proposal issue`_)
+* See the `contributing policy`_ on GitHub
+
+Tests
+=====
+
+Install requirements (pytest)
+
+Run tests::
+
+ python setup.py test
+
+Pyjokes Society
+===============
+
+This project is was founded at `PySS 2014`_ and is directed by the `Pyjokes Society`_.
+
+
+.. _documentation: http://pyjoke.es/install/
+.. _http://pyjoke.es: http://pyjoke.es
+.. _Ben Nuttall: https://github.com/bennuttall
+.. _Alex Savio: https://github.com/alexsavio
+.. _Borja Ayerdi: https://github.com/borjaayerdi
+.. _Oier Etxaniz: https://github.com/oiertwo
+.. _Luke Wren: https://github.com/wren6991
+.. _Sarah Bird: https://github.com/birdsarah
+.. _Yash Mehrotra: https://github.com/yashmehrotra
+.. _Marc Kirkwood: https://github.com/trojjer
+.. _Gregory Parker: https://github.com/ElectronicsGeek
+.. _BSD Licence: http://opensource.org/licenses/BSD-3-Clause
+.. _GitHub: https://github.com/pyjokes/pyjokes
+.. _GitHub Issues: https://github.com/pyjokes/pyjokes/issues
+.. _contribute: https://github.com/pyjokes/pyjokes/tree/master/CONTRIBUTING.md
+.. _proposal issue: https://github.com/pyjokes/pyjokes/issues/10
+.. _contributing policy: https://github.com/pyjokes/pyjokes/tree/master/CONTRIBUTING.md
+.. _PySS 2014: http://www.pyss.org/
+.. _Pyjokes Society: http://pyjok.es/society/
diff --git a/pyjokes.egg-info/PKG-INFO b/pyjokes.egg-info/PKG-INFO
new file mode 100644
index 0000000..9bbccf8
--- /dev/null
+++ b/pyjokes.egg-info/PKG-INFO
@@ -0,0 +1,110 @@
+Metadata-Version: 1.1
+Name: pyjokes
+Version: 0.5.0
+Summary: One line jokes for programmers (jokes as a service)
+Home-page: https://github.com/pyjokes/pyjokes
+Author: Pyjokes Society
+Author-email: UNKNOWN
+License: BSD
+Description: .. image:: https://travis-ci.org/pyjokes/pyjokes.svg
+ :target: https://travis-ci.org/pyjokes/pyjokes
+
+ =======
+ pyjokes
+ =======
+
+ One line jokes for programmers (jokes as a service)
+
+ Installation
+ ============
+
+ Install the `pyjokes` module with pip.
+
+ See the `documentation`_ for installation instructions.
+
+ Usage
+ =====
+
+ Once installed, simply call `pyjoke` from the command line.
+
+ Alternatively use the `-c` flag to get jokes from a specific category. Options::
+
+ -c neutral [default] (neutral geek jokes)
+ -c adult (adult geek jokes)
+ -c chuck (Chuck Norris geek jokes)
+ -c all (all jokes)
+
+ You can also access the jokes in your own project by importing `pyjokes` and using the functions `get_joke` and `get_jokes`
+
+ Comprehensive documentation is available at `http://pyjoke.es`_
+
+ Contributors
+ ============
+
+ Development:
+
+ * `Ben Nuttall`_
+ * `Alex Savio`_
+ * `Borja Ayerdi`_
+ * `Oier Etxaniz`_
+
+ Jokes:
+
+ * `Luke Wren`_
+ * `Sarah Bird`_
+ * `Yash Mehrotra`_
+ * `Marc Kirkwood`_
+ * `Gregory Parker`_
+
+ Contributing
+ ============
+
+ * The code is licensed under the `BSD Licence`_
+ * The project source code is hosted on `GitHub`_
+ * Please use `GitHub issues`_ to submit bugs and report issues
+ * Feel free to `contribute`_ to the code
+ * Feel free to contribute jokes (via pull request or `proposal issue`_)
+ * See the `contributing policy`_ on GitHub
+
+ Tests
+ =====
+
+ Install requirements (pytest)
+
+ Run tests::
+
+ python setup.py test
+
+ Pyjokes Society
+ ===============
+
+ This project is was founded at `PySS 2014`_ and is directed by the `Pyjokes Society`_.
+
+
+ .. _documentation: http://pyjoke.es/install/
+ .. _http://pyjoke.es: http://pyjoke.es
+ .. _Ben Nuttall: https://github.com/bennuttall
+ .. _Alex Savio: https://github.com/alexsavio
+ .. _Borja Ayerdi: https://github.com/borjaayerdi
+ .. _Oier Etxaniz: https://github.com/oiertwo
+ .. _Luke Wren: https://github.com/wren6991
+ .. _Sarah Bird: https://github.com/birdsarah
+ .. _Yash Mehrotra: https://github.com/yashmehrotra
+ .. _Marc Kirkwood: https://github.com/trojjer
+ .. _Gregory Parker: https://github.com/ElectronicsGeek
+ .. _BSD Licence: http://opensource.org/licenses/BSD-3-Clause
+ .. _GitHub: https://github.com/pyjokes/pyjokes
+ .. _GitHub Issues: https://github.com/pyjokes/pyjokes/issues
+ .. _contribute: https://github.com/pyjokes/pyjokes/tree/master/CONTRIBUTING.md
+ .. _proposal issue: https://github.com/pyjokes/pyjokes/issues/10
+ .. _contributing policy: https://github.com/pyjokes/pyjokes/tree/master/CONTRIBUTING.md
+ .. _PySS 2014: http://www.pyss.org/
+ .. _Pyjokes Society: http://pyjok.es/society/
+
+Keywords: pyjokes,jokes
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Topic :: Utilities
+Classifier: License :: OSI Approved :: BSD License
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 3
diff --git a/pyjokes.egg-info/SOURCES.txt b/pyjokes.egg-info/SOURCES.txt
new file mode 100644
index 0000000..4175342
--- /dev/null
+++ b/pyjokes.egg-info/SOURCES.txt
@@ -0,0 +1,14 @@
+MANIFEST.in
+README.rst
+setup.py
+pyjokes/__init__.py
+pyjokes/jokes_de.py
+pyjokes/jokes_en.py
+pyjokes/jokes_es.py
+pyjokes/pyjokes.py
+pyjokes.egg-info/PKG-INFO
+pyjokes.egg-info/SOURCES.txt
+pyjokes.egg-info/dependency_links.txt
+pyjokes.egg-info/top_level.txt
+scripts/pyjoke
+scripts/pyjokes
\ No newline at end of file
diff --git a/pyjokes.egg-info/dependency_links.txt b/pyjokes.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/pyjokes.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/pyjokes.egg-info/top_level.txt b/pyjokes.egg-info/top_level.txt
new file mode 100644
index 0000000..67cf03a
--- /dev/null
+++ b/pyjokes.egg-info/top_level.txt
@@ -0,0 +1 @@
+pyjokes
diff --git a/pyjokes/__init__.py b/pyjokes/__init__.py
new file mode 100644
index 0000000..9f36254
--- /dev/null
+++ b/pyjokes/__init__.py
@@ -0,0 +1,5 @@
+from __future__ import absolute_import
+from .pyjokes import get_joke, get_jokes
+
+
+__version__ = '0.5.0'
diff --git a/pyjokes/jokes_de.py b/pyjokes/jokes_de.py
new file mode 100644
index 0000000..343968f
--- /dev/null
+++ b/pyjokes/jokes_de.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+
+neutral = [
+ 'No jokes found.',
+]
+
+jokes_de = {
+ 'neutral': neutral,
+ 'all': neutral,
+}
diff --git a/pyjokes/jokes_en.py b/pyjokes/jokes_en.py
new file mode 100644
index 0000000..74bce70
--- /dev/null
+++ b/pyjokes/jokes_en.py
@@ -0,0 +1,215 @@
+# -*- coding: utf-8 -*-
+
+"""
+Jokes from stackoverflow - provided under CC BY-SA 3.0
+http://stackoverflow.com/questions/234075/what-is-your-best-programmer-joke?page=4&tab=votes#tab-top
+"""
+
+neutral = [
+ "Ubuntu users are apt to get this joke.",
+ "Obfuscated Reality Mappers (ORMs) can be useful database tools.",
+ "I wonder if the MPs voting on the Digital Economy Bill think that Creative Commons is a Parliamentary initiative.",
+ "Asked to explain Unicode during an interview, Geoff went into detail about his final year university project. He was not hired.",
+ "Triumphantly, Beth removed Python 2.7 from her server in 2020. 'Finally!' she said with glee, only to see the announcement for Python 4.4.",
+ "An SQL query goes into a bar, walks up to two tables and asks, 'Can I join you?'",
+ "When your hammer is C++, everything begins to look like a thumb.",
+ "If you put a million monkeys at a million keyboards, one of them will eventually write a Java program. The rest of them will write Perl.",
+ "To understand recursion you must first understand recursion.",
+ "Friends don't let friends use Python 2.7",
+ "I suggested holding a 'Python Object Oriented Programming Seminar', but the acronym was unpopular.",
+ "'Knock, knock.' 'Who’s there?' ... very long pause ... 'Java.'",
+ "How many programmers does it take to change a light bulb? None, that's a hardware problem.",
+ "What's the object-oriented way to become wealthy? Inheritance",
+ "Why don't jokes work in octal? Because 7 10 11.",
+ "How many programmers does it take to change a light bulb? None, they just make darkness a standard.",
+ "Two bytes meet. The first byte asks, 'Are you ill?' The second byte replies, 'No, just feeling a bit off.'",
+ "Two threads walk into a bar. The barkeeper looks up and yells, 'Hey, I want don't any conditions race like time last!'",
+ "Old C programmers don't die, they're just cast into void.",
+ "Eight bytes walk into a bar. The bartender asks, 'Can I get you anything?' 'Yeah,' reply the bytes. 'Make us a double.'",
+ "Why did the programmer quit his job? Because they didn't get arrays.",
+ "Why do Java programmers have to wear glasses? Because they don't see sharp.",
+ "Software developers like to solve problems. If there are no problems handily available, they will create their own problems.",
+ ".NET was named .NET so that it wouldn't show up in a Unix directory listing.",
+ "Hardware: The part of a computer that you can kick.",
+ "A programmer was found dead in the shower. Next to their body was a bottle of shampoo with the instructions 'Lather, Rinse and Repeat'.",
+ "Optimist: The glass is half full. Pessimist: The glass is half empty. Programmer: The glass is twice as large as necessary.",
+ "In C we had to code our own bugs. In C++ we can inherit them.",
+ "How come there is not obfuscated Perl contest? Because everyone would win.",
+ "If you play a Windows CD backwards, you'll hear satanic chanting ... worse still, if you play it forwards, it installs Windows.",
+ "How many programmers does it take to kill a cockroach? Two: one holds, the other installs Windows on it.",
+ "What do you call a programmer from Finland? Nerdic.",
+ "What did the Java code say to the C code? A: You've got no class.",
+ "Why did Microsoft name their search engine BING? Because It's Not Google.",
+ "Pirates go 'arg!', computer pirates go 'argv!'",
+ "Software salesmen and used-car salesmen differ in that the latter know when they are lying.",
+ "Child: Dad, why does the sun rise in the east and set in the west? Dad: Son, it's working, don't touch",
+ "Why do programmers confuse Halloween with Christmas? Because OCT 31 == DEC 25",
+ "How many Prolog programmers does it take to change a lightbulb? false.",
+ "Real programmers can write assembly code in any language",
+ "Waiter: Would you like coffee or tea? Programmer: Yes.",
+ "What do you get when you cross a cat and a dog? Cat dog sin theta.",
+ "If loving you is ROM I don't wanna read write.",
+ "A programmer walks into a foo...",
+ "A programmer walks into a bar and orders 1.38 root beers. The bartender informs her it's a root beer float. She says 'Make it a double!'",
+ "What is Benoit B. Mandelbrot's middle name? Benoit B. Mandelbrot.",
+ "Why are you always smiling? That's just my... regular expression.",
+ "ASCII stupid question, get a stupid ANSI.",
+ "A programmer had a problem. He thought to himself, 'I know, I'll solve it with threads!'. has Now problems. two he",
+ "Why do sin and tan work? Just cos.",
+ "Java: Write once, run away.",
+ "I would tell you a joke about UDP, but you would never get it.",
+ "A QA engineer walks into a bar. Runs into a bar. Crawls into a bar. Dances into a bar. Tiptoes into a bar. Rams a bar. Jumps into a bar.",
+ "My friend's in a band called '1023 Megabytes'... They haven't got a gig yet!",
+ "I had a problem so I thought I'd use Java. Now I have a ProblemFactory.",
+ "QA Engineer walks into a bar. Orders a beer. Orders 0 beers. Orders 999999999 beers. Orders a lizard. Orders -1 beers. Orders a sfdeljknesv.",
+ "A product manager walks into a bar, asks for drink. Bartender says no, but will consider adding later.",
+ "How do you generate a random string? Put a first year Computer Science student in Vim and ask them to save and exit.",
+ "I've been using Vim for a long time now, mainly because I can't figure out how to exit.",
+ "How do you know whether a person is a Vim user? Don't worry, they'll tell you.",
+ "Waiter: He's choking! Is anyone a doctor? Programmer: I'm a Vim user.",
+ "3 Database Admins walked into a NoSQL bar. A little while later they walked out because they couldn’t find a table.",
+ "How to explain the movie Inception to a programmer? When you run a VM inside another VM, inside another VM ... everything runs real slow!",
+ "What do you call a parrot that says \"Squawk! Pieces of nine! Pieces of nine!\"? A parrot-ey error.",
+ "There are only two hard problems in Computer Science: cache invalidation, naming things and off-by-one-errors.",
+ "There are 10 types of people: those who understand binary and those who don't",
+ "There are 2 types of people: those who can interpret incomplete data sets...",
+ "There are II types of people: Those who understand Roman Numerals and those who don't.",
+ "There are 10 types of people: those who understand hexadecimal and 15 others",
+ "There are 10 types of people: those who understand binary, those who don't, and those who were expecting this joke to be in trinary.",
+ "There are 10 types of people: those who understand trinary, those who don't, and those who have never heard of it.",
+ "What do you call eight hobbits? A hobbyte.",
+ "The best thing about a Boolean is even if you are wrong, you are only off by a bit.",
+ "A good programmer is someone who always looks both ways before crossing a one-way street.",
+ "There are two ways to write error-free programs; only the third one works.",
+]
+
+adult = [
+ "Programming is like sex: One mistake and you have to support it for the rest of your life.",
+ "Software is like sex: It's better when it's free.",
+ "Software is like sex: It's never REALLY free.",
+ "There are 10 types of people: those who understand binary, and those who get laid.",
+ "Why programmers like UNIX: unzip, strip, touch, finger, grep, mount, fsck, more, yes, fsck, fsck, fsck, umount, sleep",
+ "If your mom was a collection class, her insert method would be public.",
+ "Your momma's so fat that not even Dijkstra is able to find a shortest path around her.",
+ "C++ - where your friends have access to your private members.",
+ "The only intuitive user interface is the nipple. After that, it's all learned.",
+ "What's the difference between software development and sex? In sex, you don't get a bonus for releasing early.",
+ "Your momma's so fat, the recursive function calculating her mass causes a stack overflow.",
+]
+
+"""
+Jokes from The Internet Chuck Norris DB (ICNDB) (http://www.icndb.com/) - provided under CC BY-SA 3.0
+http://api.icndb.com/jokes/
+"""
+
+chuck = [
+ "When Chuck Norris throws exceptions, it's across the room.",
+ "All arrays Chuck Norris declares are of infinite size, because Chuck Norris knows no bounds.",
+ "Chuck Norris doesn't have disk latency because the hard drive knows to hurry the hell up, or else.",
+ "Chuck Norris writes code that optimises itself.",
+ "Chuck Norris can't test for equality because he has no equal.",
+ "Chuck Norris doesn't need garbage collection because he doesn't call .Dispose(), he calls .DropKick().",
+ "Chuck Norris's first program was kill -9.",
+ "Chuck Norris burst the dot com bubble.",
+ "All browsers support the hex definitions #chuck and #norris for the colours black and blue.",
+ "MySpace isn't really your space, it's Chuck's (he just lets you use it).",
+ "Chuck Norris can write infinitely recursive functions and have them return.",
+ "Chuck Norris can solve the Towers of Hanoi in one move.",
+ "The only design pattern Chuck Norris knows is the God Object Pattern.",
+ "Chuck Norris finished World of Warcraft.",
+ "Project managers never ask Chuck Norris for estimations.",
+ "Chuck Norris doesn't use web standards as the web will conform to him.",
+ "'It works on my machine' always holds true for Chuck Norris.",
+ "Chuck Norris doesn't do Burn Down charts, he does Smack Down charts.",
+ "Chuck Norris can delete the Recycling Bin.",
+ "Chuck Norris's beard can type 140 words per minute.",
+ "Chuck Norris can unit test entire applications with a single assertion, 'it works'.",
+ "Chuck Norris doesn't bug hunt as that signifies a probability of failure, he goes bug killing.",
+ "Chuck Norris's keyboard doesn't have a Ctrl key because nothing controls Chuck Norris.",
+ "Chuck Norris can overflow your stack just by looking at it.",
+ "To Chuck Norris, everything contains a vulnerability.",
+ "Chuck Norris doesn't sudo, the shell just knows it's him and does what it's told.",
+ "Chuck Norris doesn't need a debugger, he just stares at the code until it confesses.",
+ "Chuck Norris can access private methods.",
+ "Chuck Norris can instantiate an abstract class.",
+ "Chuck Norris does not need to know about Class Factory Pattern. He can instantiate interfaces.",
+ "The class object inherits from Chuck Norris",
+ "For Chuck Norris, NP-Hard = O(1).",
+ "Chuck Norris knows the last digit of Pi.",
+ "Chuck Norris's Internet connection is faster upstream than downstream because even data has more incentive to run from him than to him.",
+ "Chuck Norris solved the Travelling Salesman problem in O(1) time: break salesman into N pieces; kick each piece to a different city.",
+ "No statement can catch the ChuckNorrisException.",
+ "Chuck Norris doesn't pair program.",
+ "Chuck Norris can write multi-threaded applications with a single thread.",
+ "Chuck Norris doesn't need to use AJAX because pages are too afraid to postback anyways.",
+ "Chuck Norris doesn't use reflection, reflection asks politely for his help.",
+ "There is no Esc key on Chuck Norris' keyboard, because no one escapes Chuck Norris.",
+ "Chuck Norris can binary search unsorted data.",
+ "Chuck Norris doesn't needs try-catch, exceptions are too afraid to raise.",
+ "Chuck Norris went out of an infinite loop.",
+ "If Chuck Norris writes code with bugs, the bugs fix themselves.",
+ "Chuck Norris hosting is 101% uptime guaranteed.",
+ "Chuck Norris's keyboard has the Any key.",
+ "Chuck Norris can access the database from the UI.",
+ "Chuck Norris's programs never exit, they are terminated.",
+ "Chuck Norris insists on strongly-typed programming languages.",
+ "The Chuck Norris protocol design method has no status, requests or responses, only commands.",
+ "Chuck Norris's programs occupy 150% of CPU, even when they are not running.",
+ "Chuck Norris can spawn threads that complete before they are started.",
+ "Chuck Norris's programs do not accept input.",
+ "Chuck Norris can install iTunes without installing Quicktime.",
+ "Chuck Norris doesn't need an OS.",
+ "Chuck Norris's OSI network model has only one layer - Physical.",
+ "Chuck Norris can compile syntax errors.",
+ "Every SQL statement that Chuck Norris codes has an implicit 'COMMIT' in its end.",
+ "Chuck Norris does not need to type-cast. The Chuck-Norris Compiler (CNC) sees through things. All the way down. Always.",
+ "Chuck Norris does not code in cycles, he codes in strikes.",
+ "Chuck Norris compresses his files by doing a flying round house kick to the hard drive.",
+ "Chick Norris solved the halting problem.",
+ "With Chuck Norris P = NP. There's no nondeterminism with Chuck Norris decisions.",
+ "Chuck Norris can retrieve anything from /dev/null.",
+ "No one has ever pair-programmed with Chuck Norris and lived to tell the tale.",
+ "No one has ever spoken during review of Chuck Norris' code and lived to tell the tale.",
+ "Chuck Norris doesn't use a GUI, he prefers COMMAND line.",
+ "Chuck Norris doesn't use Oracle, he is the Oracle.",
+ "Chuck Norris can dereference NULL.",
+ "A diff between your code and Chuck Norris's is infinite.",
+ "The Chuck Norris Eclipse plugin made alien contact.",
+ "Chuck Norris is the ultimate mutex, all threads fear him.",
+ "Don't worry about tests, Chuck Norris's test cases cover your code too.",
+ "Each hair in Chuck Norris's beard contributes to make the world's largest DDOS.",
+ "Chuck Norris's log statements are always at the FATAL level.",
+ "Chuck Norris's database has only one table, 'Kick', which he drops frequently.",
+ "Chuck Norris completed World of Warcraft.",
+ "When Chuck Norris breaks the build, you can't fix it, because there is not a single line of code left.",
+ "Chuck Norris types with one finger. He points it at the keyboard and the keyboard does the rest.",
+ "Chuck Norris's programs can pass the Turing Test by staring at the interrogator.",
+ "If you try to kill -9 Chuck Norris's programs, it backfires.",
+ "Chuck Norris performs infinite loops in under 4 seconds.",
+ "Chuck Norris can overwrite a locked variable.",
+ "Chuck Norris knows the value of NULL, and he can sort by it too.",
+ "Chuck Norris can install a 64-bit operating system on 32-bit machines.",
+ "Chuck Norris can write to an output stream.",
+ "Chuck Norris can read from an input stream.",
+ "Chuck Norris never has to build his program to machine code. Machines have learnt to interpret Chuck Norris's code.",
+ "Chuck Norris's unit tests don't run. They die.",
+ "Chuck Norris causes the Blue Screen of Death.",
+ "Chuck Norris can make a class that is both abstract and final.",
+ "Chuck Norris could use anything in java.util.* to kill you, including the javadocs.",
+ "Code runs faster when Chuck Norris watches it.",
+ "Chuck Norris doesn't use REST, he waits.",
+ "Everyone likes Chuck Norris on Facebook, whether they choose to or not",
+ "You can't follow Chuck Norris on Twitter, because he follows you",
+ "Chuck Norris's calculator has only 3 keys: 0, 1, and NAND.",
+ "Chuck Norris only uses global variables. He has nothing to hide.",
+ "Chuck Norris once implemented an HTTP server in a single printf call. It is now the heart of Apache webserver.",
+ "Chuck Norris writes directly in binary. He then writes the source code as documentation for other programers.",
+ "Chuck Norris once shifted a bit so hard, it ended up on a different computer.",
+]
+
+jokes_en = {
+ 'neutral': neutral,
+ 'adult': adult,
+ 'chuck': chuck,
+ 'all': neutral + adult + chuck,
+}
diff --git a/pyjokes/jokes_es.py b/pyjokes/jokes_es.py
new file mode 100644
index 0000000..64544cf
--- /dev/null
+++ b/pyjokes/jokes_es.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+
+neutral = [
+ 'Se abre el ascensor y hay un programador dentro, le preguntan: - ¿Sube o baja? A lo que el programador responde: - Sí.',
+ 'Qué le dice un bit al otro? Nos vemos en el bus.',
+]
+
+adult = [
+ '¿Qué es una mujer objeto? Un instancia de una mujer con clase',
+ '- Cuántos dalmatas habia en la peli? - 101. - Por el culo te la hinco!',
+ 'Encuentran programador muerto en la ducha con un bote de champu: "enjabonar, aclarar y vuelta a empezar"',
+ 'Esto es un mainframe que le dice a un PC: "tan pequeno y ya "computas"?'
+]
+
+jokes_es = {
+ 'neutral': neutral,
+ 'adult': adult,
+ 'all': neutral + adult,
+}
diff --git a/pyjokes/pyjokes.py b/pyjokes/pyjokes.py
new file mode 100644
index 0000000..9d441bf
--- /dev/null
+++ b/pyjokes/pyjokes.py
@@ -0,0 +1,64 @@
+from __future__ import absolute_import
+import random
+
+from .jokes_en import jokes_en
+from .jokes_de import jokes_de
+from .jokes_es import jokes_es
+
+
+all_jokes = {
+ 'en': jokes_en,
+ 'de': jokes_de,
+ 'es': jokes_es,
+}
+
+
+class LanguageNotFoundError(Exception):
+ pass
+
+
+class CategoryNotFoundError(Exception):
+ pass
+
+
+def get_jokes(language='en', category='neutral'):
+ """
+ Parameters
+ ----------
+ category: str
+ Choices: 'neutral', 'adult', 'chuck', 'all'
+ lang: str
+ Choices: 'en', 'de', 'es'
+
+ Returns
+ -------
+ jokes: list
+ """
+
+ if language not in all_jokes:
+ raise LanguageNotFoundError('No such language %s' % language)
+
+ jokes = all_jokes[language]
+
+ if category not in jokes:
+ raise CategoryNotFoundError('No such category %s in language %s' % (category, language))
+
+ return jokes[category]
+
+
+def get_joke(language='en', category='neutral'):
+ """
+ Parameters
+ ----------
+ category: str
+ Choices: 'neutral', 'adult', 'chuck', 'all'
+ lang: str
+ Choices: 'en', 'de', 'es'
+
+ Returns
+ -------
+ joke: str
+ """
+
+ jokes = get_jokes(language, category)
+ return random.choice(jokes)
diff --git a/scripts/pyjoke b/scripts/pyjoke
new file mode 100755
index 0000000..cc90d9a
--- /dev/null
+++ b/scripts/pyjoke
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+
+import os
+import argparse
+from pyjokes import pyjokes
+
+
+def create_argparser():
+ parser = argparse.ArgumentParser(
+ description='One line jokes for programmers (jokes as a service)'
+ )
+
+ parser.add_argument(
+ '-c', '--category',
+ dest='category',
+ choices=['neutral', 'adult', 'chuck', 'all'],
+ default='neutral',
+ help='Joke category.'
+ )
+
+ parser.add_argument(
+ '-l', '--language',
+ dest='language',
+ choices=['en', 'de', 'es'],
+ default='en',
+ help='Joke language.'
+ )
+
+ return parser
+
+
+def main():
+ parser = create_argparser()
+
+ try:
+ args = parser.parse_args()
+ except argparse.ArgumentError as exc:
+ print('Error parsing arguments.')
+ parser.error(str(exc.message))
+ exit(-1)
+
+ try:
+ joke = pyjokes.get_joke(language=args.language, category=args.category)
+ except pyjokes.LanguageNotFoundError:
+ print('No such language %s' % args.language)
+ exit(-1)
+ except pyjokes.CategoryNotFoundError:
+ print('No such category %s' % args.category)
+ exit(-1)
+
+ print(joke)
+
+if __name__ == '__main__':
+ main()
diff --git a/scripts/pyjokes b/scripts/pyjokes
new file mode 100755
index 0000000..c1c07c0
--- /dev/null
+++ b/scripts/pyjokes
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+import sys
+
+
+def main():
+ print('Did you mean pyjoke?')
+ return 1
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..72f9d44
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,5 @@
+[egg_info]
+tag_svn_revision = 0
+tag_date = 0
+tag_build =
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..5a4a8a5
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,55 @@
+import os
+import sys
+from setuptools import setup, find_packages
+from setuptools.command.test import test as TestCommand
+
+
+def read(fname):
+ return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
+
+class PyTest(TestCommand):
+ user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
+
+ def initialize_options(self):
+ TestCommand.initialize_options(self)
+ self.pytest_args = []
+
+ def finalize_options(self):
+ TestCommand.finalize_options(self)
+ self.test_args = []
+ self.test_suite = True
+
+ def run_tests(self):
+ #import here, cause outside the eggs aren't loaded
+ import pytest
+ errno = pytest.main(self.pytest_args)
+ sys.exit(errno)
+
+
+setup(
+ name="pyjokes",
+ version="0.5.0",
+ author="Pyjokes Society",
+ description="One line jokes for programmers (jokes as a service)",
+ license="BSD",
+ keywords=[
+ "pyjokes",
+ "jokes",
+ ],
+ url="https://github.com/pyjokes/pyjokes",
+ packages=find_packages(),
+ long_description=read('README.rst'),
+ scripts=['scripts/pyjoke',
+ 'scripts/pyjokes'],
+ classifiers=[
+ "Development Status :: 4 - Beta",
+ "Topic :: Utilities",
+ "License :: OSI Approved :: BSD License",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 3",
+ ],
+ #test requirements and class specification:
+ tests_require=['pytest'],
+ cmdclass={ 'test' : PyTest },
+)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pyjokes.git
More information about the Python-modules-commits
mailing list