Git Product home page Git Product logo

jbrout3's Introduction

My attempt to port the good old jbrout/py2/gtk to python3/guy's web app.

Currently, it's in pre-alpha stage : USE AT YOUR OWN RISK ;-)

The idea : The old jbrout used gtk with python2 (there are a lot of works to port it to python3, with gobject changes). This version use guy, which will make it completly independant of the OS. It will reuse your chrome installation, to run a windowed version of jbrout. The frontend is full html/js/css, using vuejs + vuex. It communicates with the serverside thru a websocket. The serverside use the good olds python apis.

BTW, it will be possible to use cefpython3, to make a standalone version. And it will be possible to run jbrout headless (server mode), and use it thru any browsers (but we will need to handle session/multi-users).

Currently, it uses the simplest way : you will need to have a chrome/chromium installed.

With some little changes : "the path to your jbrout/conf", you should be able to test it against your old conf (except the jbrout.conf). It works !

To run it :

In your env:

$ git clone https://github.com/manatlan/jbrout3.git
$ cd jbrout3
$ python3 -m pip install -r requirements.txt
$ python3 jbrout.py

In a python3's virtualenv:

$ python3 -m venv FOLDER
$ cd FOLDER
$ source bin/activate
$ git clone https://github.com/manatlan/jbrout3.git
$ cd jbrout3
$ python3 -m pip install -r requirements.txt
$ python3 jbrout.py

On Windows:

install "jpegtran.exe" (will be embedded in the futur/final executable)

On others OS:

sudo apt-get install exiftran

jbrout3's People

Contributors

manatlan avatar mcepl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jbrout3's Issues

We really shouldn't expect $PWD is the directory jbrout.py is stored in

After running python3 setup.py develop --user and then running jbrout from my standard $PATH I get:

matej@stitny: ~$ jbrout
Will accept : ["......archiv.knihovna.repos.jbrout3.index: ['_render', 'addFolder', 'cfgGet', 'cfgSet', 'getFolders', 'getTags', 'getYear', 'getYears', 'photoBasket', 'photoRebuildThumbnail', 'photoRotateLeft', 'photoRotateRight', 'refreshFolder', 'removeBasket', 'removeFolder', 'request', 'selectFromBasket', 'selectFromFolder', 'selectFromTags', 'tagsAddCat', 'tagsAddTag', 'tagsDelCat', 'tagsDelTag', 'set', 'get']"]
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
[19660:19660:1217/073816.504978:ERROR:vaapi_wrapper.cc(324)] vaInitialize failed: unknown libva error
[19660:19660:1217/073816.535212:ERROR:sandbox_linux.cc(364)] InitializeSandbox() called with multiple threads in process gpu-process.
[19629:19629:1217/073816.787973:ERROR:x11_input_method_context_impl_gtk.cc(144)] Not implemented reached in virtual void libgtkui::X11InputMethodContextImplGtk::SetSurroundingText(const string16&, const gfx::Range&)
ERROR:aiohttp.server:Error handling request
Traceback (most recent call last):
  File "/home/matej/.local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start
    resp = await self._request_handler(request)
  File "/home/matej/.local/lib/python3.6/site-packages/aiohttp/web_app.py", line 366, in _handle
    resp = await handler(request)
  File "/home/matej/.local/lib/python3.6/site-packages/wuy.py", line 336, in handleWeb
    html=currents[name]._render( path(os.path.dirname(ressource)) )
  File "/home/matej/archiv/knihovna/repos/jbrout3/jbrout.py", line 109, in _render
    with open( os.path.join(path,"web","index.html") ) as fid:
FileNotFoundError: [Errno 2] No such file or directory: '/home/matej/.local/bin/web/index.html'
INFO:aiohttp.access:::1 [17/Dec/2018:06:38:16 +0000] "GET /......archiv.knihovna.repos.jbrout3.index.html?838e8aa89e13416696144f2329d9ee91 HTTP/1.1" 500 330 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36"
[19629:19652:1217/073817.271974:ERROR:nss_util.cc(748)] After loading Root Certs, loaded==false: NSS error code: -8018
[19660:19660:1217/073820.861106:ERROR:gl_surface_presentation_helper.cc(237)] GetVSyncParametersIfAvailable() failed!

^C<jbrout.index object at 0x7f3bbc5288d0>
matej@stitny: ~$

I guess jbrout still expects to be run from the code directory. It shouldn't. If you need to find the directory where the actual code is located you need to use os.path.dirname(__file__).

For fixing, there is too much magic for my taste in wuy. Where does path on line 107 come from?

"Loading data (just wait)" forever.

