dbmakefakelib

A Python Script To Make Stub GUI Libraries For Linux Dropbox
Download

dbmakefakelib Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Price:
  • FREE
  • Publisher Name:
  • Steve H.

dbmakefakelib Tags


dbmakefakelib Description

A Python Script To Make Stub GUI Libraries For Linux Dropbox dbmakefakelib is an experimental Python script that generates stub GUI libraries for the Linux version of Dropbox.You may want to use this if installing Dropbox on a Linux machine that doesn't have any of the following GUI libraries:libgtk-x11-2.0.so.0libgdk-x11-2.0.so.0libatk-1.0.so.0libgdk_pixbuf-2.0.so.0libpango-1.0.so.0This is quite common on server installations of Linux, which may be deliberately headless or with only a text console.By repeatedly executing the Dropbox daemon and seeing how it fails to start, the script uses gcc to build a fake library full of functions that do nothing. This seems to be sufficient to fool the Dropbox daemon into thinking the real libraries are there, so it starts up. It can then be set up to run as a background process as usual.Usage Example$ python dbmakefakelib.pyadding library libgtk-x11-2.0.so.0adding library libgdk-x11-2.0.so.0adding library libatk-1.0.so.0adding library libgdk_pixbuf-2.0.so.0adding library libpango-1.0.so.0adding library libgobject-2.0.so.0adding library libgmodule-2.0.so.0adding library libgthread-2.0.so.0adding library libglib-2.0.so.0adding function gtk_tree_view_newadding function gtk_toolbar_newadding function g_threads_got_initializedadding function gtk_grab_removeadding function gtk_button_newadding function gtk_frame_newadding function gtk_major_version... lots more of this ...adding function g_static_rw_lock_writer_unlockadding function g_value_set_boxed_take_ownershipadding function g_boxed_type_register_staticadding function g_datalist_cleardropboxd ran for 15 seconds without quitting - success?(Note that this will take some time as dropboxd will likely be unsuccessfully executed almost 800 times before the fake library file is complete.)Source Codedbmakefakelib.pyimport commands, re, os, threading, time, sysWAIT_TIME = 15class monitor_thread(threading.Thread): def __init__(self): self.pulse() threading.Thread.__init__ (self) def run(self): while time.time() - self.lasttime < WAIT_TIME: time.sleep(1) if self.lasttime > 0: print "dropboxd ran for %u seconds without quitting - success?" % WAIT_TIME commands.getstatusoutput("killall dropboxd") def pulse(self): self.lasttime = time.time() def stop(self): self.lasttime = 0mon = monitor_thread()mon.start()try: r_undef = re.compile('ImportError: /.*/.dropbox-dist/(.*?): undefined symbol: (.*)') r_noso = re.compile('ImportError: (.*): cannot open shared object file: No such file or directory') ok = True errmsg = "" dropboxd = os.path.expanduser("~/.dropbox-dist/dropboxd") def compile_fakelib(): ret = commands.getstatusoutput("gcc -fPIC -shared -o ~/.dropbox-dist/fakelib fakelib.c") if ret != 0: raise Exception, ret commands.getstatusoutput('echo "#define E(f) int f() {return 0;}" > fakelib.c') compile_fakelib() while ok: ok = False mon.pulse() errmsg = commands.getoutput(dropboxd) found = r_noso.findall(errmsg.split("\n")) if found != []: print "adding library " + found commands.getstatusoutput("ln -s fakelib ~/.dropbox-dist/" + found) ok = True found = r_undef.findall(errmsg.split("\n")) if found != []: print "adding function "+ found ret = commands.getstatusoutput('echo "E(' + found + ')" >> fakelib.c') compile_fakelib() ok = Trueexcept: mon.stop() raiseprint errmsgmon.stop() Requirements: · Python


dbmakefakelib Related Software