Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remap and upload to PyPi with new Kivy-Garden rules #20

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ the panel widgets.

See the example and docstrings for information on individual properties.

# Install
```sh
pip install kivy-garden.navigationdrawer
```

# Example::
# Example

from kivy.app import App
from kivy.base import runTouchApp
Expand Down
83 changes: 83 additions & 0 deletions examples/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from kivy.app import App
from kivy.base import runTouchApp
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.image import Image
from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.metrics import dp

from kivy_garden.navigationdrawer import NavigationDrawer

class ExampleApp(App):

def build(self):
navigationdrawer = NavigationDrawer()

side_panel = BoxLayout(orientation='vertical')
side_panel.add_widget(Label(text='Panel label'))
side_panel.add_widget(Button(text='A button'))
side_panel.add_widget(Button(text='Another button'))
navigationdrawer.add_widget(side_panel)

label_head = (
'[b]Example label filling main panel[/b]\n\n[color=ff0000](p'
'ull from left to right!)[/color]\n\nIn this example, the le'
'ft panel is a simple boxlayout menu, and this main panel is'
' a BoxLayout with a label and example image.\n\nSeveral pre'
'set layouts are available (see buttons below), but users ma'
'y edit every parameter for much more customisation.')
main_panel = BoxLayout(orientation='vertical')
label_bl = BoxLayout(orientation='horizontal')
label = Label(text=label_head, font_size='15sp',
markup=True, valign='top')
label_bl.add_widget(Widget(size_hint_x=None, width=dp(10)))
label_bl.add_widget(label)
label_bl.add_widget(Widget(size_hint_x=None, width=dp(10)))
main_panel.add_widget(Widget(size_hint_y=None, height=dp(10)))
main_panel.add_widget(label_bl)
main_panel.add_widget(Widget(size_hint_y=None, height=dp(10)))
main_panel.add_widget(Image(source='red_pixel.png', allow_stretch=True,
keep_ratio=False, size_hint_y=0.2))
navigationdrawer.add_widget(main_panel)
label.bind(size=label.setter('text_size'))

def set_anim_type(name):
navigationdrawer.anim_type = name
modes_layout = BoxLayout(orientation='horizontal')
modes_layout.add_widget(Label(text='preset\nanims:'))
slide_an = Button(text='slide_\nabove_\nanim')
slide_an.bind(on_press=lambda j: set_anim_type('slide_above_anim'))
slide_sim = Button(text='slide_\nabove_\nsimple')
slide_sim.bind(on_press=lambda j: set_anim_type('slide_above_simple'))
fade_in_button = Button(text='fade_in')
fade_in_button.bind(on_press=lambda j: set_anim_type('fade_in'))
reveal_button = Button(text='reveal_\nbelow_\nanim')
reveal_button.bind(on_press=
lambda j: set_anim_type('reveal_below_anim'))
slide_button = Button(text='reveal_\nbelow_\nsimple')
slide_button.bind(on_press=
lambda j: set_anim_type('reveal_below_simple'))
modes_layout.add_widget(slide_an)
modes_layout.add_widget(slide_sim)
modes_layout.add_widget(fade_in_button)
modes_layout.add_widget(reveal_button)
modes_layout.add_widget(slide_button)
main_panel.add_widget(modes_layout)

button = Button(text='toggle NavigationDrawer state (animate)',
size_hint_y=0.2)
button.bind(on_press=lambda j: navigationdrawer.toggle_state())
button2 = Button(text='toggle NavigationDrawer state (jump)',
size_hint_y=0.2)
button2.bind(on_press=lambda j: navigationdrawer.toggle_state(False))
button3 = Button(text='toggle _main_above', size_hint_y=0.2)
button3.bind(on_press=navigationdrawer.toggle_main_above)
main_panel.add_widget(button)
main_panel.add_widget(button2)
main_panel.add_widget(button3)

return navigationdrawer

ExampleApp().run()
File renamed without changes
File renamed without changes
File renamed without changes.
1 change: 1 addition & 0 deletions kivy_garden/navigationdrawer/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.0.1'
6 changes: 6 additions & 0 deletions kivy_garden/navigationdrawer/tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest


def test_flower():
from kivy_garden.navigationdrawer import NavigationDrawer
widget = NavigationDrawer()
56 changes: 56 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""See README.md for package documentation."""

from setuptools import setup, find_namespace_packages

from io import open
from os import path

here = path.abspath(path.dirname(__file__))

filename = path.join(here, 'kivy_garden', 'navigationdrawer', '_version.py')
locals = {}
with open(filename, "rb") as fh:
exec(compile(fh.read(), filename, 'exec'), globals(), locals)
__version__ = locals['__version__']

with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

URL = 'https://github.com/Tungsteno74/navigationdrawer'

setup(
name='kivy_garden.navigationdrawer',
version=__version__,
description='Android Side Panel like widget.',
long_description=long_description,
long_description_content_type='text/markdown',
url=URL,
author='Kivy',
author_email='[email protected]',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
keywords='Kivy kivy-garden',

packages=find_namespace_packages(include=['kivy_garden.*']),
install_requires=[],
extras_require={
'dev': ['pytest>=3.6', 'pytest-cov', 'pytest-asyncio',
'sphinx_rtd_theme'],
'ci': ['coveralls', 'pycodestyle'],
},
package_data={'':['navigationdrawer_gradient_ltor.png', 'navigationdrawer_gradient_rtol.png']},
data_files=[],
entry_points={},
project_urls={
'Bug Reports': URL + '/issues',
'Source': URL,
},
)