How to get WeasyPrint working with Google App Engine - google-app-engine

I'm new to GAE, WeasyPrint and Python. I realise that WeasyPrint relies on quite a few dependences. I have had a look at the install documentation for Windows. But I cant seem to figure out how I would get it working on GAE. Is there no way to download an version with all the dependencies included and just copy it to my project folder?

Its not possible to run WeasyPrint directly on appengine. You should always read the docs on the dependencies. WeasyPrint is dependent on cairo and pango which are 'c' based libs. You can only run pure python libraries that you supply. There are some directly supported python libraries that do have some 'c' that are supported like PIL and libxml. But that isn't enough for WeasyPrint.

Related

How to install cinterop tool in Windows/Ubuntu

I am following this tutoriel to use C library in Kotlin (Android Studio) https://jonnyzzz.com/blog/2018/05/28/minimalistic-kn/ But I can’t find the how to install/download the cinterop tool both in Windows and Ubuntu I have the error “cinterop: command not found” ! Does anybody please knows how to install cinterop ? Thank you in advance
This tool is a part of the kotlin-native distribution, and it does not make any sense to use it without the Kotlin/Native compiler. So, in fact, you would like to get all the distribution here, and install it correctly.There are three main approaches to the Kotlin/Native installation. All of them are described in the documentation.
Installing it with the IntelliJ IDEA. You should just get an IDE and let it install everything on its own. It will download all tools and put them to the following location: ~/.konan/kotlin-native-prebuilt-<osName>-<kotlinVersion>/bin/. Then you will be able to add this folder to your PATH and call the tool from CLI.
Installing using the Gradle build system. Quite similar, but this one will require manual installation of the Gradle. The first run will also download all tools and pack them to the same location as in the IDE case.
Installing the CLI tool. This looks like the most appropriate way to follow the tutorial, but won't help a lot when you start working on more sophisticated projects. In general, you should just download the latest version of the Kotlin/Native, unpack it to some folder and add this folder to your PATH.

New App Engine SDK unable to utilize / find locally installed Python Imaging Library

Yesterday I updated my google cloud SDK along with the python runtime. Now an app I was able to run locally in the SDK complains about the PIL / Python Imaging Library not being available:
bash-3.2$ dev_appserver.py . --host=0.0.0.0
INFO 2014-05-31 17:07:52,313 devappserver2.py:706] Skipping SDK update check.
WARNING 2014-05-31 17:07:52,319 api_server.py:378] Could not initialize images API; you are likely missing the Python "PIL" module.
Not true, however. I DO have PIL installed and it works swimmingly with jpegs, which is what I expect:
bash-3.2$ ipython
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
In [1]: from PIL import Image
In [2]: my_image = Image.open('motorcycle.jpg')
In [3]: my_image.show()
Works just fine. FWIW, I declare my app.yaml use of PIL as such:
libraries:
...
- name: webapp2
version: latest
- name: PIL
version: latest
I've tested it, so it's not a false negative. When I try to use the GAE images module, it's blows up with the same problem. It works just fine in production. Clearly Python has what it needs to work. Why is App Engine unable to make use of it?
The problem I was having had to do with having a clash between a brew version of python installed versus the system version. Fixing my shell's path to point to the correct python installation sorted this problem, too. For GAE users: I also had to make sure my app engine SDK path was correct as well.
If you're having problems installing or getting PIL to work, understand that there are many dependencies involved with PIL, including what file format codecs you will want to support (there is a PNG library, a TIFF library and a JPEG library), and whether you want to draw text in your images and need truetype font support via the freetype library. Know that you may have PIL installed and no codec support libraries and effectively PIL won't be usable.
A good starting place for this issue might be this other question:
How to deal with Linux/Python dependencies?

Which version of Eclipse works with PHP Google App Engine?

