Reputation: 40874
I am currently running 2.8.9.1 of wx in a linux box.
The App I am working on was originally written to run on MS Windows. We are planning to port part of the core logic to linux and run it as a process.
The problem is that the linux box is headless. We will not have a X-windows environment. But the existing codebase was written in such a way that it is tightly coupled with the wx layer.
For example, I have a couple of classes which are subclass of wx.EvtHandler
I probably can rewrite them one by one, but it is really not ideal.
In the new wx Pheonix, there is an AppConsole class which seems to be able to start an event loop without X-Windows. However it is not available in my local version of wx.
The Goal is ultimately to run the code in a cron job
I am basically looking for some advices/pointers as to how to tackle this issue. It would be nice to avoid as much rewrite as possible.
Upvotes: 1
Views: 580
Reputation: 40874
It turns out the rewriting is not too bad.
There are only three dependencies on wx objects in my code
1) subclassing wx.EvtHandler
2) wx.CallLater
3) wx.CallAfter
So the first case requires a reimplmentation
The other can be replaced by threading.Timer easily.
Upvotes: 0
Reputation: 74108
One way is to to use your local display. Ssh
into your server with option -X
to redirect the display to your workstation
ssh -X server
And on your server start the application, which will use your workstation's display automatically.
For Windows, there exists Xming or Cygwin for example.
As an alternative, you can use Xvfb
, which provides a headless X server. You can then start your application by using xvfb-run
as
xvfb-run my_wx_application
Upvotes: 2