Thanks Justin, that makes sense. Giving websockets a try as it sounds the most slick.
On 14 October 2014 13:10, Justin Israel <[email protected]> wrote: > There are a few ways in which a web client can get information from the > application server: > > - ajax requests - Send a request, and get a response > - websockets - Make an initial handshake and then use an open socket > to continue direct communication > - long polling - Make a request that sits on the endpoint, blocking > until it finally gets a response, which indicates that something is ready. > > So when you say you want to get a python dict delivered to your javascript > web client, you have to pick some form of communication for your client and > app server to communicate. Generally you have your set of URL endpoints > that actually deliver the client application to the browser ( > http://foo.com/app) and then you might have a set of URL endpoints for > your API so that your web app can communicate with the backend ( > http://foo.com/app/api/assets) > > > > On Wed, Oct 15, 2014 at 8:59 AM, Marcus Ottosson <[email protected]> > wrote: > >> Hey Justin, >> >> Thanks, that sounds reasonable. But I still can’t grasp how a dictionary >> from the server can be accessed from Javascript, or Angular. >> >> Some psuedo-code: >> >> data = {} # Access from JS? >> >> app = Flask() >> app.start() >> >> In the case of polling, what does JS poll from? >> >> >> On 14 October 2014 11:55, Justin Israel <[email protected]> wrote: >> >>> It wouldn't matter so much if you were using MongoDB, or MySQL, or >>> completely in memory, since that is all behind the application server >>> either way. When you do a put request to the application server, it can >>> then make that information available to other views. >>> In terms of how those other view will know about that new data... That >>> depends on how you want to implement it. Probably the most efficient way is >>> to have your frond end (angular) connect on a websocket to your backend >>> (flask) and receive all of its streaming updates through that. So when >>> another client runs that put request, and your application server is done >>> processing it, all of the connected clients could be updated over their >>> websocket. >>> Other options include long polling from the Web client side to the >>> application server. >>> On 15/10/2014 7:09 AM, "Marcus Ottosson" <[email protected]> >>> wrote: >>> >>>> Back on the topic of a Web Frontent >>>> <https://github.com/abstractfactory/pyblish/issues/99>, thanks to >>>> everyone for the feedback so far, at this point it seems to me to make the >>>> most sense to move forward with Flask for backend, Bootstrap for visuals >>>> and Angular for front-end, all of which seem really cool. >>>> >>>> I’ve managed to mock up a single-page web-app with AngularJS that lists >>>> the contents of a JSON file, as I would imagine it to list the contents of >>>> a JSON request via a RESTful POST. >>>> >>>> https://github.com/pyblish/pyblish-event >>>> >>>> The data is a list of dictionaries. >>>> >>>> [ >>>> { >>>> "name": "Peter01", >>>> "type": "publish", >>>> "source": "c:\\some\\source\\file.mb", >>>> "date": "2014-10-13 15:56:10", >>>> "author": "Marcus Ottosson", >>>> "host": "Autodesk Maya 2015x64 SP2", >>>> "machine": "alienfx" >>>> } >>>> ] >>>> >>>> Angular is great with updating the page whenever the data changes, so I >>>> can interactively modify the list during run-time with very little changes >>>> to the HTML. However, the thing I can’t wrap my head around currently is >>>> how I can send it data thru a RESTful request. >>>> >>>> I’m looking to do this. >>>> >>>> from requests import put, get >>>> put('http://localhost:8888/event', >>>> data={"name": "Peter01", >>>> "type": "publish", >>>> "source": "c:\\some\\source\\file.mb",}).json()) >>>> >>>> And have this data take part in the page at run-time. >>>> >>>> What can I do? >>>> >>>> Spontaneously, I was thinking that “if the data is coming from a >>>> database, such as MongoDB, and if I could make Angular update whenever the >>>> database changes I could also communicate with it through Python and in >>>> that way balance the equation”. But ideally I’d like to keep all data in >>>> memory initially, until I can find a valid enough reason to transition into >>>> using a database. Would MongoDB be suited for this? Is there a more suited >>>> alternative? >>>> >>>> Best, >>>> Marcus >>>> >>>> >>>> On 2 October 2014 02:02, Marcus Ottosson <[email protected]> >>>> wrote: >>>> >>>>> I hear that term referred to as “bubble up” >>>>> >>>>> This is a good term. I’ve also heard of it as “trickle down”. I >>>>> suppose it depends on how you envision the dependency graph in your mind; >>>>> either as starting from the root of a tree heading up towards the leaves >>>>> or >>>>> heading down along its roots. :) >>>>> >>>>> >>>>> On 2 October 2014 09:59, Marcus Ottosson <[email protected]> >>>>> wrote: >>>>> >>>>>> Does that at all fit into what you are talking about? I could be off >>>>>> base. >>>>>> >>>>>> Yeah, those are some of the scenarios I’d expect this feature to >>>>>> fulfill and yeah, it is quite involved and should probably involve a >>>>>> separate, dedicated versioning library. >>>>>> >>>>>> For the evaluation of versions, such as being either “latest” and >>>>>> “approved”, I’d assume the presence of other pipeline tools as it’s >>>>>> outside >>>>>> the scope of Pyblish. Physically updating an asset is most likely also >>>>>> outside this scope too. >>>>>> >>>>>> However, I would expect such a process to ultimately produce one or >>>>>> more absolute paths to files in need of updating. This is what Pyblish >>>>>> would use to ultimately produce a new version and allow users to monitor >>>>>> the results, along with distributing the action to a farm or a background >>>>>> process. Pyblish is ultimately about quality controlling assets. >>>>>> >>>>>> In practice, I would imagine seeing an extension to Pyblish that >>>>>> implements rudimentary versioning, so as to get the feature off the >>>>>> ground, >>>>>> that would ultimately be replaced with whichever library a studio is >>>>>> currently using (if any). >>>>>> >>>>>> >>>>>> On 2 October 2014 09:34, Justin Israel <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> I hear that term referred to as "bubble up". I suppose there are a >>>>>>> few different scenarios depending on how you represent and manage your >>>>>>> assets. If your assets capture and store the references to its >>>>>>> dependencies >>>>>>> in a version-specific way, then updating one dependency might trigger >>>>>>> the >>>>>>> others to need to republish. Or, if your assets evaluate dynamically at >>>>>>> runtime on concepts such as the "latest" or "approved" or "official" >>>>>>> type >>>>>>> aliases, then they can always pick up the appropriate reference at the >>>>>>> time >>>>>>> they are used. An example would be a scene asset which contains 2 >>>>>>> character >>>>>>> assets. If the scene refers to the characters by way of an alias to the >>>>>>> "latest", then each time the scene is opened/rendered it would pick >>>>>>> those >>>>>>> up. Where as if that scene referenced specific versions like "char1_v2" >>>>>>> and >>>>>>> "char2_v3", then a bubble-up process might be necessary to republish the >>>>>>> scene with new references (or a manual update triggered within the >>>>>>> scene). >>>>>>> >>>>>>> Does that at all fit into what you are talking about? I could be off >>>>>>> base. >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Thu, Oct 2, 2014 at 8:51 PM, Marcus Ottosson < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> Dependencies and Cascading Updates >>>>>>>> >>>>>>>> Hi guys, >>>>>>>> >>>>>>>> I’m looking for another pair of eyes on a potential feature. >>>>>>>> >>>>>>>> [image: Inline images 1] >>>>>>>> >>>>>>>> In short, it involves automatically updating assets A, B and C >>>>>>>> which depend on another asset D, when asset D is updated. >>>>>>>> >>>>>>>> - https://github.com/abstractfactory/pyblish/issues/113 >>>>>>>> >>>>>>>> Questions >>>>>>>> >>>>>>>> - >>>>>>>> >>>>>>>> Is this a problem worth solving? >>>>>>>> - >>>>>>>> >>>>>>>> Have you encountered it before? >>>>>>>> - Have you solved it before? >>>>>>>> - Can you spot any issues? >>>>>>>> >>>>>>>> Best, >>>>>>>> Marcus >>>>>>>> >>>>>>>> >>>>>>>> On 30 September 2014 18:38, Marcus Ottosson <[email protected] >>>>>>>> > wrote: >>>>>>>> >>>>>>>>> Hey Asi, >>>>>>>>> >>>>>>>>> I think you forgot to attach the diagram. >>>>>>>>> >>>>>>>>> I find it helps leave the little technical details for a second >>>>>>>>> >>>>>>>>> Not sure I can get less technical than the animation of the >>>>>>>>> end-result. :) >>>>>>>>> https://github.com/abstractfactory/pyblish/issues/99 >>>>>>>>> >>>>>>>>> Is there anything in particular that you find fuzzy? >>>>>>>>> >>>>>>>>> Best, >>>>>>>>> Marcus >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> *Marcus Ottosson* >>>>>>>> [email protected] >>>>>>>> >>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "Python Programming for Autodesk Maya" group. >>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>> send an email to [email protected]. >>>>>>>> To view this discussion on the web visit >>>>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBVNEGRk2XvUTn6eDw4-biefv66BY60prSejWzRNmovzg%40mail.gmail.com >>>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBVNEGRk2XvUTn6eDw4-biefv66BY60prSejWzRNmovzg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>>>>> . >>>>>>>> >>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>> >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Python Programming for Autodesk Maya" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to [email protected]. >>>>>>> To view this discussion on the web visit >>>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0zdoGyZ43bLzZSE16s4Npru5NTwkickh2uiftZF%2BUsww%40mail.gmail.com >>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0zdoGyZ43bLzZSE16s4Npru5NTwkickh2uiftZF%2BUsww%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>>>> . >>>>>>> >>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> *Marcus Ottosson* >>>>>> [email protected] >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> *Marcus Ottosson* >>>>> [email protected] >>>>> >>>> >>>> >>>> >>>> -- >>>> *Marcus Ottosson* >>>> [email protected] >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Python Programming for Autodesk Maya" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCiQXmx3k2zEK1Ku-Y%3DriNnQVbwH0TDN3XTuEnz0ww4Rg%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCiQXmx3k2zEK1Ku-Y%3DriNnQVbwH0TDN3XTuEnz0ww4Rg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Python Programming for Autodesk Maya" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2owGMGWAvjb57_5a1EQgzU1nzLEyc9wKoJuEXDLj9Jyg%40mail.gmail.com >>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2owGMGWAvjb57_5a1EQgzU1nzLEyc9wKoJuEXDLj9Jyg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> *Marcus Ottosson* >> [email protected] >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCF65HhosCB_mi%3DeCLqGU8aK37E8Kb82bTJh5sOGn8c8w%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCF65HhosCB_mi%3DeCLqGU8aK37E8Kb82bTJh5sOGn8c8w%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0U9GWGBh46ytkKojAYArMNSuaNPNZ7bLxErHUycgucEg%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0U9GWGBh46ytkKojAYArMNSuaNPNZ7bLxErHUycgucEg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAuT%3Dpq3aL_pb%3DC%3DfSAtm-WjgO2vg_--8Y7vfdhc408xA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
