Comments (16)
Thats awesome!
from justpy.
This was already resolved: #33
justpy.env
STATIC_DIRECTORY = static/
TEMPLATES_DIRECTORY = static/templates
Then make a copy of all of the templates from https://github.com/elimintz/justpy/tree/master/justpy/templates
Then download all of the resources and source the path in the template file.
from justpy.
Thanks!
If I'm not using any custom templates, is there any thing else I need to do besides copying the templates and modifying the justpy.env file?
from justpy.
@samesand
Please upgrade to version 0.0.9 (just released today) and add the following line to justpy.env:
NO_INTERNET = True
This is a much more simple solution I hope.
Let me know if this works well for you.
from justpy.
from justpy.
@samesand
Please upgrade to version 0.0.9 (just released today) and add the following line to justpy.env:
NO_INTERNET = True
This is a much more simple solution I hope.
Let me know if this works well for you.
I tried this today after upgrading to 0.0.9, but the client is still asking for internet connection. Is there anything else I need to do in addition to edit the justpy.env?
from justpy.
Could you please post a program you have problems with?
Could be it can't get the default favicon but that shouldn't stop the page from loading. What client are you using?
from justpy.
Actually, I just tested changing the host and the port number using the justpy.env file and it doesn't have any effect, so it seems that it's not reading the configuration file. Here is what I have:
- a justpy.env file on the same folder as my python file
- a line in my python file with config = justpy.Config('justpy.env')
Is there anything else I need?
Thanks.
from justpy.
Could you please post a program you have problems with?
Could be it can't get the default favicon but that shouldn't stop the page from loading. What client are you using?
Google Chrome on Windows 10
from justpy.
I think the problem may be that you added
config = justpy.Config('justpy.env')
to your program. Remove this line and see what happens.
from justpy.
I tried and I got the same result. This is my code:
` import datetime as dt
import time
import probedataextraction as pde
import dataprocessing as dp
import webpageclasses as wpc
import datetime as dt
import pandas as pd
import justpy as jp
import time
import asyncio
LOCATIONS = {
"N_PRB45": 0,
"N_PRB48": 1,
"N_PRB54": 2,
}
tools = {}
wp = jp.WebPage(classes="ml-1", delete_flag=False)
# create containers
row_2 = jp.Div(classes="flex mt-3", a=wp)
row_1 = jp.Div(classes="flex mt-3", a=wp)
cell_1 = jp.Div(classes="flex w-1/2 flex-wrap", a=row_1)
cell_2 = jp.Div(classes="flex w-1/2 flex-wrap", a=row_1)
cell_blank = jp.Div(classes="w-1/2 ml-3", a=row_2)
cell_3 = jp.Div(classes="flex w-1/2 flex-wrap", a=row_2)
# title and clock
title = jp.Div(
text="Probe Dashboard",
classes="max-w-sm text-5xl overflow-hidden text-left",
a=cell_blank,
)
clock = jp.Div(
text="00:00:00",
classes="max-w-sm text-3xl overflow-hidden text-left",
a=cell_blank,
)
cells = [cell_1, cell_2, cell_3]
for tool in LOCATIONS.keys():
tools[tool] = wpc.Tool(tool, cells[LOCATIONS[tool]])
tools[tool].add_chamber(tool)
tools[tool].add_csst(tool)
async def board_update():
while True:
mapfiles = pde.map_files()
standards = pde.standards()
current_state = dp.map_file_summary(mapfiles)
current_state = dp.add_probe_standards(current_state, standards, on="part")
current_state = dp.prober_state(current_state)
tools_dict = current_state.set_index("tool").to_dict(orient="index")
for tool in tools_dict.keys():
tool_data = tools_dict[tool]
if tool_data["state"] in ["short_delay", "long_delay", "completed"]:
elapsed_time = dt.datetime.now() - tool_data["end_dt"]
else:
elapsed_time = dt.datetime.now() - tool_data["start_dt"]
elapsed_time = str(elapsed_time).split(" ")[-1].split(".")[0]
tools[tool].cssts[tool].set_state(tool_data["state"])
tools[tool].cssts[tool].set_lot(tool_data["lot"])
tools[tool].cssts[tool].set_wafer(tool_data["wafer"])
tools[tool].cssts[tool].set_recipe(tool_data["part"])
tools[tool].cssts[tool].set_time(elapsed_time[:-3])
clock.text = dt.datetime.now().strftime("%H:%M")
jp.run_task(wp.update())
await asyncio.sleep(60)
async def board_init():
jp.run_task(board_update())
async def webpage():
return wp
jp.justpy(webpage, startup=board_init)
`
from justpy.
I don't have access to some libraries you are importing so can't run the program.
Try the following simple program:
import justpy as jp
def internet_test():
wp = jp.WebPage()
jp.Hello(a=wp)
return wp
jp.justpy(internet_test)
justpy.env looks like this:
NO_INTERNET = True
I disconnect my internet and it runs. Please try it on your end and let me know what happens.
from justpy.
Try the following simple program:
I tried the program with the same result. I added the HOST and PORT configuration lines to the justpy.env file to see if they had any effect, and they don't, so it seems that it's not reading the juspy.env file or ignoring it.
Thanks for your help.
from justpy.
Could you please check that the file in the directory the program is run from? I can't think of any other reason why this would not work.
from justpy.
Could you please check that the file in the directory the program is run from? I can't think of any other reason why this would not work.
I have the justpy.env in the same folder as the file I posted before. I created the file with notepad.
from justpy.
I'm sorry, I can't think of a reason this would not work. I can't replicate the issue.
from justpy.
Related Issues (20)
- jp.AgGrid.load_lod(lod, columnDefs) overrides user-specified self.options.columnDefs HOT 1
- jp.redirect not working HOT 2
- Allow to redirect to new tab with POST HOT 1
- QEditor 'value' does not update when 'event_propagation=False' HOT 3
- add fastapi support
- build fails in test_route with PlainTextResponse(url) HOT 1
- Qtree doesn't support toggle HOT 4
- Cannot add meta tag to head of the page for mobile friendliness. HOT 1
- PlotlyChart not show
- Unnamed folder under js template
- CI fails due to TypeError: ChromeDriverManager.__init__() got an unexpected keyword argument 'cache_valid_range'
- I want to add the timeout for session in my justpy project. HOT 1
- Store session I'd in cookie HOT 1
- How to store custom cookie in justpy application .
- Question: Authentication with Firebase
- In QSelect multiple option is not working as expected HOT 1
- Announcing ofjustpy: A webdev framework build/derived from justpy (link: https://github.com/ofjustpy/ofjustpy) HOT 3
- Uncaught ReferenceError: JustpyCore is not defined
- Ajax mode doesn't work HOT 1
- The button spinner in the slot is rendered behind the button HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from justpy.