Coder Social home page Coder Social logo

Comments (16)

knoxvilledatabase avatar knoxvilledatabase commented on September 23, 2024 1

Thats awesome!

from justpy.

knoxvilledatabase avatar knoxvilledatabase commented on September 23, 2024

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.

samesand avatar samesand commented on September 23, 2024

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.

elimintz avatar elimintz commented on September 23, 2024

@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.

samesand avatar samesand commented on September 23, 2024

from justpy.

samesand avatar samesand commented on September 23, 2024

@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.

elimintz avatar elimintz commented on September 23, 2024

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.

samesand avatar samesand commented on September 23, 2024

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.

samesand avatar samesand commented on September 23, 2024

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.

elimintz avatar elimintz commented on September 23, 2024

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.

samesand avatar samesand commented on September 23, 2024

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.

elimintz avatar elimintz commented on September 23, 2024

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.

samesand avatar samesand commented on September 23, 2024

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.

elimintz avatar elimintz commented on September 23, 2024

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.

samesand avatar samesand commented on September 23, 2024

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.

elimintz avatar elimintz commented on September 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.