matej@stitny: jbrout3 (master *)$ ./jbrout.py 
Will accept : ["index: ['_render', 'addFolder', 'getFolders', 'getTags', 'photoRebuildThumbnail', 'photoRotateLeft', 'photoRotateRight', 'request', 'selectFromBasket', 'selectFromFolder', 'selectFromTags', 'set', 'get']"]
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
[17371:17371:1215/230523.430710:ERROR:vaapi_wrapper.cc(324)] vaInitialize failed: unknown libva error
[17371:17371:1215/230523.456484:ERROR:sandbox_linux.cc(364)] InitializeSandbox() called with multiple threads in process gpu-process.
[17340:17340:1215/230523.706188:ERROR:x11_input_method_context_impl_gtk.cc(144)] Not implemented reached in virtual void libgtkui::X11InputMethodContextImplGtk::SetSurroundingText(const string16&, const gfx::Range&)
INFO:aiohttp.access:::1 [15/Dec/2018:22:05:23 +0000] "GET /index.html?1a5fd2d025424ef6bec3d8389c79237c HTTP/1.1" 200 26286 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36"
- serve wuy.js to index (with resize to (1100, 800))
INFO:aiohttp.access:::1 [15/Dec/2018:22:05:23 +0000] "GET /wuy.js HTTP/1.1" 200 4524 "http://localhost:8080/index.html?1a5fd2d025424ef6bec3d8389c79237c" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36"
! 404 on /home/matej/archiv/knihovna/repos/jbrout3/libs/web/vue.min.js
INFO:aiohttp.access:::1 [15/Dec/2018:22:05:23 +0000] "GET /libs/vue.min.js HTTP/1.1" 404 172 "http://localhost:8080/index.html?1a5fd2d025424ef6bec3d8389c79237c" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36"
! 404 on /home/matej/archiv/knihovna/repos/jbrout3/libs/web/vuex.min.js
INFO:aiohttp.access:::1 [15/Dec/2018:22:05:23 +0000] "GET /libs/vuex.min.js HTTP/1.1" 404 172 "http://localhost:8080/index.html?1a5fd2d025424ef6bec3d8389c79237c" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36"
Socket connected index
[17340:17361:1215/230523.805542:ERROR:nss_util.cc(748)] After loading Root Certs, loaded==false: NSS error code: -8018
[17371:17371:1215/230527.779304:ERROR:gl_surface_presentation_helper.cc(237)] GetVSyncParametersIfAvailable() failed!
[17371:17371:1215/230533.648282:ERROR:gl_surface_presentation_helper.cc(237)] GetVSyncParametersIfAvailable() failed!
[17371:17371:1215/230533.662857:ERROR:gl_surface_presentation_helper.cc(237)] GetVSyncParametersIfAvailable() failed!

Downloaded commit 7d7e72c, made an obligatory change (could we make it permanent?):

diff --git a/jbrout.py b/jbrout.py
index f071ff9..a5359c5 100755
--- a/jbrout.py
+++ b/jbrout.py
@@ -91,7 +91,7 @@ if __name__=="__main__":
     #~ api.init("/home/manatlan/.local/share/ijbrout/")   #copy of the original jbrout
     #~ index(log=False)
 
-    api.init("./tempconf")
+    api.init(os.path.expanduser("~/.local/share/jbrout"))
     index(log=True) #log to False, speedify a lot ;-), but when debugguing, it's hard ;-)
     api.save()

but when run ./jbrout.py and this is the result. Any thoughts? What does this mean?

libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)

ModuleNotFoundError: No module named 'pyexiv2'

Hi,
I'm trying to run jbrout3 on mageia7 (because there is no more pyexiv2 rpm for jbrout-0.2.379).
I ran the "In your env" instructions and switched to root in order to run succesfully gcc through python3 -m pip install -r requirements.txt (was this really not a good idea ?).

But then, when running

$ python3 ./jbrout.py
Traceback (most recent call last):
  File "./jbrout.py", line 20, in <module>
    from jbapi import JBrout
  File "/home/tonin/jbrout3/jbapi.py", line 17, in <module>
    from libs.db import DBPhotos,DBTags
  File "/home/tonin/jbrout3/libs/db.py", line 31, in <module>
    from .tools import PhotoCmd, supportedFormats
  File "/home/tonin/jbrout3/libs/tools.py", line 33, in <module>
    from . import pyexiv
  File "/home/tonin/jbrout3/libs/pyexiv.py", line 29, in <module>
    import pyexiv2
ModuleNotFoundError: No module named 'pyexiv2'

It looks pyexiv2 is still needed despite of py3exiv2 pip installation.
Do I really need to compile pyexiv2 ?

I don't use/need jbrout anymore ...

Yesterday ... it was my last use of jbrout.
And I used this version to correct some old photos I've got on my hdds (understand that this version is nearly usable).
Yesterday ... I've finnished to migrate all my pictures to "google photos" (free account / unlimited). It's totally amazing to have got access to all my pictures thru my devices (smatphone, nest hub, chromebook ... etc ...). And btw, they are all (automatic)indexed ... so it's definitivly, for me, the best way .. to find (quickly) a group of photos in all circunstance ...
All my photos are now in a "secure" place, (in the cloud) .... I don't say it's the way to go for everybody. But for me (and for my familly) : it's perfect ...
I don't know it I will finnish this port's version, to a well polished/usable(fully) 1.0 version ... or specialize it in an app to correct photos .. only the future knows.

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.