Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 24 2019 18:33

    tryexceptpass on bootstrap4

    gitignore update (compare)

  • Oct 14 2019 04:21
    screamingskulls opened #96
  • Sep 28 2019 14:43

    tryexceptpass on bootstrap4

    Layout section complete Completed abbr, cite, address, … No longer appending to children… and 3 more (compare)

  • Jul 23 2019 15:16
    giodegas opened #95
  • Apr 12 2019 05:14
    MisterY commented #94
  • Apr 12 2019 05:02
    MisterY commented #94
  • Apr 11 2019 23:34
    tryexceptpass commented #94
  • Apr 10 2019 11:24
    MisterY commented #94
  • Apr 10 2019 00:16
    tryexceptpass commented #94
  • Apr 07 2019 10:01
    MisterY edited #94
  • Apr 07 2019 10:00
    MisterY edited #94
  • Apr 07 2019 09:58
    MisterY edited #94
  • Apr 07 2019 09:57
    MisterY opened #94
  • Jan 08 2019 03:22

    tryexceptpass on master

    Updated requirements.txt to web… (compare)

  • Jul 24 2018 03:11

    tryexceptpass on bootstrap4

    Partially working (compare)

  • Jul 11 2018 13:40

    tryexceptpass on bootstrap4

    started on bootstrap4 (compare)

  • May 17 2018 21:37
    tryexceptpass closed #93
  • May 17 2018 21:37
    tryexceptpass commented #93
  • May 17 2018 21:36

    tryexceptpass on master

    * Added gettext(), getattribute… (compare)

  • May 17 2018 21:35
    tryexceptpass commented #93
Akshay Verma
@aeroaks
I have tried it for 2 projects earlier and want to try it for sofi this time.
I have Windows as one of available PC so can definitely help with the packaging of that!
Cristian Medina
@tryexceptpass_twitter
You'll have to grab a binary distribution from the CEF project and compile cefsimple with it. The build instructions should be in the downloaded code. You can follow the general you have that as an executable, it's a matter of putting it in a directory within Sofi and running pyinstaller with extra data file mapping parameters that will copy in the executable.
One
You can follow the general build instructions in my medium post.
Once everything is ready for packaging, have a look at sofi.app.Sofi it has a start() function that runs the cefsimple stuff you built, so you'll have to update it so it points to the correct directory / file
Cristian Medina
@tryexceptpass_twitter
Hope that helps, not near my computer at the moment, I can get you more details later
Akshay Verma
@aeroaks
thanks! I am trying to follow the article and got stuck at building cefsimple from the binary on Windows
will keep you updated
Akshay Verma
@aeroaks
Got it working! i have the 'cefsimple.exe' now
Akshay Verma
@aeroaks
now looking into pyinstaller spec file
Cristian Medina
@tryexceptpass_twitter
Cool!
Akshay Verma
@aeroaks
I want to know how you dealt with the sys._MEIPASS path setting for PyInstaller
I had used something like this:
def resource_path(relative_path):
    """ Get absolute path to resource, works for dev and for PyInstaller """
    try:
        # PyInstaller creates a temp folder and stores path in _MEIPASS
        base_path = sys._MEIPASS
    except Exception:
        base_path = os.path.abspath(".")

    return os.path.join(base_path, relative_path)
Akshay Verma
@aeroaks
are you running the check on sys.frozen only in the build script or within the source code?
Cristian Medina
@tryexceptpass_twitter
Oh wow, I'm sorry I guess I haven't pushed that yet. I could've sworn I did. I'll work it out in a little bit.
However, you're correct though
You have to check sys.frozen to know if you're in a package and then access _
_MEIPASS
You're sample code is close
Cristian Medina
@tryexceptpass_twitter
@aeroaks I pushed my code in finally... thanks for making me realize i didn't have that there
it only has checks for MacOS binaries at the moment, but it's just a matter of filling in the other if blocks for the remaining OSs
you'll want to look at the sofi.app.Sofi.start() method, specifically:
if getattr(sys, 'frozen', False):
    # we are running in a bundle
    path = sys._MEIPASS
    if sys.platform == 'linux':
        pass
    elif sys.platform == 'windows':
        pass
    else:
        # Assume Mac?
        subprocess.Popen([os.path.join(path, 'browser.app/Contents/MacOS/cefsimple'),
                          '--url=file://' + os.path.join(path, 'sofi/app/main.html')])
