From klik-devel Sun Apr 27 01:23:47 2008 From: codesite-noreply () google ! com Date: Sun, 27 Apr 2008 01:23:47 +0000 To: klik-devel Subject: [klik-devel] [klikclient commit] r1470 - in trunk/client/trunk: Message-Id: <0016367ed66ca3b1c8044bd0a6dc () google ! com> X-MARC-Message: https://marc.info/?l=klik-devel&m=120925946203576 Author: KillerKiwi2005 Date: Sat Apr 26 18:23:27 2008 New Revision: 1470 Modified: trunk/client/trunk/debian/klik.mime trunk/client/trunk/klikclient/bin/klik trunk/client/trunk/klikclient/lib/klik/base.py trunk/client/trunk/klikclient/lib/klik/utils/xdg.py trunk/client/trunk/klikclient/share/klik/klik.glade trunk/client/trunk/klikclient/share/klik/mimelnk.cmg.desktop Log: Remove visible elements of merge and jail Modified: trunk/client/trunk/debian/klik.mime ============================================================================== --- trunk/client/trunk/debian/klik.mime (original) +++ trunk/client/trunk/debian/klik.mime Sat Apr 26 18:23:27 2008 @@ -1 +1 @@ -application/x-extension-cmg; /usr/bin/klik '%s'; description=klik cmg application; priority=9 +x-application-cmg; /usr/bin/klik '%s'; description=klik cmg application; priority=9 Modified: trunk/client/trunk/klikclient/bin/klik ============================================================================== --- trunk/client/trunk/klikclient/bin/klik (original) +++ trunk/client/trunk/klikclient/bin/klik Sat Apr 26 18:23:27 2008 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# klik2 +# klik2 # Copyright (C) 2008 Jason Taylor - killerkiwi2005@gmail.com # # This program is free software; you can redistribute it and/or modify @@ -40,11 +40,11 @@ gettext.install( 'klikclient' ) -def get_help(mode): +def get_help(mode): #......... ......... ......... ......... ......... ......... ......... .........# if not mode: print "Running applications:\n" - + if not mode or mode == "run" or mode not in ["jail", "prompt", "shell", "get", "info", "pack", "unpack", "extract", "icon", "register", "unregister", "sync"]: @@ -61,28 +61,28 @@ print " home - " print " portable - " print "-------------------------------TODO: implement options, way more flexible" - if not mode or mode == "jail": - print " klik jail [jail_type] foo.cmg [args] Create a jail folder for foo.cmg." - print "-------------------------------TODO: remove" + #if not mode or mode == "jail": + # print " klik jail [jail_type] foo.cmg [args] Create a jail folder for foo.cmg." + # print "-------------------------------TODO: remove" if not mode or mode == "prompt": print " klik prompt foo.cmg [args] Force a dialogue to select application." print "-------------------------------TODO: remove" if not mode or mode == "shell": print " klik shell foo.cmg Start a shell with cmg union mounted." print "-------------------------------TODO: remove" - + if not mode: print "\nOperations with the repository:\n" - + if not mode or mode == "get": print " klik get foo [bar...] Download a recipe and create a cmg file for the" print " package foo, bar..." if not mode or mode == "info": print " klik info foo[.(cmg|recipe|ticket)] Get information from a CMG or from a package." - + if not mode: print "\nOperations with CMG files:\n" - + if not mode or mode == "pack": print " klik pack /foo/ foo.cmg Repack a CMG." if not mode or mode == "unpack": @@ -92,12 +92,13 @@ if not mode or mode == "icon": print " klik icon foo.cmg output [size] Extract the icon for the CMG into output." print " If size is specified, resizes the icon." - if not mode or mode == "merge": - print " klik merge main.cmg add.cmg out.cmg ." - + + #if not mode or mode == "merge": + # print " klik merge main.cmg add.cmg out.cmg ." + if not mode: print "\nDesktop integration:\n" - + if not mode or mode == "register": print " klik register [opts] foo.cmg [bar.cmg...] Register given CMGs with the desktop." print " Options:" @@ -109,7 +110,7 @@ print " looking for non-registered packages" print " and packages registered but no longer" print " existing." - + def usage(mode=None): @@ -117,7 +118,7 @@ print "Klik %s - Web based software installer" % klik.settings.version print print "Usage:" - + get_help(mode) s = KlikSettings() @@ -126,22 +127,22 @@ print "Documentation by :" print " " + "\n ".join(s.documenters) - + print "" print "Created by :" print " " + "\n ".join(s.authors) - + print "" print "Website : " + s.website if __name__ == "__main__": - + first_arg = None result = False - + try: # Check not root @@ -152,7 +153,7 @@ # exit(1) klik = KlikBase(sys.path[0]) - + sanity = klik.is_system_sane() """if False in sanity: print "System is not sane, aborting" @@ -161,21 +162,21 @@ stdout=subprocess.PIPE).communicate()[0].strip() if not sanity[2]: print " - sudo chmod a+rw /dev/fuse" exit(1)""" - + integration = KlikIntegration(klik) - + command_options = set() - + if len(sys.argv) == 1: usage() - + else: - + first_arg = sys.argv[1] args = sys.argv[2:] - + # Try to detect if we are executing a .cmg before parsing other options - + # Detect if we are providing a command for the CMG _command = None if first_arg == "run": @@ -185,13 +186,13 @@ _command = sys.argv[2] sys.argv.remove(sys.argv[2]) sys.argv.remove(first_arg) - + if klik.is_valid_cmg(sys.argv[1]): cmg = KlikCmg( klik, sys.argv[1] ) result, text = cmg.execute(sys.argv[2:], command=_command) # Option parsing - + elif first_arg == "unpack": if len(args) == 1: klik.unpack_cmg( args[0], args[0][:-4] ) @@ -252,16 +253,16 @@ elif first_arg == "get": result, text = klik.download(args) - + elif first_arg == "info": print "TODO" elif first_arg == "settings": klik.settings.print_settings( args ) - + elif first_arg in ("help", "--help", "-h"): usage() - + else: # klik foo[.(recipe|ticket)] result, text = klik.download_and_execute(first_arg, args) @@ -273,6 +274,5 @@ print "DEBUG - Error occurred:", inst traceback.print_exc() exit(1) - - sys.exit( 1 - int(result) ) + sys.exit( 1 - int(result) ) Modified: trunk/client/trunk/klikclient/lib/klik/base.py ============================================================================== --- trunk/client/trunk/klikclient/lib/klik/base.py (original) +++ trunk/client/trunk/klikclient/lib/klik/base.py Sat Apr 26 18:23:27 2008 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# klik2 +# klik2 # Copyright (C) 2008 Jason Taylor - killerkiwi2005@gmail.com # # This program is free software; you can redistribute it and/or modify @@ -72,7 +72,7 @@ # Insure temp path exists if not os.path.exists( self.settings.temp_directory_path ): os.mkdir(self.settings.temp_directory_path) - + # Cleanup any junk in execute self.clean_up() @@ -126,23 +126,23 @@ def check_for_updated_recipe(self, recipe): try: new_recipe = self.get_recipe(recipe.source_uri) - + # Has the recipe changed old_md5_hash = md5.new(recipe.original_xml).hexdigest() new_md5_hash = md5.new(new_recipe.original_xml).hexdigest() - + if not old_md5_hash == new_md5_hash: # Should we also check application version numbers? # A recipe might change just to fix a run time error etc... return True, new_recipe except Exception, e: print "base.check_for_updated_recipe() - Error", e - + # If we cant get a recipe always return false return False, None def get_recipe(self, application_name): - + # Get information about users system plat = platform.system() + " " + platform.machine() pyvers = "Python/"+ platform.python_version() @@ -187,7 +187,7 @@ def create_jailed_cmg(self, cmg_path, jail_type="data"): sandbox = KlikSandBox(cmg_path) sandbox.create_jail( jail_type ) - return + return def open_application_folder(self, index=0): @@ -195,7 +195,7 @@ def is_valid_cmg(self, filename): return KlikCmg( self, filename ).is_valid_cmg() - + def is_valid_recipe(self, filename): mtype, entype = mimetypes.guess_type(filename) if mtype in [ "application/x-extension-cmg-recipe", "text/xml", "application/xml" ]: @@ -221,7 +221,7 @@ print "Error occured : " + str(inst) else: traceback.print_exc() - + def pack_cmg(self, location, cmg_path): try: self.create.pack( location, cmg_path ) @@ -283,11 +283,10 @@ rv += "\nDistribution: " + self.xdg.get_distribution() rv += "\nPlatform: " + str(platform.platform()) rv += "\nX server: " + str(self.xdg.get_is_x_display()) - rv += "\nPython version: " + platform.python_version() rv += "\nDesktop environment: " + self.xdg.get_desktop_enviroment() rv += "\nTerminal detected: " + str(self.xdg.get_is_terminal()) #rv += "\nPyGTK installed: " + str(self.xdg.get_is_gtk_installed()) - rv += "\nBase System Includes: " + ", ".join(self.xdg.get_installed_libs()) + rv += "\nBase System Includes: \n\t- " + "\n\t- ".join(self.xdg.get_installed_libs()) return rv def execute_cmg_shell(self, cmg_path): @@ -296,6 +295,12 @@ def download(self, apps): + + print "" + print "System Information" + print "==================" + print self.system_info() + for app in set(apps): recipe = None if os.path.isfile(app): @@ -313,7 +318,7 @@ recipe = None ticket = None - + # Make sure gpg key has been loaded self.insure_gpg_key_registered() @@ -327,9 +332,9 @@ else: print "Error: Invalid file type" return 0, "" - - - + + + print "" print "System Information" print "==================" @@ -341,7 +346,7 @@ # Insure destination path exists, or make it if not os.path.exists( self.settings.destination ): os.mkdir(self.settings.destination) - + # TODO: This (kde|gnome|term) thing should probably be implemented with subclassing if self.xdg.get_is_x_display() and self.xdg.get_is_gtk_installed(): #and (de in ["KDE", "GNOME", "XFCE"]): @@ -395,38 +400,37 @@ # Cleanup temp files self.clean_up() - - + + def is_system_sane(self): valid_fuse_module = False valid_fuse_group = False valid_fuse_mode = False if os.path.exists("/dev/fuse"): - + # Module fuse is loaded pipe = subprocess.Popen(["lsmod"], stdout=subprocess.PIPE) for line in pipe.stdout: if line.startswith("fuse"): valid_fuse_module = True - + stbuf = os.stat("/dev/fuse") - + # If fuse device belongs to group fuse, the user is in the fuse group group =stbuf[stat.ST_GID] if group == 0: valid_fuse_group = True else: valid_fuse_group = True # TODO - + # All users can access the fuse device mode = stbuf[stat.ST_MODE] if (mode & stat.S_IROTH) and (mode & stat.S_IWOTH): valid_fuse_mode = True - + return valid_fuse_module, valid_fuse_group, valid_fuse_mode # Private methods def __download_progress(self, percentage, text): self.events.on_download_progress( percentage, text ) - Modified: trunk/client/trunk/klikclient/lib/klik/utils/xdg.py ============================================================================== --- trunk/client/trunk/klikclient/lib/klik/utils/xdg.py (original) +++ trunk/client/trunk/klikclient/lib/klik/utils/xdg.py Sat Apr 26 18:23:27 2008 @@ -29,6 +29,7 @@ import sys import re import glob +import platform from subprocess import * class XdgUtils (object): @@ -298,8 +299,7 @@ if self.__installed_libs == None: result = [] - - result.append("PYTHON") + result.append("PYTHON " + platform.python_version()) if len(Popen(["which", "gnome-about"], stdout=PIPE, stderr=open(os.devnull, "w")).communicate()[0].strip()) > 0: cmd_result = Popen(["gnome-about", "--version"], stdout=PIPE, stderr=open(os.devnull, "w")).communicate()[0] @@ -308,7 +308,9 @@ result.append("GNOME " + version) if self.get_is_gtk_installed(): - result.append("GTK") + import gtk + maj, min, rev = gtk.gtk_version + result.append("GTK %d.%d.%d" % (maj, min, rev) ) if len(Popen(["which", "kde-config"], stdout=PIPE, stderr=open(os.devnull, "w")).communicate()[0].strip()) > 0: try: Modified: trunk/client/trunk/klikclient/share/klik/klik.glade ============================================================================== --- trunk/client/trunk/klikclient/share/klik/klik.glade (original) +++ trunk/client/trunk/klikclient/share/klik/klik.glade Sat Apr 26 18:23:27 2008 @@ -165,90 +165,6 @@ 12 5 - - True - 0 - <b>Signed By:</b> - True - - - 2 - 3 - - - - - - - True - 0 - <b>unsigned</b> - True - True - - - 1 - 2 - 2 - 3 - - - - - - True - 0 - <b>Summary:</b> - True - - - - - - - - - True - 0 - <b>Version:</b> - True - - - 1 - 2 - - - - - - - True - 0 - unknown - True - - - 1 - 2 - - - - - - True - 0 - unknown - True - - - 1 - 2 - 1 - 2 - - - - True 12 @@ -377,7 +293,6 @@ - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -424,7 +339,6 @@ - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Options @@ -443,6 +357,90 @@ 4 + + + True + 0 + unknown + True + + + 1 + 2 + 1 + 2 + + + + + + True + 0 + unknown + True + + + 1 + 2 + + + + + + True + 0 + <b>Version:</b> + True + + + 1 + 2 + + + + + + + True + 0 + <b>Summary:</b> + True + + + + + + + + + True + 0 + <b>unsigned</b> + True + True + + + 1 + 2 + 2 + 3 + + + + + + True + 0 + <b>Signed By:</b> + True + + + 2 + 3 + + + + @@ -1191,7 +1189,6 @@ - True True @@ -1253,7 +1250,6 @@ GTK_BUTTONBOX_END - True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Modified: trunk/client/trunk/klikclient/share/klik/mimelnk.cmg.desktop ============================================================================== --- trunk/client/trunk/klikclient/share/klik/mimelnk.cmg.desktop (original) +++ trunk/client/trunk/klikclient/share/klik/mimelnk.cmg.desktop Sat Apr 26 18:23:27 2008 @@ -1,7 +1,7 @@ [Desktop Entry] Comment=Compressed Application Image (ISO) Hidden=false -MimeType=application/x-extension-cmg +MimeType=application/x-application-cmg Patterns=*.cmg Type=MimeType Icon=application-x-application-cmg _______________________________________________ klik-devel mailing list klik-devel@kde.org https://mail.kde.org/mailman/listinfo/klik-devel