I've search in vain for about a month now and I can't get my PHP application pushed to Google App Engine, for the PHP platform. I've got the Java version set up nicely on my computer. I followed the instructions for GAE PHP here: https://developers.google.com/appengine/docs/php/gettingstarted/introduction
..but it's really confusing because it essentially tells me to install Eclipse made for PHP which is Luna, but the only versions of Eclipse that GAE supports is Kepler, Juno and Indigo (https://developers.google.com/eclipse/docs/getting_started), so I'm super confused.
I don't think you can install two different GAE plugins on a standard version of Eclipse (which is what I use for the Java GAE plugin).
I also tried (in vain, but it was worth a shot) to upload my app using my Java plugin/setup and obviously this was a terrible idea because all it does is just print the php script/code to the browser.
Any thoughts, brothas/sistas?
I have figured out how to push php files to GAE. There are essentially 3 ways.
Use appcfg.py. Run following command:
--appcfg.py update helloworld/, where helloworld is replaced by the name of the folder containing your project files. Make sure the path is relative to appcfg.py directory or an absolute path.
--Enter your Google username and password at the prompts.
**2. Use the App Engine Launcher, probably found in C:\Program Files (x86)\Google\google_appengine\launcher. Executable is called GoogleAppEngineLauncher.exe. Simply select the project in Launcher and click Deploy.
**3. Use Git. Create a local repository on your machine. Add a repo to your Github account, and follow these instructions: https://developers.google.com/appengine/docs/push-to-deploy#creating_a_cloud_project
**4. Use PhPStorm. Download PHPStorm for free for 30 days, or buy a student version/whatever version you quality for here: . Then follow these instructions: http://confluence.jetbrains.com/display/PhpStorm/Getting+Started+with+PhpStorm+as+Google+App+Engine+PHP+IDE. The only thing I haven't figured out is #5 - where to find the php-cgi.exe file. I can't provide a path for a file I don't have.
** denotes super easy and I have used successfully.
The Google Plugin for Eclipse is only for Java applications. For PHP applications, you'll want to use the Python/PHP SDK and either the command-line tools or the Launcher UI app for running the development server. You can still use Eclipse for editing your PHP source files.
RE #5 - "I can't provide a path for a file I don't have".
That was also my problem.
They are fond of pointing out that the SDK directory should contain dev_appserver.py and ‘google’ and ‘php’ packages but you don't find those in a simple search cause they are invisible. You have to muck through the installation directory.

Google App Engine: portable SDK or way of uploading?

I've used Google App Engine, and as far as I know the only way to update my application files on Google's servers is to use the App Engine SDK. And as far as I know the App Engine SDK is a Mac or Windows package, which is not portable (requires installation on the local machine).
I need a portable version, or another way to update my application files on Google's servers using a Mac. I found this https://code.google.com/p/appengine-portable/ which purports to offer portable versions for Windows, but not Mac.
Is there a way for me to use the App Engine SDK on Mac without installing?
Is there any alternative way for me to update my application files on Google's servers?
This is not where you looking for, but have a look at this post: http://googleappengine.blogspot.nl/2012/07/develop-in-cloud-with-exos-cloud-ide.html
I am only talking about the Python SDK here. You haven't said which .
Just use the linux SDK, and run that on Mac or Windows. I haven't used mac. But I do appengine development on Windows and Linux and have never used the Launcher. Just follow the directions for unix on windows. (Well change your file paths and slashes ;-)
The python SDK and dev server is all pure python.
The Windows and OS X packages are just the the SDK and the GUI launcher. As far as I know the SDK is pure Python and portable. Either use the SDK that comes with installer or download the SDK alone.
The linux version on the documentation download page contains only the SDK, or get it on the Google App Engine googlecode project (it will be called google_appengine_x.x.x.zip):
https://code.google.com/p/googleappengine/downloads/list
Simply download the SKD, extract it somewhere (on my Mac, I link it to /usr/local/google_appengine because some script like nosegae expects it there, but it's not necessary). The SDK doesn't need to be installed, doesn't need to be in path. You can run appcfg.py from the SDK directory or using the absolute path.
Below is the Makefile I am using to run and upload an app (with make serve and make upload):
PYTHON=$(shell pwd)/venv/bin/python
GAE=/usr/local/google_appengine
APPSERVER=${GAE}/dev_appserver.py
APPCFG=${GAE}/appcfg.py
PORT=8080
SRC=./src
.PHONY: serve upload test
serve:
open "http://localhost:${PORT}"
${PYTHON} ${APPSERVER} --port=${PORT} ${SRC}
upload:
${PYTHON} ${APPCFG} --oauth2 update ${BUILD}
test:
cd ${SRC}; ${PYTHON} runtest.py

Integrate Flurry Analytics into a MonoTouch app

I've installed XCode and MonoTouch and built a basic app.
I'm trying to integrate Flurry Analytics into my application. I signed up and downloaded the SDK but I don't know what to do with it. I think I need a binding library and I found this one on GitHub.
Should I clone that repository or is it already installed somewhere because I have MonoDevelop installed? Is there somewhere standard I should clone it to?
I then add a reference from my application to the FlurryAnalytics.dll. Do I need to do anything with the FlurryAnalytics SDK?
You only have to add a reference to FlurryAnalytics.dll in your project, no need to do anything with the SDK you downloaded.
But have in mind that the dll in that git repository might be somewhat out of date, in which case you should rebuild the dll (and in this case you do need the SDK). Here is what you need to do:
Find libFlurry.a in the SDK and put it in the repository's FlurryAnalytics/binding directory.
Open a terminal and navigate to the repository's FlurryAnalytics/binding directory.
Execute make.
This should build an updated FlurryAnalytics.dll.

Resources