Akshay Verma
@aeroaks
@tryexceptpass_twitter Thanks for the Push. I will have look and try to implement it!
Akshay Verma
@aeroaks
I tried running the sample.py without bundling it... will push that first, In the meanwhile i would work on the script for pyinstaller
Akshay Verma
@aeroaks
Also, Is ii not good when we are trying out these builds, but should there not be a folder, guide or some example so that the user has a standard reference? Also does not face errors like not knowing about the path browser.app/Contents/MacOS/cefsimple when he is bundling on his own...?
and also, I would like to get my head around this async thing in Python! That was also a reason to get involved with this project! Do you have any suggestions? (one thing being I learn quicker When I implement it, are than first understanding how it works in detail!)
Akshay Verma
@aeroaks
image.png
Hi, trying to bundle sample.py, got this on closing the cefsimple window:
Is that something to look into on my side? other than that got it working, included:
dll_binaries = [('browser.app\\Contents\\win32\\*', '.')] - for cefsimple

datas = [('sofi\\app\\main.html', 'sofi\\app'),
              ('sofi\\app\\sofi.js', 'sofi\\app')] - for main.html, sofi.js
Akshay Verma
@aeroaks
I was going through the internet and came across Remi. have you seen this? How do you distinguish , if at all, from this approach? and what are the differences?
Cristian Medina
@tryexceptpass_twitter
Yes,someone pointed me to Remi after I wrote my first article last year.
I don't remember the internals, but my observations were two-fold:
1- they make their own widgets, or expect the user to, while Sofi ties to Bootstrap instead, giving you common things that are already known and tested to start from. It's also not to hard to write your own UI layer using something else.
Cristian Medina
@tryexceptpass_twitter
2- for me, generating websites is just one of the things to do, a place to start. My ultimate goal was to see how flexible I could make the protocol su j that I could extend it to 3d game engines, which I've done in my latest post.
Now it's a matter of figuring out how to get people to contribute standard assets that could serve for general purpose applications
Akshay Verma
@aeroaks
Thanks for the explanation! I did come across both sofi and remi, but what got me interested was the async part. From what little i have understood, remi uses standard python libraries, not async, to serve your pages. I have not looked into the event handling part.
I would like to go deeper into this project! I think that would help me in my async understanding.
regarding the pyinstaller packaging, do you want to release it as a guide or a pre-build script ??
Cristian Medina
@tryexceptpass_twitter
Yes async is definitely a plus, and it can get confusing if you've never fiddled with it before, so let me know if you have any questions
For the packaging, I think a guide is a good start. I did have that one Medium article that went over generic packaging, but I wouldn't mind sticking it in a doc (I have some draft docs I need to push that might be a good place to start)... I think a script can get interesting unless we put precompiled cefsimple up somewhere, which I can now do after getting an S3 account for the Unity 3D version of this. We can start with a guide though and then move over to a helper script.
Akshay Verma
@aeroaks
sounds great!
ben kozuch
@ben_kozuch_twitter
What an awesome project!!!
Cristian Medina
@tryexceptpass_twitter
glad you like it
Alistair Buxton
@ali1234
hi
Alistair Buxton
@ali1234
how can i use sofi over the network?
Alistair Buxton
@ali1234
how do i prevent it from silently catching all exceptions?
Alistair Buxton
@ali1234
i got it working over the network by modifying the websocket url in sofi.js, but now there is a 30 second delay between loading main.html and receiving the gui
according to the browser console this is not server side, it's the js doing it
Alistair Buxton
@ali1234
also it does not happen in chromium