PK!Zu+ֶeuchre/__init__.pyfrom pkg_resources import DistributionNotFound, get_distribution try: __version__ = get_distribution('Euchre').version except DistributionNotFound: __version__ = '(local)' PK!?euchre/__main__.py#!/usr/bin/env python """Package entry point.""" from euchre.gui import main if __name__ == '__main__': # pragma: no cover main() PK!jH-- euchre/cli.py"""A sample CLI.""" import click import log from . import utils @click.command() @click.argument('feet') def main(feet=None): log.init() meters = utils.feet_to_meters(feet) if meters is not None: click.echo(meters) if __name__ == '__main__': # pragma: no cover main() PK!7M M euchre/gui.py"""A sample GUI.""" from tkinter import * # pylint: disable=wildcard-import,unused-wildcard-import from tkinter.ttk import * # pylint: disable=wildcard-import,unused-wildcard-import import log from . import utils class Application: """A sample class.""" def __init__(self): log.info("Starting the application...") # Configure the root window self.root = Tk() self.root.title("Feet to Meters") self.root.minsize(400, 150) # Initialize elements self.feet = StringVar() self.meters = StringVar() frame = self.init(self.root) frame.pack(fill=BOTH, expand=1) # Start the event loop self.root.mainloop() def init(self, root): padded = {'padding': 5} sticky = {'sticky': NSEW} # Configure grid frame = Frame(root, **padded) frame.rowconfigure(0, weight=1) frame.rowconfigure(1, weight=1) frame.columnconfigure(0, weight=1) def frame_inputs(root): frame = Frame(root, **padded) # Configure grid frame.rowconfigure(0, weight=1) frame.rowconfigure(1, weight=1) frame.columnconfigure(0, weight=1) frame.columnconfigure(1, weight=1) frame.columnconfigure(2, weight=1) # Place widgets entry = Entry(frame, width=7, textvariable=self.feet) entry.grid(column=1, row=0) entry.focus() label = Label(frame, text="feet") label.grid(column=2, row=0) label = Label(frame, text="is equivalent to") label.grid(column=0, row=1) label = Label(frame, text="meters") label.grid(column=2, row=1) label = Label(frame, textvariable=self.meters) label.grid(column=1, row=1) return frame def frame_commands(root): frame = Frame(root, **padded) # Configure grid frame.rowconfigure(0, weight=1) frame.columnconfigure(0, weight=1) # Place widgets button = Button(frame, text="Calculate", command=self.calculate) button.grid(column=0, row=0) self.root.bind('', self.calculate) return frame def separator(root): return Separator(root) # Place widgets frame_inputs(frame).grid(row=0, **sticky) separator(frame).grid(row=1, padx=10, pady=5, **sticky) frame_commands(frame).grid(row=2, **sticky) return frame def calculate(self, event=None): log.debug("Event: %s", event) meters = utils.feet_to_meters(self.feet.get()) if meters is not None: self.meters.set(meters) def main(): log.init() Application() if __name__ == '__main__': # pragma: no cover main() PK!ޙPb""euchre/tests/__init__.py"""Unit tests for the package.""" PK!ov,WWeuchre/tests/conftest.py"""Unit tests configuration file.""" import log def pytest_configure(config): """Disable verbose output when running tests.""" log.init(debug=True) terminal = config.pluginmanager.getplugin('terminal') base = terminal.TerminalReporter class QuietReporter(base): """Reporter that only shows dots when running tests.""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.verbosity = 0 self.showlongtestinfo = False self.showfspath = False terminal.TerminalReporter = QuietReporter PK! euchre/tests/test_utils.py"""Sample unit test module using pytest-describe and expecter.""" # pylint: disable=redefined-outer-name,unused-variable,expression-not-assigned,singleton-comparison from euchre import utils def describe_feet_to_meters(): def when_integer(expect): expect(utils.feet_to_meters(42)) == 12.80165 def when_string(expect): expect(utils.feet_to_meters("hello")) == None PK!euchre/utils.py"""A sample module.""" import log def feet_to_meters(feet): """Convert feet to meters.""" try: value = float(feet) except ValueError: log.error("Unable to convert to float: %s", feet) else: return (0.3048 * value * 10000.0 + 0.5) / 10000.0 PK!Y@@euchre-0.0.dist-info/LICENSE.md**The MIT License (MIT)** Copyright © 2018, Jace Browning Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK!H=jTTeuchre-0.0.dist-info/WHEEL 1 0 нRN&":WhAqo;VSoBtM4[`Z} Mz7M*{/ܒ?֎XPK!H2heuchre-0.0.dist-info/METADATAUo6 ~_{lVhumhYnЪ2jK$ނrȏH~.{IR!~>SJ,4eU6),yi cGrTh .#`*O<+"V1Msʱ޸4I c AQHT>aRrw1fm g3’"e%B E-)̎節;'%RSЦWBt >9CMŧ-<|pU^QLtߥ lsAQ~侰:,`3tWnW`S| 49ofG?Ãx:܃Bg??NآQtsuNТ 6hH!Nư+4Imү d!NƉ(4;E'4!gt'ucH|?d%?pm8,^32JbX[^K7]$: 26߆R2 7FDض[>z+EGטuS)]: V*Z8/oŭ |c?-h+,r%VG}9mn\ Y̡__f#:9#Z :[7 /׃gl.igWҽ@ۀ?e[DQyvl*ؐ7'Pn_˾5kI _ taw9ƾ6%[\9ORmcWuiRU6|ycBFy/~te qoJh'k_]L0 ?p4e<h~} W_p4$7Kީl[៞]].PK!Hg*teuchre-0.0.dist-info/RECORDmɒP}} Xâ{x< _ւhMFNĽf3&`u.C) Ac_9 IVsZgq7uU=)P"(o~ID0_`YCVx;䳒 Ha ܤq_Of{1FJGF3{,.)1 $^*`5hYZ~DtE)^>]Ik\c"3V#(7iw|;f~sa$? ׊n^ǤHyfxLE3TcE3ϫEPK!Zu+ֶeuchre/__init__.pyPK!?euchre/__main__.pyPK!jH-- euchre/cli.pyPK!7M M euchre/gui.pyPK!ޙPb""reuchre/tests/__init__.pyPK!ov,WWeuchre/tests/conftest.pyPK! Weuchre/tests/test_utils.pyPK!euchre/utils.pyPK!Y@@`euchre-0.0.dist-info/LICENSE.mdPK!H=jTTeuchre-0.0.dist-info/WHEELPK!H2hieuchre-0.0.dist-info/METADATAPK!Hg*t euchre-0.0.dist-info/RECORDPK 0o