Changeset 5408 for internals/2011


Ignore:
Timestamp:
Sep 16, 2011, 2:37:18 PM (9 years ago)
Author:
goncalo.pinheira
Message:

added dev code

Location:
internals/2011/cmce/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • internals/2011/cmce/trunk/doc-internal/CMCK.mm

    r5005 r5408  
    3939<node CREATED="1311179783317" ID="ID_774502489" MODIFIED="1311344460881" TEXT="UnionFS"/>
    4040</node>
    41 <node CREATED="1311348912478" ID="ID_1394104727" MODIFIED="1311350127797" POSITION="right" TEXT="UCK">
     41<node CREATED="1311348912478" FOLDED="true" ID="ID_1394104727" MODIFIED="1315581769685" POSITION="right" TEXT="UCK">
    4242<node CREATED="1311348918013" ID="ID_1367742213" MODIFIED="1311348920264" TEXT="problemas">
    4343<node CREATED="1311348928936" FOLDED="true" ID="ID_1280246850" MODIFIED="1311955975994" TEXT="hardcode gfxboot-ubuntu-theme">
     
    7575<node CREATED="1312561213146" ID="ID_1107686331" MODIFIED="1312561213146" TEXT="uck-remaster-clean-all"/>
    7676</node>
    77 <node CREATED="1312561327082" FOLDED="true" ID="ID_1983809539" MODIFIED="1312561768266" TEXT="profiles">
     77<node CREATED="1312561327082" FOLDED="true" ID="ID_1983809539" MODIFIED="1315581762809" TEXT="profiles">
    7878<node CREATED="1312561386002" ID="ID_1095826070" MODIFIED="1312561388670" TEXT="files">
    7979<node CREATED="1312561505246" ID="ID_1745205367" MODIFIED="1312561530691" TEXT="customize">
     
    118118<node CREATED="1312559997833" ID="ID_1649895225" MODIFIED="1312560017639" TEXT="Xephyr"/>
    119119</node>
    120 <node CREATED="1311179847215" ID="ID_1819087510" MODIFIED="1311344460881" POSITION="right" TEXT="progresso">
    121 <node CREATED="1311179854797" FOLDED="true" ID="ID_1771514025" MODIFIED="1311955970954" TEXT="semana 1">
     120<node CREATED="1313169177974" ID="ID_1338697665" MODIFIED="1313169179288" POSITION="right" TEXT="TODO">
     121<node CREATED="1315410464804" ID="ID_904043176" MODIFIED="1315410484039" TEXT="done">
     122<node CREATED="1315402463228" ID="ID_150734767" MODIFIED="1315402465962" TEXT="KDE"/>
     123<node CREATED="1315583080900" ID="ID_1339950755" MODIFIED="1315583081646" TEXT="bugs">
     124<node CREATED="1315403855247" ID="ID_800616409" MODIFIED="1315583083449" TEXT="apt-get autoremove?"/>
     125<node CREATED="1315403587847" ID="ID_1007614256" MODIFIED="1315583087305" TEXT="uck dependency?">
     126<node CREATED="1315410617086" ID="ID_729538880" MODIFIED="1315580727986" TEXT="uck was detecting it&apos;s directory incorrectly, change uck call"/>
     127</node>
     128<node CREATED="1315402467609" ID="ID_179697888" MODIFIED="1315583090169" TEXT="language separated - bug?">
     129<node CREATED="1315406885041" ID="ID_231313950" MODIFIED="1315406889365" TEXT="all seems good..."/>
     130</node>
     131</node>
     132</node>
     133<node CREATED="1315583092486" ID="ID_492989746" MODIFIED="1315583093698" TEXT="bugs">
     134<node CREATED="1315402488025" ID="ID_1967574494" MODIFIED="1315583094826" TEXT="retry customization bugs?"/>
     135<node CREATED="1315402497717" ID="ID_579789238" MODIFIED="1315583098738" TEXT="proper process killing"/>
     136<node CREATED="1315578455449" ID="ID_251714847" MODIFIED="1315583101200" TEXT="error on uck failure"/>
     137</node>
     138<node CREATED="1315581766743" ID="ID_578452854" MODIFIED="1315581767264" TEXT="KDE testing"/>
     139<node CREATED="1315402911118" ID="ID_300452622" MODIFIED="1315402917927" TEXT="check uck upstream"/>
     140<node CREATED="1315403472525" ID="ID_1383665586" MODIFIED="1315581766274" TEXT="better debug output, log to file"/>
     141<node CREATED="1315404256421" ID="ID_1846084940" MODIFIED="1315404261221" TEXT="mv final iso?"/>
     142<node CREATED="1315402606974" ID="ID_12809523" MODIFIED="1315402608515" TEXT="docs"/>
     143<node CREATED="1315407674706" ID="ID_341202492" MODIFIED="1315407704263" TEXT="i18n"/>
     144<node CREATED="1315402617081" ID="ID_1058835096" MODIFIED="1315402619193" TEXT="deb package"/>
     145</node>
     146<node CREATED="1311179847215" ID="ID_1819087510" MODIFIED="1314023360967" POSITION="right" TEXT="progresso">
     147<node CREATED="1311179854797" FOLDED="true" ID="ID_1771514025" MODIFIED="1314986433651" TEXT="semana 1">
    122148<node CREATED="1311179860841" ID="ID_252548493" MODIFIED="1311345456763" TEXT="dia 1">
    123149<node CREATED="1311180417479" ID="ID_318347115" MODIFIED="1311180427339" TEXT="adicionada mais informa&#xe7;&#xe3;o &#xe0; wiki"/>
     
    175201</node>
    176202</node>
    177 <node CREATED="1312217899574" ID="ID_1940624791" MODIFIED="1312910387773" TEXT="semana 3">
     203<node CREATED="1312217899574" FOLDED="true" ID="ID_1940624791" MODIFIED="1313169167922" TEXT="semana 3">
    178204<node CREATED="1312217906658" ID="ID_416807508" MODIFIED="1312217908993" TEXT="dia 9">
    179205<node CREATED="1312217910429" ID="ID_86908126" MODIFIED="1312217916977" TEXT="desenvolvimento da GUI"/>
     
    195221</node>
    196222</node>
    197 <node CREATED="1312910381686" ID="ID_1523407565" MODIFIED="1312910384019" TEXT="semana 4">
     223<node CREATED="1312910381686" FOLDED="true" ID="ID_1523407565" MODIFIED="1313518372273" TEXT="semana 4">
    198224<node CREATED="1312910385446" ID="ID_351320403" MODIFIED="1312910391886" TEXT="dia 14">
    199225<node CREATED="1312560084846" ID="ID_642292024" MODIFIED="1312560159480" TEXT="desenvolvimento da interface python-uck"/>
     
    203229<node CREATED="1312910413513" ID="ID_985634936" MODIFIED="1312910419082" TEXT="integra&#xe7;&#xe3;o GUI - UCK"/>
    204230</node>
     231<node CREATED="1312910404383" ID="ID_1477826216" MODIFIED="1313169113291" TEXT="dia 16">
     232<node CREATED="1312910413513" ID="ID_1114487707" MODIFIED="1312910419082" TEXT="integra&#xe7;&#xe3;o GUI - UCK"/>
     233</node>
     234<node CREATED="1313000204799" ID="ID_1143181299" MODIFIED="1313169114866" TEXT="dia 17">
     235<node CREATED="1313000211675" ID="ID_1780090302" MODIFIED="1313000222816" TEXT="GUI - UCK: correc&#xe7;&#xe3;o de bugs"/>
     236<node CREATED="1313000223324" ID="ID_1881657923" MODIFIED="1313000225259" TEXT="testes"/>
     237<node CREATED="1313000230198" ID="ID_1783036546" MODIFIED="1313000279233" TEXT="manuten&#xe7;&#xe3;o, rescrita, dos repositorios git, svn"/>
     238<node CREATED="1313169655874" ID="ID_1518949757" MODIFIED="1313169671722" TEXT="integra&#xe7;&#xe3;o do X / vnc"/>
     239</node>
     240<node CREATED="1313000204799" ID="ID_1163790522" MODIFIED="1313169122587" TEXT="dia 18">
     241<node CREATED="1313169655874" ID="ID_670646916" MODIFIED="1313169676799" TEXT="integra&#xe7;&#xe3;o do X / vnc"/>
     242<node CREATED="1313000211675" ID="ID_1697853953" MODIFIED="1313169679137" TEXT="correc&#xe7;&#xe3;o de bugs"/>
     243<node CREATED="1313000223324" ID="ID_1682763939" MODIFIED="1313000225259" TEXT="testes"/>
     244<node CREATED="1313169138273" ID="ID_137625550" MODIFIED="1313169149920" TEXT="planeamento"/>
     245</node>
     246</node>
     247<node CREATED="1313518365671" FOLDED="true" ID="ID_203170329" MODIFIED="1315582416564" TEXT="semana 5">
     248<node CREATED="1313518368458" ID="ID_1695367139" MODIFIED="1313518374673" TEXT="dia 19">
     249<node CREATED="1313518375462" ID="ID_602303145" MODIFIED="1313518378908" TEXT="[feriado]"/>
     250</node>
     251<node CREATED="1313518383518" ID="ID_1452092437" MODIFIED="1313518385117" TEXT="dia 20">
     252<node CREATED="1313518386383" ID="ID_1815672308" MODIFIED="1313518388639" TEXT="testes"/>
     253<node CREATED="1313518388988" ID="ID_1796534262" MODIFIED="1313518395281" TEXT="mudan&#xe7;as &#xe0; GUI">
     254<node CREATED="1313518395989" ID="ID_711534624" MODIFIED="1313518402411" TEXT="uso de checkboxes"/>
     255<node CREATED="1313518402792" ID="ID_56328661" MODIFIED="1313518405774" TEXT="refactor"/>
     256</node>
     257<node CREATED="1313518406511" ID="ID_461960063" MODIFIED="1313518409951" TEXT="mudan&#xe7;as ao UKC">
     258<node CREATED="1313518410812" ID="ID_940437850" MODIFIED="1314023210539" TEXT="mudan&#xe7;a de utilizador ao correr a sess&#xe3;o gr&#xe1;fica (em vez de dar root ao end-user)"/>
     259</node>
     260</node>
     261<node CREATED="1314022401421" ID="ID_1674423811" MODIFIED="1314022402813" TEXT="dia 21">
     262<node CREATED="1314022405781" ID="ID_544471745" MODIFIED="1314022412233" TEXT="testes"/>
     263<node CREATED="1314022470233" ID="ID_1511813817" MODIFIED="1314022507985" TEXT="design de sistema de monitoriza&#xe7;&#xe3;o de progresso do UCK"/>
     264</node>
     265<node CREATED="1314022512746" ID="ID_243263710" MODIFIED="1314022514893" TEXT="dia 22">
     266<node CREATED="1314022544012" ID="ID_1899671975" MODIFIED="1314022576693" TEXT="desenvolvimento de framework para monitoriza&#xe7;&#xe3;o de progresso de ferramentas CLI"/>
     267</node>
     268<node CREATED="1314022581741" ID="ID_1310456279" MODIFIED="1314022584866" TEXT="dia 23">
     269<node CREATED="1314022585876" ID="ID_392215787" MODIFIED="1314023202031" TEXT="continua&#xe7;&#xe3;o do desenvolvimento do framework, testescome&#xe7;o de integra&#xe7;&#xe3;o do framework com GUI/UCK"/>
     270<node CREATED="1314022633273" ID="ID_628604825" MODIFIED="1314022633275" TEXT="come&#xe7;o de integra&#xe7;&#xe3;o do framework com GUI/UCK"/>
     271</node>
     272</node>
     273<node CREATED="1314023351003" FOLDED="true" ID="ID_1895981900" MODIFIED="1314986431652" TEXT="semana 6">
     274<node CREATED="1314023371949" ID="ID_1718914167" MODIFIED="1314023373787" TEXT="dia 24">
     275<node CREATED="1314279437873" ID="ID_671265931" MODIFIED="1314279506092" TEXT="testes, bugs"/>
     276<node CREATED="1314279421466" ID="ID_1269425531" MODIFIED="1314279437595" TEXT="conclus&#xe3;o de desenvolvimento de framework"/>
     277</node>
     278<node CREATED="1314279470511" ID="ID_1035697853" MODIFIED="1314279472200" TEXT="dia 25">
     279<node CREATED="1314279486214" ID="ID_1389438126" MODIFIED="1314279490448" TEXT="testes, bugs"/>
     280<node CREATED="1314279445650" ID="ID_213788318" MODIFIED="1314279462029" TEXT="conclus&#xe3;o de integra&#xe7;&#xe3;o do framework com GUI/UCK"/>
     281</node>
     282<node CREATED="1314279522591" ID="ID_218961078" MODIFIED="1314279524535" TEXT="dia 26">
     283<node CREATED="1314279527557" ID="ID_1698987806" MODIFIED="1314279820595" TEXT="testes, bugs"/>
     284<node CREATED="1314289846374" ID="ID_1640767119" MODIFIED="1314289988589" TEXT="pormenores, refactor"/>
     285</node>
     286<node CREATED="1314289850112" ID="ID_916405868" MODIFIED="1314289911140" TEXT="dia 27">
     287<node CREATED="1314289861155" ID="ID_1051011502" MODIFIED="1314289865134" TEXT="pormenores">
     288<node CREATED="1314289878398" ID="ID_1685976545" MODIFIED="1314289890740" TEXT="desactivar interface durante customiza&#xe7;&#xe3;o"/>
     289<node CREATED="1314289892125" ID="ID_1157770475" MODIFIED="1314289896920" TEXT="threading, etc"/>
     290</node>
     291<node CREATED="1314289918657" ID="ID_185606645" MODIFIED="1314289921279" TEXT="bugs"/>
     292</node>
     293<node CREATED="1314379753938" ID="ID_1647020127" MODIFIED="1314379756327" TEXT="dia 28">
     294<node CREATED="1314289923331" ID="ID_1937569784" MODIFIED="1314379770837" TEXT="afina&#xe7;&#xe3;o de profile de progresso"/>
     295<node CREATED="1314379757260" ID="ID_1616651945" MODIFIED="1314379760789" TEXT="testes"/>
     296<node CREATED="1314379773223" ID="ID_690483258" MODIFIED="1314379774500" TEXT="bugs"/>
     297<node CREATED="1314379778245" ID="ID_736599244" MODIFIED="1314379808260" TEXT="familiariza&#xe7;&#xe3;o com preseeding"/>
     298</node>
     299</node>
     300<node CREATED="1314636775972" FOLDED="true" ID="ID_294215487" MODIFIED="1315582070600" TEXT="semana 7">
     301<node CREATED="1314636786944" ID="ID_534741604" MODIFIED="1314636790008" TEXT="dia 29">
     302<node CREATED="1314636808944" ID="ID_351036430" MODIFIED="1314636814601" TEXT="afina&#xe7;&#xe3;o de profile de progresso"/>
     303<node CREATED="1314636838023" ID="ID_1249347480" MODIFIED="1314636853007" TEXT="altera&#xe7;&#xe3;o ao framework de monitoriza&#xe7;&#xe3;o para suportar monitoriza&#xe7;&#xe3;o de strings arbitrarias"/>
     304<node CREATED="1314636819528" ID="ID_411466568" MODIFIED="1314636834817" TEXT="correr e terminar a janela de VNC automaticamente"/>
     305</node>
     306<node CREATED="1314986422677" ID="ID_1155987700" MODIFIED="1314986425279" TEXT="dia 30">
     307<node CREATED="1314986455214" ID="ID_1394167376" MODIFIED="1314986456797" TEXT="testes"/>
     308<node CREATED="1314986457186" ID="ID_1829279920" MODIFIED="1314986464657" TEXT="familizariza&#xe7;&#xe3;o com o preseeding"/>
     309<node CREATED="1314986485829" ID="ID_1582857128" MODIFIED="1314986527851" TEXT="tentativas para fazer o preceeding copiar customiza&#xe7;&#xf5;es"/>
     310</node>
     311<node CREATED="1314986422677" ID="ID_613689525" MODIFIED="1314986556115" TEXT="dia 31">
     312<node CREATED="1314986457186" ID="ID_798716991" MODIFIED="1314986464657" TEXT="familizariza&#xe7;&#xe3;o com o preseeding"/>
     313<node CREATED="1314986485829" ID="ID_1585554354" MODIFIED="1314986527851" TEXT="tentativas para fazer o preceeding copiar customiza&#xe7;&#xf5;es"/>
     314</node>
     315<node CREATED="1314986422677" ID="ID_1056140832" MODIFIED="1314986563528" TEXT="dia 32">
     316<node CREATED="1314986457186" ID="ID_164755768" MODIFIED="1314986464657" TEXT="familizariza&#xe7;&#xe3;o com o preseeding"/>
     317<node CREATED="1314986485829" ID="ID_28225798" MODIFIED="1314986527851" TEXT="tentativas para fazer o preceeding copiar customiza&#xe7;&#xf5;es"/>
     318</node>
     319<node CREATED="1314986422677" ID="ID_1173007114" MODIFIED="1314986575308" TEXT="dia 33">
     320<node CREATED="1314986457186" ID="ID_457480235" MODIFIED="1314986464657" TEXT="familizariza&#xe7;&#xe3;o com o preseeding"/>
     321<node CREATED="1314986485829" ID="ID_945506683" MODIFIED="1314986618152" TEXT="preceeding copia customiza&#xe7;&#xf5;es"/>
     322<node CREATED="1314986618891" ID="ID_365777226" MODIFIED="1314986632455" TEXT="altera&#xe7;&#xe3;o de parametros de boot para usar o preceeding"/>
     323</node>
     324</node>
     325<node CREATED="1315246719479" ID="ID_1577648656" MODIFIED="1315246721560" TEXT="semana 8">
     326<node CREATED="1315246725604" ID="ID_1638455477" MODIFIED="1315246727655" TEXT="dia 34">
     327<node CREATED="1315246741138" ID="ID_1445778671" MODIFIED="1315246752598" TEXT="altera&#xe7;&#xe3;o &#xe0; c&#xf3;pia de customiza&#xe7;&#xf5;es"/>
     328<node CREATED="1315246728782" ID="ID_1835395465" MODIFIED="1315246736630" TEXT="testes"/>
     329<node CREATED="1315582491888" ID="ID_1870617121" MODIFIED="1315582504814" TEXT="novo bug na c&#xf3;pia de customiza&#xe7;&#xf5;es"/>
     330</node>
     331<node CREATED="1315582162670" ID="ID_986746259" MODIFIED="1315582165166" TEXT="dia 35">
     332<node CREATED="1315582166263" ID="ID_1662493389" MODIFIED="1315582167719" TEXT="testes"/>
     333<node CREATED="1315582167974" ID="ID_1772409828" MODIFIED="1315582173624" TEXT="correc&#xe7;&#xe3;o de bugs">
     334<node CREATED="1315582184934" ID="ID_925505117" MODIFIED="1315582201806" TEXT="bug no comando cp de customiza&#xe7;&#xf5;es"/>
     335</node>
     336<node CREATED="1315582441185" ID="ID_987528359" MODIFIED="1315582447998" TEXT="descoberta e listagem de bugs"/>
     337</node>
     338<node CREATED="1315582221710" ID="ID_964810708" MODIFIED="1315582224343" TEXT="dia 36">
     339<node CREATED="1315582225668" ID="ID_1400298707" MODIFIED="1315582227149" TEXT="testes"/>
     340<node CREATED="1315582227823" ID="ID_1525673875" MODIFIED="1315582256652" TEXT="customiza&#xe7;&#xe3;o gr&#xe1;fica em KDE a funcionar"/>
     341</node>
     342<node CREATED="1315582294267" ID="ID_1938961723" MODIFIED="1315582297658" TEXT="dia 37">
     343<node CREATED="1315582299780" ID="ID_1770236383" MODIFIED="1315582301747" TEXT="testes"/>
     344<node CREATED="1315582302059" ID="ID_143270939" MODIFIED="1315582318578" TEXT="mudan&#xe7;as ao preseeding para KDE"/>
     345<node CREATED="1315582326067" ID="ID_1970411343" MODIFIED="1315582341425" TEXT="mudan&#xe7;as no output da aplica&#xe7;&#xe3;o / uck"/>
     346</node>
     347<node CREATED="1315582352562" ID="ID_1528626375" MODIFIED="1315582354992" TEXT="dia 38">
     348<node CREATED="1315582356137" ID="ID_1099548042" MODIFIED="1315582357277" TEXT="testes"/>
     349<node CREATED="1315582357604" ID="ID_1469848824" MODIFIED="1315582364192" TEXT="correc&#xe7;&#xe3;o de bugs">
     350<node CREATED="1315582365129" ID="ID_398258339" MODIFIED="1315582378134" TEXT="bug de PATH quando uck n&#xe3;o est&#xe1; instalado"/>
     351<node CREATED="1315586599677" ID="ID_70864397" MODIFIED="1315586622479" TEXT="bug no vnc ao correr customiza&#xe7;&#xe3;o gr&#xe1;fica duas vezes"/>
     352</node>
     353<node CREATED="1315582388184" ID="ID_1898433017" MODIFIED="1315582400987" TEXT="remo&#xe7;&#xe3;o de packages desnecess&#xe1;rias do livecd ap&#xf3;s customiza&#xe7;&#xe3;o"/>
     354<node CREATED="1315582423249" ID="ID_493821131" MODIFIED="1315582427455" TEXT="investiga&#xe7;&#xe3;o de bugs"/>
     355</node>
    205356</node>
    206357</node>
  • internals/2011/cmce/trunk/gui/gui_library/input.py

    r5005 r5408  
    4848def choice(str_list, text="Select a option:", title="Select a option", buttons= (("OK",OK_CODE),), multi_choice=False, return_index=False):
    4949    #return QtGui.QInputDialog.getItem(None, title, text, str_list)._exec()
    50     print str_list, text, title, multi_choice, return_index
     50    model= QtGui.QStandardItemModel()
     51    for s in str_list:
     52        item= QtGui.QStandardItem(s)
     53        if multi_choice:
     54            item.setCheckable(True)
     55        model.appendRow(item)
    5156    def create_widget():
    52         w= QtGui.QListWidget()
    53         [w.addItem(s) for s in str_list]
    54         if multi_choice:
    55             w.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
     57        w= QtGui.QListView()
     58        w.setModel(model)
     59        #if multi_choice:
     60        #    w.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
    5661        def returnValue():
    57             texts= [i.text() for i in w.selectedItems()]
     62            items= [model.item(i) for i in xrange(model.rowCount())]
     63            if multi_choice:
     64                texts= [item.text() for item in items if item.checkState()]
     65            else:
     66               
     67                texts= [items[mi.row()].text() for mi in w.selectedIndexes()]
    5868            if return_index:
    5969                return map(str_list.index, map(unicode, texts))
     
    6272        w.returnValue= returnValue
    6373        return w
    64     return baseDialog( None, title, text, create_widget, buttons)
     74    qt_str_list= baseDialog( None, title, text, create_widget, buttons)
     75    print qt_str_list
     76    return map(unicode, qt_str_list)
    6577
    6678def force_choice(cant_cancel=True, return_at_least_one= True, *args, **kwargs):
  • internals/2011/cmce/trunk/gui/gui_library/output.py

    r5005 r5408  
    33def error(parent, text, title="Error"):
    44    QtGui.QMessageBox.critical(parent, title, text)
     5
     6def info(parent, text, title="Information"):
     7    QtGui.QMessageBox.information(parent, title, text)
  • internals/2011/cmce/trunk/gui/run.py

    r5005 r5408  
    11#!/usr/bin/python
    22import sys, os
    3 from PyQt4 import QtGui
    4 from PyQt4.QtCore import QObject, QString, SIGNAL
    5 from main import  Ui_MainWindow
     3import pickle
     4import logging
     5import threading, subprocess
     6
     7from PyQt4 import QtGui, uic
     8from PyQt4.QtCore import QObject, QString, SIGNAL, QThread
     9
     10CUSTOMIZATION_DIR= "~/tmp"   #temporary directory to hold customization files. MUST be absolute path
     11PROGRESSPROFILE_FILE= "progress_profile.pickle"
     12DO_PROFILE= False  #if this variable is set to True, the program will profile the customization and write timings to PROGRESSPROFILE_FILE, instead of running normally
     13CUSTOMIZATION_MESSAGE_HELP="CMCE is now customizing your CD. After a while, a new window will appear with a functioning Caixa Magica system inside. Customize this system to your liking, and logout of you session when you're done. To do this, you need to press the power icon on the top right corner, and select 'Log Out...'"
     14CUSTOMIZATION_MESSAGE_ERROR="An error occurred in the customization process"
     15CUSTOMIZATION_MESSAGE_SUCCESS="Customization finished!"
     16CUSTOMIZATION_EXIT_STATUS=0
     17
     18VNC_PROCESS= None
     19VNC_HOST= "localhost"
     20VNC_PORT= "21693"
     21VNC_SIGNALS= ["run_vnc_signal", "stop_vnc_signal"]
     22LOCATION_DETECTOR_FILE="uck_progressmonitor.py"
     23if os.path.exists(LOCATION_DETECTOR_FILE):
     24    #cmce in current directory
     25    pass
     26else:
     27    os.chdir("/usr/lib/cmce")
     28if not os.path.exists(LOCATION_DETECTOR_FILE):
     29    raise Exception("Could not find CMCE installation directory")
     30UI_FILE= "main.ui"   #QtDesigner file
     31
    632from gui_library.input  import choice, force_choice
    7 from gui_library.output import error
     33from gui_library.output import error, info
     34from process_utils import run_function_with_callback_on_output
    835import uck
     36import uck_progressmonitor
     37
     38FormClass, FormBaseClass= uic.loadUiType( UI_FILE )  #compile interface
     39
    940
    1041def check_iso(filename):
     
    1748    return True
    1849
     50def run_vnc_process(host, port="5900"):
     51    global VNC_PROCESS
     52    assert VNC_PROCESS is None
     53    VNC_PROCESS= subprocess.Popen("vncviewer {host}:{port}".format(host=host, port=port), shell=True)
     54
     55def kill_vnc_process():
     56    assert not VNC_PROCESS is None
     57    VNC_PROCESS.kill()
     58    VNC_PROCESS= None
     59
    1960def choose_languages():
    2061    language_packs= force_choice(False, True, uck.available_language_packs(), "Choose which languages you want your system to support", multi_choice=True)
     
    2667        return (language_packs, boot_languages, default_boot_language)
    2768
    28 def start_customization():
    29     iso_file= get_iso()
    30     cust_dir= os.path.expanduser("~/tmp")   #MUST be absolute path
    31     if not check_iso(iso_file):
    32          return
    33     args= {"remaster_dir":cust_dir, "source_iso":iso_file}
    34     if change_language():
     69def uck_arguments(iso, customization_dir, change_language, graphical_customization):
     70    args= {"remaster_dir":customization_dir, "source_iso":iso}
     71    if change_language:
    3572        lp, bl, dbl= choose_languages()
    3673        args.update({"language_packs":lp, "livecd_locales":bl, "livecd_locale": dbl})
    37     if  run_graphic_customization():
     74    if  graphical_customization:
    3875        args.update({"run_graphical_customization":True})
     76    return args
    3977
    40     print "CUSTOMIZATION STARTED WITH ARGS:", args
    41     c_process= uck.run_customization(**args)
    42     #while True:
    43     #    a,b= [pipe.readline() for pipe in (c_process.stdout, c_process.stderr)]
    44     #    if not (a or b):
    45     #        break
    46     #    print (a if a else b),
    47     print "RETURN CODE: ", c_process.wait()
     78
     79class CustomizationClass(QThread):
     80    def __init__(self, parent=None):
     81        QThread.__init__(self, parent)
     82
     83    def progress_callback(self, x):
     84            if x==VNC_SIGNALS[0]:
     85                run_vnc_process(VNC_HOST, VNC_PORT)
     86            elif x==VNC_SIGNALS[1]:
     87                kill_vnc_process()
     88            else:
     89                if type(x)==float:
     90                    self.emit(SIGNAL("setprogress(float)"), x)
     91                else:
     92                    logging.warn("unknown monitored string received: "+x)
     93
     94    def run(self):
     95        args=self.args
     96        if DO_PROFILE:
     97            profile= uck_progressmonitor.profile( uck.customization, (), args)
     98            print "profile:",profile
     99            pickle.dump( profile, open(PROGRESSPROFILE_FILE, "wb" ))
     100        else:
     101            profile= pickle.load( open( PROGRESSPROFILE_FILE, "rb"))
     102            CUSTOMIZATION_EXIT_STATUS= uck_progressmonitor.run( uck.customization, (), args, profile, self.progress_callback, VNC_SIGNALS )
     103
     104    def customize(self, args):
     105        self.args=args
     106        self.start()
    48107
    49108
     
    51110
    52111
    53 def browse_iso():
    54     filename= QtGui.QFileDialog().getOpenFileName(None, "Select ISO", "", "ISO image (*.iso)")
    55     if filename:
    56         myapp.pathEdit.setText(filename)
    57112
    58 def get_iso():
    59     return myapp.pathEdit.text()
    60 
    61 def set_progress(fraction):
    62     assert 0<=fraction<=1
    63     myapp.progressBar.setValue( int(100*fraction) )
    64 
    65 def change_language():
    66     return myapp.languageCheck.isChecked()
    67 
    68 def run_graphic_customization():
    69     return myapp.graphicalCheck.isChecked()
    70 
    71 class MyMainWindow(Ui_MainWindow, QtGui.QMainWindow):
     113class MyMainWindow(FormClass, FormBaseClass):
    72114    def __init__(self):
    73115        QtGui.QMainWindow.__init__(self)
     
    76118
    77119    def setupSignals(self):
    78         QObject.connect(self.browseButton, SIGNAL("clicked()"), browse_iso)
    79         QObject.connect(self.startButton, SIGNAL("clicked()"), start_customization)
     120        QObject.connect(self.browseButton, SIGNAL("clicked()"), self.browse_iso)
     121        QObject.connect(self.startButton, SIGNAL("clicked()"), self.start_customization)
    80122
     123    def disable_interface(self):
     124        self.startButton.setEnabled( False )
    81125
     126    def enable_interface(self):
     127        self.startButton.setEnabled( True )
     128
     129    def browse_iso(self):
     130        filename= QtGui.QFileDialog().getOpenFileName(None, "Select ISO", "", "ISO image (*.iso)")
     131        if filename:
     132            self.pathEdit.setText(filename)
     133
     134    def get_iso(self):
     135        return self.pathEdit.text()
     136
     137    def set_progress(self, fraction):
     138        assert 0<=fraction<=1
     139        self.progressBar.setValue( int(100*fraction) )
     140
     141    def change_language(self):
     142        return self.languageCheck.isChecked()
     143
     144    def run_graphic_customization(self):
     145        return self.graphicalCheck.isChecked()
     146
     147    def finish(self):
     148        if CUSTOMIZATION_EXIT_STATUS!=0:
     149            error(self, CUSTOMIZATION_MESSAGE_ERROR)
     150        else:
     151            info(self, CUSTOMIZATION_MESSAGE_SUCCESS)
     152        self.enable_interface()
     153
     154    def start_customization(self):
     155        iso_file= self.get_iso()
     156        if not check_iso(iso_file):
     157             return
     158        cust_dir= os.path.expanduser(CUSTOMIZATION_DIR)
     159        arguments= uck_arguments(iso_file, cust_dir, self.change_language(), self.run_graphic_customization())
     160        self.disable_interface()
     161        self.ct= CustomizationClass()
     162        self.connect(self.ct, SIGNAL("finished()"), self.finish)
     163        self.connect(self.ct, SIGNAL("terminated()"), self.finish)
     164        self.connect(self.ct, SIGNAL("setprogress(float)"), self.set_progress)
     165        info(self,  CUSTOMIZATION_MESSAGE_HELP )
     166        self.ct.customize(arguments)
    82167
    83168if __name__ == "__main__":
     169    logging.basicConfig(level=logging.DEBUG)
    84170    app = QtGui.QApplication(sys.argv)
    85171    myapp = MyMainWindow()
  • internals/2011/cmce/trunk/gui/uck.py

    r5005 r5408  
     1import shutil
     2import sys, os
    13import subprocess
    2 import os
    3 import shutil
    4 import sys
    5 from collections import namedtuple
     4from process_utils import shell
    65
    76def set_path():
     
    1312        SCRIPTS_DIR= "uck"
    1413        LIBRARIES_DIR= SCRIPTS_DIR+"/libraries"
     14        print "WARNING! Not using local UCK folder"
    1515    elif os.path.isdir("/usr/lib/uck"):
    1616        SCRIPTS_DIR= "/usr/bin"
     
    2323
    2424
    25 def shell(s, inp=None, assert_returncode=False):
    26     shellreturn= namedtuple("shellreturn", "stdout stderr returncode")
    27     p= subprocess.Popen(s, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
    28     if inp:
    29         p.stdin.write(inp)
    30     p.stdin.close()
    31     o,e,r=  p.stdout.read(), p.stderr.read(), p.wait()
    32     if assert_returncode and r!=0:
    33         raise Exception("return code != 0 in command: \n\n"+s+"\n\nstdout:\n"+o+"\n\nstderr:\n"+e+"\n\nreturncode:\n"+str(r))
    34     return shellreturn(o,e,r)
    35 
    3625def available_language_packs():
    37     return shell('''apt-cache pkgnames language-support | egrep '^language-support-.{2,7}$' | cut -b 18- | sort''').split("\n")[:-1]
     26    return shell('''apt-cache pkgnames language-support | egrep '^language-support-.{2,7}$' | cut -b 18- | sort''').stdout.split("\n")[:-1]
    3827
    3928def available_boot_languages():
     
    7766        var= "yes" if var else "no"
    7867    elif type(var)==list or type(var)==tuple:
    79         assert all(map(lambda x: type(x)==str, var))
     68        assert all(map(lambda x: isinstance(x, basestring), var))
    8069        var= " ".join(var)
    8170    elif var is None:
     
    8574    open(filename, "w").write(var)
    8675
    87 def run_customization(remaster_dir, source_iso, remove_win32_files=False, iso_description="Customized live CD", run_graphical_customization=False, language_packs=[], livecd_locales=[], livecd_locale=None, desktop_types=["gnome","kde"], print_output=True):
     76
     77def customization(remaster_dir, source_iso, remove_win32_files=False, iso_description="Customized live CD", run_graphical_customization=False, language_packs=[], livecd_locales=[], livecd_locale=None, desktop_types=["gnome","kde"]):
     78    print "customization process started"
     79    print "tick"
    8880    scripts_dir= SCRIPTS_DIR
    8981    libraries_dir= LIBRARIES_DIR
     
    9284    assert remaster_dir[-1]!="/"
    9385    if len(iso_description)>32:
    94         raise Exception("ISO description too long (max 32 characters)")
     86        print "ISO description too long (max 32 characters)"
     87        return 1
    9588    if not os.path.exists(remaster_dir):
    9689        os.mkdir(remaster_dir)
     
    10093            shutil.rmtree(build_dir)
    10194    print "copying scripts, writing var..."
     95    print "tick"
    10296    shutil.copytree(libraries_dir+"/customization-profiles/localized_cd/", build_dir )
    10397
     
    117111
    118112    print "starting UCK build..."
    119     command= '''export UCK_USERNAME=$USER ; {scripts_dir}/uck-remaster "{source_iso}" "{build_dir}" "{remaster_dir}"'''.format( **locals() )
    120     if print_output:
    121         process= subprocess.Popen(command, shell=True, stdout=sys.stdout, stderr=sys.stderr)
    122     else:
    123         process= subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    124     return process
    125     #if tmp.returncode!=0:
    126     #    raise Exception("Build failure\n"+tmp.stdout+"\n\n"+tmp.stderr)
     113    os.chdir(SCRIPTS_DIR)
     114    print "tick"
     115    command= '''export UCK_USERNAME=$USER ; gksudo ./uck-remaster "{source_iso}" "{build_dir}" "{remaster_dir}"'''.format( **locals() )
     116    process= subprocess.Popen(command, shell=True, stdout=sys.stdout, stderr=sys.stderr)
     117    returncode= process.wait()
     118    return returncode
    127119
    128120
  • internals/2011/cmce/trunk/uck/libraries/customization-profiles/localized_cd/customize

    r5005 r5408  
    7878}
    7979
     80SCRIPT_DIR=`dirname "$0"`
    8081
    8182# Inherit environment
     
    135136        REMOVED_PACKAGES=`dpkg-query --show | cut -f1 | grep -E '^(language-pack|language-support)' | grep -Ev "[-]($LANGPACKS_CONCATENATED)\>"`
    136137        remove_packages $REMOVED_PACKAGES ||
     138
    137139                failure "Removing packages failed, error=$?"
    138140fi
    139141
     142
     143
    140144if [ "$RUN_MANUAL_CUSTOMIZATIONS" = "yes" ] ; then
     145        export DISPLAY=:25
     146        VNC_PORT=21693
     147        VNC_ALLOW_IP=127.0.0.1
     148        CUSTOMIZATION_USER=customization-user
    141149        eval `dbus-launch --sh-syntax --exit-with-session 2>/dev/null`
    142         apt-get update || apt-get update
    143         apt-get install xvfb x11vnc
    144         export DISPLAY=:5
    145         Xvfb :1 -screen 0 1024x768x16 &
    146         x11vnc -display :1 -bg -nopw -listen localhost -xkb
    147         gnome-session
    148         apt-get purge xvfb x11vnc
     150        #enable universe repository to install xvfb, x11vnc
     151        cp -a /etc/apt/sources.list sources.list.bak
     152        sed 's/^#deb \(.*\)caixamagica\.pt\(.*\)universe/deb \1caixamagica.pt\2universe/' sources.list.bak > /etc/apt/sources.list
     153        #TODO: create user, su to it, etc
     154        apt-get update || apt-get update || failure "apt-get update failed"
     155        install_packages xvfb x11vnc || failure "Couldn't install needed packages"
     156        #useradd $CUSTOMIZATION_USER --create-home
     157        Xvfb $DISPLAY -screen 0 800x600x16 &
     158        XVFB_PID=$!
     159        sleep 1
     160        x11vnc -display $DISPLAY -rfbport $VNC_PORT -nopw -listen $VNC_ALLOW_IP -xkb &
     161        X11VNC_PID=$!
     162        sleep 1
     163        echo "running graphical environment..."
     164        echo "run_vnc_signal"
     165        gnome-session || startkde || failure "failed to run desktop environment"
     166        echo "stop_vnc_signal"
     167        kill -9 $X11VNC_PID
     168        kill -9 $XVFB_PID
     169        #copy customized home, for later recreation
     170        cp -pR /root /customization-home || failure "failed do copy customizations"
     171        remove_packages xvfb x11vnc || failure "failed to remove packages"
     172        apt-get autoremove
     173        cp -a sources.list.bak /etc/apt/sources.list || failure "failed to restore sources.list"
     174        #userdel --remove $CUSTOMIZATION_USER
    149175fi
    150176
  • internals/2011/cmce/trunk/uck/libraries/customization-profiles/localized_cd/customize_iso

    r5005 r5408  
    190190        fi
    191191fi
     192echo "d-i preseed/late_command string mkdir /target/preseeded" >> preseed.cfg
     193
     194
     195#Add a command to preseeding to make livecd copy root home to user home on finishing instalation (home customizations stored on /root)
     196BOOT_FILE=../isolinux/txt.cfg
     197if [ -e ../preseed/caixamagica.seed ]
     198        then
     199        #GNOME
     200        PRESEED_FILE=../preseed/caixamagica.seed
     201else
     202        if [ -e ../preseed/caixamagicakde.seed ]
     203        then
     204                PRESEED_FILE=../preseed/caixamagicakde.seed
     205        else
     206                failure "could not find preseed file"
     207        fi
     208fi
     209
     210CUST_COMMAND='CUSTDIR="/target/customization-home" ;  USERHOME=/target`cat /target/etc/passwd | grep 1000 | cut -d ":" -f 6` ; chown -R 1000:1000 $CUSTDIR && rsync -a $CUSTDIR/ $USERHOME && rm -rf $CUSTDIR && mkdir /target/preseeded'
     211echo Adding customization copying command to preseeding
     212echo "ubiquity ubiquity/success_command string $CUST_COMMAND" >> $PRESEED_FILE
     213#change boot parameters to do run ubiquity in automatic mode
     214cat $BOOT_FILE | sed "s/--/automatic-ubiquity --/" | tee $BOOT_FILE > /dev/null
     215
     216#the PRESEED_FILE must be specified in BOOT_FILE, in the following way:
     217#append [...] file=/cdrom/[PRESEED_FILE] [...]
  • internals/2011/cmce/trunk/uck/uck-remaster

    r4876 r5408  
    129129#############
    130130
     131echo tick
    131132if [ "$CUSTOMIZE_ISO" = "yes" ] ; then
    132133        $SCRIPTS_DIR/uck-remaster-unpack-iso $use_mount "$ISO_IMAGE" "$REMASTER_HOME"
     
    134135fi
    135136
     137echo tick
    136138if [ "$CUSTOMIZE_ISO" = "yes" ] && [ "$CUSTOMIZE_ROOTFS" = "yes" ] ; then
    137139        $SCRIPTS_DIR/uck-remaster-unpack-rootfs $use_mount "$REMASTER_HOME"
     
    143145###############
    144146
     147echo tick
    145148if [ "$REMOVE_WIN32_FILES" = "yes" ]; then
    146149        "$SCRIPTS_DIR/uck-remaster-remove-win32-files" "$REMASTER_HOME"
     
    148151fi
    149152
     153echo tick
    150154if [ "$CUSTOMIZE_ISO" = "yes" ] && [ "$CUSTOMIZE_ROOTFS" = "yes" ]; then
    151155        if [ "$COPY_CUSTOMIZE_DIR" = "yes" ]; then
     
    158162fi
    159163
     164echo tick
    160165if [ "$CUSTOMIZE_ISO" = "yes" ] ; then
    161166        echo "Running ISO customization script $CUSTOMIZE_DIR/customize_iso..."
     
    170175fi
    171176
     177echo tick
    172178if [ "$CUSTOMIZE_INITRD" = "yes" ] ; then
    173179        $SCRIPTS_DIR/uck-remaster-unpack-initrd "$REMASTER_HOME"
     
    175181fi
    176182
     183echo tick
    177184if [ "$CUSTOMIZE_INITRD" = "yes" ]; then
    178185        echo "Running initrd customization script $CUSTOMIZE_DIR/customize_initrd..."
     
    186193###########
    187194
     195echo tick
    188196if [ "$CUSTOMIZE_INITRD" = "yes" ] ; then
    189197        $SCRIPTS_DIR/uck-remaster-pack-initrd "$REMASTER_HOME"
     
    191199fi
    192200
     201echo tick
    193202if [ "$CUSTOMIZE_ROOTFS" = "yes" ] ; then
    194203        if [ "$CLEAN_DESKTOP_MANIFEST" = "yes" ]; then
     
    207216#############
    208217
     218echo tick
    209219if [ "$COPY_CUSTOMIZE_DIR" = "yes" ]; then
    210220        # since we copied the customization-scripts dir from outside
Note: See TracChangeset for help on using the changeset viewer.