Simon Lees 3 years ago committed by Nedko Arnaudov
parent 297d1df722
commit 11ab9f5e6b

@ -1,4 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import signal, time
@ -15,21 +15,21 @@ class level1app:
elif signum == signal.SIGINT: = False
print "Unknown signal %d received" % signum
print ("Unknown signal %d received" % signum)
def run(self):
signal.signal(signal.SIGUSR1, self.sighandler)
signal.signal(signal.SIGTERM, self.sighandler)
signal.signal(signal.SIGINT, self.sighandler)
print "Waiting for signals..."
print ("Waiting for signals...")
print "Save"
print ("Save") = False
print "Exit"
print ("Exit")

@ -1,4 +1,4 @@
#!/usr/bin/env python
# LADI Session Handler (ladish)

@ -1,4 +1,4 @@
#!/usr/bin/env python
# This file shows example usage of python bindings for LASH
# As such code here is public domain you can use it as you wish and in
@ -17,22 +17,22 @@ def lash_check_events(lash_client):
event_type = lash.lash_event_get_type(event)
if event_type == lash.LASH_Quit:
print "LASH ordered quit."
print ("LASH ordered quit.")
return False
elif event_type == lash.LASH_Save_File:
print "LASH ordered to save data in directory %s" % lash.lash_event_get_string(event)
print ("LASH ordered to save data in directory %s" % lash.lash_event_get_string(event))
lash.lash_send_event(lash_client, event)
elif event_type == lash.LASH_Save_Data_Set:
print "LASH ordered to save data"
print ("LASH ordered to save data")
lash.lash_send_event(lash_client, event)
elif event_type == lash.LASH_Restore_Data_Set:
print "LASH ordered to restore data"
print ("LASH ordered to restore data")
elif event_type == lash.LASH_Restore_File:
print "LASH ordered to restore data from directory %s" % lash.lash_event_get_string(event)
print ("LASH ordered to restore data from directory %s" % lash.lash_event_get_string(event))
print "Got unhandled LASH event, type " + str(event_type)
print ("Got unhandled LASH event, type " + str(event_type))
return True
@ -43,10 +43,10 @@ def lash_check_events(lash_client):
# sys.argv is modified by this call
lash_client = lash.init(sys.argv, "pylash test", lash.LASH_Config_Data_Set | lash.LASH_Terminal)
if not lash_client:
print "Cannot connect to LASH server"
print ("Cannot connect to LASH server")
print "Successfully connected to LASH server at " + lash.lash_get_server_name(lash_client)
print ("Successfully connected to LASH server at " + lash.lash_get_server_name(lash_client))
# Send our client name to server
lash_event = lash.lash_event_new_with_type(lash.LASH_Client_Name)

@ -1,13 +1,8 @@
#! /usr/bin/env python
# encoding: utf-8
import os
import Options
import Utils
import shutil
import re
import waflib
from waflib.Scripting import Dist
from __future__ import with_statement
parallel_debug = False
@ -20,19 +15,23 @@ RELEASE = False
top = '.'
out = 'build'
from Logs import pprint
import os, sys, re, io, optparse, shutil, tokenize
from hashlib import md5
from waflib import Errors, Utils, Options, Logs, Scripting
from waflib import Configure
def display_msg(conf, msg="", status = None, color = None):
if status:
conf.msg(msg, status, color)
pprint('NORMAL', msg)
Logs.pprint('NORMAL', msg)
def display_raw_text(conf, text, color = 'NORMAL'):
pprint(color, text, sep = '')
Logs.pprint(color, text, sep = '')
def display_line(conf, text, color = 'NORMAL'):
pprint(color, text, sep = os.linesep)
Logs.pprint(color, text, sep = os.linesep)
def yesno(bool):
if bool:
@ -55,6 +54,8 @@ def options(opt):
opt.add_option('--distsuffix', type='string', default="", help="String to append to the distribution tarball name")
opt.add_option('--tagdist', action='store_true', default=False, help='Create of git tag for distname')
opt.add_option('--libdir', type='string', default=None, help='Define lib dir')
if parallel_debug:
@ -240,10 +241,10 @@ def configure(conf):
#print "optimize force enable is required"
if not check_gcc_optimizations_enabled(conf.env['CFLAGS']):
if Options.options.debug:
print "C optimization must be forced in order to enable -Wuninitialized"
print "However this will not be made because debug compilation is enabled"
print ("C optimization must be forced in order to enable -Wuninitialized")
print ("However this will not be made because debug compilation is enabled")
print "C optimization forced in order to enable -Wuninitialized"
print ("C optimization forced in order to enable -Wuninitialized")
conf.env.append_unique('CFLAGS', "-O")
@ -273,7 +274,7 @@ def configure(conf):
version_msg = APPNAME + "-" + VERSION
if os.access('version.h', os.R_OK):
data = file('version.h').read()
data = open('version.h').read()
m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
if m != None:
version_msg += " exported from " +
@ -319,11 +320,11 @@ def git_ver(self):
if os.access('./version.h', os.R_OK):
header = os.path.join(os.getcwd(), out, "version.h")
shutil.copy('./version.h', header)
data = file(header).read()
data = open(header).read()
m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
if m != None:
self.ver =
pprint('BLUE', "tarball from git revision " + self.ver)
Logs.pprint('BLUE', "tarball from git revision " + self.ver)
self.ver = "tarball"
@ -333,7 +334,7 @@ def git_ver(self):
if bld.cmd_and_log("LANG= git diff-index --name-only HEAD", quiet=waflib.Context.BOTH).splitlines():
self.ver += "-dirty"
pprint('BLUE', "git revision " + self.ver)
Logs.pprint('BLUE', "git revision " + self.ver)
self.ver = "unknown"
@ -637,10 +638,10 @@ def build(bld):
# GtkBuilder UI definitions (XML)
bld.install_files('${DATA_DIR}', 'gui/gladish.ui')
bld.install_files('${PREFIX}/bin', 'ladish_control', chmod=0755)
bld.install_files('${PREFIX}/bin', 'ladish_control', chmod=0o0755)
# 'Desktop' file (menu entry, icon, etc)
bld.install_files('${PREFIX}/share/applications/', 'gui/gladish.desktop', chmod=0644)
bld.install_files('${PREFIX}/share/applications/', 'gui/gladish.desktop', chmod=0o0644)
# Icons
icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256']
@ -661,14 +662,14 @@ def build(bld):
html_docs_source_dir = "build/default/html"
if bld.cmd == 'clean':
if os.access(html_docs_source_dir, os.R_OK):
pprint('CYAN', "Removing doxygen generated documentation...")
Logs.pprint('CYAN', "Removing doxygen generated documentation...")
pprint('CYAN', "Removing doxygen generated documentation done.")
Logs.pprint('CYAN', "Removing doxygen generated documentation done.")
elif bld.cmd == 'build':
if not os.access(html_docs_source_dir, os.R_OK):
pprint('CYAN', "doxygen documentation already built.")
Logs.pprint('CYAN', "doxygen documentation already built.")
bld(features='intltool_po', appname=APPNAME, podir='po', install_path="${LOCALE_DIR}")
@ -701,7 +702,7 @@ def etags(ctx):
os.system("stat -c '%y' TAGS")
class ladish_dist(waflib.Scripting.Dist):
class ladish_dist(Scripting.Dist):
cmd = 'dist'
fun = 'dist'