Add basic CSV export, mac db update
This commit is contained in:
@@ -7,3 +7,4 @@ from .login_page import LoginPage
|
||||
from .item_page import ItemPage
|
||||
from .checkin_page import CheckinPage
|
||||
from .checkout_page import CheckoutPage
|
||||
from .export_page import ExportPage
|
||||
@@ -5,8 +5,15 @@ from typing import * # type: ignore
|
||||
|
||||
import rio
|
||||
import datetime
|
||||
from mac_vendor_lookup import AsyncMacLookup
|
||||
|
||||
from mac_vendor_lookup import AsyncMacLookup, MacLookup
|
||||
mac = MacLookup()
|
||||
print("Updating vendors...")
|
||||
try:
|
||||
mac.update_vendors()
|
||||
print("Update complete!")
|
||||
except:
|
||||
print("Update failed, no internet?")
|
||||
pass
|
||||
# from db_classes import *
|
||||
from db_classes import get_location_id, create_item, fancy_location
|
||||
from .. import components as comps
|
||||
|
||||
43
inventory/pages/export_page.py
Normal file
43
inventory/pages/export_page.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import * # type: ignore
|
||||
|
||||
import rio
|
||||
|
||||
from db_classes import *
|
||||
from .. import components as comps
|
||||
import asyncio
|
||||
|
||||
class ExportPage(rio.Component):
|
||||
code: str = ""
|
||||
popup_message: str = ""
|
||||
popup_show: bool = False
|
||||
popup_color: str = 'warning'
|
||||
description: str = ""
|
||||
name: str = ""
|
||||
parent_code: str = ""
|
||||
parent: str = ""
|
||||
|
||||
@rio.event.periodic(1)
|
||||
def set_office_init(self):
|
||||
self.office = self.session[comps.Settings].office
|
||||
#print("Populated:", self.office)
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
return rio.Column(
|
||||
rio.Text(
|
||||
text="Database CSV Below:",
|
||||
style='heading1',
|
||||
align_x = 0.5
|
||||
),
|
||||
rio.MultiLineTextInput(
|
||||
label="CSV",
|
||||
text=dump_csv()
|
||||
),
|
||||
spacing=2,
|
||||
min_width=60,
|
||||
margin_bottom=4,
|
||||
align_x=0.5,
|
||||
align_y=0,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user