-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04efb7f
commit 500fac7
Showing
36,766 changed files
with
11,723,223 additions
and
10 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 FranciscoCarbonell | ||
|
||
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import xmltodict | ||
|
||
handle = open("13190402419765001915650020000589401000589409.xml","r") | ||
|
||
content = handle.read() | ||
|
||
#print(content) | ||
d = xmltodict.parse(content) | ||
|
||
print('-----------------------------ID NFE-----------------------------') | ||
print(d['nfeProc']['NFe']['infNFe']['ide']['natOp']) | ||
print(d['nfeProc']['NFe']['infNFe']['ide']['cNF']) | ||
print(d['nfeProc']['NFe']['infNFe']['ide']['nNF']) | ||
print(d['nfeProc']['NFe']['infNFe']['ide']['dhEmi']) | ||
|
||
print('-----------------------------EMITENTE DA NFE-----------------------------') | ||
print(d['nfeProc']['NFe']['infNFe']['emit']['CNPJ']) | ||
print(d['nfeProc']['NFe']['infNFe']['emit']['xNome']) | ||
print(d['nfeProc']['NFe']['infNFe']['emit']['xFant']) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
from kivy.lang import Builder | ||
from kivymd.app import MDApp | ||
from kivy.factory import Factory | ||
from menu import ItemWidget | ||
|
||
|
||
Builder.load_string( | ||
''' | ||
#: import LoginScreen screens.login | ||
#: import HomeScreen screens.home | ||
#: import InfoScreen screens.info | ||
#: import ContentDrawer menu | ||
<RootWidget@Screen>: | ||
NavigationLayout: | ||
ScreenManager: | ||
id: screen_manager | ||
LoginScreen: | ||
id: login_screen | ||
name: 'login' | ||
HomeScreen: | ||
id: home_screen | ||
name: 'home' | ||
InfoScreen: | ||
id: information_screen | ||
name: 'information' | ||
MDNavigationDrawer: | ||
id: nav_drawer | ||
ContentDrawer: | ||
id: content_drawer | ||
''' | ||
) | ||
|
||
class ExampleApp(MDApp): | ||
|
||
@property | ||
def nav_drawer(self): | ||
app = self.get_running_app() | ||
return app.root.ids.nav_drawer | ||
|
||
def switch_to(self, screen_name): | ||
app = self.get_running_app() | ||
app.root.screen_manager.current = screen_name | ||
|
||
|
||
def on_start(self): | ||
items = { | ||
"home": { | ||
"text": "Home", | ||
"screen": "home"}, | ||
"information": { | ||
"text":"Informações", | ||
"screen": "information"}, | ||
"close": { | ||
"text": "Fechar", | ||
"screen": ""} | ||
} | ||
|
||
for icon, data in items.items(): | ||
item = ItemWidget(text=data['text'], screen=data['screen'], icon=icon) | ||
self.root.ids.content_drawer.ids.scroll_list.add_widget( | ||
item | ||
) | ||
def build(self): | ||
return Factory.RootWidget() | ||
|
||
if __name__ == '__main__': | ||
ExampleApp().run() |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
from kivymd.uix.list import OneLineAvatarIconListItem, MDList | ||
from kivymd.theming import ThemableBehavior | ||
from kivy.uix.boxlayout import BoxLayout | ||
from kivy.properties import StringProperty | ||
from kivy.lang import Builder | ||
from kivy.app import App | ||
|
||
Builder.load_string( | ||
''' | ||
<ItemWidget>: | ||
theme_text_color: "Custom" | ||
text_color: app.theme_cls.text_color | ||
IconLeftWidget: | ||
theme_text_color: "Custom" | ||
text_color: root.text_color | ||
icon: root.icon | ||
<ContentDrawer>: | ||
orientation: "vertical" | ||
FloatLayout: | ||
size_hint_y: None | ||
height: "200dp" | ||
BoxLayout: | ||
id: box_image | ||
x: root.x | ||
pos_hint: {"top": 1} | ||
FitImage: | ||
source: "menu.png" | ||
MDLabel: | ||
text: "Header Text" | ||
size_hint_y: None | ||
height: self.texture_size[1] | ||
x: root.x + 10 | ||
y: root.height - box_image.height + dp(10) | ||
ScrollView: | ||
ScrollList: | ||
id: scroll_list | ||
''' | ||
) | ||
|
||
|
||
class ScrollList(ThemableBehavior, MDList): | ||
def set_item_selected(self, instance): | ||
for item in self.children: | ||
if item.text_color == self.theme_cls.primary_color: | ||
item.text_color = self.theme_cls.text_color | ||
break | ||
instance.text_color = self.theme_cls.primary_color | ||
|
||
|
||
class ItemWidget(OneLineAvatarIconListItem): | ||
icon = StringProperty() | ||
screen = StringProperty() | ||
|
||
def on_release(self): | ||
self.parent.set_item_selected(self) | ||
app = App.get_running_app() | ||
if self.screen: | ||
app.root.ids.screen_manager.current = self.screen | ||
app.root.ids.nav_drawer.set_state() | ||
|
||
class ContentDrawer(BoxLayout): | ||
pass |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
from kivymd.app import MDApp | ||
from kivy.lang import Builder | ||
from kivy.uix.screenmanager import Screen | ||
from kivymd.uix.list import MDList, TwoLineIconListItem | ||
from kivy.properties import StringProperty | ||
|
||
|
||
Builder.load_string( | ||
''' | ||
<IconItemWidget>: | ||
IconLeftWidget: | ||
icon:root.icon | ||
<HomeScreen>: | ||
BoxLayout: | ||
orientation: 'vertical' | ||
MDToolbar: | ||
id: toolbar | ||
title: "Aplicação de exemplo" | ||
elevation: 10 | ||
left_action_items: [["menu", lambda x: app.nav_drawer.set_state('toggle')]] | ||
BoxLayout: | ||
orientation: 'vertical' | ||
BoxLayout: | ||
size_hint_y:.3 | ||
Image: | ||
source: 'company.png' | ||
keep_ratio: False | ||
allow_stretch: True | ||
BoxLayout: | ||
ScrollView: | ||
MDList: | ||
size_hint_y: None | ||
height: dp(100) | ||
id: list_items | ||
''' | ||
) | ||
|
||
|
||
class IconItemWidget(TwoLineIconListItem): | ||
name = StringProperty() | ||
|
||
def __init__(self, text, secondary, icon, name): | ||
self.text = text | ||
self.icon = icon | ||
self.secondary_text = secondary | ||
self.name = name | ||
super().__init__() | ||
|
||
|
||
class HomeScreen(Screen): | ||
|
||
def on_enter(self): | ||
items = { | ||
"email": { | ||
"text": "Email", | ||
"secondary": "[email protected]", | ||
"name": 'email_screen' | ||
}, | ||
"facebook": { | ||
"text": "Home", | ||
"secondary": "link to facebook", | ||
"name": 'facebook_screen' | ||
}, | ||
"twitter": { | ||
"text": "Twitter", | ||
"secondary": "link to Twitter", | ||
"name": "twitter_screen" | ||
}, | ||
"git": { | ||
"text": "Git", | ||
"secondary": "link to Git", | ||
"name": "git_screen" | ||
}, | ||
"lock": { | ||
"text": "Git", | ||
"secondary": "link to Git", | ||
"name": "git_screen" | ||
}, | ||
"clock": { | ||
"text": "Git", | ||
"secondary": "link to Git", | ||
"name": "git_screen" | ||
} | ||
|
||
} | ||
app = MDApp.get_running_app() | ||
list_items = app.root.ids.home_screen.ids.list_items | ||
for icon, data in items.items(): | ||
item = IconItemWidget( | ||
text=data['text'], | ||
secondary=data['secondary'], | ||
icon=icon, | ||
name=data['name'] | ||
) | ||
list_items.add_widget(item) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
from kivymd.app import MDApp | ||
from kivy.lang import Builder | ||
from kivy.uix.screenmanager import Screen | ||
from kivymd.uix.list import MDList, ThreeLineIconListItem | ||
from kivy.properties import StringProperty | ||
|
||
import requests | ||
import json | ||
|
||
Builder.load_string(''' | ||
<InfoScreen>: | ||
BoxLayout: | ||
orientation: 'vertical' | ||
MDToolbar: | ||
id: toolbar | ||
pos_hint: {"top": 1} | ||
title: "Aplicação de exemplo" | ||
elevation: 10 | ||
left_action_items: [["menu", lambda x: app.nav_drawer.set_state('toggle')]] | ||
BoxLayout: | ||
ScrollView: | ||
MDList: | ||
id: list_states | ||
Widget: | ||
''') | ||
|
||
|
||
class InfoScreen(Screen): | ||
|
||
def on_enter(self): | ||
url = 'https://covid19-brazil-api.now.sh/api/report/v1' | ||
|
||
response = requests.get(url) | ||
status_code = response.status_code | ||
content_json = response.json() | ||
#print(json.dumps(content_json['data'], indent=4)) | ||
|
||
i=0 | ||
app = MDApp.get_running_app() | ||
print(app.root.ids, '<<<<<========') | ||
list_states = app.root.ids.information_screen.ids.list_states | ||
|
||
for state in content_json['data']: | ||
items = ThreeLineIconListItem(text=content_json['data'][i]['state'], | ||
secondary_text='Casos de COVID-19: ' + str(content_json['data'][i]['cases']), | ||
tertiary_text='Casos suspeitos: ' + str(content_json['data'][i]['suspects'])) | ||
list_states.add_widget(items) | ||
|
||
i+=1 | ||
pass | ||
|
Binary file not shown.
Oops, something went wrong.