{"commit":"9c359fd73430cdbc654723965cd75f7d79baa189","subject":"before update","message":"before update\n","repos":"yurifrl\/spree-ember,yurifrl\/yebo-ember,hhff\/ember-cli-spree-core,yebo-ecommerce\/ember,yebo-ecommerce\/ember,hhff\/spree-ember,givanse\/spree-ember,yurifrl\/yebo-ember,yurifrl\/spree-ember,hhff\/ember-cli-spree-core,vulk\/spree-ember,vulk\/spree-ember,hhff\/spree-ember,azclick\/yebo-ember,yurifrl\/spree-ember,yurifrl\/yebo-ember,hhff\/spree-ember,azclick\/yebo-ember,givanse\/spree-ember,givanse\/spree-ember,azclick\/yebo-ember,yebo-ecommerce\/ember,vulk\/spree-ember","old_file":"app\/objects\/spree.em","new_file":"app\/objects\/spree.em","new_contents":"class Spree extends Ember.Object with Ember.Evented\n key: 'spree_ember'\n\n # todo globalize environment config\n\n orderToken: null\n orderId: null\n\n init: ->\n @restore @localStorageData()\n\n # Persist Order Details to Local Storage\n persist: (data) ->\n @restore data\n data = JSON.stringify data or {}\n localStorage.setItem @key, data\n\n restore: (data) ->\n for key, value of data\n @set key, value\n\n localStorageData: ->\n data = localStorage.getItem @key\n JSON.parse data or \"{}\"\n\n clear: ->\n localStorage.removeItem @key\n\n # TODO - This needs to save to local storage\n clearCurrentOrder: ->\n @orderId = null\n\n\n +computed orderId\n currentOrder: ->\n @store.find('order', @orderId) if @orderId\n\n # TODO - The developer should be able to\n # overwrite these steps.\n +computed currentOrder.state\n currentOrderCanAdvance: ->\n switch @currentOrder.state\n when 'cart' then true\n when 'address'\n @currentOrder.shipAddress and @currentOrder.billAddress\n when 'delivery'\n false\n # Has shipping rate for each shipment\n when 'payment'\n false\n # Order has a Payment\n when 'confirm' then true\n when 'complete' then false\n\n advanceOrderState: ->\n if @currentOrderCanAdvance\n @applicationAdapter.ajax(@nextURL, 'PUT').then(\n (order) =>\n @store.pushPayload order\n @trigger 'spreeOrderDidAdvance'\n (error) =>\n @trigger 'spreeOrderDidNotAdvance', error\n )\n else\n @trigger 'spreeOrderCanNotAdvance'\n\n saveCurrentOrder: ->\n @currentOrder.content.save().then(\n (order) =>\n debugger\n (error) =>\n debugger\n )\n\n\n +computed container\n applicationAdapter: ->\n @container.lookup('adapter:application')\n\n +computed orderId\n nextURL: ->\n \"#{@applicationAdapter.buildURL('checkout', @currentOrder.id)}\/next.json}\"\n\n`export default Spree`","old_contents":"class Spree extends Ember.Object with Ember.Evented\n key: 'spree_ember'\n\n # todo globalize environment config\n\n orderToken: null\n orderId: null\n\n init: ->\n @restore @localStorageData()\n\n # Persist Order Details to Local Storage\n persist: (data) ->\n @restore data\n data = JSON.stringify data or {}\n localStorage.setItem @key, data\n\n restore: (data) ->\n for key, value of data\n @set key, value\n\n localStorageData: ->\n data = localStorage.getItem @key\n JSON.parse data or \"{}\"\n\n clear: ->\n localStorage.removeItem @key\n\n # TODO - This needs to save to local storage\n clearCurrentOrder: ->\n @orderId = null\n\n\n +computed orderId\n currentOrder: ->\n @store.find('order', @orderId) if @orderId\n\n # TODO - The developer should be able to\n # overwrite these steps.\n +computed currentOrder.state\n currentOrderCanAdvance: ->\n switch @currentOrder.state\n when 'cart' then true\n when 'address'\n @currentOrder.shipAddress and @currentOrder.billAddress\n when 'delivery'\n false\n # Has shipping rate for each shipment\n when 'payment'\n false\n # Order has a Payment\n when 'confirm' then true\n when 'complete' then false\n\n advanceOrderState: ->\n if @currentOrderCanAdvance\n @applicationAdapter.ajax(@nextURL, 'PUT').then(\n (order) =>\n @store.pushPayload order\n @trigger 'spreeOrderDidAdvance'\n (error) =>\n @trigger 'spreeOrderDidNotAdvance', error\n )\n else\n @trigger 'spreeOrderCanNotAdvance'\n\n saveCurrentOrder: ->\n @currentOrder.save().then(\n (order) =>\n debugger\n (error) =>\n debugger\n )\n\n\n +computed container\n applicationAdapter: ->\n @container.lookup('adapter:application')\n\n +computed orderId\n nextURL: ->\n \"#{@applicationAdapter.buildURL('checkout', @currentOrder.id)}\/next.json}\"\n\n`export default Spree`","returncode":0,"stderr":"","license":"mit","lang":"EmberScript"} {"commit":"7dfde0bea1e64d3167c32e3038f9a29fce3f8dd2","subject":"Fix Emscripten 486-style makefile","message":"Fix Emscripten 486-style makefile\n","repos":"TheFakeMontyOnTheRun\/dungeons-of-noudar,TheFakeMontyOnTheRun\/dungeons-of-noudar","old_file":"DungeonsOfNoudar486\/Makefile.em","new_file":"DungeonsOfNoudar486\/Makefile.em","new_contents":"CXXFLAGS = -O3 -Wall -DEA_PLATFORM_SAMSUNG_TV -DDONT_LOAD_LEVEL_UPON_START -DSDLSW -DVGA -g -IDOS-version -I..\/stb -I..\/fixed_point\/include -fpermissive -Wno-narrowing -c -std=c++14 -ferror-limit=1 -s USE_ZLIB=1 -s USE_LIBPNG=1 -I..\/noudar-core\/noudar-core\/include -Iinclude -I..\/noudar-rendering -I..\/gles2-renderer\/ -s ALLOW_MEMORY_GROWTH=1 -I..\/noudar-core\/EASTL\/include -I..\/noudar-core\/EASTL\/test\/packages\/EABase\/include\/Common -DUSE_ITEMS_INSTANTLY -fpermissive -Wno-narrowing\nLDFLAGS = -O3 -s USE_ZLIB=1 -s USE_LIBPNG=1 -s --preload-file .\/data.pfs --use-preload-plugins -s ALLOW_MEMORY_GROWTH=1\nCXX = em++\nCC = emcc\n\n#CXXFLAGS = -Wall -std=c++14 -O3 --preload-file emdata --use-preload-plugins -g -DSDLSW -DVGA -DEA_PLATFORM_SAMSUNG_TV -Iinclude -c -Istb -fpermissive -fomit-frame-pointer -fno-exceptions -ffast-math -I..\/fixed_point\/include -IDOS-version -I..\/fixed_point\/include -Iinclude -I..\/stb -I..\/noudar-core\/noudar-core\/include -I..\/noudar-core\/EASTL\/include -I..\/noudar-core\/EASTL\/test\/packages\/EABase\/include\/Common -I..\/noudar-rendering -I..\/gles2-renderer -fpermissive -Wno-narrowing -DUSE_ITEMS_INSTANTLY -s DEMANGLE_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 -Wno-narrowing\n#LDFLAGS = -O3 --preload-file emdata --use-preload-plugins -s USE_ZLIB=1 -s USE_LIBPNG=1 -s -s DEMANGLE_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 ASSERTIONS=2\n\nOBJS = main.o \\\n events.o \\\n src\/CRenderer_Rasterization.o \\\n src\/CRenderer_Tesselation.o \\\n SDLVersion\/CSDLRenderer.o \\\n\t OPL2LPT\/MusicSDL.o \\\n src\/CRenderer.o \\\n src\/RasterizerCommon.o \\\n src\/NativeBitmap.o \\\n src\/CTile3DProperties.o \\\n\tsrc\/CPackedFileReader.o \\\n\tsrc\/VisibilityStrategy.o \\\n ..\/noudar-rendering\/LoadPNG.o \\\n ..\/noudar-core\/noudar-core\/src\/Vec2i.o \\\n ..\/noudar-core\/noudar-core\/src\/CActor.o \\\n ..\/noudar-core\/noudar-core\/src\/CMonster.o \\\n ..\/noudar-core\/noudar-core\/src\/CMonsterGenerator.o \\\n ..\/noudar-core\/noudar-core\/src\/CTeam.o \\\n ..\/noudar-core\/noudar-core\/src\/CMap.o \\\n ..\/noudar-core\/noudar-core\/src\/Common.o \\\n ..\/noudar-core\/noudar-core\/src\/CCharacter.o \\\n ..\/noudar-core\/noudar-core\/src\/CCharacterArchetype.o \\\n ..\/noudar-core\/noudar-core\/src\/CDoorway.o \\\n ..\/noudar-core\/noudar-core\/src\/IFileLoaderDelegate.o \\\n ..\/noudar-core\/noudar-core\/src\/IMapElement.o \\\n ..\/noudar-core\/noudar-core\/src\/CGame.o \\\n ..\/noudar-core\/noudar-core\/src\/CItem.o \\\n ..\/noudar-core\/noudar-core\/src\/CStorageItem.o \\\n ..\/noudar-core\/noudar-core\/src\/CPlainFileLoader.o \\\n ..\/noudar-core\/noudar-core\/src\/CGameDelegate.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/IGameCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CMoveActorCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CLoadNewLevelCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CTurnActorCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CQuitCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CNullCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CEndTurnCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CPickItemCommand.o \\\n\t..\/noudar-core\/noudar-core\/src\/commands\/CSuggestItemCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CDropItemCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CUseCurrentItemCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CCycleNextItemCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CCyclePreviousItemCommand.o\n\n$(TARGET):\t$(OBJS)\n\t$(CXX) -o $(TARGET) $(OBJS) $(LIBS)\n\nTARGET = noudar.html\n\n$(TARGET):\t$(OBJS)\n\t$(CXX) -o $(TARGET) $(OBJS) $(LDFLAGS)\n\nall:\t$(TARGET)\n\nclean:\n\trm -f $(OBJS) $(TARGET)\n\trm *~\n\trm *.js\n\trm *.mem\n\trm *.html\n\trm *.data\n\n","old_contents":"CXXFLAGS = -O3 -Wall -DEA_PLATFORM_SAMSUNG_TV -DDONT_LOAD_LEVEL_UPON_START -DSDLSW -DVGA -g -IDOS-version -I..\/stb -I..\/fixed_point\/include -fpermissive -Wno-narrowing -c -std=c++14 -ferror-limit=1 -s USE_ZLIB=1 -s USE_LIBPNG=1 -I..\/noudar-core\/noudar-core\/include -Iinclude -I..\/noudar-rendering -I..\/gles2-renderer\/ -s ALLOW_MEMORY_GROWTH=1 -I..\/noudar-core\/EASTL\/include -I..\/noudar-core\/EASTL\/test\/packages\/EABase\/include\/Common -DUSE_ITEMS_INSTANTLY -fpermissive -Wno-narrowing\nLDFLAGS = -O3 -s USE_ZLIB=1 -s USE_LIBPNG=1 -s --preload-file .\/data.pfs --use-preload-plugins -s ALLOW_MEMORY_GROWTH=1\nCXX = em++\nCC = emcc\n\n#CXXFLAGS = -Wall -std=c++14 -O3 --preload-file emdata --use-preload-plugins -g -DSDLSW -DVGA -DEA_PLATFORM_SAMSUNG_TV -Iinclude -c -Istb -fpermissive -fomit-frame-pointer -fno-exceptions -ffast-math -I..\/fixed_point\/include -IDOS-version -I..\/fixed_point\/include -Iinclude -I..\/stb -I..\/noudar-core\/noudar-core\/include -I..\/noudar-core\/EASTL\/include -I..\/noudar-core\/EASTL\/test\/packages\/EABase\/include\/Common -I..\/noudar-rendering -I..\/gles2-renderer -fpermissive -Wno-narrowing -DUSE_ITEMS_INSTANTLY -s DEMANGLE_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 -Wno-narrowing\n#LDFLAGS = -O3 --preload-file emdata --use-preload-plugins -s USE_ZLIB=1 -s USE_LIBPNG=1 -s -s DEMANGLE_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 ASSERTIONS=2\n\nOBJS = main.o \\\n events.o \\\n src\/CRenderer_Rasterization.o \\\n src\/CRenderer_Tesselation.o \\\n SDLVersion\/CSDLRenderer.o \\\n\t OPL2LPT\/MusicSDL.o \\\n src\/CRenderer.o \\\n src\/RasterizerCommon.o \\\n src\/NativeBitmap.o \\\n src\/CTile3DProperties.o \\\n\tsrc\/CPackedFileReader.o \\\n\tsrc\/VisibilityStrategy.o \\\n\t..\/gles2-renderer\/Logger.o \\\n ..\/gles2-renderer\/LoadPNG.o \\\n ..\/noudar-core\/noudar-core\/src\/Vec2i.o \\\n ..\/noudar-core\/noudar-core\/src\/CActor.o \\\n ..\/noudar-core\/noudar-core\/src\/CMonster.o \\\n ..\/noudar-core\/noudar-core\/src\/CMonsterGenerator.o \\\n ..\/noudar-core\/noudar-core\/src\/CTeam.o \\\n ..\/noudar-core\/noudar-core\/src\/CMap.o \\\n ..\/noudar-core\/noudar-core\/src\/Common.o \\\n ..\/noudar-core\/noudar-core\/src\/CCharacter.o \\\n ..\/noudar-core\/noudar-core\/src\/CCharacterArchetype.o \\\n ..\/noudar-core\/noudar-core\/src\/CDoorway.o \\\n ..\/noudar-core\/noudar-core\/src\/IFileLoaderDelegate.o \\\n ..\/noudar-core\/noudar-core\/src\/IMapElement.o \\\n ..\/noudar-core\/noudar-core\/src\/CGame.o \\\n ..\/noudar-core\/noudar-core\/src\/CItem.o \\\n ..\/noudar-core\/noudar-core\/src\/CStorageItem.o \\\n ..\/noudar-core\/noudar-core\/src\/CPlainFileLoader.o \\\n ..\/noudar-core\/noudar-core\/src\/CGameDelegate.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/IGameCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CMoveActorCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CLoadNewLevelCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CTurnActorCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CQuitCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CNullCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CEndTurnCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CPickItemCommand.o \\\n\t..\/noudar-core\/noudar-core\/src\/commands\/CSuggestItemCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CDropItemCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CUseCurrentItemCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CCycleNextItemCommand.o \\\n ..\/noudar-core\/noudar-core\/src\/commands\/CCyclePreviousItemCommand.o\n\n$(TARGET):\t$(OBJS)\n\t$(CXX) -o $(TARGET) $(OBJS) $(LIBS)\n\nTARGET = noudar.html\n\n$(TARGET):\t$(OBJS)\n\t$(CXX) -o $(TARGET) $(OBJS) $(LDFLAGS)\n\nall:\t$(TARGET)\n\nclean:\n\trm -f $(OBJS) $(TARGET)\n\trm *~\n\trm *.js\n\trm *.mem\n\trm *.html\n\trm *.data\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"EmberScript"} {"commit":"1cd50f19fa9935d2646bd953562dd4e2fe293447","subject":"Fix TreeView rows colors","message":"Fix TreeView rows colors\n\nAdd parallel rules for fixing rows colors alternation in TreeViews,\ne.g, in Log activity side list, for Gtk 3.16+.\n\nNote that parser will skip the previous rules if he fails to parse\nthe new rules. Therefore, when adding \"parallel\" rules for newer\ngtk versions, these rules must be added separately. Otherwise, it\nwill break the previous rules for older gtk versions.\n\nSigned-off-by: Martin Abente Lahaye <8bfe93bb895fa79fd0e59550af8c97ff07863991@sugarlabs.org>\n","repos":"tchx84\/debian-pkg-sugar-artwork,i5o\/sugar-artwork,godiard\/sugar-artwork,sugarlabs\/sugar-artwork,sugarlabs\/sugar-artwork,tchx84\/debian-pkg-sugar-artwork,sugarlabs\/sugar-artwork,tchx84\/debian-pkg-sugar-artwork,godiard\/sugar-artwork,godiard\/sugar-artwork,i5o\/sugar-artwork,i5o\/sugar-artwork","old_file":"gtk3\/theme\/gtk-widgets.css.em","new_file":"gtk3\/theme\/gtk-widgets.css.em","new_contents":"${\nimport math\n\ndef my_floor(num):\n return int(math.floor(num))\n\ndef my_ceil(num):\n return int(math.ceil(num))\n\n\n# Should we set the line width in the engine to 2.25, and draw non pixel aligned lines?\n# Are these already the correct sizes for the XO?\n\n# These sizes need to be sanity checked ...\nif scaling == \"100\":\n xo = True\n line_width = 2.0 # 2.25px, rounded down\n thick_line_width = 3.5 # 3.5\n subcell_size = 15\n icon_base = 11\n bullet_size = 9.5\n font_height = 24\n default_padding = 6\n toolbutton_padding = 10\n radio_size = 26\n scale_trough_margin = 8\nelse: # About 72% of the XO size, adjusted so that eg. toolbuttons work\n xo = False\n line_width = 2.0 # 1.62 rounded up\n thick_line_width = 3.0 # 2.52\n subcell_size = 11 # 10.8\n icon_base = 8 # 7.92\n bullet_size = 6.5 # 6.84\n # This is a guess on the font size (Sans 10 at 96 DPI)\n font_height = 17\n default_padding = 4 # 4.32\n toolbutton_padding = 7 # 7.68\n radio_size = 18 # 18.72\n scale_trough_margin = 6 # 5.76\n\n\nscale_slider_width = my_floor(2 * subcell_size + line_width)\nthickness = my_ceil(line_width)\n\nicon_small = icon_base * 3\nicon_large = icon_base * 5\n\n}\n\n* {\n -sugar-focus-line: @white;\n\n \/* A lot of these will probably need to be changed, but this has to\n be done when the exact sizes are known *\/\n -GtkWidget-interior-focus: 0;\n\n \/* we have to disable focus border for GtkTreeView, see #1261 *\/\n -GtkTreeView-interior-focus: 1;\n -GtkTreeView-focus-line-width: 0;\n\n -GtkTextView-interior-focus: 1;\n\n -GtkWidget-focus-line-width: 0; \/* Prevents some drawing glitches *\/\n -GtkEntry-focus-line-width: 0;\n -GtkScale-focus-line-width: 0;\n -GtkWidget-focus-padding: 0;\n \/* 0.05 works good for both the sugar and sugar-xo themes *\/\n -GtkWidget-cursor-aspect-ratio: 0.05;\n\n -GtkWidget-wide-separators: true;\n -GtkWidget-separator-height: $thickness;\n -GtkWidget-separator-width: $thickness;\n\n -GtkWidget-scroll-arrow-hlength: $subcell_size;\n -GtkWidget-scroll-arrow-vlength: $subcell_size;\n\n -GtkRange-activate-slider: 1;\n\n \/* We fake the default border in the theme *\/\n -GtkButton-default-border: 0 0 0 0;\n -GtkButton-default-outside-border: 0 0 0 0;\n -GtkButton-image-spacing: $subcell_size;\n\n -GtkEntry-progress-border: $thickness $thickness $thickness $thickness;\n\n -GtkScrolledWindow-scrollbar-spacing: 0;\n\n -GtkExpander-expander-size: $font_height;\n -GtkExpander-expander-spacing: 2;\n\n -GtkTreeView-expander-size: $font_height;\n\n -GtkArrow-arrow-size: 1.0;\n\n -GtkToolbar-space-size: $(2*subcell_size);\n -GtkToolbar-shadow-type: none;\n\n -GtkProgressBar-min-horizontal-bar-height: $subcell_size;\n -GtkProgressBar-min-vertical-bar-width: $subcell_size;\n\n -GtkButtonBox-child-min-height: $(3*subcell_size);\n -GtkButtonBox-child-min-width: $(3*subcell_size);\n -GtkButtonBox-child-internal-pad-x: 0;\n -GtkButtonBox-child-internal-pad-y: 0;\n\n -GtkCheckButton-indicator-size: $radio_size;\n -GtkCheckButton-indicator-spacing: 3;\n\n -GtkWidget-text-handle-width: 110px;\n -GtkWidget-text-handle-height: 110px;\n}\n\n*:insensitive {\n color: @button_grey;\n}\n\n\/* Backgrounds and windows *\/\n\nGtkWindow {\n background-color: @panel_grey;\n color: @black;\n}\n\nGtkDialog {\n background-color: @black;\n color: @white;\n}\n\nSugarIntroWindow {\n background-color: @white;\n}\n\nSugarIntroWindow {\n color: @black;\n}\n\nGtkLabel, GtkLabel:insensitive {\n background-color: transparent;\n}\n\n\/* Buttons *\/\n\n.button {\n ${ border = max(0, my_ceil((3*subcell_size\/2.0 - icon_small \/ 2.0))) }\n padding: $(border)px $(border)px $(border)px $(border)px;\n border-width: $(thickness)px;\n border-color: @button_grey;\n border-style: solid;\n border-radius: $(2*subcell_size)px;\n background-color: @button_grey;\n color: @white;\n}\n\n.button:focused {\n border-color: @white;\n}\n\n.button:active {\n background-color: @white;\n}\n\n.button:insensitive {\n background-color: transparent;\n}\n\n.button:active:focused {\n color: @black;\n border-color: @button_grey;\n}\n\n\/* Spin buttons *\/\n\n.spinbutton.button {\n border-radius: 0px;\n border-width: 0px;\n border-style: solid;\n background-color: @button_grey;\n}\n\n.spinbutton.button:last-child {\n border-radius: 0px $(2*subcell_size)px $(2*subcell_size)px 0px;\n border-width: 0px 0px 0px $(thickness)px;\n border-style: solid;\n border-color: @selection_grey;\n}\n\n\n.spinbutton.button:active {\n background-color: @black;\n}\n\n.spinbutton.button:insensitive {\n background-color: @selection_grey;\n}\n\n\/* Toggle buttons *\/\n\nGtkToggleButton.button:active {\n background-color: @white;\n color: @black;\n}\n\n\/* Entries and views *\/\n\n.view {\n border-width: 0px;\n border-style: none;\n border-radius: 0px;\n padding: 0px;\n background-color: @white;\n}\n\nGtkTreeView {\n background-color: @button_grey;\n}\n\ncolumn-header .button,\ncolumn-header .button:hover:active {\n border-radius: 0px;\n background-color: @button_grey;\n border-width: 0px;\n}\n\nGtkTreeView row:even {\n background-color: @row_even;\n}\nGtkTreeView row:odd {\n background-color: @row_odd;\n}\n\nGtkTreeView row:nth-child(even) {\n background-color: @row_even;\n}\nGtkTreeView row:nth-child(odd) {\n background-color: @row_odd;\n}\n\n.entry {\n border-radius: $(2 * subcell_size)px;\n border-width: $(thickness)px;\n border-color: @text_field_grey;\n border-style: solid;\n background-color: @text_field_grey;\n color: @black;\n ${ entry_ythickness = my_ceil(0.2 * (subcell_size*3.0\/2.0 - thickness) + thickness) }\n ${ entry_xthickness = my_ceil(0.32 * (subcell_size*3.0\/2.0 - thickness) + thickness) }\n padding: $(2 * max(my_ceil((3*subcell_size - font_height - entry_ythickness*2)\/2.0),0))px $(2 * max(subcell_size - entry_xthickness, 0))px $(2 * max(my_floor((3*subcell_size - font_height - entry_ythickness*2)\/2.0), 0))px $(2 * max(subcell_size - entry_xthickness, 0))px;\n}\n\n.entry.progressbar {\n border-radius: $(2 * subcell_size)px;\n border-width: $(thickness)px;\n background-color: @selection_grey;\n}\n\n.entry:focused {\n background-color: @white;\n}\n\n.toolbar .entry:focused {\n border-color: @white;\n}\n\n.entry:insensitive {\n background-color: @button_grey;\n}\n\n.entry:insensitive {\n border-color: @button_grey;\n}\n\n.view:selected {\n background-color: @panel_grey;\n color: @black;\n}\n\n.entry:selected,\n.entry:selected:focused,\n.view:selected:focused {\n background-color: @selection_grey;\n color: @black;\n}\n\n.entry:selected,\n.entry:selected:focused {\n border-color: @selection_grey;\n}\n\n\/* Frames *\/\n\nGtkScrolledWindow.frame {\n border-style: solid;\n border-color: @selection_grey;\n border-width: $(thickness)px;\n border-radius: 0;\n padding: $(default_padding)px;\n}\n\nGtkFrame.frame.journal-preview-box {\n border-style: solid;\n border-color: @button_grey;\n border-width: $(thickness)px;\n}\n\n\/* Combo boxes *\/\n\nGtkComboBox {\n color: @white;\n}\n\nGtkComboBox .menu.button {\n border-color: transparent;\n border-radius: 0px;\n border-style: none;\n background-color: transparent;\n color: @white;\n}\n\nGtkComboBox .menu {\n -GtkWidget-scroll-arrow-hlength: $(my_floor(2.5 * subcell_size));\n -GtkWidget-scroll-arrow-vlength: $(my_floor(2.5 * subcell_size));\n}\n\n\/* Notebooks *\/\n\n.notebook {\n background-color: @selection_grey;\n color: @black;\n padding: 0px;\n -GtkNotebook-tab-overlap: -2;\n -GtkNotebook-tab-curvature: $default_padding;\n -GtkWidget-scroll-arrow-hlength: $(my_floor(2.5 * subcell_size));\n -GtkWidget-scroll-arrow-vlength: $(my_floor(2.5 * subcell_size));\n}\n\n.notebook.arrow {\n color: @white;\n}\n\n.notebook tab {\n background-color: @selection_grey;\n}\n\n\/* Setting white color to the tab labels using only the previous rule *\/\n\/* doesn't work, so we have to set white color to the GtkLabel, and make *\/\n\/* sure the buttons get black color in the next two rules: *\/\n.notebook tab GtkLabel {\n color: @white;\n padding: $(subcell_size)px 0;\n}\n\n.notebook tab .button GtkLabel {\n color: @black;\n}\n\n.notebook tab:active {\n background-color: @toolbar_grey;\n}\n\n.notebook tab .button {\n border-radius: $(toolbutton_padding)px;\n}\n\n\/* Browse Widgets *\/\n\nBrowseSearchWindow .view {\n background-color: @black;\n color: @white;\n border-color: @button_grey;\n border-width: 0 $(thickness)px $(thickness)px $(thickness)px;\n border-style: solid;\n}\n\n\/* Control panel *\/\n\nSugarSectionView {\n background-color: @white;\n color: @black;\n}\n\nSugarSectionView *:insensitive {\n background-color: @white;\n}\n\n\/* Alert *\/\n\nSugarAlert {\n background-color: @black;\n color: @white;\n}\n\nSugarAlert *:insensitive {\n background-color: @black;\n}\n\n.button SugarTimeoutIcon GtkLabel,\n.button SugarTimeoutIcon GtkLabel:prelight {\n background-color: @white;\n color: @button_grey;\n border-radius: $(2 * subcell_size)px;\n}\n\n.button SugarTimeoutIcon GtkLabel:active {\n background-color: @toolbar_grey;\n color: @white;\n}\n\n\/* Tray *\/\n\nSugarHTray, SugarVTray {\n background-color: @toolbar_grey;\n}\n\nSugarHTray * , SugarVTray * { background-color: @toolbar_grey;}\n\n\/* Menus and palettes *\/\n\nSugarPaletteWindowWidget,\nGtkPopover {\n border-width: $(thickness)px;\n border-color: @button_grey;\n border-style: solid;\n background-color: @black;\n color: @white;\n}\n\nSugarPaletteWindowWidget .view {\n color: @black;\n}\n\nSugarPaletteMenuWidget {\n background-color: @black;\n}\n\nSugarPaletteMenuWidget * {\n color: @white;\n}\n\nSugarPaletteWindow SugarGroupBox {\n background-color: @toolbar_grey;\n color: @white;\n}\n\nSugarPaletteWindow SugarGroupBox *:insensitive {\n background-color: @toolbar_grey;\n}\n\n.menu {\n background-color: @black;\n color: @white;\n\n -GtkMenu-scroll-arrow-vlength: $(my_floor(subcell_size\/0.7 + 2*thickness));\n -GtkMenu-horizontal-padding: $thickness;\n -GtkMenu-vertical-padding : $thickness;\n \/* This means the outline of the submenu overlaps with a palette.\n * However in the case of two normal menus, they are next to each other.\n * It is not possible to be smarter about this, because the style comes from\n * the submenu. *\/\n -GtkMenu-horizontal-offset : -$(line_width)px;\n -GtkMenu-vertical-offset : 0;\n\n padding: 0px;\n\n border-width: 2px;\n border-color: @button_grey;\n border-style: solid;\n}\n\n.menuitem {\n padding: $(subcell_size)px $((subcell_size * 3 - font_height) \/ 2)px;\n}\n\n.menuitem:prelight, .menuitem:hover {\n background-color: @button_grey;\n}\n\n.menuitem.separator {\n padding: 0;\n}\n\n.tooltip {\n background-color: @black;\n border-style: solid;\n border-width: $(thickness)px;\n border-color: @button_grey;\n}\n\n.tooltip * {\n color: @white;\n}\n\n\/* Scrollbars *\/\n\n.scrollbar {\n -GtkRange-slider-width: $(subcell_size + 2*thickness);\n -GtkRange-trough-border: 0;\n -GtkRange-stepper-size: 0;\n -GtkScrollbar-min-slider-length: $(3*subcell_size);\n -GtkScrollbar-has-forward-stepper: 0;\n -GtkScrollbar-has-backward-stepper: 0;\n -GtkScrollbar-has-secondary-forward-stepper: 0;\n -GtkScrollbar-has-secondary-backward-stepper: 0;\n}\n\n.scrollbar.trough {\n background-color: @button_grey;\n border-width: 0px;\n}\n\n.scrollbar.slider {\n background-color: @white;\n border-radius: $(2*subcell_size)px;\n border-width: $(thickness)px;\n border-color: @button_grey;\n border-style: solid;\n}\n\n.scrollbar.slider:active {\n background-color: @text_field_grey;\n}\n\n\/* Progress bars *\/\n\n\/* Scrollbar padding hack? What was that about? *\/\n\nGtkProgressBar.progressbar {\n background-color: @white;\n border-color: @button_grey;\n border-radius: $(subcell_size)px;\n border-style: solid;\n border-width: $(thickness)px;\n}\n\nGtkProgressBar.trough {\n background-color: @selection_grey;\n border-style: solid;\n border-radius: $(subcell_size)px;\n border-color: @button_grey;\n border-width: $(thickness)px;\n}\n\n.toolbar GtkProgressBar.trough,\nSugarPaletteWindowWidget GtkProgressBar.trough {\n background-color: @black;\n}\n\n\/* Separators *\/\n\n.separator {\n border-style: solid;\n border-color: @button_grey;\n border-width: $(thickness)px;\n}\n\n\/* Tool buttons *\/\n\n.toolbar {\npadding: 0px;\nbackground-color: @toolbar_grey;\ncolor: @white;\n}\n\n.toolbar .button,\nSugarPaletteWindowWidget SugarRadioToolButton .button {\n border-color: transparent;\n border-radius: 0px;\n border-style: none;\n}\n\n.toolbar .button #gtk-toolbar-arrow {\n padding: 0 $(subcell_size + default_padding)px;\n}\n\n.toolbar GtkToolButton .button,\n.toolbar SugarRadioToolButton .button,\nSugarPaletteWindowWidget SugarRadioToolButton .button,\nSugarPaletteWindowWidget GtkToolButton .button {\n background-color: transparent;\n border-radius: $(toolbutton_padding)px;\n padding: $(toolbutton_padding)px;\n}\n\n.toolbar GtkToolButton .button,\nSugarPaletteWindowWidget GtkToolButton .button:prelight {\n padding: $(toolbutton_padding - default_padding)px;\n border-width: $(default_padding)px;\n border-style: solid;\n background-clip: padding-box;\n}\n\n.toolbar GtkToolButton .button:prelight,\n.toolbar GtkToolButton .button:prelight GtkBox,\nSugarPaletteWindowWidget GtkToolButton .button:prelight {\n background-color: @black;\n}\n\n.toolbar SugarRadioToolButton *:active,\nSugarPaletteWindowWidget SugarRadioToolButton *:active,\n.toolbar SugarRadioToolButton *:active GtkBox,\n.toolbar SugarRadioToolButton *:checked,\n.toolbar SugarRadioToolButton *:checked GtkBox,\nSugarPaletteWindowWidget SugarRadioToolButton *:checked,\n.toolbar SugarToggleToolButton *:checked,\n.toolbar SugarToggleToolButton *:checked GtkBox,\nSugarPaletteWindowWidget SugarToggleToolButton *:checked {\n background-color: @button_grey;\n border-radius: $(toolbutton_padding)px;\n}\n\n.toolbar SugarRadioToolButton *:checked:prelight,\n.toolbar SugarRadioToolButton *:checked:prelight GtkBox,\nSugarPaletteWindowWidget SugarRadioToolButton *:checked:prelight,\n.toolbar SugarToggleToolButton *:checked:prelight,\n.toolbar SugarToggleToolButton *:checked:prelight GtkBox,\nSugarPaletteWindowWidget SugarToggleToolButton *:checked:prelight {\n background-color: @button_grey;\n}\n\nSugarPaletteWindowWidget SugarRadioToolButton *:checked:prelight,\nSugarPaletteWindowWidget SugarToggleToolButton *:checked:prelight {\n border-color: @button_grey;\n}\n\nSugarPaletteWindowWidget GtkToolButton .button:active {\n background-color: @button_grey;\n}\n\n.toolbar GtkToolButton .button:active {\n background-color: @button_grey;\n border-radius: $(toolbutton_padding)px;\n}\n\nSugarPaletteWindowWidget GtkScrolledWindow {\n background-color: @black;\n}\n\n.toolbar GtkComboBox .button {\n border-radius: $(2*subcell_size)px;\n}\n\n\/* Scales *\/\n\n.scale {\n -GtkScale-slider-length: $scale_slider_width;\n -GtkRange-slider-width: $scale_slider_width;\n}\n\n\/* We have to override the color of the scale, otherwise the slider\n background image is invisible or not set for this palettes.\n Upstream bug: https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=686703 *\/\nSugarPaletteWindowWidget .scale {\n color: transparent;\n}\n\n.scale.trough {\n background-color: @button_grey;\n border-style: solid;\n border-color: @button_grey;\n border-width: $(thickness)px;\n margin: $(scale_trough_margin)px 0;\n}\n\n.scale.trough.vertical {\n margin: 0 $(scale_trough_margin)px;\n}\n\n.scale.trough:focused {\n border-color: @white;\n}\n\n.scale.trough.top,\n.scale.trough.left {\n background-color: @white;\n}\n\n.scale.trough.top:focused,\n.scale.trough.left:focused {\n border-color: @selection_grey;\n}\n\n.scale.trough {\n border-radius: 0px $(2*subcell_size)px $(2*subcell_size)px 0px;\n}\n\n.scale.trough.vertical {\n border-radius: 0px 0px $(2*subcell_size)px $(2*subcell_size)px;\n}\n\n.scale.trough.top {\n border-radius: $(2*subcell_size)px $(2*subcell_size)px 0px 0px;\n}\n\n.scale.trough.left {\n border-radius: $(2*subcell_size)px 0px 0px $(2*subcell_size)px;\n}\n\n.scale.slider,\n.scale.slider:active {\n background-color: transparent;\n}\n\n.scale.slider {\n background-image: url(\"assets\/scale-slider.svg\");\n}\n\n.scale.slider:active {\n background-image: url(\"assets\/scale-slider-active.svg\");\n}\n\n\/* Radio and check buttons *\/\n\nGtkCheckButton {\n border: 1px solid @black;\n}\n\nGtkCheckButton:prelight {\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.toolbar GtkCheckButton,.toolbar .check,\nSugarPaletteWindowWidget .check {\n color: @theme_base_color;\n border: 1px solid @theme_base_color;\n}\n\n.radio,\n.radio row:selected,\n.radio row:selected:focused {\n background-image: url(\"assets\/radio.svg\");\n \/* Gtk 3.14+ expect these to be included in icon theme however we want to\n override that *\/\n -gtk-icon-source: url(\"assets\/radio.svg\");\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.radio:selected,\n.radio:selected row:selected,\n.radio:selected row:selected:focused {\n background-image: url(\"assets\/radio-selected.svg\");\n -gtk-icon-source: url(\"assets\/radio-selected.svg\");\n}\n\n.radio:active,\n.radio row:selected:active,\n.radio row:selected:focused:active {\n background-image: url(\"assets\/radio-active.svg\");\n -gtk-icon-source: url(\"assets\/radio-active.svg\");\n}\n\n.radio:checked,\n.radio row:selected:checked,\n.radio row:selected:focused:checked {\n background-image: url(\"assets\/radio-active.svg\");\n -gtk-icon-source: url(\"assets\/radio-active.svg\");\n}\n\n.radio:active:selected,\n.radio:selected row:selected:active,\n.radio:selected row:selected:focused:active {\n background-image: url(\"assets\/radio-active-selected.svg\");\n -gtk-icon-source: url(\"assets\/radio-active-selected.svg\");\n}\n\n.radio:checked:selected,\n.radio:selected row:selected:checked,\n.radio:selected row:selected:focused:checked {\n background-image: url(\"assets\/radio-active-selected.svg\");\n -gtk-icon-source: url(\"assets\/radio-active-selected.svg\");\n}\n\n.check,\n.check row:selected,\n.check row:selected:focused {\n background-image: url(\"assets\/checkbox-unchecked.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-unchecked.svg\");\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.check:selected,\n.check:selected row:selected,\n.check:selected row:selected:focused {\n background-image: url(\"assets\/checkbox-unchecked-selected.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-unchecked-selected.svg\");\n}\n\n.check:active,\n.check row:selected:active,\n.check row:selected:focused:active {\n background-image: url(\"assets\/checkbox-checked.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-checked.svg\");\n}\n\n.check:checked,\n.check row:selected:checked,\n.check row:selected:focused:checked {\n background-image: url(\"assets\/checkbox-checked.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-checked.svg\");\n}\n\n.check:active:selected,\n.check:selected row:selected:active,\n.check:selected row:selected:focused:active {\n background-image: url(\"assets\/checkbox-checked-selected.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-checked-selected.svg\");\n}\n\n.check:checked:selected,\n.check:selected row:selected:checked,\n.check:selected row:selected:focused:checked {\n background-image: url(\"assets\/checkbox-checked-selected.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-checked-selected.svg\");\n}\n\n\/* Tool items *\/\n\n.toolitem {\n \/* arrow in the toolbarbox *\/\n color: @white;\n \/* outline of the toolbarbutton when palette is expanded *\/\n border-style: solid;\n border-width: 2px;\n border-color: @button_grey;\n}\n\n\/* GtkImage *\/\n\nGtkImage {\n background-color: transparent;\n}\n\n\/* Sugar Frame Window *\/\n\nSugarFrameWindow {\n background-color: @toolbar_grey;\n}\n\n\/* Sugar Canvas icon *\/\n\nSugarCanvasIcon,\nSugarKeepIcon.button {\n border-color: transparent;\n border-radius: $(4 * thickness)px;\n border-width: 2px;\n border-style: solid;\n background-color: transparent;\n}\n\nSugarCanvasIcon:prelight,\nSugarKeepIcon.button:prelight {\n border-color: @zoom_views_prelight;\n background-color: @zoom_views_prelight;\n}\n\nSugarCanvasIcon:active,\nSugarKeepIcon.button.toggle-press {\n border-color: @zoom_views_active;\n background-color: @zoom_views_active;\n}\n\n\/* Sugar CellRenderer Icons *\/\n\n.cell.sugar-icon-cell {\n background-color: transparent;\n border-radius: $(4 * thickness)px;\n border-color: @white;\n border-width: $(thickness)px;\n border-style: solid;\n}\n\n.cell.sugar-icon-cell:prelight {\n background-color: @zoom_views_prelight;\n}\n\n.cell.sugar-icon-cell:active {\n background-color: @zoom_views_active;\n}\n\n\/* CellRendererProgress *\/\n\n.cell.progressbar, .cell.trough {\n border-style: solid;\n border-width: $(thickness)px;\n border-color: @selection_grey;\n border-radius: $(2*subcell_size)px;\n}\n\n.cell.progressbar {\n background-color: @white;\n}\n\n.cell.trough {\n background-color: @text_field_grey;\n}\n\n\/* Text cursor handles *\/\n\n.cursor-handle.top,\n.cursor-handle.bottom {\n background-color: transparent;\n box-shadow: none;\n border-style: none;\n border-image: none;\n border-radius: 0px;\n border-width: 0px;\n}\n\n.cursor-handle.bottom {\n background-image: url(\"assets\/cursor-handle-bottom.svg\");\n}\n\n.cursor-handle.top {\n background-image: url(\"assets\/cursor-handle-top.svg\");\n}\n\n.cursor-handle.insertion-cursor {\n background-image: url(\"assets\/cursor-handle-insertion.svg\");\n}\n\n\/* Application specific properties *\/\n\nEvView {\n background-color: @panel_grey;\n}\n\nEvView:selected,\nApDocView:selected {\n background-color: @selection_grey;\n}\n","old_contents":"${\nimport math\n\ndef my_floor(num):\n return int(math.floor(num))\n\ndef my_ceil(num):\n return int(math.ceil(num))\n\n\n# Should we set the line width in the engine to 2.25, and draw non pixel aligned lines?\n# Are these already the correct sizes for the XO?\n\n# These sizes need to be sanity checked ...\nif scaling == \"100\":\n xo = True\n line_width = 2.0 # 2.25px, rounded down\n thick_line_width = 3.5 # 3.5\n subcell_size = 15\n icon_base = 11\n bullet_size = 9.5\n font_height = 24\n default_padding = 6\n toolbutton_padding = 10\n radio_size = 26\n scale_trough_margin = 8\nelse: # About 72% of the XO size, adjusted so that eg. toolbuttons work\n xo = False\n line_width = 2.0 # 1.62 rounded up\n thick_line_width = 3.0 # 2.52\n subcell_size = 11 # 10.8\n icon_base = 8 # 7.92\n bullet_size = 6.5 # 6.84\n # This is a guess on the font size (Sans 10 at 96 DPI)\n font_height = 17\n default_padding = 4 # 4.32\n toolbutton_padding = 7 # 7.68\n radio_size = 18 # 18.72\n scale_trough_margin = 6 # 5.76\n\n\nscale_slider_width = my_floor(2 * subcell_size + line_width)\nthickness = my_ceil(line_width)\n\nicon_small = icon_base * 3\nicon_large = icon_base * 5\n\n}\n\n* {\n -sugar-focus-line: @white;\n\n \/* A lot of these will probably need to be changed, but this has to\n be done when the exact sizes are known *\/\n -GtkWidget-interior-focus: 0;\n\n \/* we have to disable focus border for GtkTreeView, see #1261 *\/\n -GtkTreeView-interior-focus: 1;\n -GtkTreeView-focus-line-width: 0;\n\n -GtkTextView-interior-focus: 1;\n\n -GtkWidget-focus-line-width: 0; \/* Prevents some drawing glitches *\/\n -GtkEntry-focus-line-width: 0;\n -GtkScale-focus-line-width: 0;\n -GtkWidget-focus-padding: 0;\n \/* 0.05 works good for both the sugar and sugar-xo themes *\/\n -GtkWidget-cursor-aspect-ratio: 0.05;\n\n -GtkWidget-wide-separators: true;\n -GtkWidget-separator-height: $thickness;\n -GtkWidget-separator-width: $thickness;\n\n -GtkWidget-scroll-arrow-hlength: $subcell_size;\n -GtkWidget-scroll-arrow-vlength: $subcell_size;\n\n -GtkRange-activate-slider: 1;\n\n \/* We fake the default border in the theme *\/\n -GtkButton-default-border: 0 0 0 0;\n -GtkButton-default-outside-border: 0 0 0 0;\n -GtkButton-image-spacing: $subcell_size;\n\n -GtkEntry-progress-border: $thickness $thickness $thickness $thickness;\n\n -GtkScrolledWindow-scrollbar-spacing: 0;\n\n -GtkExpander-expander-size: $font_height;\n -GtkExpander-expander-spacing: 2;\n\n -GtkTreeView-expander-size: $font_height;\n\n -GtkArrow-arrow-size: 1.0;\n\n -GtkToolbar-space-size: $(2*subcell_size);\n -GtkToolbar-shadow-type: none;\n\n -GtkProgressBar-min-horizontal-bar-height: $subcell_size;\n -GtkProgressBar-min-vertical-bar-width: $subcell_size;\n\n -GtkButtonBox-child-min-height: $(3*subcell_size);\n -GtkButtonBox-child-min-width: $(3*subcell_size);\n -GtkButtonBox-child-internal-pad-x: 0;\n -GtkButtonBox-child-internal-pad-y: 0;\n\n -GtkCheckButton-indicator-size: $radio_size;\n -GtkCheckButton-indicator-spacing: 3;\n\n -GtkWidget-text-handle-width: 110px;\n -GtkWidget-text-handle-height: 110px;\n}\n\n*:insensitive {\n color: @button_grey;\n}\n\n\/* Backgrounds and windows *\/\n\nGtkWindow {\n background-color: @panel_grey;\n color: @black;\n}\n\nGtkDialog {\n background-color: @black;\n color: @white;\n}\n\nSugarIntroWindow {\n background-color: @white;\n}\n\nSugarIntroWindow {\n color: @black;\n}\n\nGtkLabel, GtkLabel:insensitive {\n background-color: transparent;\n}\n\n\/* Buttons *\/\n\n.button {\n ${ border = max(0, my_ceil((3*subcell_size\/2.0 - icon_small \/ 2.0))) }\n padding: $(border)px $(border)px $(border)px $(border)px;\n border-width: $(thickness)px;\n border-color: @button_grey;\n border-style: solid;\n border-radius: $(2*subcell_size)px;\n background-color: @button_grey;\n color: @white;\n}\n\n.button:focused {\n border-color: @white;\n}\n\n.button:active {\n background-color: @white;\n}\n\n.button:insensitive {\n background-color: transparent;\n}\n\n.button:active:focused {\n color: @black;\n border-color: @button_grey;\n}\n\n\/* Spin buttons *\/\n\n.spinbutton.button {\n border-radius: 0px;\n border-width: 0px;\n border-style: solid;\n background-color: @button_grey;\n}\n\n.spinbutton.button:last-child {\n border-radius: 0px $(2*subcell_size)px $(2*subcell_size)px 0px;\n border-width: 0px 0px 0px $(thickness)px;\n border-style: solid;\n border-color: @selection_grey;\n}\n\n\n.spinbutton.button:active {\n background-color: @black;\n}\n\n.spinbutton.button:insensitive {\n background-color: @selection_grey;\n}\n\n\/* Toggle buttons *\/\n\nGtkToggleButton.button:active {\n background-color: @white;\n color: @black;\n}\n\n\/* Entries and views *\/\n\n.view {\n border-width: 0px;\n border-style: none;\n border-radius: 0px;\n padding: 0px;\n background-color: @white;\n}\n\nGtkTreeView {\n background-color: @button_grey;\n}\n\ncolumn-header .button,\ncolumn-header .button:hover:active {\n border-radius: 0px;\n background-color: @button_grey;\n border-width: 0px;\n}\n\nGtkTreeView row:nth-child(even) {\n background-color: @row_even;\n}\nGtkTreeView row:nth-child(odd) {\n background-color: @row_odd;\n}\n\n.entry {\n border-radius: $(2 * subcell_size)px;\n border-width: $(thickness)px;\n border-color: @text_field_grey;\n border-style: solid;\n background-color: @text_field_grey;\n color: @black;\n ${ entry_ythickness = my_ceil(0.2 * (subcell_size*3.0\/2.0 - thickness) + thickness) }\n ${ entry_xthickness = my_ceil(0.32 * (subcell_size*3.0\/2.0 - thickness) + thickness) }\n padding: $(2 * max(my_ceil((3*subcell_size - font_height - entry_ythickness*2)\/2.0),0))px $(2 * max(subcell_size - entry_xthickness, 0))px $(2 * max(my_floor((3*subcell_size - font_height - entry_ythickness*2)\/2.0), 0))px $(2 * max(subcell_size - entry_xthickness, 0))px;\n}\n\n.entry.progressbar {\n border-radius: $(2 * subcell_size)px;\n border-width: $(thickness)px;\n background-color: @selection_grey;\n}\n\n.entry:focused {\n background-color: @white;\n}\n\n.toolbar .entry:focused {\n border-color: @white;\n}\n\n.entry:insensitive {\n background-color: @button_grey;\n}\n\n.entry:insensitive {\n border-color: @button_grey;\n}\n\n.view:selected {\n background-color: @panel_grey;\n color: @black;\n}\n\n.entry:selected,\n.entry:selected:focused,\n.view:selected:focused {\n background-color: @selection_grey;\n color: @black;\n}\n\n.entry:selected,\n.entry:selected:focused {\n border-color: @selection_grey;\n}\n\n\/* Frames *\/\n\nGtkScrolledWindow.frame {\n border-style: solid;\n border-color: @selection_grey;\n border-width: $(thickness)px;\n border-radius: 0;\n padding: $(default_padding)px;\n}\n\nGtkFrame.frame.journal-preview-box {\n border-style: solid;\n border-color: @button_grey;\n border-width: $(thickness)px;\n}\n\n\/* Combo boxes *\/\n\nGtkComboBox {\n color: @white;\n}\n\nGtkComboBox .menu.button {\n border-color: transparent;\n border-radius: 0px;\n border-style: none;\n background-color: transparent;\n color: @white;\n}\n\nGtkComboBox .menu {\n -GtkWidget-scroll-arrow-hlength: $(my_floor(2.5 * subcell_size));\n -GtkWidget-scroll-arrow-vlength: $(my_floor(2.5 * subcell_size));\n}\n\n\/* Notebooks *\/\n\n.notebook {\n background-color: @selection_grey;\n color: @black;\n padding: 0px;\n -GtkNotebook-tab-overlap: -2;\n -GtkNotebook-tab-curvature: $default_padding;\n -GtkWidget-scroll-arrow-hlength: $(my_floor(2.5 * subcell_size));\n -GtkWidget-scroll-arrow-vlength: $(my_floor(2.5 * subcell_size));\n}\n\n.notebook.arrow {\n color: @white;\n}\n\n.notebook tab {\n background-color: @selection_grey;\n}\n\n\/* Setting white color to the tab labels using only the previous rule *\/\n\/* doesn't work, so we have to set white color to the GtkLabel, and make *\/\n\/* sure the buttons get black color in the next two rules: *\/\n.notebook tab GtkLabel {\n color: @white;\n padding: $(subcell_size)px 0;\n}\n\n.notebook tab .button GtkLabel {\n color: @black;\n}\n\n.notebook tab:active {\n background-color: @toolbar_grey;\n}\n\n.notebook tab .button {\n border-radius: $(toolbutton_padding)px;\n}\n\n\/* Browse Widgets *\/\n\nBrowseSearchWindow .view {\n background-color: @black;\n color: @white;\n border-color: @button_grey;\n border-width: 0 $(thickness)px $(thickness)px $(thickness)px;\n border-style: solid;\n}\n\n\/* Control panel *\/\n\nSugarSectionView {\n background-color: @white;\n color: @black;\n}\n\nSugarSectionView *:insensitive {\n background-color: @white;\n}\n\n\/* Alert *\/\n\nSugarAlert {\n background-color: @black;\n color: @white;\n}\n\nSugarAlert *:insensitive {\n background-color: @black;\n}\n\n.button SugarTimeoutIcon GtkLabel,\n.button SugarTimeoutIcon GtkLabel:prelight {\n background-color: @white;\n color: @button_grey;\n border-radius: $(2 * subcell_size)px;\n}\n\n.button SugarTimeoutIcon GtkLabel:active {\n background-color: @toolbar_grey;\n color: @white;\n}\n\n\/* Tray *\/\n\nSugarHTray, SugarVTray {\n background-color: @toolbar_grey;\n}\n\nSugarHTray * , SugarVTray * { background-color: @toolbar_grey;}\n\n\/* Menus and palettes *\/\n\nSugarPaletteWindowWidget,\nGtkPopover {\n border-width: $(thickness)px;\n border-color: @button_grey;\n border-style: solid;\n background-color: @black;\n color: @white;\n}\n\nSugarPaletteWindowWidget .view {\n color: @black;\n}\n\nSugarPaletteMenuWidget {\n background-color: @black;\n}\n\nSugarPaletteMenuWidget * {\n color: @white;\n}\n\nSugarPaletteWindow SugarGroupBox {\n background-color: @toolbar_grey;\n color: @white;\n}\n\nSugarPaletteWindow SugarGroupBox *:insensitive {\n background-color: @toolbar_grey;\n}\n\n.menu {\n background-color: @black;\n color: @white;\n\n -GtkMenu-scroll-arrow-vlength: $(my_floor(subcell_size\/0.7 + 2*thickness));\n -GtkMenu-horizontal-padding: $thickness;\n -GtkMenu-vertical-padding : $thickness;\n \/* This means the outline of the submenu overlaps with a palette.\n * However in the case of two normal menus, they are next to each other.\n * It is not possible to be smarter about this, because the style comes from\n * the submenu. *\/\n -GtkMenu-horizontal-offset : -$(line_width)px;\n -GtkMenu-vertical-offset : 0;\n\n padding: 0px;\n\n border-width: 2px;\n border-color: @button_grey;\n border-style: solid;\n}\n\n.menuitem {\n padding: $(subcell_size)px $((subcell_size * 3 - font_height) \/ 2)px;\n}\n\n.menuitem:prelight, .menuitem:hover {\n background-color: @button_grey;\n}\n\n.menuitem.separator {\n padding: 0;\n}\n\n.tooltip {\n background-color: @black;\n border-style: solid;\n border-width: $(thickness)px;\n border-color: @button_grey;\n}\n\n.tooltip * {\n color: @white;\n}\n\n\/* Scrollbars *\/\n\n.scrollbar {\n -GtkRange-slider-width: $(subcell_size + 2*thickness);\n -GtkRange-trough-border: 0;\n -GtkRange-stepper-size: 0;\n -GtkScrollbar-min-slider-length: $(3*subcell_size);\n -GtkScrollbar-has-forward-stepper: 0;\n -GtkScrollbar-has-backward-stepper: 0;\n -GtkScrollbar-has-secondary-forward-stepper: 0;\n -GtkScrollbar-has-secondary-backward-stepper: 0;\n}\n\n.scrollbar.trough {\n background-color: @button_grey;\n border-width: 0px;\n}\n\n.scrollbar.slider {\n background-color: @white;\n border-radius: $(2*subcell_size)px;\n border-width: $(thickness)px;\n border-color: @button_grey;\n border-style: solid;\n}\n\n.scrollbar.slider:active {\n background-color: @text_field_grey;\n}\n\n\/* Progress bars *\/\n\n\/* Scrollbar padding hack? What was that about? *\/\n\nGtkProgressBar.progressbar {\n background-color: @white;\n border-color: @button_grey;\n border-radius: $(subcell_size)px;\n border-style: solid;\n border-width: $(thickness)px;\n}\n\nGtkProgressBar.trough {\n background-color: @selection_grey;\n border-style: solid;\n border-radius: $(subcell_size)px;\n border-color: @button_grey;\n border-width: $(thickness)px;\n}\n\n.toolbar GtkProgressBar.trough,\nSugarPaletteWindowWidget GtkProgressBar.trough {\n background-color: @black;\n}\n\n\/* Separators *\/\n\n.separator {\n border-style: solid;\n border-color: @button_grey;\n border-width: $(thickness)px;\n}\n\n\/* Tool buttons *\/\n\n.toolbar {\npadding: 0px;\nbackground-color: @toolbar_grey;\ncolor: @white;\n}\n\n.toolbar .button,\nSugarPaletteWindowWidget SugarRadioToolButton .button {\n border-color: transparent;\n border-radius: 0px;\n border-style: none;\n}\n\n.toolbar .button #gtk-toolbar-arrow {\n padding: 0 $(subcell_size + default_padding)px;\n}\n\n.toolbar GtkToolButton .button,\n.toolbar SugarRadioToolButton .button,\nSugarPaletteWindowWidget SugarRadioToolButton .button,\nSugarPaletteWindowWidget GtkToolButton .button {\n background-color: transparent;\n border-radius: $(toolbutton_padding)px;\n padding: $(toolbutton_padding)px;\n}\n\n.toolbar GtkToolButton .button,\nSugarPaletteWindowWidget GtkToolButton .button:prelight {\n padding: $(toolbutton_padding - default_padding)px;\n border-width: $(default_padding)px;\n border-style: solid;\n background-clip: padding-box;\n}\n\n.toolbar GtkToolButton .button:prelight,\n.toolbar GtkToolButton .button:prelight GtkBox,\nSugarPaletteWindowWidget GtkToolButton .button:prelight {\n background-color: @black;\n}\n\n.toolbar SugarRadioToolButton *:active,\nSugarPaletteWindowWidget SugarRadioToolButton *:active,\n.toolbar SugarRadioToolButton *:active GtkBox,\n.toolbar SugarRadioToolButton *:checked,\n.toolbar SugarRadioToolButton *:checked GtkBox,\nSugarPaletteWindowWidget SugarRadioToolButton *:checked,\n.toolbar SugarToggleToolButton *:checked,\n.toolbar SugarToggleToolButton *:checked GtkBox,\nSugarPaletteWindowWidget SugarToggleToolButton *:checked {\n background-color: @button_grey;\n border-radius: $(toolbutton_padding)px;\n}\n\n.toolbar SugarRadioToolButton *:checked:prelight,\n.toolbar SugarRadioToolButton *:checked:prelight GtkBox,\nSugarPaletteWindowWidget SugarRadioToolButton *:checked:prelight,\n.toolbar SugarToggleToolButton *:checked:prelight,\n.toolbar SugarToggleToolButton *:checked:prelight GtkBox,\nSugarPaletteWindowWidget SugarToggleToolButton *:checked:prelight {\n background-color: @button_grey;\n}\n\nSugarPaletteWindowWidget SugarRadioToolButton *:checked:prelight,\nSugarPaletteWindowWidget SugarToggleToolButton *:checked:prelight {\n border-color: @button_grey;\n}\n\nSugarPaletteWindowWidget GtkToolButton .button:active {\n background-color: @button_grey;\n}\n\n.toolbar GtkToolButton .button:active {\n background-color: @button_grey;\n border-radius: $(toolbutton_padding)px;\n}\n\nSugarPaletteWindowWidget GtkScrolledWindow {\n background-color: @black;\n}\n\n.toolbar GtkComboBox .button {\n border-radius: $(2*subcell_size)px;\n}\n\n\/* Scales *\/\n\n.scale {\n -GtkScale-slider-length: $scale_slider_width;\n -GtkRange-slider-width: $scale_slider_width;\n}\n\n\/* We have to override the color of the scale, otherwise the slider\n background image is invisible or not set for this palettes.\n Upstream bug: https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=686703 *\/\nSugarPaletteWindowWidget .scale {\n color: transparent;\n}\n\n.scale.trough {\n background-color: @button_grey;\n border-style: solid;\n border-color: @button_grey;\n border-width: $(thickness)px;\n margin: $(scale_trough_margin)px 0;\n}\n\n.scale.trough.vertical {\n margin: 0 $(scale_trough_margin)px;\n}\n\n.scale.trough:focused {\n border-color: @white;\n}\n\n.scale.trough.top,\n.scale.trough.left {\n background-color: @white;\n}\n\n.scale.trough.top:focused,\n.scale.trough.left:focused {\n border-color: @selection_grey;\n}\n\n.scale.trough {\n border-radius: 0px $(2*subcell_size)px $(2*subcell_size)px 0px;\n}\n\n.scale.trough.vertical {\n border-radius: 0px 0px $(2*subcell_size)px $(2*subcell_size)px;\n}\n\n.scale.trough.top {\n border-radius: $(2*subcell_size)px $(2*subcell_size)px 0px 0px;\n}\n\n.scale.trough.left {\n border-radius: $(2*subcell_size)px 0px 0px $(2*subcell_size)px;\n}\n\n.scale.slider,\n.scale.slider:active {\n background-color: transparent;\n}\n\n.scale.slider {\n background-image: url(\"assets\/scale-slider.svg\");\n}\n\n.scale.slider:active {\n background-image: url(\"assets\/scale-slider-active.svg\");\n}\n\n\/* Radio and check buttons *\/\n\nGtkCheckButton {\n border: 1px solid @black;\n}\n\nGtkCheckButton:prelight {\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.toolbar GtkCheckButton,.toolbar .check,\nSugarPaletteWindowWidget .check {\n color: @theme_base_color;\n border: 1px solid @theme_base_color;\n}\n\n.radio,\n.radio row:selected,\n.radio row:selected:focused {\n background-image: url(\"assets\/radio.svg\");\n \/* Gtk 3.14+ expect these to be included in icon theme however we want to\n override that *\/\n -gtk-icon-source: url(\"assets\/radio.svg\");\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.radio:selected,\n.radio:selected row:selected,\n.radio:selected row:selected:focused {\n background-image: url(\"assets\/radio-selected.svg\");\n -gtk-icon-source: url(\"assets\/radio-selected.svg\");\n}\n\n.radio:active,\n.radio row:selected:active,\n.radio row:selected:focused:active {\n background-image: url(\"assets\/radio-active.svg\");\n -gtk-icon-source: url(\"assets\/radio-active.svg\");\n}\n\n.radio:checked,\n.radio row:selected:checked,\n.radio row:selected:focused:checked {\n background-image: url(\"assets\/radio-active.svg\");\n -gtk-icon-source: url(\"assets\/radio-active.svg\");\n}\n\n.radio:active:selected,\n.radio:selected row:selected:active,\n.radio:selected row:selected:focused:active {\n background-image: url(\"assets\/radio-active-selected.svg\");\n -gtk-icon-source: url(\"assets\/radio-active-selected.svg\");\n}\n\n.radio:checked:selected,\n.radio:selected row:selected:checked,\n.radio:selected row:selected:focused:checked {\n background-image: url(\"assets\/radio-active-selected.svg\");\n -gtk-icon-source: url(\"assets\/radio-active-selected.svg\");\n}\n\n.check,\n.check row:selected,\n.check row:selected:focused {\n background-image: url(\"assets\/checkbox-unchecked.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-unchecked.svg\");\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.check:selected,\n.check:selected row:selected,\n.check:selected row:selected:focused {\n background-image: url(\"assets\/checkbox-unchecked-selected.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-unchecked-selected.svg\");\n}\n\n.check:active,\n.check row:selected:active,\n.check row:selected:focused:active {\n background-image: url(\"assets\/checkbox-checked.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-checked.svg\");\n}\n\n.check:checked,\n.check row:selected:checked,\n.check row:selected:focused:checked {\n background-image: url(\"assets\/checkbox-checked.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-checked.svg\");\n}\n\n.check:active:selected,\n.check:selected row:selected:active,\n.check:selected row:selected:focused:active {\n background-image: url(\"assets\/checkbox-checked-selected.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-checked-selected.svg\");\n}\n\n.check:checked:selected,\n.check:selected row:selected:checked,\n.check:selected row:selected:focused:checked {\n background-image: url(\"assets\/checkbox-checked-selected.svg\");\n -gtk-icon-source: url(\"assets\/checkbox-checked-selected.svg\");\n}\n\n\/* Tool items *\/\n\n.toolitem {\n \/* arrow in the toolbarbox *\/\n color: @white;\n \/* outline of the toolbarbutton when palette is expanded *\/\n border-style: solid;\n border-width: 2px;\n border-color: @button_grey;\n}\n\n\/* GtkImage *\/\n\nGtkImage {\n background-color: transparent;\n}\n\n\/* Sugar Frame Window *\/\n\nSugarFrameWindow {\n background-color: @toolbar_grey;\n}\n\n\/* Sugar Canvas icon *\/\n\nSugarCanvasIcon,\nSugarKeepIcon.button {\n border-color: transparent;\n border-radius: $(4 * thickness)px;\n border-width: 2px;\n border-style: solid;\n background-color: transparent;\n}\n\nSugarCanvasIcon:prelight,\nSugarKeepIcon.button:prelight {\n border-color: @zoom_views_prelight;\n background-color: @zoom_views_prelight;\n}\n\nSugarCanvasIcon:active,\nSugarKeepIcon.button.toggle-press {\n border-color: @zoom_views_active;\n background-color: @zoom_views_active;\n}\n\n\/* Sugar CellRenderer Icons *\/\n\n.cell.sugar-icon-cell {\n background-color: transparent;\n border-radius: $(4 * thickness)px;\n border-color: @white;\n border-width: $(thickness)px;\n border-style: solid;\n}\n\n.cell.sugar-icon-cell:prelight {\n background-color: @zoom_views_prelight;\n}\n\n.cell.sugar-icon-cell:active {\n background-color: @zoom_views_active;\n}\n\n\/* CellRendererProgress *\/\n\n.cell.progressbar, .cell.trough {\n border-style: solid;\n border-width: $(thickness)px;\n border-color: @selection_grey;\n border-radius: $(2*subcell_size)px;\n}\n\n.cell.progressbar {\n background-color: @white;\n}\n\n.cell.trough {\n background-color: @text_field_grey;\n}\n\n\/* Text cursor handles *\/\n\n.cursor-handle.top,\n.cursor-handle.bottom {\n background-color: transparent;\n box-shadow: none;\n border-style: none;\n border-image: none;\n border-radius: 0px;\n border-width: 0px;\n}\n\n.cursor-handle.bottom {\n background-image: url(\"assets\/cursor-handle-bottom.svg\");\n}\n\n.cursor-handle.top {\n background-image: url(\"assets\/cursor-handle-top.svg\");\n}\n\n.cursor-handle.insertion-cursor {\n background-image: url(\"assets\/cursor-handle-insertion.svg\");\n}\n\n\/* Application specific properties *\/\n\nEvView {\n background-color: @panel_grey;\n}\n\nEvView:selected,\nApDocView:selected {\n background-color: @selection_grey;\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"EmberScript"} {"commit":"1435af8d2bb68cb085edc09dded4feaef2d68da1","subject":"Make std.Graphics.GUI helpers around eval support JSON-encodable objects. Fixes #279.","message":"Make std.Graphics.GUI helpers around eval support JSON-encodable\nobjects. Fixes #279.\n","repos":"sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata","old_file":"liboh\/plugins\/js\/scripts\/std\/graphics\/gui.em","new_file":"liboh\/plugins\/js\/scripts\/std\/graphics\/gui.em","new_contents":"\/* Sirikata\n * graphics.em\n *\n * Copyright (c) 2011, Ewen Cheslack-Postava\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in\n * the documentation and\/or other materials provided with the\n * distribution.\n * * Neither the name of Sirikata nor the names of its contributors may\n * be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\n * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\nsystem.require('std\/escape.em');\n\nif (typeof(std) === \"undefined\") std = {};\nif (typeof(std.graphics) === \"undefined\") std.graphics = {};\n\n(\nfunction() {\n\n var ns = std.graphics;\n\n \/** @namespace\n * The GUI class wraps the underlying GUI Invokable\n * objects. These present 2D user interface widgets to the user,\n * which are coded as HTML + Javascript pages.\n *\n * The callback is passed this GUI as a parameter.\n *\/\n std.graphics.GUI = function(name, me, onready) {\n this._name = name;\n this._gui = me;\n if (onready)\n this.bind('__ready', std.core.bind(onready, undefined, this));\n };\n\n \/** Bind a listener for events from this GUI. *\/\n std.graphics.GUI.prototype.bind = function(type, cb) {\n this._gui.invoke(\"bind\", this._name + '-' + type, cb);\n };\n\n \/** Evaluate the Javascript string inside the GUI context. *\/\n std.graphics.GUI.prototype.eval = function(js) {\n this._gui.invoke(\"eval\", js);\n };\n\n var getGUIJSValue = function(arg) {\n if (typeof(arg) === 'string')\n return Escape.escapeString(arg, '\"');\n else if (typeof(arg) === 'undefined' ||\n (typeof(arg) === 'object' && arg === null) ||\n typeof(arg) === 'number' ||\n typeof(arg) === 'boolean')\n return arg.toString();\n else {\n \/\/ Non-trivial type. Try to JSONify it.\n try {\n var arg_json = JSON.stringify(arg);\n \/\/ And wrap in decoding call\n return 'JSON.parse(' + Escape.escapeString(arg_json) + ')';\n } catch (x) {\n throw new TypeError(\"Invalid object type passed to GUI.call. Must be basic type (undefined, null, boolean, number, string) or JSON-encodable.\");\n }\n }\n };\n\n \/** Call a method in the GUI context. This is just a convenience\n * wrapper around eval which will build the string to eval\n * automatically from the method arguments.\n *\n * Example:\n * var x = 7;\n * var st = 'hello \"Bob\"';\n * gui.call('myfunc', x, st);\n * is equivalent to\n * gui.eval( \"myfunc(7, 'hello \\\"Bob\\\"');\" );\n *\/\n std.graphics.GUI.prototype.call = function() {\n if (arguments.length < 1) return;\n var methodname = arguments[0];\n\n var ev_str = methodname + '(';\n\n for(var i = 1; i < arguments.length; i++) {\n if (i > 1) ev_str += ', ';\n\n var arg = arguments[i];\n ev_str += getGUIJSValue(arg);\n }\n\n ev_str += ')';\n\n this.eval(ev_str);\n };\n\n \/** Set the value of a variable in the GUI context. This is just a\n * convenience wrapper around eval which will build the string to\n * eval automatically from the arguments.\n *\n * Example:\n * gui.set('myvar', 17)\n * is equivalent to\n * gui.eval('var myvar = 17;');\n *\n *\/\n std.graphics.GUI.prototype.set = function(varname, value) {\n var ev_str = varname + ' = ' + getGUIJSValue(value) + ';';\n this.eval(ev_str);\n };\n\n \/** Hides the GUI window. *\/\n std.graphics.GUI.prototype.hide = function() {\n this._gui.invoke(\"hide\");\n };\n\n \/** Shows the GUI window. *\/\n std.graphics.GUI.prototype.show = function() {\n this._gui.invoke(\"show\");\n };\n\n \/** Shows the GUI window. *\/\n std.graphics.GUI.prototype.focus = function() {\n this._gui.invoke(\"focus\");\n };\n\n \/** Bind a listener for exception events. Listener should have the form fn(message, file, linenum). *\/\n std.graphics.GUI.prototype.onException = function(cb) {\n this._gui.invoke(\"onException\", cb);\n };\n})();\n","old_contents":"\/* Sirikata\n * graphics.em\n *\n * Copyright (c) 2011, Ewen Cheslack-Postava\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in\n * the documentation and\/or other materials provided with the\n * distribution.\n * * Neither the name of Sirikata nor the names of its contributors may\n * be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\n * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\nsystem.require('std\/escape.em');\n\nif (typeof(std) === \"undefined\") std = {};\nif (typeof(std.graphics) === \"undefined\") std.graphics = {};\n\n(\nfunction() {\n\n var ns = std.graphics;\n\n \/** @namespace\n * The GUI class wraps the underlying GUI Invokable\n * objects. These present 2D user interface widgets to the user,\n * which are coded as HTML + Javascript pages.\n *\n * The callback is passed this GUI as a parameter.\n *\/\n std.graphics.GUI = function(name, me, onready) {\n this._name = name;\n this._gui = me;\n if (onready)\n this.bind('__ready', std.core.bind(onready, undefined, this));\n };\n\n \/** Bind a listener for events from this GUI. *\/\n std.graphics.GUI.prototype.bind = function(type, cb) {\n this._gui.invoke(\"bind\", this._name + '-' + type, cb);\n };\n\n \/** Evaluate the Javascript string inside the GUI context. *\/\n std.graphics.GUI.prototype.eval = function(js) {\n this._gui.invoke(\"eval\", js);\n };\n\n var getGUIJSValue = function(arg) {\n if (typeof(arg) === 'string')\n return Escape.escapeString(arg, '\"');\n else if (typeof(arg) === 'undefined' ||\n (typeof(arg) === 'object' && arg === null) ||\n typeof(arg) === 'number' ||\n typeof(arg) === 'boolean')\n return arg.toString();\n else\n throw new TypeError(\"Invalid object type passed to GUI.call.\");\n };\n\n \/** Call a method in the GUI context. This is just a convenience\n * wrapper around eval which will build the string to eval\n * automatically from the method arguments.\n *\n * Example:\n * var x = 7;\n * var st = 'hello \"Bob\"';\n * gui.call('myfunc', x, st);\n * is equivalent to\n * gui.eval( \"myfunc(7, 'hello \\\"Bob\\\"');\" );\n *\/\n std.graphics.GUI.prototype.call = function() {\n if (arguments.length < 1) return;\n var methodname = arguments[0];\n\n var ev_str = methodname + '(';\n\n for(var i = 1; i < arguments.length; i++) {\n if (i > 1) ev_str += ', ';\n\n var arg = arguments[i];\n ev_str += getGUIJSValue(arg);\n }\n\n ev_str += ')';\n\n this.eval(ev_str);\n };\n\n \/** Set the value of a variable in the GUI context. This is just a\n * convenience wrapper around eval which will build the string to\n * eval automatically from the arguments.\n *\n * Example:\n * gui.set('myvar', 17)\n * is equivalent to\n * gui.eval('var myvar = 17;');\n *\n *\/\n std.graphics.GUI.prototype.set = function(varname, value) {\n var ev_str = varname + ' = ' + getGUIJSValue(value) + ';';\n this.eval(ev_str);\n };\n\n \/** Hides the GUI window. *\/\n std.graphics.GUI.prototype.hide = function() {\n this._gui.invoke(\"hide\");\n };\n\n \/** Shows the GUI window. *\/\n std.graphics.GUI.prototype.show = function() {\n this._gui.invoke(\"show\");\n };\n\n \/** Shows the GUI window. *\/\n std.graphics.GUI.prototype.focus = function() {\n this._gui.invoke(\"focus\");\n };\n\n \/** Bind a listener for exception events. Listener should have the form fn(message, file, linenum). *\/\n std.graphics.GUI.prototype.onException = function(cb) {\n this._gui.invoke(\"onException\", cb);\n };\n})();\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"EmberScript"} {"commit":"988f9bdb35de4d4ce63831043fb6378a6c9d865e","subject":"create -> delete -> create -> delete test","message":"create -> delete -> create -> delete test\n","repos":"coalescejs\/coalesce,getoutreach\/coalesce,getoutreach\/epf,getoutreach\/epf,getoutreach\/coalesce,getoutreach\/epf,coalescejs\/coalesce,getoutreach\/coalesce","old_file":"test\/rest\/rest.simple.em","new_file":"test\/rest\/rest.simple.em","new_contents":"describe \"rest\", ->\n\n adapter = null\n session = null\n\n beforeEach ->\n require('.\/_shared').setupRest.apply(this)\n adapter = @adapter\n session = @session\n\n context 'simple model', ->\n\n beforeEach ->\n class @Post extends Ep.Model\n title: Ep.attr('string')\n @App.Post = @Post\n\n @container.register 'model:post', @Post\n\n\n it 'loads', -> \n adapter.r['GET:\/posts\/1'] = posts: {id: 1, title: 'mvcc ftw'}\n session.load(@Post, 1).then (post) ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('mvcc ftw')\n expect(adapter.h).to.eql(['GET:\/posts\/1'])\n\n\n it 'saves', ->\n adapter.r['POST:\/posts'] = -> posts: {client_id: post.clientId, id: 1, title: 'mvcc ftw'}\n\n post = session.create('post')\n post.title = 'mvcc ftw'\n\n session.flush().then ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('mvcc ftw')\n expect(adapter.h).to.eql(['POST:\/posts'])\n\n\n it 'updates', ->\n adapter.r['PUT:\/posts\/1'] = -> posts: {id: 1, title: 'updated'}\n\n session.merge @Post.create(id: \"1\", title: 'test')\n\n session.load('post', 1).then (post) ->\n expect(post.title).to.eq('test')\n post.title = 'updated'\n session.flush().then ->\n expect(post.title).to.eq('updated')\n expect(adapter.h).to.eql(['PUT:\/posts\/1'])\n\n\n it 'updates multiple times', ->\n adapter.r['PUT:\/posts\/1'] = -> posts: {id: 1, title: 'updated'}\n\n post = session.merge @Post.create(id: \"1\", title: 'test')\n\n expect(post.title).to.eq('test')\n post.title = 'updated'\n\n session.flush().then ->\n expect(post.title).to.eq('updated')\n expect(adapter.h).to.eql(['PUT:\/posts\/1'])\n\n adapter.r['PUT:\/posts\/1'] = -> posts: {id: 1, title: 'updated again'}\n post.title = 'updated again'\n session.flush().then ->\n expect(post.title).to.eq('updated again')\n expect(adapter.h).to.eql(['PUT:\/posts\/1', 'PUT:\/posts\/1'])\n\n session.flush().then -> # NO-OP\n expect(post.title).to.eq('updated again')\n expect(adapter.h).to.eql(['PUT:\/posts\/1', 'PUT:\/posts\/1'])\n\n\n it 'deletes', ->\n adapter.r['DELETE:\/posts\/1'] = {}\n\n session.merge @Post.create(id: \"1\", title: 'test')\n\n session.load('post', 1).then (post) ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('test')\n session.deleteModel(post)\n session.flush().then ->\n expect(post.isDeleted).to.be.true\n expect(adapter.h).to.eql(['DELETE:\/posts\/1'])\n\n\n it 'deletes multiple times in multiple flushes', ->\n adapter.r['DELETE:\/posts\/1'] = {}\n\n post1 = session.merge @Post.create(id: \"1\", title: 'thing 1')\n post2 = session.merge @Post.create(id: \"2\", title: 'thing 2')\n\n session.deleteModel post1\n\n session.flush().then ->\n\n expect(post1.isDeleted).to.be.true\n expect(post2.isDeleted).to.be.false\n\n adapter.r['DELETE:\/posts\/1'] = -> throw \"already deleted\"\n adapter.r['DELETE:\/posts\/2'] = {}\n\n session.deleteModel post2\n\n session.flush().then ->\n expect(post1.isDeleted).to.be.true\n expect(post2.isDeleted).to.be.true\n \n it 'creates, deletes, creates, deletes', ->\n post1 = session.create('post')\n post1.title = 'thing 1'\n \n adapter.r['POST:\/posts'] = -> posts: {client_id: post1.clientId, id: 1, title: 'thing 1'}\n session.flush().then ->\n expect(post1.id).to.eq('1')\n expect(post1.title).to.eq('thing 1')\n session.deleteModel(post1)\n \n adapter.r['DELETE:\/posts\/1'] = {}\n \n session.flush().then ->\n expect(post1.isDeleted).to.be.true\n post2 = session.create('post')\n post2.title = 'thing 2'\n \n adapter.r['POST:\/posts'] = -> posts: {client_id: post2.clientId, id: 2, title: 'thing 2'}\n \n session.flush().then ->\n \n adapter.r['DELETE:\/posts\/1'] = -> throw 'not found'\n adapter.r['DELETE:\/posts\/2'] = {}\n \n expect(post2.id).to.eq('2')\n expect(post2.title).to.eq('thing 2')\n session.deleteModel(post2)\n \n session.flush().then ->\n expect(post2.isDeleted).to.be.true\n expect(adapter.h).to.eql(['POST:\/posts', 'DELETE:\/posts\/1', 'POST:\/posts', 'DELETE:\/posts\/2'])\n \n \n\n\n it 'refreshes', ->\n adapter.r['GET:\/posts\/1'] = posts: {id: 1, title: 'something new'}\n\n session.merge @Post.create(id: \"1\", title: 'test')\n\n session.load(@Post, 1).then (post) ->\n expect(post.title).to.eq('test')\n expect(adapter.h).to.eql([])\n session.refresh(post).then (post) ->\n expect(post.title).to.eq('something new')\n expect(adapter.h).to.eql(['GET:\/posts\/1'])\n\n\n it 'finds', ->\n adapter.r['GET:\/posts'] = (url, type, hash) ->\n expect(hash.data).to.eql({q: \"aardvarks\"})\n posts: [{id: 1, title: 'aardvarks explained'}, {id: 2, title: 'aardvarks in depth'}]\n\n session.find('post', {q: 'aardvarks'}).then (models) ->\n expect(models.length).to.eq(2)\n expect(adapter.h).to.eql(['GET:\/posts'])\n\n\n it 'loads then updates', ->\n adapter.r['GET:\/posts\/1'] = posts: {id: 1, title: 'mvcc ftw'}\n adapter.r['PUT:\/posts\/1'] = posts: {id: 1, title: 'no more fsm'}\n\n session.load(@Post, 1).then (post) ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('mvcc ftw')\n expect(adapter.h).to.eql(['GET:\/posts\/1'])\n\n post.title = 'no more fsm'\n session.flush().then ->\n expect(adapter.h).to.eql(['GET:\/posts\/1', 'PUT:\/posts\/1'])\n expect(post.title).to.eq('no more fsm')\n \n it 'loads with parameter', ->\n adapter.r['GET:\/posts\/1'] = (url, type, hash) ->\n expect(hash.data.invite_token).to.eq('fdsavcxz')\n posts: {id: 1, title: 'mvcc ftw'}\n session.load(@Post, 1, params: {invite_token: 'fdsavcxz'}).then (post) ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('mvcc ftw')\n expect(adapter.h).to.eql(['GET:\/posts\/1'])\n \n","old_contents":"describe \"rest\", ->\n\n adapter = null\n session = null\n\n beforeEach ->\n require('.\/_shared').setupRest.apply(this)\n adapter = @adapter\n session = @session\n\n context 'simple model', ->\n\n beforeEach ->\n class @Post extends Ep.Model\n title: Ep.attr('string')\n @App.Post = @Post\n\n @container.register 'model:post', @Post\n\n\n it 'loads', -> \n adapter.r['GET:\/posts\/1'] = posts: {id: 1, title: 'mvcc ftw'}\n session.load(@Post, 1).then (post) ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('mvcc ftw')\n expect(adapter.h).to.eql(['GET:\/posts\/1'])\n\n\n it 'saves', ->\n adapter.r['POST:\/posts'] = -> posts: {client_id: post.clientId, id: 1, title: 'mvcc ftw'}\n\n post = session.create('post')\n post.title = 'mvcc ftw'\n\n session.flush().then ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('mvcc ftw')\n expect(adapter.h).to.eql(['POST:\/posts'])\n\n\n it 'updates', ->\n adapter.r['PUT:\/posts\/1'] = -> posts: {id: 1, title: 'updated'}\n\n session.merge @Post.create(id: \"1\", title: 'test')\n\n session.load('post', 1).then (post) ->\n expect(post.title).to.eq('test')\n post.title = 'updated'\n session.flush().then ->\n expect(post.title).to.eq('updated')\n expect(adapter.h).to.eql(['PUT:\/posts\/1'])\n\n\n it 'updates multiple times', ->\n adapter.r['PUT:\/posts\/1'] = -> posts: {id: 1, title: 'updated'}\n\n post = session.merge @Post.create(id: \"1\", title: 'test')\n\n expect(post.title).to.eq('test')\n post.title = 'updated'\n\n session.flush().then ->\n expect(post.title).to.eq('updated')\n expect(adapter.h).to.eql(['PUT:\/posts\/1'])\n\n adapter.r['PUT:\/posts\/1'] = -> posts: {id: 1, title: 'updated again'}\n post.title = 'updated again'\n session.flush().then ->\n expect(post.title).to.eq('updated again')\n expect(adapter.h).to.eql(['PUT:\/posts\/1', 'PUT:\/posts\/1'])\n\n session.flush().then -> # NO-OP\n expect(post.title).to.eq('updated again')\n expect(adapter.h).to.eql(['PUT:\/posts\/1', 'PUT:\/posts\/1'])\n\n\n it 'deletes', ->\n adapter.r['DELETE:\/posts\/1'] = {}\n\n session.merge @Post.create(id: \"1\", title: 'test')\n\n session.load('post', 1).then (post) ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('test')\n session.deleteModel(post)\n session.flush().then ->\n expect(post.isDeleted).to.be.true\n expect(adapter.h).to.eql(['DELETE:\/posts\/1'])\n\n\n it 'deletes multiple times in multiple flushes', ->\n adapter.r['DELETE:\/posts\/1'] = {}\n\n post1 = session.merge @Post.create(id: \"1\", title: 'thing 1')\n post2 = session.merge @Post.create(id: \"2\", title: 'thing 2')\n\n session.deleteModel post1\n\n session.flush().then ->\n\n expect(post1.isDeleted).to.be.true\n expect(post2.isDeleted).to.be.false\n\n adapter.r['DELETE:\/posts\/1'] = -> throw \"already deleted\"\n adapter.r['DELETE:\/posts\/2'] = {}\n\n session.deleteModel post2\n\n session.flush().then ->\n expect(post1.isDeleted).to.be.true\n expect(post2.isDeleted).to.be.true\n\n\n it 'refreshes', ->\n adapter.r['GET:\/posts\/1'] = posts: {id: 1, title: 'something new'}\n\n session.merge @Post.create(id: \"1\", title: 'test')\n\n session.load(@Post, 1).then (post) ->\n expect(post.title).to.eq('test')\n expect(adapter.h).to.eql([])\n session.refresh(post).then (post) ->\n expect(post.title).to.eq('something new')\n expect(adapter.h).to.eql(['GET:\/posts\/1'])\n\n\n it 'finds', ->\n adapter.r['GET:\/posts'] = (url, type, hash) ->\n expect(hash.data).to.eql({q: \"aardvarks\"})\n posts: [{id: 1, title: 'aardvarks explained'}, {id: 2, title: 'aardvarks in depth'}]\n\n session.find('post', {q: 'aardvarks'}).then (models) ->\n expect(models.length).to.eq(2)\n expect(adapter.h).to.eql(['GET:\/posts'])\n\n\n it 'loads then updates', ->\n adapter.r['GET:\/posts\/1'] = posts: {id: 1, title: 'mvcc ftw'}\n adapter.r['PUT:\/posts\/1'] = posts: {id: 1, title: 'no more fsm'}\n\n session.load(@Post, 1).then (post) ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('mvcc ftw')\n expect(adapter.h).to.eql(['GET:\/posts\/1'])\n\n post.title = 'no more fsm'\n session.flush().then ->\n expect(adapter.h).to.eql(['GET:\/posts\/1', 'PUT:\/posts\/1'])\n expect(post.title).to.eq('no more fsm')\n \n it 'loads with parameter', ->\n adapter.r['GET:\/posts\/1'] = (url, type, hash) ->\n expect(hash.data.invite_token).to.eq('fdsavcxz')\n posts: {id: 1, title: 'mvcc ftw'}\n session.load(@Post, 1, params: {invite_token: 'fdsavcxz'}).then (post) ->\n expect(post.id).to.eq(\"1\")\n expect(post.title).to.eq('mvcc ftw')\n expect(adapter.h).to.eql(['GET:\/posts\/1'])\n \n","returncode":0,"stderr":"","license":"mit","lang":"EmberScript"} {"commit":"a8955e98187be231f4f4c8fd0ee13a277cbac980","subject":"Add ros2_distro parameter ","message":"Add ros2_distro parameter \n\nand set repos URL to null to default to https:\/\/raw.githubusercontent.com\/ros2\/ros2\/$ROS_DISTRO\/ros2.repos","repos":"ruffsl\/docker_images,ruffsl\/docker_images","old_file":"ros2\/source\/images.yaml.em","new_file":"ros2\/source\/images.yaml.em","new_contents":"%YAML 1.1\n# ROS2 Dockerfile database\n---\nimages:\n source:\n base_image: @(os_name):@(os_code_name)\n maintainer_name: @(maintainer_name)\n template_name: docker_images_ros2\/source\/create_ros_image.Dockerfile.em\n entrypoint_name: docker_images_ros2\/source\/ros_entrypoint.sh\n template_packages:\n - docker_templates\n upstream_packages:\n - bash-completion\n - git\n - libasio-dev\n - libtinyxml2-dev\n - wget\n ros2_distro: crystal\n ros2_repo_packages:\n - python3-catkin-pkg-modules\n - python3-rosdep\n - python3-vcstool\n pip3_install:\n - argcomplete\n - flake8\n - flake8-blind-except\n - flake8-builtins\n - flake8-class-newline\n - flake8-comprehensions\n - flake8-deprecated\n - flake8-docstrings\n - flake8-import-order\n - flake8-quotes\n - pytest-repeat\n - pytest-rerunfailures\n ws: \/root\/ros2_ws\n colcon_args:\n - build\n - --cmake-args\n -DSECURITY=ON --no-warn-unused-cli\n - --symlink-install\n rosdep:\n install:\n - --from-paths src\n - --ignore-src\n - --skip-keys \"console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers\"\n vcs:\n ros2:\n repos:\n","old_contents":"%YAML 1.1\n# ROS2 Dockerfile database\n---\nimages:\n source:\n base_image: @(os_name):@(os_code_name)\n maintainer_name: @(maintainer_name)\n template_name: docker_images_ros2\/source\/create_ros_image.Dockerfile.em\n entrypoint_name: docker_images_ros2\/source\/ros_entrypoint.sh\n template_packages:\n - docker_templates\n upstream_packages:\n - bash-completion\n - git\n - libasio-dev\n - libtinyxml2-dev\n - wget\n ros2_repo_packages:\n - python3-catkin-pkg-modules\n - python3-rosdep\n - python3-vcstool\n pip3_install:\n - argcomplete\n - flake8\n - flake8-blind-except\n - flake8-builtins\n - flake8-class-newline\n - flake8-comprehensions\n - flake8-deprecated\n - flake8-docstrings\n - flake8-import-order\n - flake8-quotes\n - pytest-repeat\n - pytest-rerunfailures\n ws: \/root\/ros2_ws\n colcon_args:\n - build\n - --cmake-args\n -DSECURITY=ON --no-warn-unused-cli\n - --symlink-install\n rosdep:\n install:\n - --from-paths src\n - --ignore-src\n - --rosdistro crystal\n - --skip-keys \"console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers\"\n vcs:\n ros2:\n repos: https:\/\/raw.githubusercontent.com\/ros2\/ros2\/release-latest\/ros2.repos\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"b6278610191989210fbe27608561c1eea8711638","subject":"Provide addGUIModule in DefaultGraphics that just forwards to the underlying graphics class.","message":"Provide addGUIModule in DefaultGraphics that just forwards to the underlying graphics class.\n","repos":"sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata","old_file":"liboh\/plugins\/js\/scripts\/std\/graphics\/default.em","new_file":"liboh\/plugins\/js\/scripts\/std\/graphics\/default.em","new_contents":"\/* Sirikata\n * default.em\n *\n * Copyright (c) 2011, Ewen Cheslack-Postava\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in\n * the documentation and\/or other materials provided with the\n * distribution.\n * * Neither the name of Sirikata nor the names of its contributors may\n * be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\n * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\nsystem.require('graphics.em');\nsystem.require('std\/movement\/moveAndRotate.em');\nsystem.require('std\/script\/scripter.em');\nsystem.require('inputbinding.em');\nsystem.require('drag\/move.em');\nsystem.require('drag\/rotate.em');\nsystem.require('drag\/scale.em');\nsystem.require('std\/graphics\/chat.em');\n\n(\nfunction() {\n\n var ns = std.graphics;\n\n \/** @namespace\n * The DefaultGraphics class just contains some sane defaults for\n * interaction, allowing you to get a decent, baseline client\n * that only requires built-in functionality. You still define\n * the presence and which underlying graphics system to use, but\n * this class takes care of defining all other UI and interaction.\n *\/\n std.graphics.DefaultGraphics = function(pres, name) {\n this._pres = pres;\n this._simulator = new std.graphics.Graphics(pres, name);\n\n this._cameraMode = 'first';\n\n this._selected = null;\n this._scripter = new std.script.Scripter(this);\n this._chat = new std.graphics.Chat(pres, this._simulator);\n this._moverot = new std.movement.MoveAndRotate(this._pres, std.core.bind(this.updateCameraOffset, this), 'rotation');\n\n this._draggers = {\n move: new std.graphics.MoveDragHandler(this._simulator),\n rotate: new std.graphics.RotateDragHandler(this._simulator),\n scale: new std.graphics.ScaleDragHandler(this._simulator)\n };\n\n\n this._binding = new std.graphics.InputBinding();\n this._simulator.inputHandler.onAnything = std.core.bind(this._binding.dispatch, this._binding);\n\n\n this._binding.addAction('quit', std.core.bind(this._simulator.quit, this._simulator));\n this._binding.addAction('screenshot', std.core.bind(this._simulator.screenshot, this._simulator));\n this._binding.addAction('toggleSuspend', std.core.bind(this._simulator.toggleSuspend, this._simulator));\n this._binding.addAction('scriptSelectedObject', std.core.bind(this.scriptSelectedObject, this));\n this._binding.addAction('scriptSelf', std.core.bind(this.scriptSelf, this));\n\n this._binding.addAction('toggleChat', std.core.bind(this.toggleChat, this));\n\n this._binding.addAction('toggleCameraMode', std.core.bind(this.toggleCameraMode, this));\n\n this._binding.addToggleAction('moveForward', std.core.bind(this.moveSelf, this, new util.Vec3(0, 0, -1)), 1, -1);\n this._binding.addToggleAction('moveBackward', std.core.bind(this.moveSelf, this, new util.Vec3(0, 0, 1)), 1, -1);\n this._binding.addToggleAction('moveLeft', std.core.bind(this.moveSelf, this, new util.Vec3(-1, 0, 0)), 1, -1);\n this._binding.addToggleAction('moveRight', std.core.bind(this.moveSelf, this, new util.Vec3(1, 0, 0)), 1, -1);\n this._binding.addToggleAction('moveUp', std.core.bind(this.moveSelf, this, new util.Vec3(0, 1, 0)), 1, -1);\n this._binding.addToggleAction('moveDown', std.core.bind(this.moveSelf, this, new util.Vec3(0, -1, 0)), 1, -1);\n\n this._binding.addToggleAction('rotateUp', std.core.bind(this.rotateSelf, this, new util.Vec3(1, 0, 0)), 1, -1);\n this._binding.addToggleAction('rotateDown', std.core.bind(this.rotateSelf, this, new util.Vec3(-1, 0, 0)), 1, -1);\n this._binding.addToggleAction('rotateLeft', std.core.bind(this.rotateSelf, this, new util.Vec3(0, 1, 0)), 1, -1);\n this._binding.addToggleAction('rotateRight', std.core.bind(this.rotateSelf, this, new util.Vec3(0, -1, 0)), 1, -1);\n\n this._binding.addFloat2Action('pickObject', std.core.bind(this.pickObject, this));\n\n this._binding.addAction('startMoveDrag', std.core.bind(this.startDrag, this, this._draggers.move));\n this._binding.addAction('startRotateDrag', std.core.bind(this.startDrag, this, this._draggers.rotate));\n this._binding.addAction('startScaleDrag', std.core.bind(this.startDrag, this, this._draggers.scale));\n this._binding.addAction('forwardMousePressToDragger', std.core.bind(this.forwardMousePressToDragger, this));\n this._binding.addAction('forwardMouseDragToDragger', std.core.bind(this.forwardMouseDragToDragger, this));\n this._binding.addAction('forwardMouseReleaseToDragger', std.core.bind(this.forwardMouseReleaseToDragger, this));\n this._binding.addAction('stopDrag', std.core.bind(this.stopDrag, this));\n\n \/** Bindings are an *ordered* list of keys and actions. Keys\n * are a combination of the type of event, the primary key\n * for the event (key or mouse button), and modifiers.\n * Modifiers are tricky to handle. You can specify a string\n * indicating which to filter on. If you omit the string, it\n * is equivalent to 'none'. The special values '*' and 'any'\n * are equivalent and will match any modifier, i.e. the event\n * will always be triggered. There isn't support\n * for matching combinations of modifiers.\n *\/\n var bindings = [\n { key: ['button-pressed', 'escape'], action: 'quit' },\n { key: ['button-pressed', 'i'], action: 'screenshot' },\n { key: ['button-pressed', 'm'], action: 'toggleSuspend' },\n { key: ['button-pressed', 's', 'alt' ], action: 'scriptSelectedObject' },\n { key: ['button-pressed', 's', 'ctrl' ], action: 'scriptSelf' },\n\n { key: ['button-pressed', 'c', 'ctrl' ], action: 'toggleChat' },\n\n { key: ['mouse-click', 3], action: 'pickObject' },\n { key: ['mouse-click', 3], action: 'scriptSelectedObject' },\n\n { key: ['button-pressed', 'c' ], action: 'toggleCameraMode' },\n\n { key: ['button', 'w' ], action: 'moveForward' },\n { key: ['button', 'up' ], action: 'moveForward' },\n { key: ['button', 's' ], action: 'moveBackward' },\n { key: ['button', 'down' ], action: 'moveBackward' },\n { key: ['button', 'a' ], action: 'moveLeft' },\n { key: ['button', 'd' ], action: 'moveRight' },\n { key: ['button', 'q' ], action: 'moveUp' },\n { key: ['button', 'z' ], action: 'moveDown' },\n\n { key: ['button', 'up', 'shift' ], action: 'rotateUp' },\n { key: ['button', 'down', 'shift' ], action: 'rotateDown' },\n { key: ['button', 'left' ], action: 'rotateLeft' },\n { key: ['button', 'right' ], action: 'rotateRight' },\n\n { key: ['mouse-press', 1 ], action: 'pickObject' },\n\n \/\/ Note that the ordering of registration here is critical.\n { key: ['mouse-press', 1, 'none' ], action: 'startMoveDrag' },\n { key: ['mouse-press', 1, 'ctrl' ], action: 'startRotateDrag' },\n { key: ['mouse-press', 1, 'alt' ], action: 'startScaleDrag' },\n { key: ['mouse-press', 1, '*'], action: 'forwardMousePressToDragger' },\n { key: ['mouse-drag', 1, '*'], action: 'forwardMouseDragToDragger' },\n { key: ['mouse-release', 1, '*'], action: 'forwardMouseReleaseToDragger' },\n { key: ['mouse-release', 1, '*'], action: 'stopDrag' }\n ];\n\n this._binding.addBindings(bindings);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.simulator = function() {\n return this._simulator;\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.invoke = function() {\n \/\/ Just forward manual invoke commands directly\n return this._simulator.invoke.apply(this._simulator, arguments);\n };\n\n \/** Request that the given URL be added as a module in the UI. *\/\n std.graphics.DefaultGraphics.prototype.addGUIModule = function(name, url) {\n return this._simulator.addGUIModule(name, url);\n };\n\n\n \/\/by default how to scale translational velocity from keypresses. (movement\n \/\/is agonizingly slow if just set this to 1. I really recommend 5.)\n \/** @public *\/\n std.graphics.DefaultGraphics.prototype.defaultVelocityScaling = 5;\n \/\/by default how to scale rotational velocity from keypresses\n \/** @public *\/\n std.graphics.DefaultGraphics.prototype.defaultRotationalVelocityScaling = .5;\n\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.toggleChat = function() {\n this._chat.toggle();\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.scriptSelf = function() {\n this._scripter.script(system.self);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.scriptSelectedObject = function() {\n this._scripter.script(this._selected);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.toggleCameraMode = function(evt) {\n this._cameraMode = this._cameraMode == 'first' ? 'third' : 'first';\n this._simulator.setCameraMode(this._cameraMode);\n this.updateCameraOffset();\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.updateCameraOffset = function(evt) {\n if (this._cameraMode == 'third') {\n var orient = this._pres.getOrientation();\n this._simulator.setCameraOffset(orient.mul(<0, 1.5, 4>));\n }\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.moveSelf = function(dir, val) {\n this._moverot.move(dir, this.defaultVelocityScaling * val);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.rotateSelf = function(about, val) {\n this._moverot.rotate(about, this.defaultRotationalVelocityScaling * val);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.pickObject = function(x, y) {\n if (this._selected) {\n this._simulator.bbox(this._selected, false);\n this._selected = null;\n }\n\n var clicked = this._simulator.pick(x, y);\n if (clicked) {\n this._selected = clicked;\n this._simulator.bbox(this._selected, true);\n }\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.startDrag = function(dragger, evt) {\n if (this._selected)\n this._dragger = dragger;\n if (this._dragger)\n this._dragger.selected(this._selected);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.forwardMousePressToDragger = function(evt) {\n if (this._dragger) this._dragger.onMousePress(evt);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.forwardMouseDragToDragger = function(evt) {\n if (this._dragger) this._dragger.onMouseDrag(evt);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.forwardMouseReleaseToDragger = function(evt) {\n if (this._dragger) this._dragger.onMouseRelease(evt);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.stopDrag = function() {\n delete this._dragger;\n };\n\n})();\n","old_contents":"\/* Sirikata\n * default.em\n *\n * Copyright (c) 2011, Ewen Cheslack-Postava\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in\n * the documentation and\/or other materials provided with the\n * distribution.\n * * Neither the name of Sirikata nor the names of its contributors may\n * be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\n * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\nsystem.require('graphics.em');\nsystem.require('std\/movement\/moveAndRotate.em');\nsystem.require('std\/script\/scripter.em');\nsystem.require('inputbinding.em');\nsystem.require('drag\/move.em');\nsystem.require('drag\/rotate.em');\nsystem.require('drag\/scale.em');\nsystem.require('std\/graphics\/chat.em');\n\n(\nfunction() {\n\n var ns = std.graphics;\n\n \/** @namespace\n * The DefaultGraphics class just contains some sane defaults for\n * interaction, allowing you to get a decent, baseline client\n * that only requires built-in functionality. You still define\n * the presence and which underlying graphics system to use, but\n * this class takes care of defining all other UI and interaction.\n *\/\n std.graphics.DefaultGraphics = function(pres, name) {\n this._pres = pres;\n this._simulator = new std.graphics.Graphics(pres, name);\n\n this._cameraMode = 'first';\n\n this._selected = null;\n this._scripter = new std.script.Scripter(this);\n this._chat = new std.graphics.Chat(pres, this._simulator);\n this._moverot = new std.movement.MoveAndRotate(this._pres, std.core.bind(this.updateCameraOffset, this), 'rotation');\n\n this._draggers = {\n move: new std.graphics.MoveDragHandler(this._simulator),\n rotate: new std.graphics.RotateDragHandler(this._simulator),\n scale: new std.graphics.ScaleDragHandler(this._simulator)\n };\n\n\n this._binding = new std.graphics.InputBinding();\n this._simulator.inputHandler.onAnything = std.core.bind(this._binding.dispatch, this._binding);\n\n\n this._binding.addAction('quit', std.core.bind(this._simulator.quit, this._simulator));\n this._binding.addAction('screenshot', std.core.bind(this._simulator.screenshot, this._simulator));\n this._binding.addAction('toggleSuspend', std.core.bind(this._simulator.toggleSuspend, this._simulator));\n this._binding.addAction('scriptSelectedObject', std.core.bind(this.scriptSelectedObject, this));\n this._binding.addAction('scriptSelf', std.core.bind(this.scriptSelf, this));\n\n this._binding.addAction('toggleChat', std.core.bind(this.toggleChat, this));\n\n this._binding.addAction('toggleCameraMode', std.core.bind(this.toggleCameraMode, this));\n\n this._binding.addToggleAction('moveForward', std.core.bind(this.moveSelf, this, new util.Vec3(0, 0, -1)), 1, -1);\n this._binding.addToggleAction('moveBackward', std.core.bind(this.moveSelf, this, new util.Vec3(0, 0, 1)), 1, -1);\n this._binding.addToggleAction('moveLeft', std.core.bind(this.moveSelf, this, new util.Vec3(-1, 0, 0)), 1, -1);\n this._binding.addToggleAction('moveRight', std.core.bind(this.moveSelf, this, new util.Vec3(1, 0, 0)), 1, -1);\n this._binding.addToggleAction('moveUp', std.core.bind(this.moveSelf, this, new util.Vec3(0, 1, 0)), 1, -1);\n this._binding.addToggleAction('moveDown', std.core.bind(this.moveSelf, this, new util.Vec3(0, -1, 0)), 1, -1);\n\n this._binding.addToggleAction('rotateUp', std.core.bind(this.rotateSelf, this, new util.Vec3(1, 0, 0)), 1, -1);\n this._binding.addToggleAction('rotateDown', std.core.bind(this.rotateSelf, this, new util.Vec3(-1, 0, 0)), 1, -1);\n this._binding.addToggleAction('rotateLeft', std.core.bind(this.rotateSelf, this, new util.Vec3(0, 1, 0)), 1, -1);\n this._binding.addToggleAction('rotateRight', std.core.bind(this.rotateSelf, this, new util.Vec3(0, -1, 0)), 1, -1);\n\n this._binding.addFloat2Action('pickObject', std.core.bind(this.pickObject, this));\n\n this._binding.addAction('startMoveDrag', std.core.bind(this.startDrag, this, this._draggers.move));\n this._binding.addAction('startRotateDrag', std.core.bind(this.startDrag, this, this._draggers.rotate));\n this._binding.addAction('startScaleDrag', std.core.bind(this.startDrag, this, this._draggers.scale));\n this._binding.addAction('forwardMousePressToDragger', std.core.bind(this.forwardMousePressToDragger, this));\n this._binding.addAction('forwardMouseDragToDragger', std.core.bind(this.forwardMouseDragToDragger, this));\n this._binding.addAction('forwardMouseReleaseToDragger', std.core.bind(this.forwardMouseReleaseToDragger, this));\n this._binding.addAction('stopDrag', std.core.bind(this.stopDrag, this));\n\n \/** Bindings are an *ordered* list of keys and actions. Keys\n * are a combination of the type of event, the primary key\n * for the event (key or mouse button), and modifiers.\n * Modifiers are tricky to handle. You can specify a string\n * indicating which to filter on. If you omit the string, it\n * is equivalent to 'none'. The special values '*' and 'any'\n * are equivalent and will match any modifier, i.e. the event\n * will always be triggered. There isn't support\n * for matching combinations of modifiers.\n *\/\n var bindings = [\n { key: ['button-pressed', 'escape'], action: 'quit' },\n { key: ['button-pressed', 'i'], action: 'screenshot' },\n { key: ['button-pressed', 'm'], action: 'toggleSuspend' },\n { key: ['button-pressed', 's', 'alt' ], action: 'scriptSelectedObject' },\n { key: ['button-pressed', 's', 'ctrl' ], action: 'scriptSelf' },\n\n { key: ['button-pressed', 'c', 'ctrl' ], action: 'toggleChat' },\n\n { key: ['mouse-click', 3], action: 'pickObject' },\n { key: ['mouse-click', 3], action: 'scriptSelectedObject' },\n\n { key: ['button-pressed', 'c' ], action: 'toggleCameraMode' },\n\n { key: ['button', 'w' ], action: 'moveForward' },\n { key: ['button', 'up' ], action: 'moveForward' },\n { key: ['button', 's' ], action: 'moveBackward' },\n { key: ['button', 'down' ], action: 'moveBackward' },\n { key: ['button', 'a' ], action: 'moveLeft' },\n { key: ['button', 'd' ], action: 'moveRight' },\n { key: ['button', 'q' ], action: 'moveUp' },\n { key: ['button', 'z' ], action: 'moveDown' },\n\n { key: ['button', 'up', 'shift' ], action: 'rotateUp' },\n { key: ['button', 'down', 'shift' ], action: 'rotateDown' },\n { key: ['button', 'left' ], action: 'rotateLeft' },\n { key: ['button', 'right' ], action: 'rotateRight' },\n\n { key: ['mouse-press', 1 ], action: 'pickObject' },\n\n \/\/ Note that the ordering of registration here is critical.\n { key: ['mouse-press', 1, 'none' ], action: 'startMoveDrag' },\n { key: ['mouse-press', 1, 'ctrl' ], action: 'startRotateDrag' },\n { key: ['mouse-press', 1, 'alt' ], action: 'startScaleDrag' },\n { key: ['mouse-press', 1, '*'], action: 'forwardMousePressToDragger' },\n { key: ['mouse-drag', 1, '*'], action: 'forwardMouseDragToDragger' },\n { key: ['mouse-release', 1, '*'], action: 'forwardMouseReleaseToDragger' },\n { key: ['mouse-release', 1, '*'], action: 'stopDrag' }\n ];\n\n this._binding.addBindings(bindings);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.simulator = function() {\n return this._simulator;\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.invoke = function() {\n \/\/ Just forward manual invoke commands directly\n return this._simulator.invoke.apply(this._simulator, arguments);\n };\n\n\n \/\/by default how to scale translational velocity from keypresses. (movement\n \/\/is agonizingly slow if just set this to 1. I really recommend 5.)\n \/** @public *\/\n std.graphics.DefaultGraphics.prototype.defaultVelocityScaling = 5;\n \/\/by default how to scale rotational velocity from keypresses\n \/** @public *\/\n std.graphics.DefaultGraphics.prototype.defaultRotationalVelocityScaling = .5;\n\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.toggleChat = function() {\n this._chat.toggle();\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.scriptSelf = function() {\n this._scripter.script(system.self);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.scriptSelectedObject = function() {\n this._scripter.script(this._selected);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.toggleCameraMode = function(evt) {\n this._cameraMode = this._cameraMode == 'first' ? 'third' : 'first';\n this._simulator.setCameraMode(this._cameraMode);\n this.updateCameraOffset();\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.updateCameraOffset = function(evt) {\n if (this._cameraMode == 'third') {\n var orient = this._pres.getOrientation();\n this._simulator.setCameraOffset(orient.mul(<0, 1.5, 4>));\n }\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.moveSelf = function(dir, val) {\n this._moverot.move(dir, this.defaultVelocityScaling * val);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.rotateSelf = function(about, val) {\n this._moverot.rotate(about, this.defaultRotationalVelocityScaling * val);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.pickObject = function(x, y) {\n if (this._selected) {\n this._simulator.bbox(this._selected, false);\n this._selected = null;\n }\n\n var clicked = this._simulator.pick(x, y);\n if (clicked) {\n this._selected = clicked;\n this._simulator.bbox(this._selected, true);\n }\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.startDrag = function(dragger, evt) {\n if (this._selected)\n this._dragger = dragger;\n if (this._dragger)\n this._dragger.selected(this._selected);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.forwardMousePressToDragger = function(evt) {\n if (this._dragger) this._dragger.onMousePress(evt);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.forwardMouseDragToDragger = function(evt) {\n if (this._dragger) this._dragger.onMouseDrag(evt);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.forwardMouseReleaseToDragger = function(evt) {\n if (this._dragger) this._dragger.onMouseRelease(evt);\n };\n\n \/** @function *\/\n std.graphics.DefaultGraphics.prototype.stopDrag = function() {\n delete this._dragger;\n };\n\n})();\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"EmberScript"} {"commit":"227a0f5aff9775f41ce6771fc63e0212a59b61c4","subject":"Disable mock bootstrapping in RPM builds (#804)","message":"Disable mock bootstrapping in RPM builds (#804)\n\nThis mock feature was enabled by default in mock 2.0. It isn't really\r\nuseful to us because the Docker container always matches the mock guest\r\nOS. It also adds at least a minute to each build.","repos":"ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm","old_file":"ros_buildfarm\/templates\/release\/rpm\/mock_config.cfg.em","new_file":"ros_buildfarm\/templates\/release\/rpm\/mock_config.cfg.em","new_contents":"include('\/etc\/mock\/default.cfg')\n\n# Change the root name since we're modifying the chroot\nconfig_opts['root'] += '-ros-buildfarm'\n\n# Disable mock bootstrapping\nconfig_opts['use_bootstrap'] = False\n\n# Add python3-rpm-macros to resolve %{python3_pkgversion} in rosdep rules\nconfig_opts['chroot_setup_cmd'] += ' python3-rpm-macros'\n\n# Install weak dependencies to get group members\nconfig_opts['yum_builddep_opts'] = config_opts.get('yum_builddep_opts', []) + ['--setopt=install_weak_deps=True']\nconfig_opts['dnf_builddep_opts'] = config_opts.get('dnf_builddep_opts', []) + ['--setopt=install_weak_deps=True']\nconfig_opts['microdnf_builddep_opts'] = config_opts.get('microdnf_builddep_opts', []) + ['--setopt=install_weak_deps=True']\n\n@[if env_vars]@\n# Set environment vars from the build config\n@[for env_key, env_val in env_vars.items()]@\nconfig_opts['environment']['@env_key'] = '@env_val'\n@[end for]\n@[end if]@\n# Disable debug packages until infrastructure can handle it\nconfig_opts['macros']['debug_package'] = '%{nil}'\n\n# Hack the %{dist} macro to allow release suffixing\nconfig_opts['macros']['%dist'] = '.' + config_opts['dist'] + '%{?dist_suffix}'\n\n# Required for running mock in Docker\nconfig_opts['use_nspawn'] = False\n\n@[if os_name in ['centos', 'rhel'] and os_code_name == '7']@\n# Inject g++ 8 into RHEL 7 builds\nconfig_opts['chroot_setup_cmd'] += ' devtoolset-8-gcc-c++ devtoolset-8-make-nonblocking'\nconfig_opts['macros']['_buildshell'] = '\/usr\/bin\/scl enable devtoolset-8 -- \/bin\/sh'\n\n# Disable weak dependencies on RHEL 7 builds\nconfig_opts['macros']['_without_weak_deps'] = '1'\n@[else]@\n# Add g++, which is an assumed dependency in ROS\nconfig_opts['chroot_setup_cmd'] += ' gcc-c++ make'\n@[end if]@\n\nconfig_opts['yum.conf'] += \"\"\"\n@[for i, url in enumerate(distribution_repository_urls)]@\n[ros-buildfarm-@(i)]\nname=ROS Buildfarm Repository @(i) - $basearch\nbaseurl=@(url)\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-ros-buildfarm-@(i)\nrepo_gpgcheck=@(1 if i < len(distribution_repository_keys) and distribution_repository_keys[i] else 0)\ngpgcheck=0\nenabled=1\nskip_if_unavailable=False\n\n@[end for]@\n@[if target_repository]@\n[ros-buildfarm-target-source]\nname=ROS Buildfarm Repository Target - SRPMS\nbaseurl=@(target_repository)\nrepo_gpgcheck=0\ngpgcheck=0\nenabled=0\nskip_if_unavailable=False\n\n@[end if]@\n\"\"\"\n","old_contents":"include('\/etc\/mock\/default.cfg')\n\n# Change the root name since we're modifying the chroot\nconfig_opts['root'] += '-ros-buildfarm'\n\n# Add python3-rpm-macros to resolve %{python3_pkgversion} in rosdep rules\nconfig_opts['chroot_setup_cmd'] += ' python3-rpm-macros'\n\n# Install weak dependencies to get group members\nconfig_opts['yum_builddep_opts'] = config_opts.get('yum_builddep_opts', []) + ['--setopt=install_weak_deps=True']\nconfig_opts['dnf_builddep_opts'] = config_opts.get('dnf_builddep_opts', []) + ['--setopt=install_weak_deps=True']\nconfig_opts['microdnf_builddep_opts'] = config_opts.get('microdnf_builddep_opts', []) + ['--setopt=install_weak_deps=True']\n\n@[if env_vars]@\n# Set environment vars from the build config\n@[for env_key, env_val in env_vars.items()]@\nconfig_opts['environment']['@env_key'] = '@env_val'\n@[end for]\n@[end if]@\n# Disable debug packages until infrastructure can handle it\nconfig_opts['macros']['debug_package'] = '%{nil}'\n\n# Hack the %{dist} macro to allow release suffixing\nconfig_opts['macros']['%dist'] = '.' + config_opts['dist'] + '%{?dist_suffix}'\n\n# Required for running mock in Docker\nconfig_opts['use_nspawn'] = False\n\n@[if os_name in ['centos', 'rhel'] and os_code_name == '7']@\n# Inject g++ 8 into RHEL 7 builds\nconfig_opts['chroot_setup_cmd'] += ' devtoolset-8-gcc-c++ devtoolset-8-make-nonblocking'\nconfig_opts['macros']['_buildshell'] = '\/usr\/bin\/scl enable devtoolset-8 -- \/bin\/sh'\n\n# Disable weak dependencies on RHEL 7 builds\nconfig_opts['macros']['_without_weak_deps'] = '1'\n@[else]@\n# Add g++, which is an assumed dependency in ROS\nconfig_opts['chroot_setup_cmd'] += ' gcc-c++ make'\n@[end if]@\n\nconfig_opts['yum.conf'] += \"\"\"\n@[for i, url in enumerate(distribution_repository_urls)]@\n[ros-buildfarm-@(i)]\nname=ROS Buildfarm Repository @(i) - $basearch\nbaseurl=@(url)\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-ros-buildfarm-@(i)\nrepo_gpgcheck=@(1 if i < len(distribution_repository_keys) and distribution_repository_keys[i] else 0)\ngpgcheck=0\nenabled=1\nskip_if_unavailable=False\n\n@[end for]@\n@[if target_repository]@\n[ros-buildfarm-target-source]\nname=ROS Buildfarm Repository Target - SRPMS\nbaseurl=@(target_repository)\nrepo_gpgcheck=0\ngpgcheck=0\nenabled=0\nskip_if_unavailable=False\n\n@[end if]@\n\"\"\"\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"2efe2cec7ff6f0553581b0ced610d9c8aba36118","subject":"Add speed control for default client script.","message":"Add speed control for default client script.\n","repos":"sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata","old_file":"liboh\/plugins\/js\/scripts\/std\/client\/default.em","new_file":"liboh\/plugins\/js\/scripts\/std\/client\/default.em","new_contents":"\/* Sirikata\n * default.em\n *\n * Copyright (c) 2011, Ewen Cheslack-Postava\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in\n * the documentation and\/or other materials provided with the\n * distribution.\n * * Neither the name of Sirikata nor the names of its contributors may\n * be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\n * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\nsystem.require('std\/core\/namespace.em');\nsystem.require('std\/graphics\/graphics.em');\nsystem.require('std\/graphics\/undo.em');\nsystem.require('std\/movement\/pursue.em');\nsystem.require('std\/graphics\/inputbinding.em');\nsystem.require('std\/graphics\/defaultcamera.em');\nsystem.require('std\/graphics\/drag\/move.em');\nsystem.require('std\/graphics\/drag\/rotate.em');\nsystem.require('std\/graphics\/drag\/scale.em');\nsystem.require('std\/graphics\/chat.em');\nsystem.require('std\/graphics\/physics.em');\nsystem.require('std\/graphics\/propertybox.em');\nsystem.require('std\/graphics\/presenceList.em');\nsystem.require('std\/graphics\/setMesh.em');\nsystem.require('std\/graphics\/axes.em');\nsystem.require('std\/graphics\/flatlandViewer.em');\nsystem.require('std\/graphics\/characterAnimation.em');\n\nsystem.require('std\/audio\/audio.em');\nsystem.require('std\/env\/env.em');\n\n\n(\nfunction() {\n\n var ns = Namespace('std.client');\n\n \/** @namespace\n * The Default class just contains some sane defaults for\n * interaction, allowing you to get a decent, baseline client\n * that only requires built-in functionality. You still define\n * the presence and which underlying graphics system to use, but\n * this class takes care of defining all other UI and interaction.\n *\/\n std.client.Default = function(pres, cb) {\n this._pres = pres;\n\n \/\/ We'd like to rename this this._graphics, but many other things depend on it's location still...\n this._simulator = new std.graphics.Graphics(pres, 'ogregraphics', std.core.bind(this.finishedGraphicsInit, this, cb), std.core.bind(this.finishedGraphicsUIReset, this));\n\n this._env = new std.env.Environment(pres);\n this._env.listen(std.core.bind(this._environmentChanged, this));\n\n\/\/ this._audio = new std.audio.Audio(pres, 'sdlaudio');\n };\n\n \n std.client.Default.prototype.finishedGraphicsInit = function(cb, gfx, alreadyInitialized) {\n this._camera = new std.graphics.DefaultCamera(this._simulator, system.self);\n \n this._selected = null;\n this._loadingUIs = 0;\n\n this._alreadyInitialized = alreadyInitialized;\n if (! this._alreadyInitialized)\n {\n var ui_finish_cb = std.core.bind(this.finishedUIInit, this, cb);\n\/\/ this._loadingUIs++; this._scripter = new std.script.Scripter(this, ui_finish_cb);\n \/\/using new scripting gui interface\n \/\/ this._loadingUIs++; this._scripter = new std.ScriptingGui.Controller(this);\n\n \n \/\/this._loadingUIs++; this._chat = new std.graphics.Chat(this._pres, this._simulator, ui_finish_cb);\n this._loadingUIs++; this._physics = new std.graphics.PhysicsProperties(this._simulator, ui_finish_cb);\n \/\/this._loadingUIs++; this._propertybox = new std.propertybox.PropertyBox(this, ui_finish_cb);\n \/\/this._loadingUIs++; this._presenceList = new std.graphics.PresenceList(this._pres, this._simulator, this._scripter, ui_finish_cb);\n this._loadingUIs++; this._setMesh = new std.graphics.SetMesh(this._simulator, ui_finish_cb);\n \/\/this._loadingUIs++; this._flatland = new std.fl.FL(this, ui_finish_cb); \n }\n else\n this.finishedUIInit(cb);\n\n };\n\n std.client.Default.prototype.finishedGraphicsUIReset = function(gfx) {\n this._camera.reinit();\n\n var ui_finish_cb = std.core.bind(this.finishedUIInit, this);\n\n \/\/this._loadingUIs++; this._scripter.onReset(ui_finish_cb);\n \/\/this._loadingUIs++; this._chat.onReset(ui_finish_cb);\n this._loadingUIs++; this._physics.onReset(ui_finish_cb);\n \/\/this._loadingUIs++; this._propertybox.onReset(ui_finish_cb);\n \/\/this._loadingUIs++; this._presenceList.onReset(ui_finish_cb);\n this._loadingUIs++; this._setMesh.onReset(ui_finish_cb);\n \/\/this._loadingUIs++; this._flatland.onReset(ui_finish_cb);\n };\n\n\n \/**\n this._alreadyInitialized is true or false. If true, means that we\n already had a graphics viewer completely initialized before going\n through this initialization process. If false, means that we\n are doing initialization for the first time.\n *\/\n std.client.Default.prototype.finishedUIInit = function(cb) {\n this._loadingUIs--;\n if (this._loadingUIs > 0) return;\n\n if (! this._alreadyInitialized)\n this._simulator.hideLoadScreen();\n\n this._move_speed = 1;\n this._moverot = new std.movement.MoveAndRotate(this._pres, std.core.bind(this.updateCameraAndAnimation, this), 'rotation');\n this._characterAnimation = new std.graphics.CharacterAnimation(this);\n\n this._draggers = {\n move: new std.graphics.MoveDragHandler(this._simulator),\n rotate: new std.graphics.RotateDragHandler(this._simulator),\n scale: new std.graphics.ScaleDragHandler(this._simulator)\n };\n\n this._binding = new std.graphics.InputBinding();\n this._simulator.inputHandler.onAnything = std.core.bind(this._binding.dispatch, this._binding);\n\n this._binding.addFloat2Action('pickObject', std.core.bind(this.pickObject, this));\n\n if (! this._alreadyInitialized)\n {\n this._binding.addAction('quit', std.core.bind(this._simulator.quit, this._simulator));\n this._binding.addAction('screenshot', std.core.bind(this._simulator.screenshot, this._simulator));\n this._binding.addAction('toggleSuspend', std.core.bind(this._simulator.toggleSuspend, this._simulator));\n this._binding.addAction('scriptSelectedObject', std.core.bind(this.scriptSelectedObject, this));\n this._binding.addAction('scriptSelf', std.core.bind(this.scriptSelf, this));\n\n \n this._binding.addAction('togglePropertyBox', std.core.bind(this.togglePropertyBox, this));\n this._binding.addAction('toggleChat', std.core.bind(this.toggleChat, this));\n this._binding.addAction('togglePhysicsProperties', std.core.bind(this._physics.toggle, this._physics));\n \/\/this._binding.addAction('togglePresenceList', std.core.bind(this._presenceList.toggle, this._presenceList));\n this._binding.addAction('toggleSetMesh', std.core.bind(this._setMesh.toggle, this._setMesh));\n \/\/this._binding.addFloat2Action('showFlatland', std.core.bind(this.showFlatland, this));\n \/\/this._binding.addAction('hideFlatland', std.core.bind(this.hideFlatland, this));\n\n this._binding.addAction('toggleCameraMode', std.core.bind(this.toggleCameraMode, this));\n\n this._binding.addAction('actOnObject', std.core.bind(this.actOnObject, this));\n this._binding.addAction('teleportToObj', std.core.bind(this.teleportToObj, this));\n\n this._binding.addToggleAction('moveForward', std.core.bind(this.moveSelf, this, new util.Vec3(0, 0, -1)), 1, -1);\n this._binding.addToggleAction('moveBackward', std.core.bind(this.moveSelf, this, new util.Vec3(0, 0, 1)), 1, -1);\n this._binding.addToggleAction('moveLeft', std.core.bind(this.moveSelf, this, new util.Vec3(-1, 0, 0)), 1, -1);\n this._binding.addToggleAction('moveRight', std.core.bind(this.moveSelf, this, new util.Vec3(1, 0, 0)), 1, -1);\n this._binding.addToggleAction('moveUp', std.core.bind(this.moveSelf, this, new util.Vec3(0, 1, 0)), 1, -1);\n this._binding.addToggleAction('moveDown', std.core.bind(this.moveSelf, this, new util.Vec3(0, -1, 0)), 1, -1);\n \/\/ Movement speed\n this._binding.addAction('moveSpeedUp', std.core.bind(this.moveSpeedUp, this));\n this._binding.addAction('moveSpeedDown', std.core.bind(this.moveSpeedDown, this));\n\n this._binding.addToggleAction('rotateUp', std.core.bind(this.rotateSelf, this, new util.Vec3(1, 0, 0), \"_rotate_up_handle_\"), true, false);\n this._binding.addToggleAction('rotateDown', std.core.bind(this.rotateSelf, this, new util.Vec3(-1, 0, 0), \"_rotate_down_handle_\"), true, false);\n this._binding.addToggleAction('rotateLeft', std.core.bind(this.rotateSelf, this, new util.Vec3(0, 1, 0), \"_rotate_left_handle_\"), true, false);\n this._binding.addToggleAction('rotateRight', std.core.bind(this.rotateSelf, this, new util.Vec3(0, -1, 0), \"_rotate_right_handle_\"), true, false);\n\n this._binding.addFloat2Action('turnOffAxis', std.core.bind(this.turnOffAxis, this));\n \n this._binding.addAction('axesSnapLocal', std.core.bind(this.setAxesInheritOrient, this, true));\n this._binding.addAction('axesSnapGlobal', std.core.bind(this.setAxesInheritOrient, this, false));\n \n this._binding.addAction('updatePhysicsProperties', std.core.bind(this.updatePhysicsProperties, this));\n\n this._binding.addAction('startMoveDrag', std.core.bind(this.startDrag, this, this._draggers.move));\n this._binding.addAction('startRotateDrag', std.core.bind(this.startDrag, this, this._draggers.rotate));\n this._binding.addAction('startScaleDrag', std.core.bind(this.startDrag, this, this._draggers.scale));\n this._binding.addAction('forwardMousePressToDragger', std.core.bind(this.forwardMousePressToDragger, this));\n this._binding.addAction('forwardMouseDragToDragger', std.core.bind(this.forwardMouseDragToDragger, this));\n this._binding.addAction('updatePropertyBox', std.core.bind(this.updatePropertyBox, this));\n this._binding.addAction('forwardMouseReleaseToDragger', std.core.bind(this.forwardMouseReleaseToDragger, this));\n this._binding.addAction('stopDrag', std.core.bind(this.stopDrag, this));\n\n this._binding.addAction('startFreeRotate', std.core.bind(this.startFreeRotate, this));\n this._binding.addAction('freeRotateDrag', std.core.bind(this.freeRotateDrag, this));\n this._binding.addAction('freeRotateRelease', std.core.bind(this.freeRotateRelease, this));\n this._binding.addAction('undo', std.core.bind(this.undo, this));\n this._binding.addAction('redo', std.core.bind(this.redo, this));\n }\n\n \/** Bindings are an *ordered* list of keys and actions. Keys\n * are a combination of the type of event, the primary key\n * for the event (key or mouse button), and modifiers.\n * Modifiers are tricky to handle. You can specify a string\n * indicating which to filter on. If you omit the string, it\n * is equivalent to 'none'. The special values '*' and 'any'\n * are equivalent and will match any modifier, i.e. the event\n * will always be triggered. There isn't support\n * for matching combinations of modifiers.\n *\/\n var bindings = [{ key: ['mouse-press', 1 ], action: 'pickObject' },\n { key: ['mouse-click', 2], action: 'pickObject' }];\n\n if (!this._alreadyInitialized)\n {\n bindings = bindings.concat([{ key: ['button-pressed', 'escape'], action: 'quit' },\n { key: ['button-pressed', 'i'], action: 'screenshot' },\n { key: ['button-pressed', 'm'], action: 'toggleSuspend' },\n { key: ['button-pressed', 's', 'alt' ], action: 'scriptSelectedObject' },\n { key: ['button-pressed', 's', 'ctrl' ], action: 'scriptSelf' },\n { key: ['button-pressed', 'c', 'ctrl' ], action: 'toggleChat' },\n { key: ['button-pressed', 'p', 'ctrl' ], action: 'togglePhysicsProperties' },\n { key: ['button-pressed', 'p', 'alt' ], action: 'togglePropertyBox' },\n { key: ['button-pressed', 'l', 'ctrl' ], action: 'togglePresenceList' },\n { key: ['button-pressed', 'j', 'ctrl' ], action: 'toggleSetMesh' },\n \n { key: ['button-pressed', 'g', 'alt' ], action: 'axesSnapLocal' },\n { key: ['button-pressed', 'g', 'ctrl' ], action: 'axesSnapGlobal' },\n \n { key: ['button-pressed', 'z', 'ctrl' ], action: 'undo' },\n { key: ['button-pressed', 'y', 'ctrl' ], action: 'redo' },\n \n { key: ['mouse-click', 1, 'shift'], action: 'turnOffAxis' },\n { key: ['mouse-click', 2], action: 'scriptSelectedObject' },\n { key: ['button-pressed', 'return'], action: 'actOnObject' },\n { key: ['button-pressed', 't', 'ctrl' ], action: 'teleportToObj' },\n\n { key: ['button-pressed', 'c' ], action: 'toggleCameraMode' },\n\n { key: ['button', 'w' ], action: 'moveForward' },\n { key: ['button', 'up' ], action: 'moveForward' },\n { key: ['button', 's' ], action: 'moveBackward' },\n { key: ['button', 'down' ], action: 'moveBackward' },\n { key: ['button', 'a' ], action: 'moveLeft' },\n { key: ['button', 'd' ], action: 'moveRight' },\n { key: ['button', 'q' ], action: 'moveUp' },\n { key: ['button', 'z' ], action: 'moveDown' },\n\n { key: ['button', ']' ], action: 'moveSpeedUp' },\n { key: ['button', '[' ], action: 'moveSpeedDown' },\n\n { key: ['button', 'up', 'shift' ], action: 'rotateUp' },\n { key: ['button', 'down', 'shift' ], action: 'rotateDown' },\n { key: ['button', 'left' ], action: 'rotateLeft' },\n { key: ['button', 'right' ], action: 'rotateRight' },\n\n { key: ['mouse-press', 1 ], action: 'updatePhysicsProperties' },\n\n \/\/ Note that the ordering of registration here is critical.\n { key: ['mouse-press', 1, 'none' ], action: 'startMoveDrag' },\n { key: ['mouse-press', 1, 'ctrl' ], action: 'startRotateDrag' },\n { key: ['mouse-press', 1, 'alt' ], action: 'startScaleDrag' },\n { key: ['mouse-press', 1, '*'], action: 'forwardMousePressToDragger' },\n { key: ['mouse-press', 1, '*'], action: 'updatePropertyBox' },\n { key: ['mouse-drag', 1, '*'], action: 'forwardMouseDragToDragger' },\n { key: ['mouse-release', 1, '*'], action: 'forwardMouseReleaseToDragger' },\n { key: ['mouse-release', 1, '*'], action: 'stopDrag' },\n { key: ['mouse-press', 3, 'none'], action: 'showFlatland' },\n { key: ['mouse-press', 3, 'none' ], action: 'startFreeRotate' },\n { key: ['mouse-drag', 3, 'none'], action: 'freeRotateDrag' },\n { key: ['mouse-release', 3, 'none'], action: 'freeRotateRelease' }\n ]);\n }\n\n this._binding.addBindings(bindings);\n std.graphics.axes.init(this._simulator);\n this._axesInheritOrient = true;\n\n if (cb && typeof(cb) === \"function\")\n cb(this);\n };\n\n std.client.Default.prototype.presence = function() {\n return this._pres;\n };\n\n \/** @function *\/\n std.client.Default.prototype.simulator = function() {\n return this._simulator;\n };\n\n \/** @function *\/\n std.client.Default.prototype.invoke = function() {\n \/\/ Just forward manual invoke commands directly\n return this._simulator.invoke.apply(this._simulator, arguments);\n };\n\n \/** Request that the given URL be added as a module in the UI. *\/\n std.client.Default.prototype.addGUIModule = function(name, url, cb) {\n return this._simulator.addGUIModule(name, url, cb);\n };\n\n \/** Request that the given script text be added as a module in the UI. *\/\n std.client.Default.prototype.addGUITextModule = function(name, js_text, cb) {\n return this._simulator.addGUITextModule(name, js_text, cb);\n };\n\n \/** Get the GUI for a previously loaded GUI module. *\/\n std.client.Default.prototype.getGUIModule = function(name) {\n return this._simulator.getGUIModule(name);\n };\n\n \/** Request that the given URL be presented as a widget. *\/\n std.client.Default.prototype.createBrowser = function(name, url, cb) {\n return this._simulator.createBrowser(name, url, cb);\n };\n\n\n \/** Get a list of animations associated with this entity. *\/\n std.client.Default.prototype.getAnimationList = function(vis) {\n if (!vis)\n vis = system.self;\n\n return this._simulator.getAnimationList(vis);\n };\n\n \/** Start the animation on this entity given by the specified animation name. *\/\n std.client.Default.prototype.startAnimation = function(vis, anim) {\n return this._simulator.startAnimation(vis, anim);\n };\n\n \/** Stop the animation on this entity. *\/\n std.client.Default.prototype.stopAnimation = function(vis) {\n return this._simulator.stopAnimation(vis);\n };\n\n\n\n \/\/by default how to scale translational velocity from keypresses. (movement\n \/\/is agonizingly slow if just set this to 1. I really recommend 5.)\n \/** @public *\/\n std.client.Default.prototype.defaultVelocityScaling = 5;\n \/\/by default how to scale rotational velocity from keypresses\n \/** @public *\/\n std.client.Default.prototype.defaultRotationalVelocityScaling = .5;\n\n\n \/** @function *\/\n std.client.Default.prototype.toggleChat = function() {\n this._chat.toggle();\n };\n\n \/** @function *\/\n std.client.Default.prototype.scriptSelf = function() {\n if (typeof(this._scripter) == 'undefined')\n {\n system.require('std\/scriptingGui\/scriptingGui.em');\n this._scripter = new std.ScriptingGui.Controller(this);\n }\n \n this._scripter.script(system.self);\n };\n\n \/** @function *\/\n std.client.Default.prototype.togglePropertyBox = function() {\n this._propertybox.TogglePropertyBox();\n };\n\n std.client.Default.prototype.setAxesInheritOrient = function(inheritOrient) {\n if (this._axesInheritOrient === inheritOrient) {\n return;\n }\n \n this._axesInheritOrient = inheritOrient;\n \n if (this._selected) {\n std.graphics.axes.setInheritOrientAll(this._selected, inheritOrient);\n }\n };\n\n \/** @function *\/\n std.client.Default.prototype.scriptSelectedObject = function() {\n if (this._selected == null)\n return;\n \/\/this._presenceList.addObject(this._selected.toString(), 'Scripted');\n if (typeof(this._scripter) == 'undefined')\n {\n \/\/gross way of doing this. allows us to use simpleInput.em\n system.require('std\/scriptingGui\/scriptingGui.em');\n this._scripter = new std.ScriptingGui.Controller(this);\n }\n\n this._scripter.script(this._selected);\n };\n\n \/** @function *\/\n std.client.Default.prototype.toggleCameraMode = function(evt) {\n var newmode = this._camera.mode() == 'first' ? 'third' : 'first';\n this._camera.setMode(newmode);\n this.updateCameraOffset();\n };\n\n \/** @function *\/\n std.client.Default.prototype.updateCameraOffset = function() {\n if (this._camera.mode() == 'third') {\n var orient = this._pres.getOrientation();\n this._camera.setOffset(orient.mul(<0, 1.5, 6>));\n }\n };\n\n std.client.Default.prototype.updateAnimation = function() {\n this._characterAnimation.update();\n };\n\n std.client.Default.prototype.updateCameraAndAnimation = function() {\n this.updateCameraOffset();\n this.updateAnimation();\n };\n\n std.client.Default.prototype.moveSpeed = function() {\n return this._move_speed;\n };\n\n std.client.Default.prototype.moveSpeedUp = function() {\n this._move_speed *= 1.1;\n };\n\n std.client.Default.prototype.moveSpeedDown = function() {\n this._move_speed \/= 1.1;\n if (this._move_speed == 0) this._move_speed = 0.0001;\n };\n\n \/** @function *\/\n std.client.Default.prototype.moveSelf = function(dir, flip) {\n this._moverot.move(dir, this.defaultVelocityScaling * this.moveSpeed() * flip);\n };\n\n \/** @function *\/\n std.client.Default.prototype.rotateSelf = function(about, name, val) {\n if (val) {\n this[name] = this._moverot.rotate(about, this.defaultRotationalVelocityScaling);\n }\n else {\n this._moverot.cancelRotate(this[name]);\n delete this[name];\n }\n };\n\n std.client.Default.prototype.turnOffAxis = function(x, y) {\n if (!this._selected) {\n return;\n }\n var axis = std.graphics.axes.pick(this._selected, x, y);\n if (axis < 0) {\n return;\n } else {\n std.graphics.axes.setVisible(this._selected, axis, false);\n }\n };\n\n \/** @function *\/\n std.client.Default.prototype.pickObject = function(x, y)\n {\n var ignore_self = this._camera.mode() == 'first';\n var clicked = this._simulator.pick(x, y, ignore_self);\n if (clicked) {\n if (this._selected) {\n if (this._selected.toString() != clicked.toString()) {\n if (!this._alreadyInitialized)\n {\n this._simulator.bbox(this._selected, false);\n std.graphics.axes.setVisibleAll(this._selected, false); \n }\n } else {\n return;\n }\n }\n\n this._selected = clicked;\n if (!this._alreadyInitialized)\n {\n this._simulator.bbox(this._selected, true);\n std.graphics.axes.setInheritOrientAll(this._selected, this._axesInheritOrient);\n std.graphics.axes.setVisibleAll(this._selected, true);\n }\n } else if (this._selected) {\n if (!this._alreadyInitialized)\n {\n this._simulator.bbox(this._selected, false);\n std.graphics.axes.setVisibleAll(this._selected, false);\n }\n this._selected = null;\n }\n\n };\n\n \/** @function *\/\n std.client.Default.prototype.actOnObject = function(evt) {\n if (this._selected)\n { 'action' : 'touch' } >> this._selected >> [];\n }\n \n \/** @function *\/\n std.client.Default.prototype.teleportToObj = function(evt) {\n if (this._selected) {\n var dir = this._selected.getPosition() - this._pres.getPosition();\n dir = dir.normal();\n var self = this;\n this._selected.loadMesh(function() {\n var hit = std.raytrace.raytrace(null, self._pres.getPosition(), dir, self._selected, null);\n if (hit) {\n self._pres.setPosition(hit.sub(dir.scale(3)));\n } else {\n self._pres.setPosition(this._selected.getPosition());\n }\n self._pres.setOrientation(util.Quaternion.fromLookAt(dir));\n });\n }\n }\n\n \/** @function *\/\n std.client.Default.prototype.updatePhysicsProperties = function() {\n \/\/ Update even if not selected so display can be disabled\n this._physics.update(this._selected);\n if (this._setMesh) this._setMesh.update(this._selected);\n };\n\n \/** @function *\/\n std.client.Default.prototype.startDrag = function(dragger, evt) {\n if (this._selected)\n this._dragger = dragger;\n if (this._dragger)\n this._dragger.selected(this._selected, this._simulator.pickedPosition(), evt);\n };\n\n \/** @function *\/\n std.client.Default.prototype.forwardMousePressToDragger = function(evt) {\n if (this._dragger) this._dragger.onMousePress(evt);\n };\n\n \/** @function *\/\n std.client.Default.prototype.forwardMouseDragToDragger = function(evt) {\n if (this._dragger) this._dragger.onMouseDrag(evt);\n \/\/this._propertybox.HandleUpdateProperties(this._selected);\n };\n\n\n \n \/** @function *\/\n std.client.Default.prototype.updatePropertyBox = function(evt) {\n \/\/this._propertybox.HandleUpdateProperties(this._selected);\n };\n\n \/** @function *\/\n std.client.Default.prototype.forwardMouseReleaseToDragger = function(evt) {\n if (this._dragger) this._dragger.onMouseRelease(evt);\n };\n\n \/** @function *\/\n std.client.Default.prototype.stopDrag = function() {\n delete this._dragger;\n };\n\n \/** @function *\/\n std.client.Default.prototype.startFreeRotate = function(evt) {\n this.startX = evt.x;\n this.startY = evt.y;\n this.startOrientation = this._pres.getOrientation();\n };\n\n \/** @function *\/\n std.client.Default.prototype.freeRotateDrag = function(evt) {\n if (this.startX == null || this.startY == null)\n return;\n\n var SCALE = 1;\n var dx = evt.x - this.startX;\n var dy = evt.y - this.startY;\n var dXAngle = dx * SCALE;\n var dYAngle = dy * SCALE;\n var newQuat = this.startOrientation\n .mul(new util.Quaternion(<0, 1, 0>, -dXAngle))\n .mul(new util.Quaternion(<1, 0, 0>, dYAngle));\n this._pres.setOrientation(newQuat);\n\n \/\/ Reorient self so up is up.\n this._pres.setOrientation(util.Quaternion.fromLookAt(\n this._pres.getOrientation().zAxis().scale(-1), <0, 1, 0>));\n this.updateCameraOffset();\n this._moverot.reeval();\n };\n\n \/** @function *\/\n std.client.Default.prototype.freeRotateRelease = function(evt) {\n this.startX = null;\n this.startY = null;\n this.startOrientation = null;\n };\n\n std.client.Default.prototype.undo = function(evt) {\n this._simulator.undo();\n };\n\n std.client.Default.prototype.redo = function(evt) {\n this._simulator.redo();\n };\n\n\n std.client.Default.prototype.orientDefault = function(evt) {\n var vis = this._selected;\n if(!vis)\n return;\n var orient = vis.orientation;\n var movable = new std.movement.MovableRemote(vis);\n movable.setOrientation(new util.Quaternion());\n this._simulator.addUndoAction({}, {\n undo: function(action) {\n movable.setOrientation(orient);\n },\n redo: function(action) {\n movable.setOrientation(new util.Quaternion());\n }\n });\n };\n\n std.client.Default.prototype.setMaxObjects = function(maxobjs) {\n this._simulator.setMaxObjects(maxobjs);\n };\n\n\n std.client.Default.prototype.showFlatland = function (x, y) {\n var ignore_self = this._camera.mode() == 'first';\n var clicked = this._simulator.pick(x, y, ignore_self);\n this._flatland.show(clicked, x, y);\n };\n\n std.client.Default.prototype.hideFlatland = function () {\n this._flatland.hide();\n };\n\n\n\n std.client.Default.prototype._environmentChanged = function () {\n \/\/ Check all paths we know about to see if they've changed\n\n \/\/ Audio\n var audio_ambient = this._env.get('audio.ambient');\n if (audio_ambient && audio_ambient != this._env.audio_ambient) {\n this._env.audio_ambient = audio_ambient;\n if (this._env.audio_ambient_clip)\n this._env.audio_ambient_clip.stop();\n \/\/ Default to volume 1, looping\n if (this._audio)\n this._env.audio_ambient_clip = this._audio.play(audio_ambient, 1, true);\n }\n var audio_ambient_volume = this._env.get('audio.ambient_volume');\n if (audio_ambient_volume !== undefined && this._env.audio_ambient_clip) {\n this._env.audio_ambient_clip.volume(parseFloat(audio_ambient_volume));\n }\n\n \/\/ Skybox\n var skybox_type = this._env.get('sky.type');\n var skybox_img = this._env.get('sky.img');\n if (skybox_type && skybox_img) {\n var skybox_distance = this._env.get('sky.distance');\n if (!skybox_distance) skybox_distance = 4000;\n var skybox_tiling = this._env.get('sky.tiling');\n if (!skybox_tiling) skybox_tiling = 1;\n var skybox_curvature = this._env.get('sky.curvature');\n if (!skybox_curvature) skybox_curvature = 65;\n var skybox_orientation = this._env.get('sky.orientation');\n this._simulator.skybox(skybox_type, skybox_img, 4000, skybox_tiling, skybox_curvature, skybox_orientation);\n }\n };\n\n})();\n","old_contents":"\/* Sirikata\n * default.em\n *\n * Copyright (c) 2011, Ewen Cheslack-Postava\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in\n * the documentation and\/or other materials provided with the\n * distribution.\n * * Neither the name of Sirikata nor the names of its contributors may\n * be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\n * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\nsystem.require('std\/core\/namespace.em');\nsystem.require('std\/graphics\/graphics.em');\nsystem.require('std\/graphics\/undo.em');\nsystem.require('std\/movement\/pursue.em');\nsystem.require('std\/graphics\/inputbinding.em');\nsystem.require('std\/graphics\/defaultcamera.em');\nsystem.require('std\/graphics\/drag\/move.em');\nsystem.require('std\/graphics\/drag\/rotate.em');\nsystem.require('std\/graphics\/drag\/scale.em');\nsystem.require('std\/graphics\/chat.em');\nsystem.require('std\/graphics\/physics.em');\nsystem.require('std\/graphics\/propertybox.em');\nsystem.require('std\/graphics\/presenceList.em');\nsystem.require('std\/graphics\/setMesh.em');\nsystem.require('std\/graphics\/axes.em');\nsystem.require('std\/graphics\/flatlandViewer.em');\nsystem.require('std\/graphics\/characterAnimation.em');\n\nsystem.require('std\/audio\/audio.em');\nsystem.require('std\/env\/env.em');\n\n\n(\nfunction() {\n\n var ns = Namespace('std.client');\n\n \/** @namespace\n * The Default class just contains some sane defaults for\n * interaction, allowing you to get a decent, baseline client\n * that only requires built-in functionality. You still define\n * the presence and which underlying graphics system to use, but\n * this class takes care of defining all other UI and interaction.\n *\/\n std.client.Default = function(pres, cb) {\n this._pres = pres;\n\n \/\/ We'd like to rename this this._graphics, but many other things depend on it's location still...\n this._simulator = new std.graphics.Graphics(pres, 'ogregraphics', std.core.bind(this.finishedGraphicsInit, this, cb), std.core.bind(this.finishedGraphicsUIReset, this));\n\n this._env = new std.env.Environment(pres);\n this._env.listen(std.core.bind(this._environmentChanged, this));\n\n\/\/ this._audio = new std.audio.Audio(pres, 'sdlaudio');\n };\n\n \n std.client.Default.prototype.finishedGraphicsInit = function(cb, gfx, alreadyInitialized) {\n this._camera = new std.graphics.DefaultCamera(this._simulator, system.self);\n \n this._selected = null;\n this._loadingUIs = 0;\n\n this._alreadyInitialized = alreadyInitialized;\n if (! this._alreadyInitialized)\n {\n var ui_finish_cb = std.core.bind(this.finishedUIInit, this, cb);\n\/\/ this._loadingUIs++; this._scripter = new std.script.Scripter(this, ui_finish_cb);\n \/\/using new scripting gui interface\n \/\/ this._loadingUIs++; this._scripter = new std.ScriptingGui.Controller(this);\n\n \n \/\/this._loadingUIs++; this._chat = new std.graphics.Chat(this._pres, this._simulator, ui_finish_cb);\n this._loadingUIs++; this._physics = new std.graphics.PhysicsProperties(this._simulator, ui_finish_cb);\n \/\/this._loadingUIs++; this._propertybox = new std.propertybox.PropertyBox(this, ui_finish_cb);\n \/\/this._loadingUIs++; this._presenceList = new std.graphics.PresenceList(this._pres, this._simulator, this._scripter, ui_finish_cb);\n this._loadingUIs++; this._setMesh = new std.graphics.SetMesh(this._simulator, ui_finish_cb);\n \/\/this._loadingUIs++; this._flatland = new std.fl.FL(this, ui_finish_cb); \n }\n else\n this.finishedUIInit(cb);\n\n };\n\n std.client.Default.prototype.finishedGraphicsUIReset = function(gfx) {\n this._camera.reinit();\n\n var ui_finish_cb = std.core.bind(this.finishedUIInit, this);\n\n \/\/this._loadingUIs++; this._scripter.onReset(ui_finish_cb);\n \/\/this._loadingUIs++; this._chat.onReset(ui_finish_cb);\n this._loadingUIs++; this._physics.onReset(ui_finish_cb);\n \/\/this._loadingUIs++; this._propertybox.onReset(ui_finish_cb);\n \/\/this._loadingUIs++; this._presenceList.onReset(ui_finish_cb);\n this._loadingUIs++; this._setMesh.onReset(ui_finish_cb);\n \/\/this._loadingUIs++; this._flatland.onReset(ui_finish_cb);\n };\n\n\n \/**\n this._alreadyInitialized is true or false. If true, means that we\n already had a graphics viewer completely initialized before going\n through this initialization process. If false, means that we\n are doing initialization for the first time.\n *\/\n std.client.Default.prototype.finishedUIInit = function(cb) {\n this._loadingUIs--;\n if (this._loadingUIs > 0) return;\n\n if (! this._alreadyInitialized)\n this._simulator.hideLoadScreen();\n\n this._moverot = new std.movement.MoveAndRotate(this._pres, std.core.bind(this.updateCameraAndAnimation, this), 'rotation');\n this._characterAnimation = new std.graphics.CharacterAnimation(this);\n\n this._draggers = {\n move: new std.graphics.MoveDragHandler(this._simulator),\n rotate: new std.graphics.RotateDragHandler(this._simulator),\n scale: new std.graphics.ScaleDragHandler(this._simulator)\n };\n\n this._binding = new std.graphics.InputBinding();\n this._simulator.inputHandler.onAnything = std.core.bind(this._binding.dispatch, this._binding);\n\n this._binding.addFloat2Action('pickObject', std.core.bind(this.pickObject, this));\n\n if (! this._alreadyInitialized)\n {\n this._binding.addAction('quit', std.core.bind(this._simulator.quit, this._simulator));\n this._binding.addAction('screenshot', std.core.bind(this._simulator.screenshot, this._simulator));\n this._binding.addAction('toggleSuspend', std.core.bind(this._simulator.toggleSuspend, this._simulator));\n this._binding.addAction('scriptSelectedObject', std.core.bind(this.scriptSelectedObject, this));\n this._binding.addAction('scriptSelf', std.core.bind(this.scriptSelf, this));\n\n \n this._binding.addAction('togglePropertyBox', std.core.bind(this.togglePropertyBox, this));\n this._binding.addAction('toggleChat', std.core.bind(this.toggleChat, this));\n this._binding.addAction('togglePhysicsProperties', std.core.bind(this._physics.toggle, this._physics));\n \/\/this._binding.addAction('togglePresenceList', std.core.bind(this._presenceList.toggle, this._presenceList));\n this._binding.addAction('toggleSetMesh', std.core.bind(this._setMesh.toggle, this._setMesh));\n \/\/this._binding.addFloat2Action('showFlatland', std.core.bind(this.showFlatland, this));\n \/\/this._binding.addAction('hideFlatland', std.core.bind(this.hideFlatland, this));\n\n this._binding.addAction('toggleCameraMode', std.core.bind(this.toggleCameraMode, this));\n\n this._binding.addAction('actOnObject', std.core.bind(this.actOnObject, this));\n this._binding.addAction('teleportToObj', std.core.bind(this.teleportToObj, this));\n\n this._binding.addToggleAction('moveForward', std.core.bind(this.moveSelf, this, new util.Vec3(0, 0, -1)), 1, -1);\n this._binding.addToggleAction('moveBackward', std.core.bind(this.moveSelf, this, new util.Vec3(0, 0, 1)), 1, -1);\n this._binding.addToggleAction('moveLeft', std.core.bind(this.moveSelf, this, new util.Vec3(-1, 0, 0)), 1, -1);\n this._binding.addToggleAction('moveRight', std.core.bind(this.moveSelf, this, new util.Vec3(1, 0, 0)), 1, -1);\n this._binding.addToggleAction('moveUp', std.core.bind(this.moveSelf, this, new util.Vec3(0, 1, 0)), 1, -1);\n this._binding.addToggleAction('moveDown', std.core.bind(this.moveSelf, this, new util.Vec3(0, -1, 0)), 1, -1);\n\n this._binding.addToggleAction('rotateUp', std.core.bind(this.rotateSelf, this, new util.Vec3(1, 0, 0), \"_rotate_up_handle_\"), true, false);\n this._binding.addToggleAction('rotateDown', std.core.bind(this.rotateSelf, this, new util.Vec3(-1, 0, 0), \"_rotate_down_handle_\"), true, false);\n this._binding.addToggleAction('rotateLeft', std.core.bind(this.rotateSelf, this, new util.Vec3(0, 1, 0), \"_rotate_left_handle_\"), true, false);\n this._binding.addToggleAction('rotateRight', std.core.bind(this.rotateSelf, this, new util.Vec3(0, -1, 0), \"_rotate_right_handle_\"), true, false);\n\n this._binding.addFloat2Action('turnOffAxis', std.core.bind(this.turnOffAxis, this));\n \n this._binding.addAction('axesSnapLocal', std.core.bind(this.setAxesInheritOrient, this, true));\n this._binding.addAction('axesSnapGlobal', std.core.bind(this.setAxesInheritOrient, this, false));\n \n this._binding.addAction('updatePhysicsProperties', std.core.bind(this.updatePhysicsProperties, this));\n\n this._binding.addAction('startMoveDrag', std.core.bind(this.startDrag, this, this._draggers.move));\n this._binding.addAction('startRotateDrag', std.core.bind(this.startDrag, this, this._draggers.rotate));\n this._binding.addAction('startScaleDrag', std.core.bind(this.startDrag, this, this._draggers.scale));\n this._binding.addAction('forwardMousePressToDragger', std.core.bind(this.forwardMousePressToDragger, this));\n this._binding.addAction('forwardMouseDragToDragger', std.core.bind(this.forwardMouseDragToDragger, this));\n this._binding.addAction('updatePropertyBox', std.core.bind(this.updatePropertyBox, this));\n this._binding.addAction('forwardMouseReleaseToDragger', std.core.bind(this.forwardMouseReleaseToDragger, this));\n this._binding.addAction('stopDrag', std.core.bind(this.stopDrag, this));\n\n this._binding.addAction('startFreeRotate', std.core.bind(this.startFreeRotate, this));\n this._binding.addAction('freeRotateDrag', std.core.bind(this.freeRotateDrag, this));\n this._binding.addAction('freeRotateRelease', std.core.bind(this.freeRotateRelease, this));\n this._binding.addAction('undo', std.core.bind(this.undo, this));\n this._binding.addAction('redo', std.core.bind(this.redo, this));\n }\n\n \/** Bindings are an *ordered* list of keys and actions. Keys\n * are a combination of the type of event, the primary key\n * for the event (key or mouse button), and modifiers.\n * Modifiers are tricky to handle. You can specify a string\n * indicating which to filter on. If you omit the string, it\n * is equivalent to 'none'. The special values '*' and 'any'\n * are equivalent and will match any modifier, i.e. the event\n * will always be triggered. There isn't support\n * for matching combinations of modifiers.\n *\/\n var bindings = [{ key: ['mouse-press', 1 ], action: 'pickObject' },\n { key: ['mouse-click', 2], action: 'pickObject' }];\n\n if (!this._alreadyInitialized)\n {\n bindings = bindings.concat([{ key: ['button-pressed', 'escape'], action: 'quit' },\n { key: ['button-pressed', 'i'], action: 'screenshot' },\n { key: ['button-pressed', 'm'], action: 'toggleSuspend' },\n { key: ['button-pressed', 's', 'alt' ], action: 'scriptSelectedObject' },\n { key: ['button-pressed', 's', 'ctrl' ], action: 'scriptSelf' },\n { key: ['button-pressed', 'c', 'ctrl' ], action: 'toggleChat' },\n { key: ['button-pressed', 'p', 'ctrl' ], action: 'togglePhysicsProperties' },\n { key: ['button-pressed', 'p', 'alt' ], action: 'togglePropertyBox' },\n { key: ['button-pressed', 'l', 'ctrl' ], action: 'togglePresenceList' },\n { key: ['button-pressed', 'j', 'ctrl' ], action: 'toggleSetMesh' },\n \n { key: ['button-pressed', 'g', 'alt' ], action: 'axesSnapLocal' },\n { key: ['button-pressed', 'g', 'ctrl' ], action: 'axesSnapGlobal' },\n \n { key: ['button-pressed', 'z', 'ctrl' ], action: 'undo' },\n { key: ['button-pressed', 'y', 'ctrl' ], action: 'redo' },\n \n { key: ['mouse-click', 1, 'shift'], action: 'turnOffAxis' },\n { key: ['mouse-click', 2], action: 'scriptSelectedObject' },\n { key: ['button-pressed', 'return'], action: 'actOnObject' },\n { key: ['button-pressed', 't', 'ctrl' ], action: 'teleportToObj' },\n\n { key: ['button-pressed', 'c' ], action: 'toggleCameraMode' },\n\n { key: ['button', 'w' ], action: 'moveForward' },\n { key: ['button', 'up' ], action: 'moveForward' },\n { key: ['button', 's' ], action: 'moveBackward' },\n { key: ['button', 'down' ], action: 'moveBackward' },\n { key: ['button', 'a' ], action: 'moveLeft' },\n { key: ['button', 'd' ], action: 'moveRight' },\n { key: ['button', 'q' ], action: 'moveUp' },\n { key: ['button', 'z' ], action: 'moveDown' },\n\n { key: ['button', 'up', 'shift' ], action: 'rotateUp' },\n { key: ['button', 'down', 'shift' ], action: 'rotateDown' },\n { key: ['button', 'left' ], action: 'rotateLeft' },\n { key: ['button', 'right' ], action: 'rotateRight' },\n\n { key: ['mouse-press', 1 ], action: 'updatePhysicsProperties' },\n\n \/\/ Note that the ordering of registration here is critical.\n { key: ['mouse-press', 1, 'none' ], action: 'startMoveDrag' },\n { key: ['mouse-press', 1, 'ctrl' ], action: 'startRotateDrag' },\n { key: ['mouse-press', 1, 'alt' ], action: 'startScaleDrag' },\n { key: ['mouse-press', 1, '*'], action: 'forwardMousePressToDragger' },\n { key: ['mouse-press', 1, '*'], action: 'updatePropertyBox' },\n { key: ['mouse-drag', 1, '*'], action: 'forwardMouseDragToDragger' },\n { key: ['mouse-release', 1, '*'], action: 'forwardMouseReleaseToDragger' },\n { key: ['mouse-release', 1, '*'], action: 'stopDrag' },\n { key: ['mouse-press', 3, 'none'], action: 'showFlatland' },\n { key: ['mouse-press', 3, 'none' ], action: 'startFreeRotate' },\n { key: ['mouse-drag', 3, 'none'], action: 'freeRotateDrag' },\n { key: ['mouse-release', 3, 'none'], action: 'freeRotateRelease' }\n ]);\n }\n\n this._binding.addBindings(bindings);\n std.graphics.axes.init(this._simulator);\n this._axesInheritOrient = true;\n\n if (cb && typeof(cb) === \"function\")\n cb(this);\n };\n\n std.client.Default.prototype.presence = function() {\n return this._pres;\n };\n\n \/** @function *\/\n std.client.Default.prototype.simulator = function() {\n return this._simulator;\n };\n\n \/** @function *\/\n std.client.Default.prototype.invoke = function() {\n \/\/ Just forward manual invoke commands directly\n return this._simulator.invoke.apply(this._simulator, arguments);\n };\n\n \/** Request that the given URL be added as a module in the UI. *\/\n std.client.Default.prototype.addGUIModule = function(name, url, cb) {\n return this._simulator.addGUIModule(name, url, cb);\n };\n\n \/** Request that the given script text be added as a module in the UI. *\/\n std.client.Default.prototype.addGUITextModule = function(name, js_text, cb) {\n return this._simulator.addGUITextModule(name, js_text, cb);\n };\n\n \/** Get the GUI for a previously loaded GUI module. *\/\n std.client.Default.prototype.getGUIModule = function(name) {\n return this._simulator.getGUIModule(name);\n };\n\n \/** Request that the given URL be presented as a widget. *\/\n std.client.Default.prototype.createBrowser = function(name, url, cb) {\n return this._simulator.createBrowser(name, url, cb);\n };\n\n\n \/** Get a list of animations associated with this entity. *\/\n std.client.Default.prototype.getAnimationList = function(vis) {\n if (!vis)\n vis = system.self;\n\n return this._simulator.getAnimationList(vis);\n };\n\n \/** Start the animation on this entity given by the specified animation name. *\/\n std.client.Default.prototype.startAnimation = function(vis, anim) {\n return this._simulator.startAnimation(vis, anim);\n };\n\n \/** Stop the animation on this entity. *\/\n std.client.Default.prototype.stopAnimation = function(vis) {\n return this._simulator.stopAnimation(vis);\n };\n\n\n\n \/\/by default how to scale translational velocity from keypresses. (movement\n \/\/is agonizingly slow if just set this to 1. I really recommend 5.)\n \/** @public *\/\n std.client.Default.prototype.defaultVelocityScaling = 5;\n \/\/by default how to scale rotational velocity from keypresses\n \/** @public *\/\n std.client.Default.prototype.defaultRotationalVelocityScaling = .5;\n\n\n \/** @function *\/\n std.client.Default.prototype.toggleChat = function() {\n this._chat.toggle();\n };\n\n \/** @function *\/\n std.client.Default.prototype.scriptSelf = function() {\n if (typeof(this._scripter) == 'undefined')\n {\n system.require('std\/scriptingGui\/scriptingGui.em');\n this._scripter = new std.ScriptingGui.Controller(this);\n }\n \n this._scripter.script(system.self);\n };\n\n \/** @function *\/\n std.client.Default.prototype.togglePropertyBox = function() {\n this._propertybox.TogglePropertyBox();\n };\n\n std.client.Default.prototype.setAxesInheritOrient = function(inheritOrient) {\n if (this._axesInheritOrient === inheritOrient) {\n return;\n }\n \n this._axesInheritOrient = inheritOrient;\n \n if (this._selected) {\n std.graphics.axes.setInheritOrientAll(this._selected, inheritOrient);\n }\n };\n\n \/** @function *\/\n std.client.Default.prototype.scriptSelectedObject = function() {\n if (this._selected == null)\n return;\n \/\/this._presenceList.addObject(this._selected.toString(), 'Scripted');\n if (typeof(this._scripter) == 'undefined')\n {\n \/\/gross way of doing this. allows us to use simpleInput.em\n system.require('std\/scriptingGui\/scriptingGui.em');\n this._scripter = new std.ScriptingGui.Controller(this);\n }\n\n this._scripter.script(this._selected);\n };\n\n \/** @function *\/\n std.client.Default.prototype.toggleCameraMode = function(evt) {\n var newmode = this._camera.mode() == 'first' ? 'third' : 'first';\n this._camera.setMode(newmode);\n this.updateCameraOffset();\n };\n\n \/** @function *\/\n std.client.Default.prototype.updateCameraOffset = function() {\n if (this._camera.mode() == 'third') {\n var orient = this._pres.getOrientation();\n this._camera.setOffset(orient.mul(<0, 1.5, 6>));\n }\n };\n\n std.client.Default.prototype.updateAnimation = function() {\n this._characterAnimation.update();\n };\n\n std.client.Default.prototype.updateCameraAndAnimation = function() {\n this.updateCameraOffset();\n this.updateAnimation();\n };\n\n \/** @function *\/\n std.client.Default.prototype.moveSelf = function(dir, val) {\n this._moverot.move(dir, this.defaultVelocityScaling * val);\n };\n\n \/** @function *\/\n std.client.Default.prototype.rotateSelf = function(about, name, val) {\n if (val) {\n this[name] = this._moverot.rotate(about, this.defaultRotationalVelocityScaling);\n }\n else {\n this._moverot.cancelRotate(this[name]);\n delete this[name];\n }\n };\n\n std.client.Default.prototype.turnOffAxis = function(x, y) {\n if (!this._selected) {\n return;\n }\n var axis = std.graphics.axes.pick(this._selected, x, y);\n if (axis < 0) {\n return;\n } else {\n std.graphics.axes.setVisible(this._selected, axis, false);\n }\n };\n\n \/** @function *\/\n std.client.Default.prototype.pickObject = function(x, y)\n {\n var ignore_self = this._camera.mode() == 'first';\n var clicked = this._simulator.pick(x, y, ignore_self);\n if (clicked) {\n if (this._selected) {\n if (this._selected.toString() != clicked.toString()) {\n if (!this._alreadyInitialized)\n {\n this._simulator.bbox(this._selected, false);\n std.graphics.axes.setVisibleAll(this._selected, false); \n }\n } else {\n return;\n }\n }\n\n this._selected = clicked;\n if (!this._alreadyInitialized)\n {\n this._simulator.bbox(this._selected, true);\n std.graphics.axes.setInheritOrientAll(this._selected, this._axesInheritOrient);\n std.graphics.axes.setVisibleAll(this._selected, true);\n }\n } else if (this._selected) {\n if (!this._alreadyInitialized)\n {\n this._simulator.bbox(this._selected, false);\n std.graphics.axes.setVisibleAll(this._selected, false);\n }\n this._selected = null;\n }\n\n };\n\n \/** @function *\/\n std.client.Default.prototype.actOnObject = function(evt) {\n if (this._selected)\n { 'action' : 'touch' } >> this._selected >> [];\n }\n \n \/** @function *\/\n std.client.Default.prototype.teleportToObj = function(evt) {\n if (this._selected) {\n var dir = this._selected.getPosition() - this._pres.getPosition();\n dir = dir.normal();\n var self = this;\n this._selected.loadMesh(function() {\n var hit = std.raytrace.raytrace(null, self._pres.getPosition(), dir, self._selected, null);\n if (hit) {\n self._pres.setPosition(hit.sub(dir.scale(3)));\n } else {\n self._pres.setPosition(this._selected.getPosition());\n }\n self._pres.setOrientation(util.Quaternion.fromLookAt(dir));\n });\n }\n }\n\n \/** @function *\/\n std.client.Default.prototype.updatePhysicsProperties = function() {\n \/\/ Update even if not selected so display can be disabled\n this._physics.update(this._selected);\n if (this._setMesh) this._setMesh.update(this._selected);\n };\n\n \/** @function *\/\n std.client.Default.prototype.startDrag = function(dragger, evt) {\n if (this._selected)\n this._dragger = dragger;\n if (this._dragger)\n this._dragger.selected(this._selected, this._simulator.pickedPosition(), evt);\n };\n\n \/** @function *\/\n std.client.Default.prototype.forwardMousePressToDragger = function(evt) {\n if (this._dragger) this._dragger.onMousePress(evt);\n };\n\n \/** @function *\/\n std.client.Default.prototype.forwardMouseDragToDragger = function(evt) {\n if (this._dragger) this._dragger.onMouseDrag(evt);\n \/\/this._propertybox.HandleUpdateProperties(this._selected);\n };\n\n\n \n \/** @function *\/\n std.client.Default.prototype.updatePropertyBox = function(evt) {\n \/\/this._propertybox.HandleUpdateProperties(this._selected);\n };\n\n \/** @function *\/\n std.client.Default.prototype.forwardMouseReleaseToDragger = function(evt) {\n if (this._dragger) this._dragger.onMouseRelease(evt);\n };\n\n \/** @function *\/\n std.client.Default.prototype.stopDrag = function() {\n delete this._dragger;\n };\n\n \/** @function *\/\n std.client.Default.prototype.startFreeRotate = function(evt) {\n this.startX = evt.x;\n this.startY = evt.y;\n this.startOrientation = this._pres.getOrientation();\n };\n\n \/** @function *\/\n std.client.Default.prototype.freeRotateDrag = function(evt) {\n if (this.startX == null || this.startY == null)\n return;\n\n var SCALE = 1;\n var dx = evt.x - this.startX;\n var dy = evt.y - this.startY;\n var dXAngle = dx * SCALE;\n var dYAngle = dy * SCALE;\n var newQuat = this.startOrientation\n .mul(new util.Quaternion(<0, 1, 0>, -dXAngle))\n .mul(new util.Quaternion(<1, 0, 0>, dYAngle));\n this._pres.setOrientation(newQuat);\n\n \/\/ Reorient self so up is up.\n this._pres.setOrientation(util.Quaternion.fromLookAt(\n this._pres.getOrientation().zAxis().scale(-1), <0, 1, 0>));\n this.updateCameraOffset();\n this._moverot.reeval();\n };\n\n \/** @function *\/\n std.client.Default.prototype.freeRotateRelease = function(evt) {\n this.startX = null;\n this.startY = null;\n this.startOrientation = null;\n };\n\n std.client.Default.prototype.undo = function(evt) {\n this._simulator.undo();\n };\n\n std.client.Default.prototype.redo = function(evt) {\n this._simulator.redo();\n };\n\n\n std.client.Default.prototype.orientDefault = function(evt) {\n var vis = this._selected;\n if(!vis)\n return;\n var orient = vis.orientation;\n var movable = new std.movement.MovableRemote(vis);\n movable.setOrientation(new util.Quaternion());\n this._simulator.addUndoAction({}, {\n undo: function(action) {\n movable.setOrientation(orient);\n },\n redo: function(action) {\n movable.setOrientation(new util.Quaternion());\n }\n });\n };\n\n std.client.Default.prototype.setMaxObjects = function(maxobjs) {\n this._simulator.setMaxObjects(maxobjs);\n };\n\n\n std.client.Default.prototype.showFlatland = function (x, y) {\n var ignore_self = this._camera.mode() == 'first';\n var clicked = this._simulator.pick(x, y, ignore_self);\n this._flatland.show(clicked, x, y);\n };\n\n std.client.Default.prototype.hideFlatland = function () {\n this._flatland.hide();\n };\n\n\n\n std.client.Default.prototype._environmentChanged = function () {\n \/\/ Check all paths we know about to see if they've changed\n\n \/\/ Audio\n var audio_ambient = this._env.get('audio.ambient');\n if (audio_ambient && audio_ambient != this._env.audio_ambient) {\n this._env.audio_ambient = audio_ambient;\n if (this._env.audio_ambient_clip)\n this._env.audio_ambient_clip.stop();\n \/\/ Default to volume 1, looping\n if (this._audio)\n this._env.audio_ambient_clip = this._audio.play(audio_ambient, 1, true);\n }\n var audio_ambient_volume = this._env.get('audio.ambient_volume');\n if (audio_ambient_volume !== undefined && this._env.audio_ambient_clip) {\n this._env.audio_ambient_clip.volume(parseFloat(audio_ambient_volume));\n }\n\n \/\/ Skybox\n var skybox_type = this._env.get('sky.type');\n var skybox_img = this._env.get('sky.img');\n if (skybox_type && skybox_img) {\n var skybox_distance = this._env.get('sky.distance');\n if (!skybox_distance) skybox_distance = 4000;\n var skybox_tiling = this._env.get('sky.tiling');\n if (!skybox_tiling) skybox_tiling = 1;\n var skybox_curvature = this._env.get('sky.curvature');\n if (!skybox_curvature) skybox_curvature = 65;\n var skybox_orientation = this._env.get('sky.orientation');\n this._simulator.skybox(skybox_type, skybox_img, 4000, skybox_tiling, skybox_curvature, skybox_orientation);\n }\n };\n\n})();\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"EmberScript"} {"commit":"e605ffdb5b11fa12bddc1ef855b8601c8a9b6f7b","subject":"fix bounded arrays","message":"fix bounded arrays\n","repos":"ros2\/rosidl,esteve\/rosidl_typesupport,ros2\/rosidl_typesupport,ros2\/rosidl,esteve\/rosidl,ros2\/rosidl,esteve\/rosidl_typesupport,esteve\/rosidl,ros2\/rosidl_typesupport,esteve\/rosidl_typesupport,esteve\/rosidl,ros2\/rosidl,ros2\/rosidl_typesupport","old_file":"rosidl_generator_py\/resource\/_msg_support.c.em","new_file":"rosidl_generator_py\/resource\/_msg_support.c.em","new_contents":"\/\/ generated from rosidl_generator_py\/resource\/_msg_support.c.em\n\/\/ generated code does not contain a copyright notice\n\n#include \n\n#include <@(spec.base_type.pkg_name)\/@(subfolder)\/@(module_name)__struct.h>\n#include <@(spec.base_type.pkg_name)\/@(subfolder)\/@(module_name)__functions.h>\n\n@{\nhave_not_included_primitive_arrays = True\nhave_not_included_string = True\nnested_array_dict = {}\n}@\n@[for field in spec.fields]@\n@[ if field.type.is_array and have_not_included_primitive_arrays]@\n@{have_not_included_primitive_arrays = False}@\n#include \n#include \n\n@[ end if]@\n@[ if field.type.type == 'string' and have_not_included_string]@\n@{have_not_included_string = False}@\n#include \n#include \n\n@[ end if]@\n@{\nif not field.type.is_primitive_type() and field.type.is_array:\n if field.type.type not in nested_array_dict:\n nested_array_dict[field.type.type] = field.type.pkg_name\n}@\n@[end for]@\n@[if nested_array_dict != {}]@\n\/\/ Nested array functions includes\n@[ for key in nested_array_dict]@\n#include <@(nested_array_dict[key])\/@(subfolder)\/@convert_camel_case_to_lower_case_underscore(key)__functions.h>\n@[ end for]@\n\/\/ end nested array functions include\n@[end if]@\n@{\nmsg_typename = '%s__%s__%s' % (spec.base_type.pkg_name, subfolder, spec.base_type.type)\n}@\n\nvoid * @(spec.base_type.pkg_name)_@(module_name)__convert_from_py(PyObject * _pymsg)\n{\n @(msg_typename) * ros_message = @(msg_typename)__create();\n (void)ros_message;\n@{\nfull_classname = \"@(spec.base_type.pkg_name).@(subfolder)._@(module_name).@(spec.base_type.type)\"\n}@\n char full_classname_dest[@(len(full_classname) + 1)];\n\n char * class_name = (char *)PyUnicode_1BYTE_DATA(\n PyObject_GetAttrString(PyObject_GetAttrString(_pymsg, \"__class__\"), \"__name__\"));\n char * module_name = (char *)PyUnicode_1BYTE_DATA(\n PyObject_GetAttrString(PyObject_GetAttrString(_pymsg, \"__class__\"), \"__module__\"));\n\n snprintf(full_classname_dest, sizeof(full_classname_dest), \"%s.%s\", class_name, module_name);\n\n \/\/ TODO(dirk-thomas) The check seems to be wrong, asserting that the strings are not equal?\n assert(strncmp(\n \"@(spec.base_type.pkg_name).@(subfolder)._@(module_name).@(spec.base_type.type)\",\n full_classname_dest, @(len(full_classname))));\n\n@[for field in spec.fields]@\n PyObject * py@(field.name) = PyObject_GetAttrString(_pymsg, \"@(field.name)\");\n@[ if not field.type.is_primitive_type()]@\n@{\nnested_type = '%s__%s__%s' % (field.type.pkg_name, 'msg', field.type.type)\n}@\n PyObject * py@(field.name)_msg_module = PyImport_ImportModule(\"@(field.type.pkg_name).msg._@convert_camel_case_to_lower_case_underscore(field.type.type)\");\n PyObject * py@(field.name)_convert_from_py = PyObject_GetAttrString(py@(field.name)_msg_module, \"_convert_from_py\");\n typedef PyObject *(* convert_from_py_signature)(void *);\n convert_from_py_signature convert_from_py_@(field.name) = (convert_from_py_signature)PyCapsule_GetPointer(py@(field.name)_convert_from_py, NULL);\n@[ if field.type.is_array]@\n assert(PySequence_Check(py@(field.name)));\n PyObject * seq@(field.name) = PySequence_Fast(py@(field.name), \"expected a sequence\");\n @(nested_type) * item@(field.name);\n@[ if field.type.array_size is None]@\n size_t size@(field.name) = PySequence_Size(py@(field.name));\n if (!@(nested_type)__Array__init(&(ros_message->@(field.name)), size@(field.name))) {\n PyErr_SetString(PyExc_RuntimeError, \"unable to create @(nested_type)__Array ros_message\");\n }\n @(nested_type) * dest@(field.name) = ros_message->@(field.name).data;\n@[ else]@\n size_t size@(field.name) = @(field.type.array_size);\n@[ if field.type.is_upper_bound]@\n @(nested_type) * dest@(field.name) = ros_message->@(field.name).data;\n@[ else]@\n @(nested_type) * dest@(field.name) = ros_message->@(field.name);\n@[ end if]@\n@[ end if]@\n size_t idx@(field.name);\n for (idx@(field.name) = 0; idx@(field.name) < size@(field.name); idx@(field.name)++) {\n item@(field.name) = (@(nested_type) *) convert_from_py_@(field.name)(\n PySequence_Fast_GET_ITEM(seq@(field.name), idx@(field.name)));\n memcpy(&dest@(field.name)[idx@(field.name)], item@(field.name), sizeof(@(nested_type)));\n }\n@[ else]@\n @(nested_type) * tmp@(field.name) = (@(nested_type) *) convert_from_py_@(field.name)(py@(field.name));\n ros_message->@(field.name) = *tmp@(field.name);\n@[ end if]@\n@[ elif field.type.is_array]@\n assert(PySequence_Check(py@(field.name)));\n PyObject * seq@(field.name) = PySequence_Fast(py@(field.name), \"expected a sequence\");\n PyObject * item@(field.name);\n@[ if field.type.array_size is None]@\n size_t size@(field.name) = PySequence_Size(py@(field.name));\n@[ if field.type.type == 'string']@\n if (!rosidl_generator_c__String__Array__init(&(ros_message->@(field.name)), size@(field.name))) {\n PyErr_SetString(PyExc_RuntimeError, \"unable to create String__Array ros_message\");\n }\n@[ else]@\n if (!rosidl_generator_c__@(field.type.type)__Array__init(&(ros_message->@(field.name)), size@(field.name))) {\n PyErr_SetString(PyExc_RuntimeError, \"unable to create @(field.type.type)__Array ros_message\");\n }\n@[ end if]@\n @primitive_msg_type_to_c(field.type.type) * dest@(field.name) = ros_message->@(field.name).data;\n@[ else]@\n size_t size@(field.name) = @(field.type.array_size);\n@[ if field.type.is_upper_bound]@\n @primitive_msg_type_to_c(field.type.type) * dest@(field.name) = ros_message->@(field.name).data;\n@[ else]@\n @primitive_msg_type_to_c(field.type.type) * dest@(field.name) = ros_message->@(field.name);\n@[ end if]@\n@[ end if]@\n@[ if field.type.type != 'string']@\n @primitive_msg_type_to_c(field.type.type) tmp@(field.name);\n@[ end if]@\n size_t idx@(field.name);\n for (idx@(field.name) = 0; idx@(field.name) < size@(field.name); idx@(field.name)++) {\n item@(field.name) = PySequence_Fast_GET_ITEM(seq@(field.name), idx@(field.name));\n@[ if field.type.type == 'char']@\n assert(PyUnicode_Check(item@(field.name)));\n tmp@(field.name) = PyUnicode_1BYTE_DATA(item@(field.name))[0];\n@[ elif field.type.type == 'byte']@\n assert(PyBytes_Check(item@(field.name)));\n tmp@(field.name) = PyBytes_AS_STRING(item@(field.name))[0];\n@[ elif field.type.type == 'string']@\n assert(PyUnicode_Check(item@(field.name)));\n rosidl_generator_c__String__assign(\n &dest@(field.name)[idx@(field.name)], (char *)PyUnicode_1BYTE_DATA(item@(field.name)));\n@[ elif field.type.type == 'bool']@\n assert(PyBool_Check(item@(field.name)));\n tmp@(field.name) = (item@(field.name) == Py_True);\n@[ elif field.type.type in ['float32', 'float64']]@\n assert(PyFloat_Check(item@(field.name)));\n@[ if field.type.type == 'float32']@\n tmp@(field.name) = (float)PyFloat_AS_DOUBLE(item@(field.name));\n@[ else]@\n tmp@(field.name) = PyFloat_AS_DOUBLE(item@(field.name));\n@[ end if]@\n@[ elif field.type.type in [\n 'int8',\n 'int16',\n 'int32',\n ]]@\n assert(PyLong_Check(item@(field.name)));\n tmp@(field.name) = (@(primitive_msg_type_to_c(field.type.type)))PyLong_AsLong(item@(field.name));\n@[ elif field.type.type in [\n 'uint8',\n 'uint16',\n 'uint32',\n ]]@\n assert(PyLong_Check(item@(field.name)));\n@[ if field.type.type == 'uint32']@\n tmp@(field.name) = PyLong_AsUnsignedLong(item@(field.name));\n@[ else]@\n tmp@(field.name) = (@(primitive_msg_type_to_c(field.type.type)))PyLong_AsUnsignedLong(item@(field.name));\n@[ end if]\n@[ elif field.type.type == 'int64']@\n assert(PyLong_Check(item@(field.name)));\n tmp@(field.name) = PyLong_AsLongLong(item@(field.name));\n@[ elif field.type.type == 'uint64']@\n assert(PyLong_Check(item@(field.name)));\n tmp@(field.name) = PyLong_AsUnsignedLongLong(item@(field.name));\n@[ end if]@\n@[ if field.type.type != 'string']@\n memcpy(&dest@(field.name)[idx@(field.name)], &tmp@(field.name), sizeof(@primitive_msg_type_to_c(field.type.type)));\n@[ end if]@\n }\n@[ elif field.type.type == 'char']@\n assert(PyUnicode_Check(py@(field.name)));\n ros_message->@(field.name) = PyUnicode_1BYTE_DATA(py@(field.name))[0];\n@[ elif field.type.type == 'byte']@\n assert(PyBytes_Check(py@(field.name)));\n ros_message->@(field.name) = PyBytes_AsString(py@(field.name))[0];\n@[ elif field.type.type == 'string']@\n assert(PyUnicode_Check(py@(field.name)));\n rosidl_generator_c__String__assign(\n &ros_message->@(field.name), (char *)PyUnicode_1BYTE_DATA(py@(field.name)));\n@[ elif field.type.type == 'bool']@\n assert(PyBool_Check(py@(field.name)));\n ros_message->@(field.name) = (Py_True == py@(field.name));\n@[ elif field.type.type in ['float32', 'float64']]@\n assert(PyFloat_Check(py@(field.name)));\n@[ if field.type.type == 'float32']@\n ros_message->@(field.name) = (float)PyFloat_AS_DOUBLE(py@(field.name));\n@[ else]@\n ros_message->@(field.name) = PyFloat_AS_DOUBLE(py@(field.name));\n@[ end if]@\n@[ elif field.type.type in [\n 'int8',\n 'int16',\n 'int32',\n ]]@\n assert(PyLong_Check(py@(field.name)));\n ros_message->@(field.name) = (@(primitive_msg_type_to_c(field.type.type)))PyLong_AsLong(py@(field.name));\n@[ elif field.type.type in [\n 'uint8',\n 'uint16',\n 'uint32',\n ]]@\n assert(PyLong_Check(py@(field.name)));\n@[ if field.type.type == 'uint32']@\n ros_message->@(field.name) = PyLong_AsUnsignedLong(py@(field.name));\n@[ else]@\n ros_message->@(field.name) = (@(primitive_msg_type_to_c(field.type.type)))PyLong_AsUnsignedLong(py@(field.name));\n@[ end if]@\n@[ elif field.type.type == 'int64']@\n assert(PyLong_Check(py@(field.name)));\n ros_message->@(field.name) = PyLong_AsLongLong(py@(field.name));\n@[ elif field.type.type == 'uint64']@\n assert(PyLong_Check(py@(field.name)));\n ros_message->@(field.name) = PyLong_AsUnsignedLongLong(py@(field.name));\n@[ else]@\n assert(false);\n@[ end if]@\n@[end for]@\n\n assert(ros_message != NULL);\n return ros_message;\n}\n\nPyObject * @(spec.base_type.pkg_name)_@(module_name)__convert_to_py(void * raw_ros_message)\n{\n @(msg_typename) * ros_message = (@(msg_typename) *)raw_ros_message;\n (void)ros_message;\n\n PyObject * pymessage_module = PyImport_ImportModule(\"@(spec.base_type.pkg_name).@(subfolder)._@(module_name)\");\n PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, \"@(spec.base_type.type)\");\n\n \/* NOTE(esteve): Call constructor of @(spec.base_type.type) *\/\n PyObject * _pymessage = NULL;\n _pymessage = PyObject_CallObject(pymessage_class, NULL);\n assert(_pymessage != NULL);\n\n@[for field in spec.fields]@\n PyObject * py@(field.name) = NULL;\n@[ if not field.type.is_primitive_type()]@\n@{\nnested_type = '%s__%s__%s' % (field.type.pkg_name, 'msg', field.type.type)\n}@\n PyObject * py@(field.name)_msg_module = PyImport_ImportModule(\"@(field.type.pkg_name).msg._@convert_camel_case_to_lower_case_underscore(field.type.type)\");\n PyObject * py@(field.name)_convert_to_py = PyObject_GetAttrString(py@(field.name)_msg_module, \"_convert_to_py\");\n typedef PyObject *(* convert_to_py_signature)(void *);\n convert_to_py_signature convert_to_py_@(field.name) = (convert_to_py_signature)PyCapsule_GetPointer(py@(field.name)_convert_to_py, NULL);\n@[ if field.type.is_array]@\n@[ if field.type.array_size is None]@\n size_t size@(field.name) = ros_message->@(field.name).size;\n@[ else]@\n size_t size@(field.name) = @(field.type.array_size);\n@[ end if]@\n py@(field.name) = PyList_New(size@(field.name));\n @(nested_type) item@(field.name);\n size_t idx@(field.name);\n for (idx@(field.name) = 0; idx@(field.name) < size@(field.name); idx@(field.name)++) {\n@[ if field.type.array_size is None or field.type.is_upper_bound]@\n item@(field.name) = ros_message->@(field.name).data[idx@(field.name)];\n@[ else]@\n item@(field.name) = ros_message->@(field.name)[idx@(field.name)];\n@[ end if]@\n PyList_SetItem(py@(field.name), idx@(field.name), convert_to_py_@(field.name)(&item@(field.name)));\n }\n assert(PySequence_Check(py@(field.name)));\n@[ else]@\n @(nested_type) pytmp@(field.name) = ros_message->@(field.name);\n py@(field.name) = convert_to_py_@(field.name)(&pytmp@(field.name));\n@[ end if]@\n@[ elif field.type.is_array]@\n@[ if field.type.array_size is None]@\n size_t size@(field.name) = ros_message->@(field.name).size;\n @primitive_msg_type_to_c(field.type.type) * tmpmessagedata@(field.name) = ros_message->@(field.name).data;\n@[ else]@\n size_t size@(field.name) = @(field.type.array_size);\n@[ if field.type.is_upper_bound]@\n @primitive_msg_type_to_c(field.type.type) * tmpmessagedata@(field.name) = ros_message->@(field.name).data;\n@[ else]@\n @primitive_msg_type_to_c(field.type.type) * tmpmessagedata@(field.name) = ros_message->@(field.name);\n@[ end if]@\n@[ end if]@\n py@(field.name) = PyList_New(size@(field.name));\n size_t idx@(field.name);\n for (idx@(field.name) = 0; idx@(field.name) < size@(field.name); idx@(field.name)++) {\n@[ if field.type.type == 'char']@\n PyList_SetItem(py@(field.name), idx@(field.name),\n PyUnicode_FromStringAndSize(&tmpmessagedata@(field.name)[idx@(field.name)], 1));\n@[ elif field.type.type == 'byte']@\n PyList_SetItem(py@(field.name), idx@(field.name),\n PyBytes_FromStringAndSize((const char *)&tmpmessagedata@(field.name)[idx@(field.name)], 1));\n@[ elif field.type.type == 'string']@\n PyList_SetItem(py@(field.name), idx@(field.name), PyUnicode_FromString(tmpmessagedata@(field.name)[idx@(field.name)].data));\n@[ elif field.type.type == 'bool']@\n PyList_SetItem(py@(field.name), idx@(field.name), tmpmessagedata@(field.name)[idx@(field.name)] ? Py_True : Py_False);\n@[ elif field.type.type in ['float32', 'float64']]@\n PyList_SetItem(py@(field.name), idx@(field.name), PyFloat_FromDouble(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ elif field.type.type in [\n 'int8',\n 'int16',\n 'int32',\n ]]@\n PyList_SetItem(py@(field.name), idx@(field.name), PyLong_FromLong(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ elif field.type.type in [\n 'uint8',\n 'uint16',\n 'uint32',\n ]]@\n PyList_SetItem(py@(field.name), idx@(field.name), PyLong_FromUnsignedLong(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ elif field.type.type == 'int64']@\n PyList_SetItem(py@(field.name), idx@(field.name), PyLong_FromLongLong(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ elif field.type.type == 'uint64']@\n PyList_SetItem(py@(field.name), idx@(field.name), PyLong_FromUnsignedLongLong(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ end if]@\n }\n assert(PySequence_Check(py@(field.name)));\n@[ elif field.type.type == 'char']@\n py@(field.name) = PyUnicode_FromStringAndSize(&ros_message->@(field.name), 1);\n@[ elif field.type.type == 'byte']@\n py@(field.name) = PyBytes_FromStringAndSize((const char *)&ros_message->@(field.name), 1);\n@[ elif field.type.type == 'string']@\n py@(field.name) = PyUnicode_FromString(ros_message->@(field.name).data);\n@[ elif field.type.type == 'bool']@\n py@(field.name) = ros_message->@(field.name) ? Py_True : Py_False;\n@[ elif field.type.type in ['float32', 'float64']]@\n py@(field.name) = PyFloat_FromDouble(ros_message->@(field.name));\n@[ elif field.type.type in [\n 'int8',\n 'int16',\n 'int32',\n ]]@\n py@(field.name) = PyLong_FromLong(ros_message->@(field.name));\n@[ elif field.type.type in [\n 'uint8',\n 'uint16',\n 'uint32',\n ]]@\n py@(field.name) = PyLong_FromUnsignedLong(ros_message->@(field.name));\n@[ elif field.type.type == 'int64']@\n py@(field.name) = PyLong_FromLongLong(ros_message->@(field.name));\n@[ elif field.type.type == 'uint64']@\n py@(field.name) = PyLong_FromUnsignedLongLong(ros_message->@(field.name));\n@[ else]@\n assert(false);\n@[ end if]@\n assert(py@(field.name) != NULL);\n Py_INCREF(py@(field.name));\n PyObject_SetAttrString(_pymessage, \"@(field.name)\", py@(field.name));\n@[end for]@\n assert(_pymessage != NULL);\n return _pymessage;\n}\n","old_contents":"\/\/ generated from rosidl_generator_py\/resource\/_msg_support.c.em\n\/\/ generated code does not contain a copyright notice\n\n#include \n\n#include <@(spec.base_type.pkg_name)\/@(subfolder)\/@(module_name)__struct.h>\n#include <@(spec.base_type.pkg_name)\/@(subfolder)\/@(module_name)__functions.h>\n\n@{\nhave_not_included_primitive_arrays = True\nhave_not_included_string = True\nnested_array_dict = {}\n}@\n@[for field in spec.fields]@\n@[ if field.type.is_array and have_not_included_primitive_arrays]@\n@{have_not_included_primitive_arrays = False}@\n#include \n#include \n\n@[ end if]@\n@[ if field.type.type == 'string' and have_not_included_string]@\n@{have_not_included_string = False}@\n#include \n#include \n\n@[ end if]@\n@{\nif not field.type.is_primitive_type() and field.type.is_array:\n if field.type.type not in nested_array_dict:\n nested_array_dict[field.type.type] = field.type.pkg_name\n}@\n@[end for]@\n@[if nested_array_dict != {}]@\n\/\/ Nested array functions includes\n@[ for key in nested_array_dict]@\n#include <@(nested_array_dict[key])\/@(subfolder)\/@convert_camel_case_to_lower_case_underscore(key)__functions.h>\n@[ end for]@\n\/\/ end nested array functions include\n@[end if]@\n@{\nmsg_typename = '%s__%s__%s' % (spec.base_type.pkg_name, subfolder, spec.base_type.type)\n}@\n\nvoid * @(spec.base_type.pkg_name)_@(module_name)__convert_from_py(PyObject * _pymsg)\n{\n @(msg_typename) * ros_message = @(msg_typename)__create();\n (void)ros_message;\n@{\nfull_classname = \"@(spec.base_type.pkg_name).@(subfolder)._@(module_name).@(spec.base_type.type)\"\n}@\n char full_classname_dest[@(len(full_classname) + 1)];\n\n char * class_name = (char *)PyUnicode_1BYTE_DATA(\n PyObject_GetAttrString(PyObject_GetAttrString(_pymsg, \"__class__\"), \"__name__\"));\n char * module_name = (char *)PyUnicode_1BYTE_DATA(\n PyObject_GetAttrString(PyObject_GetAttrString(_pymsg, \"__class__\"), \"__module__\"));\n\n snprintf(full_classname_dest, sizeof(full_classname_dest), \"%s.%s\", class_name, module_name);\n\n \/\/ TODO(dirk-thomas) The check seems to be wrong, asserting that the strings are not equal?\n assert(strncmp(\n \"@(spec.base_type.pkg_name).@(subfolder)._@(module_name).@(spec.base_type.type)\",\n full_classname_dest, @(len(full_classname))));\n\n@[for field in spec.fields]@\n PyObject * py@(field.name) = PyObject_GetAttrString(_pymsg, \"@(field.name)\");\n@[ if not field.type.is_primitive_type()]@\n@{\nnested_type = '%s__%s__%s' % (field.type.pkg_name, 'msg', field.type.type)\n}@\n PyObject * py@(field.name)_msg_module = PyImport_ImportModule(\"@(field.type.pkg_name).msg._@convert_camel_case_to_lower_case_underscore(field.type.type)\");\n PyObject * py@(field.name)_convert_from_py = PyObject_GetAttrString(py@(field.name)_msg_module, \"_convert_from_py\");\n typedef PyObject *(* convert_from_py_signature)(void *);\n convert_from_py_signature convert_from_py_@(field.name) = (convert_from_py_signature)PyCapsule_GetPointer(py@(field.name)_convert_from_py, NULL);\n@[ if field.type.is_array]@\n assert(PySequence_Check(py@(field.name)));\n PyObject * seq@(field.name) = PySequence_Fast(py@(field.name), \"expected a sequence\");\n @(nested_type) * item@(field.name);\n@[ if field.type.array_size is None]@\n size_t size@(field.name) = PySequence_Size(py@(field.name));\n if (!@(nested_type)__Array__init(&(ros_message->@(field.name)), size@(field.name))) {\n PyErr_SetString(PyExc_RuntimeError, \"unable to create @(nested_type)__Array ros_message\");\n }\n @(nested_type) * dest@(field.name) = ros_message->@(field.name).data;\n@[ else]@\n size_t size@(field.name) = @(field.type.array_size);\n @(nested_type) * dest@(field.name) = ros_message->@(field.name);\n@[ end if]@\n size_t idx@(field.name);\n for (idx@(field.name) = 0; idx@(field.name) < size@(field.name); idx@(field.name)++) {\n item@(field.name) = (@(nested_type) *) convert_from_py_@(field.name)(\n PySequence_Fast_GET_ITEM(seq@(field.name), idx@(field.name)));\n memcpy(&dest@(field.name)[idx@(field.name)], item@(field.name), sizeof(@(nested_type)));\n }\n@[ else]@\n @(nested_type) * tmp@(field.name) = (@(nested_type) *) convert_from_py_@(field.name)(py@(field.name));\n ros_message->@(field.name) = *tmp@(field.name);\n@[ end if]@\n@[ elif field.type.is_array]@\n assert(PySequence_Check(py@(field.name)));\n PyObject * seq@(field.name) = PySequence_Fast(py@(field.name), \"expected a sequence\");\n PyObject * item@(field.name);\n@[ if field.type.array_size is None]@\n size_t size@(field.name) = PySequence_Size(py@(field.name));\n@[ if field.type.type == 'string']@\n if (!rosidl_generator_c__String__Array__init(&(ros_message->@(field.name)), size@(field.name))) {\n PyErr_SetString(PyExc_RuntimeError, \"unable to create String__Array ros_message\");\n }\n@[ else]@\n if (!rosidl_generator_c__@(field.type.type)__Array__init(&(ros_message->@(field.name)), size@(field.name))) {\n PyErr_SetString(PyExc_RuntimeError, \"unable to create @(field.type.type)__Array ros_message\");\n }\n@[ end if]@\n @primitive_msg_type_to_c(field.type.type) * dest@(field.name) = ros_message->@(field.name).data;\n@[ else]@\n size_t size@(field.name) = @(field.type.array_size);\n @primitive_msg_type_to_c(field.type.type) * dest@(field.name) = ros_message->@(field.name);\n@[ end if]@\n@[ if field.type.type != 'string']@\n @primitive_msg_type_to_c(field.type.type) tmp@(field.name);\n@[ end if]@\n size_t idx@(field.name);\n for (idx@(field.name) = 0; idx@(field.name) < size@(field.name); idx@(field.name)++) {\n item@(field.name) = PySequence_Fast_GET_ITEM(seq@(field.name), idx@(field.name));\n@[ if field.type.type == 'char']@\n assert(PyUnicode_Check(item@(field.name)));\n tmp@(field.name) = PyUnicode_1BYTE_DATA(item@(field.name))[0];\n@[ elif field.type.type == 'byte']@\n assert(PyBytes_Check(item@(field.name)));\n tmp@(field.name) = PyBytes_AS_STRING(item@(field.name))[0];\n@[ elif field.type.type == 'string']@\n assert(PyUnicode_Check(item@(field.name)));\n rosidl_generator_c__String__assign(\n &dest@(field.name)[idx@(field.name)], (char *)PyUnicode_1BYTE_DATA(item@(field.name)));\n@[ elif field.type.type == 'bool']@\n assert(PyBool_Check(item@(field.name)));\n tmp@(field.name) = (item@(field.name) == Py_True);\n@[ elif field.type.type in ['float32', 'float64']]@\n assert(PyFloat_Check(item@(field.name)));\n@[ if field.type.type == 'float32']@\n tmp@(field.name) = (float)PyFloat_AS_DOUBLE(item@(field.name));\n@[ else]@\n tmp@(field.name) = PyFloat_AS_DOUBLE(item@(field.name));\n@[ end if]@\n@[ elif field.type.type in [\n 'int8',\n 'int16',\n 'int32',\n ]]@\n assert(PyLong_Check(item@(field.name)));\n tmp@(field.name) = (@(primitive_msg_type_to_c(field.type.type)))PyLong_AsLong(item@(field.name));\n@[ elif field.type.type in [\n 'uint8',\n 'uint16',\n 'uint32',\n ]]@\n assert(PyLong_Check(item@(field.name)));\n@[ if field.type.type == 'uint32']@\n tmp@(field.name) = PyLong_AsUnsignedLong(item@(field.name));\n@[ else]@\n tmp@(field.name) = (@(primitive_msg_type_to_c(field.type.type)))PyLong_AsUnsignedLong(item@(field.name));\n@[ end if]\n@[ elif field.type.type == 'int64']@\n assert(PyLong_Check(item@(field.name)));\n tmp@(field.name) = PyLong_AsLongLong(item@(field.name));\n@[ elif field.type.type == 'uint64']@\n assert(PyLong_Check(item@(field.name)));\n tmp@(field.name) = PyLong_AsUnsignedLongLong(item@(field.name));\n@[ end if]@\n@[ if field.type.type != 'string']@\n memcpy(&dest@(field.name)[idx@(field.name)], &tmp@(field.name), sizeof(@primitive_msg_type_to_c(field.type.type)));\n@[ end if]@\n }\n@[ elif field.type.type == 'char']@\n assert(PyUnicode_Check(py@(field.name)));\n ros_message->@(field.name) = PyUnicode_1BYTE_DATA(py@(field.name))[0];\n@[ elif field.type.type == 'byte']@\n assert(PyBytes_Check(py@(field.name)));\n ros_message->@(field.name) = PyBytes_AsString(py@(field.name))[0];\n@[ elif field.type.type == 'string']@\n assert(PyUnicode_Check(py@(field.name)));\n rosidl_generator_c__String__assign(\n &ros_message->@(field.name), (char *)PyUnicode_1BYTE_DATA(py@(field.name)));\n@[ elif field.type.type == 'bool']@\n assert(PyBool_Check(py@(field.name)));\n ros_message->@(field.name) = (Py_True == py@(field.name));\n@[ elif field.type.type in ['float32', 'float64']]@\n assert(PyFloat_Check(py@(field.name)));\n@[ if field.type.type == 'float32']@\n ros_message->@(field.name) = (float)PyFloat_AS_DOUBLE(py@(field.name));\n@[ else]@\n ros_message->@(field.name) = PyFloat_AS_DOUBLE(py@(field.name));\n@[ end if]@\n@[ elif field.type.type in [\n 'int8',\n 'int16',\n 'int32',\n ]]@\n assert(PyLong_Check(py@(field.name)));\n ros_message->@(field.name) = (@(primitive_msg_type_to_c(field.type.type)))PyLong_AsLong(py@(field.name));\n@[ elif field.type.type in [\n 'uint8',\n 'uint16',\n 'uint32',\n ]]@\n assert(PyLong_Check(py@(field.name)));\n@[ if field.type.type == 'uint32']@\n ros_message->@(field.name) = PyLong_AsUnsignedLong(py@(field.name));\n@[ else]@\n ros_message->@(field.name) = (@(primitive_msg_type_to_c(field.type.type)))PyLong_AsUnsignedLong(py@(field.name));\n@[ end if]@\n@[ elif field.type.type == 'int64']@\n assert(PyLong_Check(py@(field.name)));\n ros_message->@(field.name) = PyLong_AsLongLong(py@(field.name));\n@[ elif field.type.type == 'uint64']@\n assert(PyLong_Check(py@(field.name)));\n ros_message->@(field.name) = PyLong_AsUnsignedLongLong(py@(field.name));\n@[ else]@\n assert(false);\n@[ end if]@\n@[end for]@\n\n assert(ros_message != NULL);\n return ros_message;\n}\n\nPyObject * @(spec.base_type.pkg_name)_@(module_name)__convert_to_py(void * raw_ros_message)\n{\n @(msg_typename) * ros_message = (@(msg_typename) *)raw_ros_message;\n (void)ros_message;\n\n PyObject * pymessage_module = PyImport_ImportModule(\"@(spec.base_type.pkg_name).@(subfolder)._@(module_name)\");\n PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, \"@(spec.base_type.type)\");\n\n \/* NOTE(esteve): Call constructor of @(spec.base_type.type) *\/\n PyObject * _pymessage = NULL;\n _pymessage = PyObject_CallObject(pymessage_class, NULL);\n assert(_pymessage != NULL);\n\n@[for field in spec.fields]@\n PyObject * py@(field.name) = NULL;\n@[ if not field.type.is_primitive_type()]@\n@{\nnested_type = '%s__%s__%s' % (field.type.pkg_name, 'msg', field.type.type)\n}@\n PyObject * py@(field.name)_msg_module = PyImport_ImportModule(\"@(field.type.pkg_name).msg._@convert_camel_case_to_lower_case_underscore(field.type.type)\");\n PyObject * py@(field.name)_convert_to_py = PyObject_GetAttrString(py@(field.name)_msg_module, \"_convert_to_py\");\n typedef PyObject *(* convert_to_py_signature)(void *);\n convert_to_py_signature convert_to_py_@(field.name) = (convert_to_py_signature)PyCapsule_GetPointer(py@(field.name)_convert_to_py, NULL);\n@[ if field.type.is_array]@\n@[ if field.type.array_size is None]@\n size_t size@(field.name) = ros_message->@(field.name).size;\n@[ else]@\n size_t size@(field.name) = @(field.type.array_size);\n@[ end if]@\n py@(field.name) = PyList_New(size@(field.name));\n @(nested_type) item@(field.name);\n size_t idx@(field.name);\n for (idx@(field.name) = 0; idx@(field.name) < size@(field.name); idx@(field.name)++) {\n@[ if field.type.array_size is None]@\n item@(field.name) = ros_message->@(field.name).data[idx@(field.name)];\n@[ else]@\n item@(field.name) = ros_message->@(field.name)[idx@(field.name)];\n@[ end if]@\n PyList_SetItem(py@(field.name), idx@(field.name), convert_to_py_@(field.name)(&item@(field.name)));\n }\n assert(PySequence_Check(py@(field.name)));\n@[ else]@\n @(nested_type) pytmp@(field.name) = ros_message->@(field.name);\n py@(field.name) = convert_to_py_@(field.name)(&pytmp@(field.name));\n@[ end if]@\n@[ elif field.type.is_array]@\n@[ if field.type.array_size is None]@\n size_t size@(field.name) = ros_message->@(field.name).size;\n @primitive_msg_type_to_c(field.type.type) * tmpmessagedata@(field.name) = ros_message->@(field.name).data;\n@[ else]@\n size_t size@(field.name) = @(field.type.array_size);\n @primitive_msg_type_to_c(field.type.type) * tmpmessagedata@(field.name) = ros_message->@(field.name);\n@[ end if]@\n py@(field.name) = PyList_New(size@(field.name));\n size_t idx@(field.name);\n for (idx@(field.name) = 0; idx@(field.name) < size@(field.name); idx@(field.name)++) {\n@[ if field.type.type == 'char']@\n PyList_SetItem(py@(field.name), idx@(field.name),\n PyUnicode_FromStringAndSize(&tmpmessagedata@(field.name)[idx@(field.name)], 1));\n@[ elif field.type.type == 'byte']@\n PyList_SetItem(py@(field.name), idx@(field.name),\n PyBytes_FromStringAndSize((const char *)&tmpmessagedata@(field.name)[idx@(field.name)], 1));\n@[ elif field.type.type == 'string']@\n PyList_SetItem(py@(field.name), idx@(field.name), PyUnicode_FromString(tmpmessagedata@(field.name)[idx@(field.name)].data));\n@[ elif field.type.type == 'bool']@\n PyList_SetItem(py@(field.name), idx@(field.name), tmpmessagedata@(field.name)[idx@(field.name)] ? Py_True : Py_False);\n@[ elif field.type.type in ['float32', 'float64']]@\n PyList_SetItem(py@(field.name), idx@(field.name), PyFloat_FromDouble(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ elif field.type.type in [\n 'int8',\n 'int16',\n 'int32',\n ]]@\n PyList_SetItem(py@(field.name), idx@(field.name), PyLong_FromLong(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ elif field.type.type in [\n 'uint8',\n 'uint16',\n 'uint32',\n ]]@\n PyList_SetItem(py@(field.name), idx@(field.name), PyLong_FromUnsignedLong(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ elif field.type.type == 'int64']@\n PyList_SetItem(py@(field.name), idx@(field.name), PyLong_FromLongLong(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ elif field.type.type == 'uint64']@\n PyList_SetItem(py@(field.name), idx@(field.name), PyLong_FromUnsignedLongLong(tmpmessagedata@(field.name)[idx@(field.name)]));\n@[ end if]@\n }\n assert(PySequence_Check(py@(field.name)));\n@[ elif field.type.type == 'char']@\n py@(field.name) = PyUnicode_FromStringAndSize(&ros_message->@(field.name), 1);\n@[ elif field.type.type == 'byte']@\n py@(field.name) = PyBytes_FromStringAndSize((const char *)&ros_message->@(field.name), 1);\n@[ elif field.type.type == 'string']@\n py@(field.name) = PyUnicode_FromString(ros_message->@(field.name).data);\n@[ elif field.type.type == 'bool']@\n py@(field.name) = ros_message->@(field.name) ? Py_True : Py_False;\n@[ elif field.type.type in ['float32', 'float64']]@\n py@(field.name) = PyFloat_FromDouble(ros_message->@(field.name));\n@[ elif field.type.type in [\n 'int8',\n 'int16',\n 'int32',\n ]]@\n py@(field.name) = PyLong_FromLong(ros_message->@(field.name));\n@[ elif field.type.type in [\n 'uint8',\n 'uint16',\n 'uint32',\n ]]@\n py@(field.name) = PyLong_FromUnsignedLong(ros_message->@(field.name));\n@[ elif field.type.type == 'int64']@\n py@(field.name) = PyLong_FromLongLong(ros_message->@(field.name));\n@[ elif field.type.type == 'uint64']@\n py@(field.name) = PyLong_FromUnsignedLongLong(ros_message->@(field.name));\n@[ else]@\n assert(false);\n@[ end if]@\n assert(py@(field.name) != NULL);\n Py_INCREF(py@(field.name));\n PyObject_SetAttrString(_pymessage, \"@(field.name)\", py@(field.name));\n@[end for]@\n assert(_pymessage != NULL);\n return _pymessage;\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"a3487ab8a3fea451e456b3d6f762b29a0b3dd27f","subject":"microRTPS: timesync: fix unit conversion","message":"microRTPS: timesync: fix unit conversion\n","repos":"PX4\/Firmware,krbeverx\/Firmware,krbeverx\/Firmware,krbeverx\/Firmware,acfloria\/Firmware,acfloria\/Firmware,acfloria\/Firmware,krbeverx\/Firmware,krbeverx\/Firmware,PX4\/Firmware,acfloria\/Firmware,PX4\/Firmware,acfloria\/Firmware,PX4\/Firmware,acfloria\/Firmware,krbeverx\/Firmware,krbeverx\/Firmware,PX4\/Firmware,PX4\/Firmware,acfloria\/Firmware,PX4\/Firmware","old_file":"msg\/templates\/urtps\/microRTPS_timesync.h.em","new_file":"msg\/templates\/urtps\/microRTPS_timesync.h.em","new_contents":"@###############################################\n@#\n@# EmPy template for generating microRTPS_timesync.h file\n@#\n@###############################################\n@# Start of Template\n@#\n@# Context:\n@# - msgs (List) list of all msg files\n@# - multi_topics (List) list of all multi-topic names\n@# - ids (List) list of all RTPS msg ids\n@###############################################\n@{\nimport genmsg.msgs\n\nfrom px_generate_uorb_topic_helper import * # this is in Tools\/\nfrom px_generate_uorb_topic_files import MsgScope # this is in Tools\/\n\npackage = package[0]\nfastrtpsgen_version = fastrtpsgen_version[0]\ntry:\n ros2_distro = ros2_distro[0].decode(\"utf-8\")\nexcept AttributeError:\n ros2_distro = ros2_distro[0]\n}@\n\/****************************************************************************\n *\n * Copyright (c) 2020 PX4 Development Team. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and\/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n ****************************************************************************\/\n\n\/*!\n * @@file microRTPS_timesync.h\n * @@brief Adds time sync for the microRTPS bridge\n * @@author Nuno Marques \n * @@author Julian Kent \n *\/\n\n#pragma once\n\n#include \n#include \n#include \n\n@[if ros2_distro]@\n#include \"Timesync_Publisher.h\"\n#include \"Timesync_Subscriber.h\"\n@[else]@\n#include \"timesync_Publisher.h\"\n#include \"timesync_Subscriber.h\"\n@[end if]@\n\nstatic constexpr double ALPHA_INITIAL = 0.05;\nstatic constexpr double ALPHA_FINAL = 0.003;\nstatic constexpr double BETA_INITIAL = 0.05;\nstatic constexpr double BETA_FINAL = 0.003;\nstatic constexpr int WINDOW_SIZE = 500;\nstatic constexpr int64_t UNKNOWN = 0;\nstatic constexpr int64_t TRIGGER_RESET_THRESHOLD_NS = 100ll * 1000ll * 1000ll;\nstatic constexpr int REQUEST_RESET_COUNTER_THRESHOLD = 5;\n\nclass TimeSync {\npublic:\n\tTimeSync();\n\tvirtual ~TimeSync();\n\n@[if ros2_distro]@\n\tvoid start(const Timesync_Publisher* pub);\n@[else]@\n\tvoid start(const timesync_Publisher* pub);\n@[end if]@\n\n\tvoid reset();\n\tvoid stop();\n\n\t\/**\n\t * Get clock monotonic time (raw) in nanoseconds\n\t *\/\n\tinline int64_t getMonoRawTimeNSec() {\n\t\ttimespec t;\n\t\tclock_gettime(CLOCK_MONOTONIC_RAW, &t);\n\t\treturn (int64_t)t.tv_sec * 1000000000LL + t.tv_nsec;\n\t}\n\n\t\/**\n\t * Get system monotonic time in microseconds\n\t *\/\n\tinline int64_t getMonoTimeUSec() {\n\t\ttimespec t;\n\t\tclock_gettime(CLOCK_MONOTONIC, &t);\n\t\treturn (int64_t)(t.tv_sec * 1000000000LL + t.tv_nsec) \/ 1000LL;\n\t}\n\n\tbool addMeasurement(int64_t local_t1_ns, int64_t remote_t2_ns, int64_t local_t3_ns);\n\n@[if 1.5 <= fastrtpsgen_version <= 1.7]@\n@[ if ros2_distro]@\n\tvoid processTimesyncMsg(@(package)::msg::dds_::Timesync_* msg);\n\n\t@(package)::msg::dds_::Timesync_ newTimesyncMsg();\n@[ else]@\n\tvoid processTimesyncMsg(timesync_* msg);\n\n\ttimesync_ newTimesyncMsg();\n@[ end if]@\n@[else]@\n@[ if ros2_distro]@\n\tvoid processTimesyncMsg(@(package)::msg::Timesync* msg);\n\n\t@(package)::msg::Timesync newTimesyncMsg();\n@[ else]@\n\tvoid processTimesyncMsg(timesync* msg);\n\n\ttimesync newTimesyncMsg();\n@[ end if]@\n@[end if]@\n\n\tinline int64_t getOffset() { return _offset_ns.load(); }\n\tinline void addOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL + _offset_ns.load()) \/ 1000ULL; }\n\tinline void subtractOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL - _offset_ns.load()) \/ 1000ULL; }\n\nprivate:\n\tstd::atomic _offset_ns;\n\tint64_t _skew_ns_per_sync;\n\tint64_t _num_samples;\n\n\tint32_t _request_reset_counter;\n\tuint8_t _last_msg_seq;\n\tuint8_t _last_remote_msg_seq;\n\n@[if ros2_distro]@\n\tTimesync_Publisher _timesync_pub;\n\tTimesync_Subscriber _timesync_sub;\n@[else]@\n\ttimesync_Publisher _timesync_pub;\n\ttimesync_Subscriber _timesync_sub;\n@[end if]@\n\n\tstd::unique_ptr _send_timesync_thread;\n\tstd::atomic _request_stop{false};\n\n\tinline void updateOffset(const uint64_t& offset) { _offset_ns.store(offset, std::memory_order_relaxed); }\n};\n","old_contents":"@###############################################\n@#\n@# EmPy template for generating microRTPS_timesync.h file\n@#\n@###############################################\n@# Start of Template\n@#\n@# Context:\n@# - msgs (List) list of all msg files\n@# - multi_topics (List) list of all multi-topic names\n@# - ids (List) list of all RTPS msg ids\n@###############################################\n@{\nimport genmsg.msgs\n\nfrom px_generate_uorb_topic_helper import * # this is in Tools\/\nfrom px_generate_uorb_topic_files import MsgScope # this is in Tools\/\n\npackage = package[0]\nfastrtpsgen_version = fastrtpsgen_version[0]\ntry:\n ros2_distro = ros2_distro[0].decode(\"utf-8\")\nexcept AttributeError:\n ros2_distro = ros2_distro[0]\n}@\n\/****************************************************************************\n *\n * Copyright (c) 2020 PX4 Development Team. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and\/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n ****************************************************************************\/\n\n\/*!\n * @@file microRTPS_timesync.h\n * @@brief Adds time sync for the microRTPS bridge\n * @@author Nuno Marques \n * @@author Julian Kent \n *\/\n\n#pragma once\n\n#include \n#include \n#include \n\n@[if ros2_distro]@\n#include \"Timesync_Publisher.h\"\n#include \"Timesync_Subscriber.h\"\n@[else]@\n#include \"timesync_Publisher.h\"\n#include \"timesync_Subscriber.h\"\n@[end if]@\n\nstatic constexpr double ALPHA_INITIAL = 0.05;\nstatic constexpr double ALPHA_FINAL = 0.003;\nstatic constexpr double BETA_INITIAL = 0.05;\nstatic constexpr double BETA_FINAL = 0.003;\nstatic constexpr int WINDOW_SIZE = 500;\nstatic constexpr int64_t UNKNOWN = 0;\nstatic constexpr int64_t TRIGGER_RESET_THRESHOLD_NS = 100ll * 1000ll * 1000ll;\nstatic constexpr int REQUEST_RESET_COUNTER_THRESHOLD = 5;\n\nclass TimeSync {\npublic:\n\tTimeSync();\n\tvirtual ~TimeSync();\n\n@[if ros2_distro]@\n\tvoid start(const Timesync_Publisher* pub);\n@[else]@\n\tvoid start(const timesync_Publisher* pub);\n@[end if]@\n\n\tvoid reset();\n\tvoid stop();\n\n\t\/**\n\t * Get clock monotonic time (raw) in nanoseconds\n\t *\/\n\tinline int64_t getMonoRawTimeNSec() {\n\t\ttimespec t;\n\t\tclock_gettime(CLOCK_MONOTONIC_RAW, &t);\n\t\treturn (int64_t)t.tv_sec * 1000000000LL + t.tv_nsec;\n\t}\n\n\t\/**\n\t * Get system monotonic time in microseconds\n\t *\/\n\tinline int64_t getMonoTimeUSec() {\n\t\ttimespec t;\n\t\tclock_gettime(CLOCK_MONOTONIC, &t);\n\t\treturn (int64_t)(t.tv_sec * 1000000000LL + t.tv_nsec) \/ 1000LL;\n\t}\n\n\tbool addMeasurement(int64_t local_t1_ns, int64_t remote_t2_ns, int64_t local_t3_ns);\n\n@[if 1.5 <= fastrtpsgen_version <= 1.7]@\n@[ if ros2_distro]@\n\tvoid processTimesyncMsg(@(package)::msg::dds_::Timesync_* msg);\n\n\t@(package)::msg::dds_::Timesync_ newTimesyncMsg();\n@[ else]@\n\tvoid processTimesyncMsg(timesync_* msg);\n\n\ttimesync_ newTimesyncMsg();\n@[ end if]@\n@[else]@\n@[ if ros2_distro]@\n\tvoid processTimesyncMsg(@(package)::msg::Timesync* msg);\n\n\t@(package)::msg::Timesync newTimesyncMsg();\n@[ else]@\n\tvoid processTimesyncMsg(timesync* msg);\n\n\ttimesync newTimesyncMsg();\n@[ end if]@\n@[end if]@\n\n\tinline int64_t getOffset() { return _offset_ns.load(); }\n\tinline void addOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL + _offset_ns.load()) \/ 10000ULL; }\n\tinline void subtractOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL - _offset_ns.load()) \/ 10000ULL; }\n\nprivate:\n\tstd::atomic _offset_ns;\n\tint64_t _skew_ns_per_sync;\n\tint64_t _num_samples;\n\n\tint32_t _request_reset_counter;\n\tuint8_t _last_msg_seq;\n\tuint8_t _last_remote_msg_seq;\n\n@[if ros2_distro]@\n\tTimesync_Publisher _timesync_pub;\n\tTimesync_Subscriber _timesync_sub;\n@[else]@\n\ttimesync_Publisher _timesync_pub;\n\ttimesync_Subscriber _timesync_sub;\n@[end if]@\n\n\tstd::unique_ptr _send_timesync_thread;\n\tstd::atomic _request_stop{false};\n\n\tinline void updateOffset(const uint64_t& offset) { _offset_ns.store(offset, std::memory_order_relaxed); }\n};\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"EmberScript"} {"commit":"68c27dabcd3340406522276541807108124bdb50","subject":"Making script executable in repo removing chmod from template","message":"Making script executable in repo\nremoving chmod from template\n","repos":"ruffsl\/docker_templates,ros-infrastructure\/docker_images,ruffsl\/docker_templates,ros-infrastructure\/docker_images,osrf\/docker_templates,osrf\/docker_templates","old_file":"ros_docker_images\/templates\/docker_images\/create_ros_core_image.Dockerfile.em","new_file":"ros_docker_images\/templates\/docker_images\/create_ros_core_image.Dockerfile.em","new_contents":"@(TEMPLATE(\n 'snippet\/add_generated_comment.Dockerfile.em',\n user_name=user_name,\n tag_name=tag_name,\n source_template_name=template_name,\n now_str=now_str,\n))@\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n template_packages=template_packages,\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n base_image=base_image,\n))@\nMAINTAINER Dirk Thomas dthomas+buildfarm@@osrfoundation.org\n\n# setup environment\nRUN locale-gen en_US.UTF-8\nENV LANG en_US.UTF-8\n@[if 'packages' in locals()]@\n@[if packages]@\n\n# install packages\nRUN apt-get update && apt-get install -y \\\n @(' \\\\\\n '.join(packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n@[end if]@\n@[end if]@\n\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.ros.org\/ros\/@os_name @os_code_name main\" > \/etc\/apt\/sources.list.d\/ros-latest.list\n\n# install bootstrap tools\nENV ROS_DISTRO @rosdistro_name\nRUN apt-get update && apt-get install --no-install-recommends -y \\\n python-rosdep \\\n python-rosinstall \\\n python-vcstools \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n# bootstrap rosdep\nRUN rosdep init \\\n && rosdep update\n\n# install ros packages\nRUN apt-get update && apt-get install -y \\\n @(' \\\\\\n '.join(ros_packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n# setup entrypoint\nCOPY .\/ros_entrypoint.sh \/\n\n@[if 'entrypoint_name' in locals()]@\n@[if entrypoint_name]@\n@{\nentrypoint_file = entrypoint_name.split('\/')[-1]\n}@\nENTRYPOINT [\"\/@entrypoint_file\"]\n@[end if]@\n@[end if]@\n@{\ncmds = [\n'bash',\n]\n}@\nCMD [\"@(' && '.join(cmds))\"]\n","old_contents":"@(TEMPLATE(\n 'snippet\/add_generated_comment.Dockerfile.em',\n user_name=user_name,\n tag_name=tag_name,\n source_template_name=template_name,\n now_str=now_str,\n))@\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n template_packages=template_packages,\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n base_image=base_image,\n))@\nMAINTAINER Dirk Thomas dthomas+buildfarm@@osrfoundation.org\n\n# setup environment\nRUN locale-gen en_US.UTF-8\nENV LANG en_US.UTF-8\n@[if 'packages' in locals()]@\n@[if packages]@\n\n# install packages\nRUN apt-get update && apt-get install -y \\\n @(' \\\\\\n '.join(packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n@[end if]@\n@[end if]@\n\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.ros.org\/ros\/@os_name @os_code_name main\" > \/etc\/apt\/sources.list.d\/ros-latest.list\n\n# install bootstrap tools\nENV ROS_DISTRO @rosdistro_name\nRUN apt-get update && apt-get install --no-install-recommends -y \\\n python-rosdep \\\n python-rosinstall \\\n python-vcstools \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n# bootstrap rosdep\nRUN rosdep init \\\n && rosdep update\n\n# install ros packages\nRUN apt-get update && apt-get install -y \\\n @(' \\\\\\n '.join(ros_packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n# setup entrypoint\nCOPY .\/ros_entrypoint.sh \/\nRUN chmod +x .\/ros_entrypoint.sh\n\n@[if 'entrypoint_name' in locals()]@\n@[if entrypoint_name]@\n@{\nentrypoint_file = entrypoint_name.split('\/')[-1]\n}@\nENTRYPOINT [\"\/@entrypoint_file\"]\n@[end if]@\n@[end if]@\n@{\ncmds = [\n'bash',\n]\n}@\nCMD [\"@(' && '.join(cmds))\"]\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"89475c6ee228c830ad7542204402f642a62ac3e3","subject":"thor onboard updated to correct hostname","message":"thor onboard updated to correct hostname\n","repos":"thor-mang\/thor_mang_scripts","old_file":"10.thor_mang_scripts.sh.em","new_file":"10.thor_mang_scripts.sh.em","new_contents":"#!\/bin\/sh\n\n@[if DEVELSPACE]@\nexport THOR_SCRIPTS=@(PROJECT_SOURCE_DIR)\/scripts\n@[else]@\nexport THOR_SCRIPTS=@(CMAKE_INSTALL_PREFIX)\/@(CATKIN_PACKAGE_SHARE_DESTINATION)\/scripts\n@[end if]@\nexport THOR_ROOT=$(cd \"@(CMAKE_SOURCE_DIR)\/..\"; pwd)\n\n# set THOR_* environment variables\nalias l_vt_hand='. l_vt_hand'\nalias r_vt_hand='. r_vt_hand'\nalias l_thor_mang_hand='. l_thor_mang_hand'\nalias r_thor_mang_hand='. r_thor_mang_hand'\n\n# include THOR_scripts hooks\n#if [ -d $THOR_SCRIPTS ]; then\n# . $THOR_SCRIPTS\/functions.sh\n# . $THOR_SCRIPTS\/robot.sh \"\"\n\n# _THOR_include \"$THOR_SCRIPTS\/setup.d\/*.sh\"\n# _THOR_include \"$THOR_SCRIPTS\/$HOSTNAME\/setup.d\/*.sh\"\n\n# if [ -r \"$THOR_SCRIPTS\/$HOSTNAME\/setup.sh\" ]; then\n# echo \"Including $THOR_SCRIPTS\/$HOSTNAME\/setup.sh...\" >&2\n# . \"$THOR_SCRIPTS\/$HOSTNAME\/setup.sh\"\n# fi\n#fi\n\n# export additional ROS_PACKAGE_PATH for indigo\nif [ \"$ROS_DISTRO\" = \"indigo\" ]; then\n export ROS_BOOST_LIB_DIR_NAME=\/usr\/lib\/x86_64-linux-gnu\n export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$ROS_WORKSPACE\/..\/external\nfi\n\n# export some variables\nexport PATH=$THOR_SCRIPTS\/helper:$PATH\nexport ROS_WORKSPACE=$THOR_ROOT\/src\nexport THOR_MOTION_HOSTNAME=\"thor-motion\"\nexport THOR_PERCEPTION_HOSTNAME=\"thor-perception\"\nexport THOR_ONBOARD_HOSTNAME=\"thor-motion\" #need to be thor-motion because on same machine\nexport THOR_FIELD_HOSTNAME=\"thor-field\"\nexport ROBOT_HOSTNAMES=\"thor-motion thor-perception thor-onboard thor-field\"\nexport ROBOT_USER=\"thor\"\nexport THOR_ROBOT_TYPE=\"thor_mang_hands\"\nexport LEFT_HAND_TYPE=\"l_vt_hand\"\nexport RIGHT_HAND_TYPE=\"r_vt_hand\"\n\n# adding ssh keys\nif [ -d \"$THOR_ROOT\/.ssh\/\" ] && [ \"$(ls -A $THOR_ROOT\/.ssh\/)\" ]; then\n #echo \"Adding ssh keys from '$THOR_ROOT\/.ssh\/':\"\n for f in $THOR_ROOT\/.ssh\/*; do\n ssh-add $f\n done\nfi\n","old_contents":"#!\/bin\/sh\n\n@[if DEVELSPACE]@\nexport THOR_SCRIPTS=@(PROJECT_SOURCE_DIR)\/scripts\n@[else]@\nexport THOR_SCRIPTS=@(CMAKE_INSTALL_PREFIX)\/@(CATKIN_PACKAGE_SHARE_DESTINATION)\/scripts\n@[end if]@\nexport THOR_ROOT=$(cd \"@(CMAKE_SOURCE_DIR)\/..\"; pwd)\n\n# set THOR_* environment variables\nalias l_vt_hand='. l_vt_hand'\nalias r_vt_hand='. r_vt_hand'\nalias l_thor_mang_hand='. l_thor_mang_hand'\nalias r_thor_mang_hand='. r_thor_mang_hand'\n\n# include THOR_scripts hooks\n#if [ -d $THOR_SCRIPTS ]; then\n# . $THOR_SCRIPTS\/functions.sh\n# . $THOR_SCRIPTS\/robot.sh \"\"\n\n# _THOR_include \"$THOR_SCRIPTS\/setup.d\/*.sh\"\n# _THOR_include \"$THOR_SCRIPTS\/$HOSTNAME\/setup.d\/*.sh\"\n\n# if [ -r \"$THOR_SCRIPTS\/$HOSTNAME\/setup.sh\" ]; then\n# echo \"Including $THOR_SCRIPTS\/$HOSTNAME\/setup.sh...\" >&2\n# . \"$THOR_SCRIPTS\/$HOSTNAME\/setup.sh\"\n# fi\n#fi\n\n# export additional ROS_PACKAGE_PATH for indigo\nif [ \"$ROS_DISTRO\" = \"indigo\" ]; then\n export ROS_BOOST_LIB_DIR_NAME=\/usr\/lib\/x86_64-linux-gnu\n export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$ROS_WORKSPACE\/..\/external\nfi\n\n# export some variables\nexport PATH=$THOR_SCRIPTS\/helper:$PATH\nexport ROS_WORKSPACE=$THOR_ROOT\/src\nexport THOR_MOTION_HOSTNAME=\"thor-motion\"\nexport THOR_PERCEPTION_HOSTNAME=\"thor-perception\"\nexport THOR_ONBOARD_HOSTNAME=\"thor-onboard\"\nexport THOR_FIELD_HOSTNAME=\"thor-field\"\nexport ROBOT_HOSTNAMES=\"thor-motion thor-perception thor-onboard thor-field\"\nexport ROBOT_USER=\"thor\"\nexport THOR_ROBOT_TYPE=\"thor_mang_hands\"\nexport LEFT_HAND_TYPE=\"l_vt_hand\"\nexport RIGHT_HAND_TYPE=\"r_vt_hand\"\n\n# adding ssh keys\nif [ -d \"$THOR_ROOT\/.ssh\/\" ] && [ \"$(ls -A $THOR_ROOT\/.ssh\/)\" ]; then\n #echo \"Adding ssh keys from '$THOR_ROOT\/.ssh\/':\"\n for f in $THOR_ROOT\/.ssh\/*; do\n ssh-add $f\n done\nfi\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"EmberScript"} {"commit":"a34641521e3e477bc7d4c79b5815b6cab8972715","subject":"Fix double free issue when initialization is failed (#423)","message":"Fix double free issue when initialization is failed (#423)\n\nSigned-off-by: Donghee Ye <964818a2edbec03f09493583a2972b059526e7eb@samsung.com>","repos":"ros2\/rosidl,ros2\/rosidl,ros2\/rosidl,ros2\/rosidl","old_file":"rosidl_generator_c\/resource\/msg__functions.c.em","new_file":"rosidl_generator_c\/resource\/msg__functions.c.em","new_contents":"@# Included from rosidl_generator_c\/resource\/idl__functions.c.em\n@{\nfrom ast import literal_eval\nfrom rosidl_parser.definition import AbstractNestedType\nfrom rosidl_parser.definition import AbstractSequence\nfrom rosidl_parser.definition import AbstractString\nfrom rosidl_parser.definition import AbstractWString\nfrom rosidl_parser.definition import Array\nfrom rosidl_parser.definition import BasicType\nfrom rosidl_parser.definition import AbstractGenericString\nfrom rosidl_parser.definition import NamespacedType\nfrom rosidl_generator_c import basetype_to_c\nfrom rosidl_generator_c import idl_structure_type_sequence_to_c_typename\nfrom rosidl_generator_c import idl_structure_type_to_c_include_prefix\nfrom rosidl_generator_c import idl_structure_type_to_c_typename\nfrom rosidl_generator_c import idl_type_to_c\nfrom rosidl_generator_c import interface_path_to_string\nfrom rosidl_generator_c import value_to_c\n\nmessage_typename = idl_structure_type_to_c_typename(message.structure.namespaced_type)\narray_typename = idl_structure_type_sequence_to_c_typename(\n message.structure.namespaced_type)\n}@\n@#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n@# Collect necessary include directives for all members\n@{\nfrom collections import OrderedDict\nincludes = OrderedDict()\nfor member in message.structure.members:\n if isinstance(member.type, AbstractSequence) and isinstance(member.type.value_type, BasicType):\n member_names = includes.setdefault(\n 'rosidl_generator_c\/primitives_sequence_functions.h', [])\n member_names.append(member.name)\n continue\n type_ = member.type\n if isinstance(type_, AbstractNestedType):\n type_ = type_.value_type\n if isinstance(type_, AbstractString):\n member_names = includes.setdefault('rosidl_generator_c\/string_functions.h', [])\n member_names.append(member.name)\n elif isinstance(type_, AbstractWString):\n member_names = includes.setdefault(\n 'rosidl_generator_c\/u16string_functions.h', [])\n member_names.append(member.name)\n elif isinstance(type_, NamespacedType):\n include_prefix = idl_structure_type_to_c_include_prefix(type_)\n if include_prefix.endswith('__request'):\n include_prefix = include_prefix[:-9]\n elif include_prefix.endswith('__response'):\n include_prefix = include_prefix[:-10]\n if include_prefix.endswith('__goal'):\n include_prefix = include_prefix[:-6]\n elif include_prefix.endswith('__result'):\n include_prefix = include_prefix[:-8]\n elif include_prefix.endswith('__feedback'):\n include_prefix = include_prefix[:-10]\n member_names = includes.setdefault(\n include_prefix + '__functions.h', [])\n member_names.append(member.name)\n}@\n@#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n@\n@#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n@[if includes]@\n\n\/\/ Include directives for member types\n@[ for header_file, member_names in includes.items()]@\n@[ for member_name in member_names]@\n\/\/ Member `@(member_name)`\n@[ end for]@\n@[ if header_file in include_directives]@\n\/\/ already included above\n\/\/ @\n@[ else]@\n@{include_directives.add(header_file)}@\n@[ end if]@\n#include \"@(header_file)\"\n@[ end for]@\n@[end if]@\n@#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n@#######################################################################\n@# message functions\n@#######################################################################\nbool\n@(message_typename)__init(@(message_typename) * msg)\n{\n if (!msg) {\n return false;\n }\n@{\nlabel_prefix = 'abort_init_'\nlast_label_index = 0\nlines = []\nabort_lines = []\nfor member in message.structure.members:\n lines.append('\/\/ ' + member.name)\n if isinstance(member.type, Array):\n if isinstance(member.type.value_type, BasicType):\n if member.has_annotation('default'):\n # set default value for each array element\n for i, default_value in enumerate(literal_eval(member.get_annotation_value('default')['value'])):\n lines.append('msg->%s[%d] = %s;' % (member.name, i, value_to_c(member.type.value_type, default_value)))\n elif isinstance(member.type.value_type, (AbstractGenericString, NamespacedType)):\n # initialize each array element\n lines.append('for (size_t i = 0; i < %d; ++i) {' % member.type.size)\n lines.append(' if (!%s__init(&msg->%s[i])) {' % (basetype_to_c(member.type.value_type), member.name))\n lines.append(' %s__fini(msg);' % message_typename)\n lines.append(' return false;')\n lines.append(' }')\n lines.append('}')\n\n if member.has_annotation('default'):\n for i, default_value in enumerate(literal_eval(member.get_annotation_value('default')['value'])):\n if isinstance(member.type.value_type, AbstractGenericString):\n lines.append('{')\n lines.append(\n ' bool success = %s__assign(&msg->%s[%d], %s);' % \\\n (basetype_to_c(member.type.value_type), member.name, i, value_to_c(member.type.value_type, default_value)))\n lines.append(' if (!success) {')\n lines.append(' goto %s%s;' % (label_prefix, last_label_index))\n abort_lines[0:0] = [\n ' %s__fini(&msg->%s[%d]);' % (basetype_to_c(member.type.value_type), member.name, i),\n '%s%d:' % (label_prefix, last_label_index),\n ]\n last_label_index += 1\n lines.append(' }')\n lines.append('}')\n\n elif isinstance(member.type, AbstractSequence):\n if not member.has_annotation('default'):\n # initialize the dynamic array with a capacity of zero\n lines.append('if (!%s__init(&msg->%s, 0)) {' % (idl_type_to_c(member.type), member.name))\n lines.append(' %s__fini(msg);' % message_typename)\n lines.append(' return false;')\n lines.append('}')\n else:\n # initialize the dynamic array with the number of default values\n lines.append('{')\n lines.append(' bool success = %s__init(&msg->%s, %d);' % (idl_type_to_c(member.type), member.name, len(literal_eval(member.get_annotation_value('default')['value']))))\n lines.append(' if (!success) {')\n lines.append(' goto %s%d;' % (label_prefix, last_label_index))\n abort_lines[0:0] = [\n ' %s__fini(&msg->%s);' % (idl_type_to_c(member.type), member.name),\n '%s%d:' % (label_prefix, last_label_index),\n ]\n last_label_index += 1\n lines.append(' }')\n lines.append('}')\n # set default value for each array element\n for i, default_value in enumerate(literal_eval(member.get_annotation_value('default')['value'])):\n if isinstance(member.type.value_type, AbstractGenericString):\n lines.append('{')\n lines.append(\n ' bool success = %s__assign(&msg->%s.data[%d], %s);' % \\\n (basetype_to_c(member.type.value_type), member.name, i, value_to_c(member.type.value_type, default_value)))\n lines.append(' if (!success) {')\n lines.append(' goto %s%s;' % (label_prefix, last_label_index))\n abort_lines[0:0] = [\n ' %s__fini(&msg->%s.data[%d]);' % (basetype_to_c(member.type.value_type), member.name, i),\n '%s%d:' % (label_prefix, last_label_index),\n ]\n last_label_index += 1\n lines.append(' }')\n lines.append('}')\n else:\n lines.append('msg->%s.data[%d] = %s;' % (member.name, i, value_to_c(member.type.value_type, default_value)))\n\n elif isinstance(member.type, NamespacedType):\n # initialize the sub message\n lines.append('if (!%s__init(&msg->%s)) {' % (basetype_to_c(member.type), member.name))\n lines.append(' %s__fini(msg);' % message_typename)\n lines.append(' return false;')\n lines.append('}')\n # no default value for nested messages yet\n\n elif isinstance(member.type, AbstractGenericString):\n lines.append('if (!%s__init(&msg->%s)) {' % (basetype_to_c(member.type), member.name))\n lines.append(' %s__fini(msg);' % message_typename)\n lines.append(' return false;')\n lines.append('}')\n if member.has_annotation('default'):\n lines.append('{')\n lines.append(\n ' bool success = %s__assign(&msg->%s, %s);' % (\n basetype_to_c(member.type), member.name,\n value_to_c(member.type, member.get_annotation_value('default')['value'])))\n lines.append(' if (!success) {')\n lines.append(' goto %s%s;' % (label_prefix, last_label_index))\n abort_lines[0:0] = [\n ' %s__fini(&msg->%s);' % (basetype_to_c(member.type), member.name),\n '%s%d:' % (label_prefix, last_label_index),\n ]\n last_label_index += 1\n lines.append(' }')\n lines.append('}')\n elif isinstance(member.type, BasicType):\n if member.has_annotation('default'):\n # set default value of primitive type\n lines.append('msg->%s = %s;' % (member.name, value_to_c(member.type, member.get_annotation_value('default')['value'])))\n\nfor line in lines:\n print(' ' + line)\n}@\n return true;\n@{\nif abort_lines:\n # remove lines before the first label since they are unreachable\n while not abort_lines[0].startswith(label_prefix):\n abort_lines.pop(0)\n for line in abort_lines:\n print(line)\n print(' return false;')\n}@\n}\n\nvoid\n@(message_typename)__fini(@(message_typename) * msg)\n{\n if (!msg) {\n return;\n }\n@{\nlines = []\nfor member in message.structure.members:\n lines.append('\/\/ ' + member.name)\n if isinstance(member.type, Array):\n if isinstance(member.type.value_type, (AbstractGenericString, NamespacedType)):\n lines.append('for (size_t i = 0; i < %d; ++i) {' % member.type.size)\n # initialize each array element\n lines.append(' %s__fini(&msg->%s[i]);' % (basetype_to_c(member.type.value_type), member.name))\n lines.append('}')\n elif isinstance(member.type, AbstractSequence):\n # finalize the dynamic array\n lines.append('%s__fini(&msg->%s);' % (idl_type_to_c(member.type), member.name))\n elif not isinstance(member.type, BasicType):\n # finalize non-array sub messages and strings\n lines.append('%s__fini(&msg->%s);' % (basetype_to_c(member.type), member.name))\nfor line in lines:\n print(' ' + line)\n}@\n}\n\n@(message_typename) *\n@(message_typename)__create()\n{\n @(message_typename) * msg = (@(message_typename) *)malloc(sizeof(@(message_typename)));\n if (!msg) {\n return NULL;\n }\n memset(msg, 0, sizeof(@(message_typename)));\n bool success = @(message_typename)__init(msg);\n if (!success) {\n free(msg);\n return NULL;\n }\n return msg;\n}\n\nvoid\n@(message_typename)__destroy(@(message_typename) * msg)\n{\n if (msg) {\n @(message_typename)__fini(msg);\n }\n free(msg);\n}\n\n\n@#######################################################################\n@# array functions\n@#######################################################################\nbool\n@(array_typename)__init(@(array_typename) * array, size_t size)\n{\n if (!array) {\n return false;\n }\n @(message_typename) * data = NULL;\n if (size) {\n data = (@(message_typename) *)calloc(size, sizeof(@(message_typename)));\n if (!data) {\n return false;\n }\n \/\/ initialize all array elements\n size_t i;\n for (i = 0; i < size; ++i) {\n bool success = @(message_typename)__init(&data[i]);\n if (!success) {\n break;\n }\n }\n if (i < size) {\n \/\/ if initialization failed finalize the already initialized array elements\n for (; i > 0; --i) {\n @(message_typename)__fini(&data[i - 1]);\n }\n free(data);\n return false;\n }\n }\n array->data = data;\n array->size = size;\n array->capacity = size;\n return true;\n}\n\nvoid\n@(array_typename)__fini(@(array_typename) * array)\n{\n if (!array) {\n return;\n }\n if (array->data) {\n \/\/ ensure that data and capacity values are consistent\n assert(array->capacity > 0);\n \/\/ finalize all array elements\n for (size_t i = 0; i < array->capacity; ++i) {\n @(message_typename)__fini(&array->data[i]);\n }\n free(array->data);\n array->data = NULL;\n array->size = 0;\n array->capacity = 0;\n } else {\n \/\/ ensure that data, size, and capacity values are consistent\n assert(0 == array->size);\n assert(0 == array->capacity);\n }\n}\n\n@(array_typename) *\n@(array_typename)__create(size_t size)\n{\n @(array_typename) * array = (@(array_typename) *)malloc(sizeof(@(array_typename)));\n if (!array) {\n return NULL;\n }\n bool success = @(array_typename)__init(array, size);\n if (!success) {\n free(array);\n return NULL;\n }\n return array;\n}\n\nvoid\n@(array_typename)__destroy(@(array_typename) * array)\n{\n if (array) {\n @(array_typename)__fini(array);\n }\n free(array);\n}\n","old_contents":"@# Included from rosidl_generator_c\/resource\/idl__functions.c.em\n@{\nfrom ast import literal_eval\nfrom rosidl_parser.definition import AbstractNestedType\nfrom rosidl_parser.definition import AbstractSequence\nfrom rosidl_parser.definition import AbstractString\nfrom rosidl_parser.definition import AbstractWString\nfrom rosidl_parser.definition import Array\nfrom rosidl_parser.definition import BasicType\nfrom rosidl_parser.definition import AbstractGenericString\nfrom rosidl_parser.definition import NamespacedType\nfrom rosidl_generator_c import basetype_to_c\nfrom rosidl_generator_c import idl_structure_type_sequence_to_c_typename\nfrom rosidl_generator_c import idl_structure_type_to_c_include_prefix\nfrom rosidl_generator_c import idl_structure_type_to_c_typename\nfrom rosidl_generator_c import idl_type_to_c\nfrom rosidl_generator_c import interface_path_to_string\nfrom rosidl_generator_c import value_to_c\n\nmessage_typename = idl_structure_type_to_c_typename(message.structure.namespaced_type)\narray_typename = idl_structure_type_sequence_to_c_typename(\n message.structure.namespaced_type)\n}@\n@#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n@# Collect necessary include directives for all members\n@{\nfrom collections import OrderedDict\nincludes = OrderedDict()\nfor member in message.structure.members:\n if isinstance(member.type, AbstractSequence) and isinstance(member.type.value_type, BasicType):\n member_names = includes.setdefault(\n 'rosidl_generator_c\/primitives_sequence_functions.h', [])\n member_names.append(member.name)\n continue\n type_ = member.type\n if isinstance(type_, AbstractNestedType):\n type_ = type_.value_type\n if isinstance(type_, AbstractString):\n member_names = includes.setdefault('rosidl_generator_c\/string_functions.h', [])\n member_names.append(member.name)\n elif isinstance(type_, AbstractWString):\n member_names = includes.setdefault(\n 'rosidl_generator_c\/u16string_functions.h', [])\n member_names.append(member.name)\n elif isinstance(type_, NamespacedType):\n include_prefix = idl_structure_type_to_c_include_prefix(type_)\n if include_prefix.endswith('__request'):\n include_prefix = include_prefix[:-9]\n elif include_prefix.endswith('__response'):\n include_prefix = include_prefix[:-10]\n if include_prefix.endswith('__goal'):\n include_prefix = include_prefix[:-6]\n elif include_prefix.endswith('__result'):\n include_prefix = include_prefix[:-8]\n elif include_prefix.endswith('__feedback'):\n include_prefix = include_prefix[:-10]\n member_names = includes.setdefault(\n include_prefix + '__functions.h', [])\n member_names.append(member.name)\n}@\n@#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n@\n@#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n@[if includes]@\n\n\/\/ Include directives for member types\n@[ for header_file, member_names in includes.items()]@\n@[ for member_name in member_names]@\n\/\/ Member `@(member_name)`\n@[ end for]@\n@[ if header_file in include_directives]@\n\/\/ already included above\n\/\/ @\n@[ else]@\n@{include_directives.add(header_file)}@\n@[ end if]@\n#include \"@(header_file)\"\n@[ end for]@\n@[end if]@\n@#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n@#######################################################################\n@# message functions\n@#######################################################################\nbool\n@(message_typename)__init(@(message_typename) * msg)\n{\n if (!msg) {\n return false;\n }\n@{\nlabel_prefix = 'abort_init_'\nlast_label_index = 0\nlines = []\nabort_lines = []\nfor member in message.structure.members:\n lines.append('\/\/ ' + member.name)\n if isinstance(member.type, Array):\n if isinstance(member.type.value_type, BasicType):\n if member.has_annotation('default'):\n # set default value for each array element\n for i, default_value in enumerate(literal_eval(member.get_annotation_value('default')['value'])):\n lines.append('msg->%s[%d] = %s;' % (member.name, i, value_to_c(member.type.value_type, default_value)))\n elif isinstance(member.type.value_type, (AbstractGenericString, NamespacedType)):\n # initialize each array element\n lines.append('for (size_t i = 0; i < %d; ++i) {' % member.type.size)\n lines.append(' if (!%s__init(&msg->%s[i])) {' % (basetype_to_c(member.type.value_type), member.name))\n lines.append(' %s__destroy(msg);' % message_typename)\n lines.append(' return false;')\n lines.append(' }')\n lines.append('}')\n\n if member.has_annotation('default'):\n for i, default_value in enumerate(literal_eval(member.get_annotation_value('default')['value'])):\n if isinstance(member.type.value_type, AbstractGenericString):\n lines.append('{')\n lines.append(\n ' bool success = %s__assign(&msg->%s[%d], %s);' % \\\n (basetype_to_c(member.type.value_type), member.name, i, value_to_c(member.type.value_type, default_value)))\n lines.append(' if (!success) {')\n lines.append(' goto %s%s;' % (label_prefix, last_label_index))\n abort_lines[0:0] = [\n ' %s__fini(&msg->%s[%d]);' % (basetype_to_c(member.type.value_type), member.name, i),\n '%s%d:' % (label_prefix, last_label_index),\n ]\n last_label_index += 1\n lines.append(' }')\n lines.append('}')\n\n elif isinstance(member.type, AbstractSequence):\n if not member.has_annotation('default'):\n # initialize the dynamic array with a capacity of zero\n lines.append('if (!%s__init(&msg->%s, 0)) {' % (idl_type_to_c(member.type), member.name))\n lines.append(' %s__destroy(msg);' % message_typename)\n lines.append(' return false;')\n lines.append('}')\n else:\n # initialize the dynamic array with the number of default values\n lines.append('{')\n lines.append(' bool success = %s__init(&msg->%s, %d);' % (idl_type_to_c(member.type), member.name, len(literal_eval(member.get_annotation_value('default')['value']))))\n lines.append(' if (!success) {')\n lines.append(' goto %s%d;' % (label_prefix, last_label_index))\n abort_lines[0:0] = [\n ' %s__fini(&msg->%s);' % (idl_type_to_c(member.type), member.name),\n '%s%d:' % (label_prefix, last_label_index),\n ]\n last_label_index += 1\n lines.append(' }')\n lines.append('}')\n # set default value for each array element\n for i, default_value in enumerate(literal_eval(member.get_annotation_value('default')['value'])):\n if isinstance(member.type.value_type, AbstractGenericString):\n lines.append('{')\n lines.append(\n ' bool success = %s__assign(&msg->%s.data[%d], %s);' % \\\n (basetype_to_c(member.type.value_type), member.name, i, value_to_c(member.type.value_type, default_value)))\n lines.append(' if (!success) {')\n lines.append(' goto %s%s;' % (label_prefix, last_label_index))\n abort_lines[0:0] = [\n ' %s__fini(&msg->%s.data[%d]);' % (basetype_to_c(member.type.value_type), member.name, i),\n '%s%d:' % (label_prefix, last_label_index),\n ]\n last_label_index += 1\n lines.append(' }')\n lines.append('}')\n else:\n lines.append('msg->%s.data[%d] = %s;' % (member.name, i, value_to_c(member.type.value_type, default_value)))\n\n elif isinstance(member.type, NamespacedType):\n # initialize the sub message\n lines.append('if (!%s__init(&msg->%s)) {' % (basetype_to_c(member.type), member.name))\n lines.append(' %s__destroy(msg);' % message_typename)\n lines.append(' return false;')\n lines.append('}')\n # no default value for nested messages yet\n\n elif isinstance(member.type, AbstractGenericString):\n lines.append('if (!%s__init(&msg->%s)) {' % (basetype_to_c(member.type), member.name))\n lines.append(' %s__destroy(msg);' % message_typename)\n lines.append(' return false;')\n lines.append('}')\n if member.has_annotation('default'):\n lines.append('{')\n lines.append(\n ' bool success = %s__assign(&msg->%s, %s);' % (\n basetype_to_c(member.type), member.name,\n value_to_c(member.type, member.get_annotation_value('default')['value'])))\n lines.append(' if (!success) {')\n lines.append(' goto %s%s;' % (label_prefix, last_label_index))\n abort_lines[0:0] = [\n ' %s__fini(&msg->%s);' % (basetype_to_c(member.type), member.name),\n '%s%d:' % (label_prefix, last_label_index),\n ]\n last_label_index += 1\n lines.append(' }')\n lines.append('}')\n elif isinstance(member.type, BasicType):\n if member.has_annotation('default'):\n # set default value of primitive type\n lines.append('msg->%s = %s;' % (member.name, value_to_c(member.type, member.get_annotation_value('default')['value'])))\n\nfor line in lines:\n print(' ' + line)\n}@\n return true;\n@{\nif abort_lines:\n # remove lines before the first label since they are unreachable\n while not abort_lines[0].startswith(label_prefix):\n abort_lines.pop(0)\n for line in abort_lines:\n print(line)\n print(' return false;')\n}@\n}\n\nvoid\n@(message_typename)__fini(@(message_typename) * msg)\n{\n if (!msg) {\n return;\n }\n@{\nlines = []\nfor member in message.structure.members:\n lines.append('\/\/ ' + member.name)\n if isinstance(member.type, Array):\n if isinstance(member.type.value_type, (AbstractGenericString, NamespacedType)):\n lines.append('for (size_t i = 0; i < %d; ++i) {' % member.type.size)\n # initialize each array element\n lines.append(' %s__fini(&msg->%s[i]);' % (basetype_to_c(member.type.value_type), member.name))\n lines.append('}')\n elif isinstance(member.type, AbstractSequence):\n # finalize the dynamic array\n lines.append('%s__fini(&msg->%s);' % (idl_type_to_c(member.type), member.name))\n elif not isinstance(member.type, BasicType):\n # finalize non-array sub messages and strings\n lines.append('%s__fini(&msg->%s);' % (basetype_to_c(member.type), member.name))\nfor line in lines:\n print(' ' + line)\n}@\n}\n\n@(message_typename) *\n@(message_typename)__create()\n{\n @(message_typename) * msg = (@(message_typename) *)malloc(sizeof(@(message_typename)));\n if (!msg) {\n return NULL;\n }\n memset(msg, 0, sizeof(@(message_typename)));\n bool success = @(message_typename)__init(msg);\n if (!success) {\n free(msg);\n return NULL;\n }\n return msg;\n}\n\nvoid\n@(message_typename)__destroy(@(message_typename) * msg)\n{\n if (msg) {\n @(message_typename)__fini(msg);\n }\n free(msg);\n}\n\n\n@#######################################################################\n@# array functions\n@#######################################################################\nbool\n@(array_typename)__init(@(array_typename) * array, size_t size)\n{\n if (!array) {\n return false;\n }\n @(message_typename) * data = NULL;\n if (size) {\n data = (@(message_typename) *)calloc(size, sizeof(@(message_typename)));\n if (!data) {\n return false;\n }\n \/\/ initialize all array elements\n size_t i;\n for (i = 0; i < size; ++i) {\n bool success = @(message_typename)__init(&data[i]);\n if (!success) {\n break;\n }\n }\n if (i < size) {\n \/\/ if initialization failed finalize the already initialized array elements\n for (; i > 0; --i) {\n @(message_typename)__fini(&data[i - 1]);\n }\n free(data);\n return false;\n }\n }\n array->data = data;\n array->size = size;\n array->capacity = size;\n return true;\n}\n\nvoid\n@(array_typename)__fini(@(array_typename) * array)\n{\n if (!array) {\n return;\n }\n if (array->data) {\n \/\/ ensure that data and capacity values are consistent\n assert(array->capacity > 0);\n \/\/ finalize all array elements\n for (size_t i = 0; i < array->capacity; ++i) {\n @(message_typename)__fini(&array->data[i]);\n }\n free(array->data);\n array->data = NULL;\n array->size = 0;\n array->capacity = 0;\n } else {\n \/\/ ensure that data, size, and capacity values are consistent\n assert(0 == array->size);\n assert(0 == array->capacity);\n }\n}\n\n@(array_typename) *\n@(array_typename)__create(size_t size)\n{\n @(array_typename) * array = (@(array_typename) *)malloc(sizeof(@(array_typename)));\n if (!array) {\n return NULL;\n }\n bool success = @(array_typename)__init(array, size);\n if (!success) {\n free(array);\n return NULL;\n }\n return array;\n}\n\nvoid\n@(array_typename)__destroy(@(array_typename) * array)\n{\n if (array) {\n @(array_typename)__fini(array);\n }\n free(array);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"ff6d1bdd33587617a85b1d6472eb029e863c64e6","subject":"Delete test_code.em","message":"Delete test_code.em","repos":"hookoored\/Emalplip","old_file":"test_code.em","new_file":"test_code.em","new_contents":"","old_contents":"deffunc int square(number):\r\n\n return power number 2\r\n\n end","returncode":0,"stderr":"","license":"mit","lang":"EmberScript"} {"commit":"946f12f218e510b8f74d79c424347a8846d67a46","subject":"Update subversion plugin to version 2.13.1","message":"Update subversion plugin to version 2.13.1\n","repos":"ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm","old_file":"ros_buildfarm\/templates\/snippet\/scm_svn.xml.em","new_file":"ros_buildfarm\/templates\/snippet\/scm_svn.xml.em","new_contents":"\n \n \n @ESCAPE(remote)<\/remote>\n@[if local]@\n @ESCAPE(local)<\/local>\n@[end if]@\n infinity<\/depthOption>\n false<\/ignoreExternalsOption>\n <\/hudson.scm.SubversionSCM_-ModuleLocation>\n <\/locations>\n \n \n \n \n \n \n false<\/ignoreDirPropChanges>\n false<\/filterChangelog>\n<\/scm>\n","old_contents":"\n \n \n @ESCAPE(remote)<\/remote>\n@[if local]@\n @ESCAPE(local)<\/local>\n@[end if]@\n infinity<\/depthOption>\n false<\/ignoreExternalsOption>\n <\/hudson.scm.SubversionSCM_-ModuleLocation>\n <\/locations>\n \n \n \n \n \n \n false<\/ignoreDirPropChanges>\n false<\/filterChangelog>\n<\/scm>\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"7a83e2f812be94d2652aca0526872501209880ec","subject":"More toolbox cleanups","message":"More toolbox cleanups\n","repos":"i5o\/sugar-artwork,tchx84\/debian-pkg-sugar-artwork,gusDuarte\/sugar-artwork,tchx84\/debian-pkg-sugar-artwork,gusDuarte\/sugar-artwork,sugarlabs\/sugar-artwork,gusDuarte\/sugar-artwork,godiard\/sugar-artwork,samdroid-apps\/sugar-artwork,i5o\/sugar-artwork,ceibal-tatu\/sugar-artwork,samdroid-apps\/sugar-artwork,gusDuarte\/sugar-artwork,i5o\/sugar-artwork,godiard\/sugar-artwork,ceibal-tatu\/sugar-artwork,godiard\/sugar-artwork,samdroid-apps\/sugar-artwork,tchx84\/debian-pkg-sugar-artwork,sugarlabs\/sugar-artwork,sugarlabs\/sugar-artwork,ceibal-tatu\/sugar-artwork","old_file":"gtk\/theme\/gtkrc.em","new_file":"gtk\/theme\/gtkrc.em","new_contents":"${\nimport math\n\ndef my_floor(num):\n return int(math.floor(num))\n\ndef my_ceil(num):\n return int(math.ceil(num))\n\n\n# Should we set the line width in the engine to 2.25, and draw non pixel aligned lines?\n# Are these already the correct sizes for the XO?\n\n# These sizes need to be sanity checked ...\nif theme == \"sugar-xo\":\n xo = True\n line_width = 2.25 # 2.25\n thick_line_width = 3.5 # 3.5\n subcell_size = 15\n bullet_size = 9.5\n font_height = 24\nelse: # About 50% smaller\n xo = False\n line_width = 1.125\n thick_line_width = 1.75\n subcell_size = 7\n bullet_size = 5\n font_height = 12\n\n\nradio_size = my_floor(subcell_size + bullet_size + line_width)\nscale_slider_width = my_floor(2 * subcell_size + line_width)\nthickness = my_ceil(line_width)\n\n}\nstyle \"default\"\n{\n # Will be overriden in some widgets\n color[\"focus_line\"] = \"#FFFFFF\"\n\n bg[NORMAL] = \"#808080\"\n bg[PRELIGHT] = \"#808080\"\n bg[ACTIVE] = \"#ffffff\"\n bg[SELECTED] = \"#e7e7e7\"\n\n fg[NORMAL] = \"#000000\"\n fg[ACTIVE] = \"#000000\"\n fg[SELECTED] = \"#ffffff\"\n fg[PRELIGHT] = \"#ffffff\"\n\n text[NORMAL] = \"#000000\" # \"#7f7f7f\" 1. need to patch GTK+ to use ACTIVE when focused, 2. what color should this really be?\n text[ACTIVE] = \"#000000\"\n text[SELECTED] = \"#000000\"\n text[PRELIGHT] = \"#000000\"\n\n base[NORMAL] = \"#E6E6E6\"\n base[ACTIVE] = \"#ffffff\"\n base[SELECTED] = \"#a6a6a6\"\n base[PRELIGHT] = \"#ffffff\"\n\n fg[INSENSITIVE] = \"#808080\"\n text[INSENSITIVE] = \"#808080\"\n\n xthickness = $thickness\n ythickness = $thickness\n\n # A lot of these will probably need to be changed, but this has to\n # be done when the exact sizes are known\n GtkWidget::interior-focus = 0\n GtkWidget::focus-line-width = 1 # This does not do anything really\n GtkWidget::focus-padding = 0\n # 0.05 works good for both the sugar and sugar-xo themes\n GtkWidget::cursor-aspect-ratio = 0.05\n\n GtkWidget::wide-separators = 0\n GtkWidget::separator-height = $thickness\n GtkWidget::separator-width = $thickness\n\n GtkRange::activate-slider = 1\n GtkButton::inner-border = { 6, 6, 6, 6 } # ??\n\n GtkButton::default-border = { 1, 1, 1, 1 } # line_width - focus-line-width\n GtkButton::default-outside-border = { 2, 2, 2, 2 } # focus-line-width\n\n GtkScrolledWindow::scrollbar-spacing = 0\n\n GtkExpander::expander-size = 24\n GtkExpander::expander-spacing = 2 # XXX\n\n GtkTreeView::expander-size = 24\n \n GtkArrow::arrow-size = 1.0\n\n GtkToolbar::shadow-type = GTK_SHADOW_NONE\n\n engine \"sugar\" {\n # Is this correct? Should we make sure it is pixel aligned?\n # 6 pixel for the XO version, and 3 for the \"normal\" one\n line_width = $line_width\n # 9-10 pixel for the XO version, and 4 for the \"normal\" one\n thick_line_width = $thick_line_width\n\n max_radius = $( xo ? 25 : 15)\n }\n}\n\nstyle \"window-content\"\n{\n color[\"bg_color\"] = \"#C0C0C0\"\n\n bg[INSENSITIVE] = @bg_color\n base[INSENSITIVE] = @bg_color\n}\n\nstyle \"window\"\n{\n color[\"bg_color\"] = \"#C0C0C0\"\n\n bg[NORMAL] = @bg_color\n}\n\nstyle \"scrollbar\"\n{\n GtkRange::slider-width = 16 # ?\n GtkRange::trough-border = 0\n GtkRange::stepper-spacing = 0\n GtkScrollbar::min-slider-length = 30 # ?\n GtkScrollbar::has-forward-stepper = 0\n GtkScrollbar::has-backward-stepper = 0\n GtkScrollbar::has-secondary-forward-stepper = 0\n GtkScrollbar::has-secondary-backward-stepper = 0\n\n # Hack for mozilla as it does not obey the above style properties ...\n # Really, mozilla should be fixed ...\n GtkRange::stepper-size = 1\n\n engine \"sugar\" {\n hint = \"scrollbar\"\n scrollbar_border = 3\n }\n}\n\nstyle \"scale\"\n{\n GtkWidget::focus-line-width = 0\n\n # \"square\" slider (really round of course)\n # Same as indicator-size?\n GtkRange::slider-width = $scale_slider_width\n GtkScale::slider-length = $scale_slider_width\n GtkRange::trough-border = 0\n GtkRange::stepper-spacing = 0\n GtkRange::trough-side-details = 1\n}\n\n# hints for the trough sizing hacks\nstyle \"hscale\" = \"scale\"\n{\n engine \"sugar\" {\n hint = \"hscale\"\n }\n}\n\nstyle \"vscale\" = \"scale\"\n{\n engine \"sugar\" {\n hint = \"vscale\"\n }\n}\n\nstyle \"spinbutton\"\n{\n fg[NORMAL] = \"#ffffff\"\n engine \"sugar\" {\n hint = \"spinbutton\"\n }\n}\n\nstyle \"comboboxentry\"\n{\n # Copied from the \"default\" style. Part of the workaround for bug #382646.\n text[NORMAL] = \"#000000\"\n text[ACTIVE] = \"#000000\"\n text[SELECTED] = \"#000000\"\n text[PRELIGHT] = \"#000000\"\n\n engine \"sugar\" {\n hint = \"comboboxentry\"\n }\n}\n\n\nstyle \"frame\"\n{\n bg[NORMAL] = \"#404040\"\n}\n\nstyle \"notebook\"\n{\n GtkNotebook::tab-overlap = -2\n \n xthickness = 0\n ythickness = 0\n\n bg[ACTIVE] = \"#808080\"\n}\n\nstyle \"toolbutton\"\n{\n color[\"focus_line\"] = \"#000000\"\n\n #bg[NORMAL] = \"#404040\"\n bg[PRELIGHT] = \"#000000\"\n bg[ACTIVE] = \"#808080\"\n\n fg[NORMAL] = \"#FFFFFF\"\n fg[ACTIVE] = \"#FFFFFF\"\n fg[PRELIGHT] = \"#ffffff\"\n\n engine \"sugar\" {\n max_radius = 5.0\n }\n}\n\nstyle \"toolbox\"\n{\n color[\"bg_color\"] = \"#404040\"\n\n fg[NORMAL] = \"#FFFFFF\"\n fg[ACTIVE] = \"#FFFFFF\"\n\n bg[NORMAL] = @bg_color\n}\n\nstyle \"panel\"\n{\n bg[NORMAL] = \"#C0C0C0\"\n fg[NORMAL] = \"#000000\"\n}\n\nstyle \"entry\"\n{\n # small inner border and a large x\/ythickness for entries\n # to reduce the number of hacks needed :-)\n xthickness = $(thickness*3)\n ythickness = $(thickness*3)\n\n # This tries to get a height of exactly 45 pixel for the entry.\n GtkEntry::inner-border = { $(subcell_size - thickness*3), $(subcell_size - thickness*3),\n $(my_floor((3*subcell_size - font_height - thickness*3*2)\/2)), $(my_ceil((3*subcell_size - font_height - thickness*3*2)\/2)) }\n\n GtkWidget::focus-line-width = 0\n}\n\nstyle \"button\"\n{\n fg[NORMAL] = \"#ffffff\"\n}\n\nstyle \"combobox\"\n{\n # Work around GTK+ bug #382646\n text[NORMAL] = \"#FFFFFF\"\n text[ACTIVE] = \"#FFFFFF\"\n text[PRELIGHT] = \"#ffffff\"\n}\n\nstyle \"checkbutton\"\n{\n fg[NORMAL] = \"#000000\"\n fg[PRELIGHT] = \"#000000\"\n fg[ACTIVE] = \"#000000\"\n \n base[NORMAL] = \"#ffffff\"\n base[PRELIGHT] = \"#ffffff\"\n base[ACTIVE] = \"#E6E6E6\"\n\n text[PRELIGHT] = \"#5d5d5d\"\n text[NORMAL] = \"#5d5d5d\"\n text[ACTIVE] = \"#5d5d5d\"\n\n # I won't get the exact sizing, but this should be pretty close\n GtkCheckButton::indicator-size = $radio_size\n GtkCheckButton::indicator-spacing = 3\n GtkWidget::focus-padding = 3\n}\n\nstyle \"progressbar\"\n{\n xthickness = 0\n ythickness = 0\n\n # Make the bar visible (only until the engine implements it!)\n bg[PRELIGHT] = \"#ffffff\"\n}\n\nstyle \"menu\"\n{\n color[\"bg_color\"] = \"#000000\"\n\n fg[NORMAL] = \"#ffffff\"\n fg[PRELIGHT] = \"#ffffff\"\n bg[NORMAL] = \"#808080\"\n \n # The following colors are for the check and radio menu items\n base[NORMAL] = \"#ffffff\"\n base[PRELIGHT] = \"#ffffff\"\n base[ACTIVE] = \"#E6E6E6\"\n\n text[PRELIGHT] = \"#5d5d5d\"\n text[NORMAL] = \"#5d5d5d\"\n text[ACTIVE] = \"#5d5d5d\"\n \n GtkMenu::horizontal-padding = 0\n GtkMenu::vertical-padding = 0\n\n xthickness = 0\n ythickness = 0\n}\n\nstyle \"menuitem\"\n{\n GtkCheckMenuItem::indicator-size = $radio_size\n\n bg[PRELIGHT] = \"#808080\"\n\n # For check\/radio menu items\n text[NORMAL] = \"#FFFFFF\"\n text[PRELIGHT] = \"#FFFFFF\"\n\n GtkMenuItem::horizontal-padding = $line_width\n xthickness = $(my_ceil(line_width * 2))\n ythickness = $thickness\n}\n\nstyle \"separatormenuitem\"\n{\n GtkMenuItem::horizontal-padding = 0\n xthickness = 0\n}\n\n\nclass \"GtkWidget\" style \"default\"\nclass \"GtkWindow\" style \"window\"\nclass \"GtkEventBox\" style \"window\"\nclass \"GtkNotebook\" style \"notebook\"\nclass \"GtkEntry\" style \"entry\"\nclass \"GtkSpinButton\" style \"spinbutton\"\nclass \"GtkScrollbar\" style \"scrollbar\"\nclass \"GtkHScale\" style \"hscale\"\nclass \"GtkVScale\" style \"vscale\"\nclass \"GtkProgressBar\" style \"progressbar\"\n\nwidget_class \".*\" style \"window-content\"\n\nwidget_class \"**\" style \"toolbox\"\nwidget_class \"**\" style \"toolbutton\"\n\nwidget_class \"**\" style \"menu\"\nwidget_class \"**\" style \"menuitem\"\nwidget_class \"**\" style \"menuitem\"\n\nwidget_class \"**\" style \"combobox\"\nwidget_class \"**\" style \"comboboxentry\"\nwidget_class \"**\" style \"comboboxentry\"\nwidget_class \"**\" style \"button\"\nwidget_class \"**\" style \"checkbutton\"\n\nwidget_class \"*\" style \"panel\"\n\nwidget_class \"**\" style \"frame\"\n","old_contents":"${\nimport math\n\ndef my_floor(num):\n return int(math.floor(num))\n\ndef my_ceil(num):\n return int(math.ceil(num))\n\n\n# Should we set the line width in the engine to 2.25, and draw non pixel aligned lines?\n# Are these already the correct sizes for the XO?\n\n# These sizes need to be sanity checked ...\nif theme == \"sugar-xo\":\n xo = True\n line_width = 2.25 # 2.25\n thick_line_width = 3.5 # 3.5\n subcell_size = 15\n bullet_size = 9.5\n font_height = 24\nelse: # About 50% smaller\n xo = False\n line_width = 1.125\n thick_line_width = 1.75\n subcell_size = 7\n bullet_size = 5\n font_height = 12\n\n\nradio_size = my_floor(subcell_size + bullet_size + line_width)\nscale_slider_width = my_floor(2 * subcell_size + line_width)\nthickness = my_ceil(line_width)\n\n}\nstyle \"default\"\n{\n # Will be overriden in some widgets\n color[\"focus_line\"] = \"#FFFFFF\"\n\n bg[NORMAL] = \"#808080\"\n bg[PRELIGHT] = \"#808080\"\n bg[ACTIVE] = \"#ffffff\"\n bg[SELECTED] = \"#e7e7e7\"\n\n fg[NORMAL] = \"#000000\"\n fg[ACTIVE] = \"#000000\"\n fg[SELECTED] = \"#ffffff\"\n fg[PRELIGHT] = \"#ffffff\"\n\n text[NORMAL] = \"#000000\" # \"#7f7f7f\" 1. need to patch GTK+ to use ACTIVE when focused, 2. what color should this really be?\n text[ACTIVE] = \"#000000\"\n text[SELECTED] = \"#000000\"\n text[PRELIGHT] = \"#000000\"\n\n base[NORMAL] = \"#E6E6E6\"\n base[ACTIVE] = \"#ffffff\"\n base[SELECTED] = \"#a6a6a6\"\n base[PRELIGHT] = \"#ffffff\"\n\n fg[INSENSITIVE] = \"#808080\"\n text[INSENSITIVE] = \"#808080\"\n\n xthickness = $thickness\n ythickness = $thickness\n\n # A lot of these will probably need to be changed, but this has to\n # be done when the exact sizes are known\n GtkWidget::interior-focus = 0\n GtkWidget::focus-line-width = 1 # This does not do anything really\n GtkWidget::focus-padding = 0\n # 0.05 works good for both the sugar and sugar-xo themes\n GtkWidget::cursor-aspect-ratio = 0.05\n\n GtkWidget::wide-separators = 0\n GtkWidget::separator-height = $thickness\n GtkWidget::separator-width = $thickness\n\n GtkRange::activate-slider = 1\n GtkButton::inner-border = { 6, 6, 6, 6 } # ??\n\n GtkButton::default-border = { 1, 1, 1, 1 } # line_width - focus-line-width\n GtkButton::default-outside-border = { 2, 2, 2, 2 } # focus-line-width\n\n GtkScrolledWindow::scrollbar-spacing = 0\n\n GtkExpander::expander-size = 24\n GtkExpander::expander-spacing = 2 # XXX\n\n GtkTreeView::expander-size = 24\n \n GtkArrow::arrow-size = 1.0\n\n GtkToolbar::shadow-type = GTK_SHADOW_NONE\n\n engine \"sugar\" {\n # Is this correct? Should we make sure it is pixel aligned?\n # 6 pixel for the XO version, and 3 for the \"normal\" one\n line_width = $line_width\n # 9-10 pixel for the XO version, and 4 for the \"normal\" one\n thick_line_width = $thick_line_width\n\n max_radius = $( xo ? 25 : 15)\n }\n}\n\nstyle \"window-content\"\n{\n color[\"bg_color\"] = \"#C0C0C0\"\n\n bg[INSENSITIVE] = @bg_color\n base[INSENSITIVE] = @bg_color\n}\n\nstyle \"window\"\n{\n color[\"bg_color\"] = \"#C0C0C0\"\n\n bg[NORMAL] = @bg_color\n}\n\nstyle \"scrollbar\"\n{\n GtkRange::slider-width = 16 # ?\n GtkRange::trough-border = 0\n GtkRange::stepper-spacing = 0\n GtkScrollbar::min-slider-length = 30 # ?\n GtkScrollbar::has-forward-stepper = 0\n GtkScrollbar::has-backward-stepper = 0\n GtkScrollbar::has-secondary-forward-stepper = 0\n GtkScrollbar::has-secondary-backward-stepper = 0\n\n # Hack for mozilla as it does not obey the above style properties ...\n # Really, mozilla should be fixed ...\n GtkRange::stepper-size = 1\n\n engine \"sugar\" {\n hint = \"scrollbar\"\n scrollbar_border = 3\n }\n}\n\nstyle \"scale\"\n{\n GtkWidget::focus-line-width = 0\n\n # \"square\" slider (really round of course)\n # Same as indicator-size?\n GtkRange::slider-width = $scale_slider_width\n GtkScale::slider-length = $scale_slider_width\n GtkRange::trough-border = 0\n GtkRange::stepper-spacing = 0\n GtkRange::trough-side-details = 1\n}\n\n# hints for the trough sizing hacks\nstyle \"hscale\" = \"scale\"\n{\n engine \"sugar\" {\n hint = \"hscale\"\n }\n}\n\nstyle \"vscale\" = \"scale\"\n{\n engine \"sugar\" {\n hint = \"vscale\"\n }\n}\n\nstyle \"spinbutton\"\n{\n fg[NORMAL] = \"#ffffff\"\n engine \"sugar\" {\n hint = \"spinbutton\"\n }\n}\n\nstyle \"comboboxentry\"\n{\n # Copied from the \"default\" style. Part of the workaround for bug #382646.\n text[NORMAL] = \"#000000\"\n text[ACTIVE] = \"#000000\"\n text[SELECTED] = \"#000000\"\n text[PRELIGHT] = \"#000000\"\n\n engine \"sugar\" {\n hint = \"comboboxentry\"\n }\n}\n\n\nstyle \"frame\"\n{\n bg[NORMAL] = \"#404040\"\n}\n\nstyle \"notebook\"\n{\n GtkNotebook::tab-overlap = -2\n \n xthickness = 0\n ythickness = 0\n\n bg[ACTIVE] = \"#808080\"\n}\n\nstyle \"toolbutton\"\n{\n color[\"focus_line\"] = \"#000000\"\n\n #bg[NORMAL] = \"#404040\"\n bg[PRELIGHT] = \"#000000\"\n bg[ACTIVE] = \"#808080\"\n\n fg[NORMAL] = \"#FFFFFF\"\n fg[ACTIVE] = \"#FFFFFF\"\n fg[PRELIGHT] = \"#ffffff\"\n\n engine \"sugar\" {\n max_radius = 5.0\n }\n}\n\nstyle \"toolbox\"\n{\n color[\"bg_color\"] = \"#404040\"\n\n fg[NORMAL] = \"#FFFFFF\"\n fg[ACTIVE] = \"#FFFFFF\"\n\n bg[NORMAL] = @bg_color\n}\n\nstyle \"panel\"\n{\n bg[NORMAL] = \"#C0C0C0\"\n fg[NORMAL] = \"#000000\"\n}\n\nstyle \"entry\"\n{\n # small inner border and a large x\/ythickness for entries\n # to reduce the number of hacks needed :-)\n xthickness = $(thickness*3)\n ythickness = $(thickness*3)\n\n # This tries to get a height of exactly 45 pixel for the entry.\n GtkEntry::inner-border = { $(subcell_size - thickness*3), $(subcell_size - thickness*3),\n $(my_floor((3*subcell_size - font_height - thickness*3*2)\/2)), $(my_ceil((3*subcell_size - font_height - thickness*3*2)\/2)) }\n\n GtkWidget::focus-line-width = 0\n}\n\nstyle \"button\"\n{\n fg[NORMAL] = \"#ffffff\"\n}\n\nstyle \"combobox\"\n{\n # Work around GTK+ bug #382646\n text[NORMAL] = \"#FFFFFF\"\n text[ACTIVE] = \"#FFFFFF\"\n text[PRELIGHT] = \"#ffffff\"\n}\n\nstyle \"checkbutton\"\n{\n fg[NORMAL] = \"#000000\"\n fg[PRELIGHT] = \"#000000\"\n fg[ACTIVE] = \"#000000\"\n \n base[NORMAL] = \"#ffffff\"\n base[PRELIGHT] = \"#ffffff\"\n base[ACTIVE] = \"#E6E6E6\"\n\n text[PRELIGHT] = \"#5d5d5d\"\n text[NORMAL] = \"#5d5d5d\"\n text[ACTIVE] = \"#5d5d5d\"\n\n # I won't get the exact sizing, but this should be pretty close\n GtkCheckButton::indicator-size = $radio_size\n GtkCheckButton::indicator-spacing = 3\n GtkWidget::focus-padding = 3\n}\n\nstyle \"progressbar\"\n{\n xthickness = 0\n ythickness = 0\n\n # Make the bar visible (only until the engine implements it!)\n bg[PRELIGHT] = \"#ffffff\"\n}\n\nstyle \"menu\"\n{\n color[\"bg_color\"] = \"#000000\"\n\n fg[NORMAL] = \"#ffffff\"\n fg[PRELIGHT] = \"#ffffff\"\n bg[NORMAL] = \"#808080\"\n \n # The following colors are for the check and radio menu items\n base[NORMAL] = \"#ffffff\"\n base[PRELIGHT] = \"#ffffff\"\n base[ACTIVE] = \"#E6E6E6\"\n\n text[PRELIGHT] = \"#5d5d5d\"\n text[NORMAL] = \"#5d5d5d\"\n text[ACTIVE] = \"#5d5d5d\"\n \n GtkMenu::horizontal-padding = 0\n GtkMenu::vertical-padding = 0\n\n xthickness = 0\n ythickness = 0\n}\n\nstyle \"menuitem\"\n{\n GtkCheckMenuItem::indicator-size = $radio_size\n\n bg[PRELIGHT] = \"#808080\"\n\n # For check\/radio menu items\n text[NORMAL] = \"#FFFFFF\"\n text[PRELIGHT] = \"#FFFFFF\"\n\n GtkMenuItem::horizontal-padding = $line_width\n xthickness = $(my_ceil(line_width * 2))\n ythickness = $thickness\n}\n\nstyle \"separatormenuitem\"\n{\n GtkMenuItem::horizontal-padding = 0\n xthickness = 0\n}\n\n\nclass \"GtkWidget\" style \"default\"\nclass \"GtkWindow\" style \"window\"\nclass \"GtkEventBox\" style \"window\"\nclass \"GtkNotebook\" style \"notebook\"\nclass \"GtkEntry\" style \"entry\"\nclass \"GtkSpinButton\" style \"spinbutton\"\nclass \"GtkScrollbar\" style \"scrollbar\"\nclass \"GtkHScale\" style \"hscale\"\nclass \"GtkVScale\" style \"vscale\"\nclass \"GtkProgressBar\" style \"progressbar\"\n\nwidget_class \".*\" style \"window-content\"\n\nwidget_class \"**\" style \"toolbox\"\nwidget_class \"*.GtkNotebook\" style \"toolbox\"\nwidget_class \"**\" style \"toolbutton\"\n\nwidget_class \"**\" style \"menu\"\nwidget_class \"**\" style \"menuitem\"\nwidget_class \"**\" style \"menuitem\"\n\nwidget_class \"**\" style \"combobox\"\nwidget_class \"**\" style \"comboboxentry\"\nwidget_class \"**\" style \"comboboxentry\"\nwidget_class \"**\" style \"button\"\nwidget_class \"**\" style \"checkbutton\"\n\nwidget_class \"*\" style \"panel\"\n\nwidget_class \"**\" style \"frame\"\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"EmberScript"} {"commit":"e7a2f1cca54636729019f4857f91417b5a35f1e3","subject":"Before deleting example_tx.ami.em","message":"Before deleting example_tx.ami.em\n","repos":"capn-freako\/ibisami,capn-freako\/ibisami,capn-freako\/ibisami","old_file":"example\/example_tx.ami.em","new_file":"example\/example_tx.ami.em","new_contents":"(@model_name\n\n (Description \"@description\")\n\n@{\nfor (sec_name, sec_key) in [('Reserved_Parameters', 'reserved'), ('Model_Specific', 'model')]:\n print \" (%s\" % sec_name\n for param_name in ami_params[sec_key].keys():\n print \" (%s\" % param_name\n param = ami_params[sec_key][param_name]\n for (fld_name, fld_key) in [('Usage', 'usage'), ('Type', 'type'), ('Format', 'format'),\n ('Default', 'default'), ('Description', 'description'), \n ]:\n # Trap the special cases.\n if(fld_name == 'Type'):\n print \" (Type\", param_types[param['type']]['ami_type'], \")\"\n elif(fld_name == 'Default'):\n if(param['format'] == 'Value'):\n pass\n elif(fld_name == 'Format'):\n if(param['format'] == 'Value'):\n print \" (Value\", param['default'], \")\"\n else:\n print \" (%s\" % param['format'], param['default'], param['min'], param['max'], \")\"\n # Execute the default action.\n else:\n print \" (%s\" % fld_name, param[fld_key], \")\" \n\n print \" )\"\n print \" )\"\n}\n)\n\n","old_contents":"(@model_name\n\n (Description \"@description\")\n\n (Reserved_Parameters\n@{\nfor param_name in ami_params['reserved'].keys():\n param = ami_params['reserved'][param_name]\n print \" (%s\" % param_name\n print \" (Usage Info)\"\n print \" (Type\", param_types[param['type']]['ami_type'], \")\"\n print \" (Default\", param['default'], \")\"\n print ' (Description \"%s\")' % (param['description'],)\n print \" )\"\n print\n}\n )\n\n (Model_Specific\n@{\nfor param_name in ami_params['model'].keys():\n param = ami_params['model'][param_name]\n print \" (%s\" % param_name\n print \" (Usage\", param['usage'], \")\"\n print \" (Type\", param_types[param['type']]['ami_type'], \")\"\n print \" (Default\", param['default'], \")\"\n print ' (Description \"%s\")' % (param['description'],)\n print \" )\"\n print\n}\n )\n\n)\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"EmberScript"} {"commit":"b9d55ffdfba01da6d9a268d5b4e1a7a9d7fce579","subject":"process jobs in alphabetical order in generated groovy script","message":"process jobs in alphabetical order in generated groovy script\n","repos":"ruffsl\/ros_buildfarm,mistoll\/ros_buildfarm,ruffsl\/ros_buildfarm,mistoll\/ros_buildfarm,mistoll\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ruffsl\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm","old_file":"ros_buildfarm\/templates\/snippet\/reconfigure_jobs.groovy.em","new_file":"ros_buildfarm\/templates\/snippet\/reconfigure_jobs.groovy.em","new_contents":"import difflib.DiffUtils\nimport groovy.io.FileType\nimport hudson.AbortException\nimport java.io.StringBufferInputStream\nimport java.io.StringWriter\nimport javax.xml.parsers.DocumentBuilderFactory\nimport javax.xml.transform.stream.StreamSource\nimport jenkins.model.Jenkins\nimport org.apache.xml.serialize.OutputFormat\nimport org.apache.xml.serialize.XMLSerializer\n\n\/\/ job types with their prefix and a list of job names\n\/\/ used to remove obsolete jobs with the same prefix which are not part of the list\njob_prefixes_and_names = [:]\n@[for job_type in sorted(job_prefixes_and_names.keys())]@\njob_prefixes_and_names['@job_type'] = [\n 'job_prefix': '@(job_prefixes_and_names[job_type][0])',\n 'job_names': [],\n]\n@{\njob_names = sorted(job_prefixes_and_names[job_type][1])\ngroup_size = 1000\n}@\n\/\/ group job names in chunks of @group_size to not exceed groovy limits\n@[for i in range(0, len(job_names), group_size)]@\ndef add_job_prefixes_and_names_@(job_type)_@(int(i \/ group_size) + 1)(job_names) {\n@[for j in range(i, min(i + group_size, len(job_names)))]@\njob_names << '@(job_names[j])'\n@[end for]@\n}\nadd_job_prefixes_and_names_@(job_type)_@(int(i \/ group_size) + 1)(job_prefixes_and_names['@job_type'].job_names)\n@[end for]@\n@[end for]@\n\n\ndef diff_configs(current_config_file, new_config) {\n\n factory = DocumentBuilderFactory.newInstance()\n builder = factory.newDocumentBuilder()\n\n current_doc = builder.parse(current_config_file.getFile())\n\n new_config_stream = new StringBufferInputStream(new_config)\n new_doc = builder.parse(new_config_stream)\n\n \/\/ ignore description which contains a timestamp\n if (current_doc.getElementsByTagName('description')) {\n current_doc.getElementsByTagName('description').item(0).setTextContent('')\n }\n if (new_doc.getElementsByTagName('description')) {\n new_doc.getElementsByTagName('description').item(0).setTextContent('')\n }\n\n current_string = format_xml(current_doc)\n new_string = format_xml(new_doc)\n\n if (current_string == new_string) {\n return []\n }\n\n current_lines = []\n current_string.eachLine { line, count ->\n current_lines << line\n }\n new_lines = []\n new_string.eachLine { line, count ->\n new_lines << line\n }\n\n patch = DiffUtils.diff(current_lines, new_lines)\n return DiffUtils.generateUnifiedDiff('current config', 'new config', current_lines, patch, 0)\n}\n\n\ndef format_xml(doc) {\n format = new OutputFormat(doc)\n format.setIndenting(true)\n format.setIndent(2)\n writer = new StringWriter()\n serializer = new XMLSerializer(writer, format)\n serializer.serialize(doc)\n return writer.toString()\n}\n\n\n\/\/ reconfigure jobs\nprintln '# BEGIN SECTION: Groovy script - reconfigure jobs'\nprintln 'Reconfiguring @(expected_num_jobs) jobs...'\ncreated = 0\nupdated = 0\nskipped = 0\n\nconfig_dir = build.getWorkspace().toString() + '\/reconfigure_jobs\/configs'\n\ndef dir = new File(config_dir)\ndef jobs = dir.listFiles()\njobs.sort()\n\nif (jobs.size() != @(expected_num_jobs)) {\n println \"ERROR: Found different number of job configs than expected!! \" + jobs.size() + \" is not @(expected_num_jobs) as expected.\"\n \/\/ fail this build\n throw new AbortException(\"Wrong number of job configs\")\n}\n\njobs.each{\n found_project = false\n job_name = it.getName()\n job_config = new File(it.path).getText('UTF-8')\n for (p in Jenkins.instance.allItems) {\n if (p.name != job_name) continue\n found_project = true\n job_config_file = p.getConfigFile()\n\n diff = diff_configs(job_config_file, job_config)\n if (!diff) {\n println \"Skipped job '\" + job_name + \"' because the config is the same\"\n skipped += 1\n } else {\n println \"Updating job '\" + job_name + \"'\"\n println ' <<<'\n for (line in diff) {\n println ' ' + line\n }\n println ' <<<'\n\n reader = new StringReader(job_config)\n source = new StreamSource(reader)\n p.updateByXml(source)\n updated += 1\n }\n break\n }\n if (!found_project) {\n println \"Creating job '\" + job_name + \"'\"\n stream = new StringBufferInputStream(job_config)\n Jenkins.instance.createProjectFromXML(job_name, stream)\n created += 1\n }\n}\nprintln 'Created ' + created + ' jobs, updated ' + updated + ' jobs, skipped ' + skipped + ' jobs.'\nprintln '# END SECTION'\n\n\/\/ delete obsolete jobs\nfor (item in job_prefixes_and_names) {\n job_type = item.key\n job_prefix = item.value.job_prefix\n job_names = item.value.job_names\n deleted = 0\n println \"# BEGIN SECTION: Groovy script - delete obsolete '\" + job_type + \"' jobs\"\n println \"Searching for obsolete jobs starting with '\" + job_prefix + \"'\"\n for (p in Jenkins.instance.allItems) {\n if (!p.name.startsWith(job_prefix)) continue\n if (p.name in job_names) continue\n println \"Deleting job '\" + p.name + \"'\"\n p.delete()\n deleted += 1\n }\n println 'Deleted ' + deleted + ' jobs.'\n println '# END SECTION'\n}\n","old_contents":"import difflib.DiffUtils\nimport groovy.io.FileType\nimport hudson.AbortException\nimport java.io.StringBufferInputStream\nimport java.io.StringWriter\nimport javax.xml.parsers.DocumentBuilderFactory\nimport javax.xml.transform.stream.StreamSource\nimport jenkins.model.Jenkins\nimport org.apache.xml.serialize.OutputFormat\nimport org.apache.xml.serialize.XMLSerializer\n\n\/\/ job types with their prefix and a list of job names\n\/\/ used to remove obsolete jobs with the same prefix which are not part of the list\njob_prefixes_and_names = [:]\n@[for job_type in sorted(job_prefixes_and_names.keys())]@\njob_prefixes_and_names['@job_type'] = [\n 'job_prefix': '@(job_prefixes_and_names[job_type][0])',\n 'job_names': [],\n]\n@{\njob_names = sorted(job_prefixes_and_names[job_type][1])\ngroup_size = 1000\n}@\n\/\/ group job names in chunks of @group_size to not exceed groovy limits\n@[for i in range(0, len(job_names), group_size)]@\ndef add_job_prefixes_and_names_@(job_type)_@(int(i \/ group_size) + 1)(job_names) {\n@[for j in range(i, min(i + group_size, len(job_names)))]@\njob_names << '@(job_names[j])'\n@[end for]@\n}\nadd_job_prefixes_and_names_@(job_type)_@(int(i \/ group_size) + 1)(job_prefixes_and_names['@job_type'].job_names)\n@[end for]@\n@[end for]@\n\n\ndef diff_configs(current_config_file, new_config) {\n\n factory = DocumentBuilderFactory.newInstance()\n builder = factory.newDocumentBuilder()\n\n current_doc = builder.parse(current_config_file.getFile())\n\n new_config_stream = new StringBufferInputStream(new_config)\n new_doc = builder.parse(new_config_stream)\n\n \/\/ ignore description which contains a timestamp\n if (current_doc.getElementsByTagName('description')) {\n current_doc.getElementsByTagName('description').item(0).setTextContent('')\n }\n if (new_doc.getElementsByTagName('description')) {\n new_doc.getElementsByTagName('description').item(0).setTextContent('')\n }\n\n current_string = format_xml(current_doc)\n new_string = format_xml(new_doc)\n\n if (current_string == new_string) {\n return []\n }\n\n current_lines = []\n current_string.eachLine { line, count ->\n current_lines << line\n }\n new_lines = []\n new_string.eachLine { line, count ->\n new_lines << line\n }\n\n patch = DiffUtils.diff(current_lines, new_lines)\n return DiffUtils.generateUnifiedDiff('current config', 'new config', current_lines, patch, 0)\n}\n\n\ndef format_xml(doc) {\n format = new OutputFormat(doc)\n format.setIndenting(true)\n format.setIndent(2)\n writer = new StringWriter()\n serializer = new XMLSerializer(writer, format)\n serializer.serialize(doc)\n return writer.toString()\n}\n\n\n\/\/ reconfigure jobs\nprintln '# BEGIN SECTION: Groovy script - reconfigure jobs'\nprintln 'Reconfiguring @(expected_num_jobs) jobs...'\ncreated = 0\nupdated = 0\nskipped = 0\n\nconfig_dir = build.getWorkspace().toString() + '\/reconfigure_jobs\/configs'\n\ndef jobs = []\ndef dir = new File(config_dir)\ndir.eachFileRecurse (FileType.FILES) { file ->\n jobs << file\n}\n\nif (jobs.size() != @(expected_num_jobs)) {\n println \"ERROR: Found different number of job configs than expected!! \" + jobs.size() + \" is not @(expected_num_jobs) as expected.\"\n \/\/ fail this build\n throw new AbortException(\"Wrong number of job configs\")\n}\n\njobs.each{\n found_project = false\n job_name = it.getName()\n job_config = new File(it.path).getText('UTF-8')\n for (p in Jenkins.instance.allItems) {\n if (p.name != job_name) continue\n found_project = true\n job_config_file = p.getConfigFile()\n\n diff = diff_configs(job_config_file, job_config)\n if (!diff) {\n println \"Skipped job '\" + job_name + \"' because the config is the same\"\n skipped += 1\n } else {\n println \"Updating job '\" + job_name + \"'\"\n println ' <<<'\n for (line in diff) {\n println ' ' + line\n }\n println ' <<<'\n\n reader = new StringReader(job_config)\n source = new StreamSource(reader)\n p.updateByXml(source)\n updated += 1\n }\n break\n }\n if (!found_project) {\n println \"Creating job '\" + job_name + \"'\"\n stream = new StringBufferInputStream(job_config)\n Jenkins.instance.createProjectFromXML(job_name, stream)\n created += 1\n }\n}\nprintln 'Created ' + created + ' jobs, updated ' + updated + ' jobs, skipped ' + skipped + ' jobs.'\nprintln '# END SECTION'\n\n\/\/ delete obsolete jobs\nfor (item in job_prefixes_and_names) {\n job_type = item.key\n job_prefix = item.value.job_prefix\n job_names = item.value.job_names\n deleted = 0\n println \"# BEGIN SECTION: Groovy script - delete obsolete '\" + job_type + \"' jobs\"\n println \"Searching for obsolete jobs starting with '\" + job_prefix + \"'\"\n for (p in Jenkins.instance.allItems) {\n if (!p.name.startsWith(job_prefix)) continue\n if (p.name in job_names) continue\n println \"Deleting job '\" + p.name + \"'\"\n p.delete()\n deleted += 1\n }\n println 'Deleted ' + deleted + ' jobs.'\n println '# END SECTION'\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"ae529da8d098dd9a99b9b48749d1c574bba812b9","subject":"update default ros2.repos URL (#62)","message":"update default ros2.repos URL (#62)\n\n* update default ros2.repos URL\r\n\r\nSigned-off-by: Mikael Arguedas \r\n\r\n* reverse order\r\n\r\nSigned-off-by: Mikael Arguedas \r\n","repos":"osrf\/docker_templates,ros-infrastructure\/docker_images,ros-infrastructure\/docker_images,osrf\/docker_templates","old_file":"docker_templates\/templates\/snippet\/vcs_import.Dockerfile.em","new_file":"docker_templates\/templates\/snippet\/vcs_import.Dockerfile.em","new_contents":"@[if 'vcs' in locals()]@\n@[ if vcs]@\n@[ for i, (imports_name, imports) in enumerate(vcs.items())]@\n@{\nif imports['repos'] is None:\n imports['repos'] = \"https:\/\/raw.githubusercontent.com\/ros2\/ros2\/$ROS_DISTRO-release\/ros2.repos\"\n}@\nRUN wget @(imports['repos']) \\\n && vcs import @(ws) < @(imports['repos'].split('\/')[-1])\n@[ end for]@\n@[ end if]@\n@[end if]@\n","old_contents":"@[if 'vcs' in locals()]@\n@[ if vcs]@\n@[ for i, (imports_name, imports) in enumerate(vcs.items())]@\n@{\nif imports['repos'] is None:\n imports['repos'] = \"https:\/\/raw.githubusercontent.com\/ros2\/ros2\/$ROS_DISTRO\/ros2.repos\"\n}@\nRUN wget @(imports['repos']) \\\n && vcs import @(ws) < @(imports['repos'].split('\/')[-1])\n@[ end for]@\n@[ end if]@\n@[end if]@\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"3372d9dc9a68d5e5d8e8a4009702f0f747ac99c8","subject":"Add checks for expected functionality in PresenceEventsTest.","message":"Add checks for expected functionality in PresenceEventsTest.\n\nThe previous fix was necessary because we didn't properly setup\nProxManager to ensure callbacks will be able to use the functionality\nwe expect in them. This adds a couple of simple tests to the\nEmerson PresenceEventsTests to check that this functionality is\navailable. Currently the tests are whether system.self is set and\nwhether we can call getProxSet.\n","repos":"sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata","old_file":"test\/system\/tests\/emTests\/presenceEventsTest.em","new_file":"test\/system\/tests\/emTests\/presenceEventsTest.em","new_contents":"\/**\n * presenceEventsTest -- tests onPresenceConnected,\n * onPresenceDisconnected, and createPresence callback\n *\n * Scene.db:\n * * Ent 1 : Anything\n *\/\n\n\nsystem.require('emUtil\/util.em');\n\nmTest = new UnitTest('presenceEventsTest');\n\n\/\/ We just want to make sure we can trigger each of the 3 events. A\n\/\/ timeout will indicate if we failed.\nvar expectedEvents = 3;\nvar testTimeout = system.timeout(\n 5,\n function() {\n mTest.fail('Timed out before all events were triggered.');\n system.killEntity();\n }\n);\n\n\/\/ Verify that functionality that should always be available in a presence\n\/\/ callback is there\nvar verifyAvailableFunctionality = function() {\n \/\/ system.self should be available when we get connected\n if (system.self === undefined || system.self === null) {\n mTest.fail(\"system.self isn't available in presence connection event callback\");\n return;\n }\n\n \/\/ getProxSet should work; even if we didn't register a query, it should\n \/\/ just be empty.\n try {\n var ps = system.getProxSet(system.self);\n }\n catch(e) {\n mTest.fail(\"Exception when trying to get prox set\");\n }\n};\n\nvar logEvent = function(name) {\n system.print('Callback ' + name + ' fired for ' + system.self + '\\n');\n expectedEvents--;\n if (expectedEvents == 0) {\n testTimeout.clear();\n system.killEntity();\n }\n};\n\nsystem.onPresenceConnected(\n function(newPres, clearable) {\n clearable.clear();\n\n \/\/ 3 handlers\n var presenceConnectedCallback = function() {\n verifyAvailableFunctionality();\n logEvent('createPresenceCallback');\n \/\/ Delayed event, to ensure all presence connected callbacks finish\n system.event(\n function() {\n system.self.disconnect();\n }\n );\n };\n system.onPresenceConnected(\n function() {\n verifyAvailableFunctionality();\n logEvent('onPresenceConnected');\n }\n );\n system.onPresenceDisconnected(\n function() {\n verifyAvailableFunctionality();\n logEvent('onPresenceDisconnected');\n }\n );\n\n \/\/ And this actually starts the process\n system.createPresence({}, presenceConnectedCallback);\n }\n);\n","old_contents":"\/**\n * presenceEventsTest -- tests onPresenceConnected,\n * onPresenceDisconnected, and createPresence callback\n *\n * Scene.db:\n * * Ent 1 : Anything\n *\/\n\n\nsystem.require('emUtil\/util.em');\n\nmTest = new UnitTest('presenceEventsTest');\n\n\/\/ We just want to make sure we can trigger each of the 3 events. A\n\/\/ timeout will indicate if we failed.\nvar expectedEvents = 3;\nvar testTimeout = system.timeout(\n 5,\n function() {\n mTest.fail('Timed out before all events were triggered.');\n system.killEntity();\n }\n);\nvar logEvent = function(name) {\n system.print('Callback ' + name + ' fired for ' + system.self + '\\n');\n expectedEvents--;\n if (expectedEvents == 0) {\n testTimeout.clear();\n system.killEntity();\n }\n};\n\nsystem.onPresenceConnected(\n function(newPres, clearable) {\n clearable.clear();\n \n \/\/ 3 handlers\n var presenceConnectedCallback = function() {\n logEvent('createPresenceCallback');\n \/\/ Delayed event, to ensure all presence connected callbacks finish\n system.event(\n function() {\n system.self.disconnect();\n }\n );\n };\n system.onPresenceConnected(\n function() {\n logEvent('onPresenceConnected');\n }\n );\n system.onPresenceDisconnected(\n function() {\n logEvent('onPresenceDisconnected');\n }\n );\n\n \/\/ And this actually starts the process\n system.createPresence({}, presenceConnectedCallback);\n }\n);\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"EmberScript"} {"commit":"1827044c75c32244b18cfbe1da0289c709e9d976","subject":"read stdout_stderr.log from build steps to extract CMake \/ compiler warnings (#477)","message":"read stdout_stderr.log from build steps to extract CMake \/ compiler warnings (#477)\n\n* read stdout_stderr.log from latest build to extract CMake \/ compiler warnings\r\n\r\nSigned-off-by: Dirk Thomas <19795c8185177e940eedd30ceb2b716a54a3d5dc@users.noreply.github.com>\r\n\r\n* use all build log directories, even if there is only one atm\r\n\r\nSigned-off-by: Dirk Thomas <19795c8185177e940eedd30ceb2b716a54a3d5dc@users.noreply.github.com>\r\n\r\n* also handle 'work space'\r\n\r\nSigned-off-by: Dirk Thomas <19795c8185177e940eedd30ceb2b716a54a3d5dc@users.noreply.github.com>","repos":"ros2\/ci,ros2\/ci,ros2\/ci","old_file":"job_templates\/snippet\/publisher_warnings_ng.xml.em","new_file":"job_templates\/snippet\/publisher_warnings_ng.xml.em","new_contents":"\n \n@[for workspace in ['ws', 'work space']]@\n \n <\/id>\n <\/name>\n @(workspace)\/log\/build_*\/*\/stdout_stderr.log<\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.Cmake>\n@[ if os_name in ['linux', 'linux-armhf', 'linux-aarch64', 'linux-centos']]@\n \n <\/id>\n <\/name>\n @(workspace)\/log\/build_*\/*\/stdout_stderr.log<\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.Gcc4>\n@[ end if]\n@[ if os_name in ['osx', 'linux', 'linux-armhf', 'linux-aarch64', 'linux-centos']]@\n \n <\/id>\n <\/name>\n @(workspace)\/log\/build_*\/*\/stdout_stderr.log<\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.Clang>\n \n <\/id>\n <\/name>\n @(workspace)\/log\/build_*\/*\/stdout_stderr.log<\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.ClangTidy>\n@[ elif os_name in ['windows', 'windows-metal']]@\n \n <\/id>\n <\/name>\n @(workspace)\/log\/build_*\/*\/stdout_stderr.log<\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.MsBuild>\n@[ else]@\n@{assert False, 'Unknown os_name: ' + os_name}@\n@[ end if]@\n@[end for]@\n <\/analysisTools>\n <\/sourceCodeEncoding>\n <\/sourceDirectory>\n false<\/ignoreQualityGate>\n true<\/ignoreFailedBuilds>\n -<\/referenceJobName>\n false<\/failOnError>\n 0<\/healthy>\n 0<\/unhealthy>\n \n LOW<\/name>\n <\/minimumSeverity>\n \n false<\/isEnabledForFailure>\n false<\/isAggregatingResults>\n false<\/isBlameDisabled>\n false<\/isForensicsDisabled>\n \n \n 1<\/threshold>\n TOTAL<\/type>\n WARNING<\/status>\n <\/io.jenkins.plugins.analysis.core.util.QualityGate>\n <\/qualityGates>\n AGGREGATION_TOOLS<\/trendChartType>\n<\/io.jenkins.plugins.analysis.core.steps.IssuesRecorder>\n","old_contents":"\n \n \n <\/id>\n <\/name>\n <\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.Cmake>\n@[if os_name in ['linux', 'linux-armhf', 'linux-aarch64', 'linux-centos']]@\n \n <\/id>\n <\/name>\n <\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.Gcc4>\n@[end if]\n@[if os_name in ['osx', 'linux', 'linux-armhf', 'linux-aarch64', 'linux-centos']]@\n \n <\/id>\n <\/name>\n <\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.Clang>\n \n <\/id>\n <\/name>\n <\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.ClangTidy>\n@[elif os_name in ['windows', 'windows-metal']]@\n \n <\/id>\n <\/name>\n <\/pattern>\n <\/reportEncoding>\n false<\/skipSymbolicLinks>\n <\/io.jenkins.plugins.analysis.warnings.MsBuild>\n@[else]@\n@{assert False, 'Unknown os_name: ' + os_name}@\n@[end if]@\n <\/analysisTools>\n <\/sourceCodeEncoding>\n <\/sourceDirectory>\n false<\/ignoreQualityGate>\n true<\/ignoreFailedBuilds>\n -<\/referenceJobName>\n false<\/failOnError>\n 0<\/healthy>\n 0<\/unhealthy>\n \n LOW<\/name>\n <\/minimumSeverity>\n \n false<\/isEnabledForFailure>\n false<\/isAggregatingResults>\n false<\/isBlameDisabled>\n false<\/isForensicsDisabled>\n \n \n 1<\/threshold>\n TOTAL<\/type>\n WARNING<\/status>\n <\/io.jenkins.plugins.analysis.core.util.QualityGate>\n <\/qualityGates>\n AGGREGATION_TOOLS<\/trendChartType>\n<\/io.jenkins.plugins.analysis.core.steps.IssuesRecorder>\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"bcfe94efcd889d48f7907172460d55204bcd9d18","subject":"Add missing build dependencies to fix race conditions","message":"Add missing build dependencies to fix race conditions\n","repos":"osrf\/ros_dds,osrf\/ros_dds,osrf\/ros_dds,osrf\/ros_dds,osrf\/ros_dds,osrf\/ros_dds","old_file":"prototype\/src\/genidlcpp\/cmake\/genidlcpp-extras.cmake.em","new_file":"prototype\/src\/genidlcpp\/cmake\/genidlcpp-extras.cmake.em","new_contents":"find_package(opensplice REQUIRED)\ninclude_directories(${OPENSPLICE_INCLUDE_DIRS})\n\nset(GENIDLCPP_PP_BIN \"idlpp\")\n@[if DEVELSPACE]@\n# bin and template dir variables in develspace\nset(GENIDLCPP_BIN \"@(CMAKE_CURRENT_SOURCE_DIR)\/scripts\/gen_idl_cpp_convert.py\")\nset(GENIDLCPP_TEMPLATE_DIR \"@(CMAKE_CURRENT_SOURCE_DIR)\/scripts\")\n@[else]@\n# bin and template dir variables in installspace\nset(GENIDLCPP_BIN \"${genidlcpp_DIR}\/..\/..\/..\/@(CATKIN_PACKAGE_BIN_DESTINATION)\/gen_idl_cpp_convert.py\")\nset(GENIDLCPP_TEMPLATE_DIR \"${genidlcpp_DIR}\/..\")\n@[end if]@\n\n# Generate .idl -> dds code generation and _convert.h\n# The generated files should be added to ALL_GEN_OUTPUT_FILES_idlcpp\nmacro(_generate_msg_idlcpp ARG_PKG ARG_MSG ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR)\n #message(\"msg ${ARG_PKG} ${ARG_MSG} ${ARG_IFLAGS} ${ARG_MSG_DEPS}\")\n\n # generate dds code for message\n get_filename_component(MSG_SHORT_NAME ${ARG_MSG} NAME_WE)\n _generate_msg_idlcpp_dds(${ARG_PKG} ${MSG_SHORT_NAME} \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\n # generate _convert.h for message\n _generate_msg_idlcpp_convert(${ARG_PKG} ${ARG_MSG} \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\nendmacro()\n\n# Generate .idl -> dds code generation and _convert.h\n# The generated files should be added to ALL_GEN_OUTPUT_FILES_idlcpp\nmacro(_generate_srv_idlcpp ARG_PKG ARG_SRV ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR)\n #message(\"srv ${ARG_PKG} ${ARG_SRV} ${ARG_IFLAGS} ${ARG_MSG_DEPS}\")\n\n # generate dds code for service as well as request and response messages\n get_filename_component(SRV_SHORT_NAME ${ARG_SRV} NAME_WE)\n _generate_msg_idlcpp_dds(${ARG_PKG} \"${SRV_SHORT_NAME}Request\" \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\n _generate_msg_idlcpp_dds(${ARG_PKG} \"${SRV_SHORT_NAME}Response\" \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\n # Note that we add FooRequest.msg and FooResponse.msg to ARG_MSG_DEPS\n # for Foo.srv, even though those .msg files never actually exist. We do\n # this to ensure that the corresponding FooRequest_.h and FooResponse_.h\n # files will have been generated by the time we try to process Foo_.idl.\n _generate_msg_idlcpp_dds(${ARG_PKG} \"${SRV_SHORT_NAME}\" \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS};${CATKIN_DEVEL_PREFIX}\/${CATKIN_GLOBAL_SHARE_DESTINATION}\/${ARG_PKG}\/dds_impl\/${SRV_SHORT_NAME}Request.msg;${CATKIN_DEVEL_PREFIX}\/${CATKIN_GLOBAL_SHARE_DESTINATION}\/${ARG_PKG}\/dds_impl\/${SRV_SHORT_NAME}Response.msg\" ${ARG_GEN_OUTPUT_DIR})\n # generate _convert.h for request and response\n _generate_msg_idlcpp_convert(${ARG_PKG} ${ARG_SRV} \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\nendmacro()\n\nmacro(_generate_msg_idlcpp_dds ARG_PKG MSG_SHORT_NAME ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR)\n #message(\"msg_dds ${ARG_PKG} ${MSG_SHORT_NAME} ${ARG_IFLAGS} ${ARG_MSG_DEPS}\")\n\n set(IDL_INPUT_FILE \"${CATKIN_DEVEL_PREFIX}\/${CATKIN_GLOBAL_SHARE_DESTINATION}\/${ARG_PKG}\/dds_idl\/${MSG_SHORT_NAME}_.idl\")\n set(GEN_OUTPUT_FILES\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_.h\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_.cpp\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_Dcps.h\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_Dcps.cpp\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_Dcps_impl.h\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_Dcps_impl.cpp\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_SplDcps.h\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_SplDcps.cpp\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/ccpp_${MSG_SHORT_NAME}_.h\"\n )\n\n set(IDL_DEPS \"\")\n foreach(dep ${ARG_MSG_DEPS})\n get_filename_component(dep_name ${dep} NAME_WE)\n get_filename_component(dep_pkg ${dep} PATH)\n get_filename_component(dep_pkg ${dep_pkg} PATH)\n get_filename_component(dep_pkg ${dep_pkg} NAME)\n list(APPEND IDL_DEPS \"${CATKIN_DEVEL_PREFIX}\/${CATKIN_GLOBAL_SHARE_DESTINATION}\/${dep_pkg}\/dds_idl\/${dep_name}_.idl\")\n list(APPEND ${ARG_PKG}_MSG_DEPENDENCIES \"${dep_pkg}\")\n endforeach()\n\n set(COMMAND \"${GENIDLCPP_PP_BIN}\" -I \"@(CATKIN_DEVEL_PREFIX)\/@(CATKIN_GLOBAL_SHARE_DESTINATION)\" -S -l cpp -o dds-types -d \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\" \"${IDL_INPUT_FILE}\")\n\n string(REPLACE \";\" \" \" COMMAND_STR \"${COMMAND}\")\n #message(\"${COMMAND_STR}\")\n\n file(MAKE_DIRECTORY ${ARG_GEN_OUTPUT_DIR}\/dds_impl)\n\n add_custom_command(OUTPUT ${GEN_OUTPUT_FILES}\n DEPENDS ${IDL_DEPS} ${IDL_INPUT_FILE}\n COMMAND ${COMMAND}\n COMMENT \"Generating DDS C++ code from ${ARG_PKG}\/${MSG_SHORT_NAME}_.idl\"\n )\n list(APPEND ALL_GEN_OUTPUT_FILES_idlcpp ${GEN_OUTPUT_FILES})\n\n genidlcpp_append_include_dirs()\nendmacro()\n\nmacro(_generate_msg_idlcpp_convert ARG_PKG ARG_MSG ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR)\n #message(\"msg_convert ${ARG_PKG} ${ARG_MSG} ${ARG_IFLAGS} ${ARG_MSG_DEPS}\")\n\n get_filename_component(MSG_SHORT_NAME ${ARG_MSG} NAME_WE)\n set(GEN_OUTPUT_FILES\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_convert.h\"\n )\n\n set(COMMAND ${GENIDLCPP_BIN} ${ARG_MSG} ${ARG_PKG} -o \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\" -e ${GENIDLCPP_TEMPLATE_DIR})\n\n string(REPLACE \";\" \" \" COMMAND_STR \"${COMMAND}\")\n #message(\"${COMMAND_STR}\")\n\n get_filename_component(MSG_NAME ${ARG_MSG} NAME)\n\n assert(CATKIN_ENV)\n add_custom_command(OUTPUT ${GEN_OUTPUT_FILES}\n DEPENDS ${GENIDLCPP_BIN} ${ARG_MSG} \"${GENIDLCPP_TEMPLATE_DIR}\/msg_convert.h.template\"\n COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE} ${COMMAND}\n COMMENT \"Generating conversion code between ROS and DDS message instances for ${ARG_PKG}\/${MSG_NAME}\"\n )\n list(APPEND ALL_GEN_OUTPUT_FILES_idlcpp ${GEN_OUTPUT_FILES})\n\n genidlcpp_append_include_dirs()\nendmacro()\n\nmacro(_generate_module_idlcpp ARG_PKG ARG_GEN_OUTPUT_DIR)\n include_directories(BEFORE ${genidlcpp_INCLUDE_DIRS})\n if(${ARG_PKG}_MSG_DEPENDENCIES)\n list(REMOVE_DUPLICATES ${ARG_PKG}_MSG_DEPENDENCIES)\n endif()\n set(dds_impl_libs \"\")\n foreach(dep ${${ARG_PKG}_MSG_DEPENDENCIES})\n include_directories(BEFORE ${CATKIN_DEVEL_PREFIX}\/include\/${dep}\/dds_impl)\n list(APPEND dds_impl_libs ${dep}_dds_msgs)\n endforeach()\n if(NOT \"${ARGN}\" STREQUAL \"\")\n add_library(${PROJECT_NAME}_dds_msgs ${ARGN})\n # This dependency is here to prevent simultaneous invocation of idlpp\n # on the same .idl file. In that situation, the two invocations fight\n # over access to a temporary intermediate file and cause intermittent\n # crashes. I'm not sure exactly why we were getting simultanous\n # invocations in the first place, but this dependency seems to prevent\n # it.\n add_dependencies(${PROJECT_NAME}_dds_msgs ${PROJECT_NAME}_genidlcpp)\n target_link_libraries(${PROJECT_NAME}_dds_msgs ${dds_impl_libs} ${OPENSPLICE_LIBRARIES})\n list(APPEND ${PROJECT_NAME}_LIBRARIES ${PROJECT_NAME}_dds_msgs)\n endif()\nendmacro()\n\nset(genidlcpp_INSTALL_DIR include)\n\nmacro(genidlcpp_append_include_dirs)\n if(NOT genidlcpp_APPENDED_INCLUDE_DIRS)\n # make sure we can find generated messages and that they overlay all other includes\n include_directories(BEFORE ${CATKIN_DEVEL_PREFIX}\/${genidlcpp_INSTALL_DIR})\n # pass the include directory to catkin_package()\n list(APPEND ${PROJECT_NAME}_INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}\/${genidlcpp_INSTALL_DIR})\n set(genidlcpp_APPENDED_INCLUDE_DIRS TRUE)\n endif()\nendmacro()\n","old_contents":"find_package(opensplice REQUIRED)\ninclude_directories(${OPENSPLICE_INCLUDE_DIRS})\n\nset(GENIDLCPP_PP_BIN \"idlpp\")\n@[if DEVELSPACE]@\n# bin and template dir variables in develspace\nset(GENIDLCPP_BIN \"@(CMAKE_CURRENT_SOURCE_DIR)\/scripts\/gen_idl_cpp_convert.py\")\nset(GENIDLCPP_TEMPLATE_DIR \"@(CMAKE_CURRENT_SOURCE_DIR)\/scripts\")\n@[else]@\n# bin and template dir variables in installspace\nset(GENIDLCPP_BIN \"${genidlcpp_DIR}\/..\/..\/..\/@(CATKIN_PACKAGE_BIN_DESTINATION)\/gen_idl_cpp_convert.py\")\nset(GENIDLCPP_TEMPLATE_DIR \"${genidlcpp_DIR}\/..\")\n@[end if]@\n\n# Generate .idl -> dds code generation and _convert.h\n# The generated files should be added to ALL_GEN_OUTPUT_FILES_idlcpp\nmacro(_generate_msg_idlcpp ARG_PKG ARG_MSG ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR)\n #message(\"msg ${ARG_PKG} ${ARG_MSG} ${ARG_IFLAGS} ${ARG_MSG_DEPS}\")\n\n # generate dds code for message\n get_filename_component(MSG_SHORT_NAME ${ARG_MSG} NAME_WE)\n _generate_msg_idlcpp_dds(${ARG_PKG} ${MSG_SHORT_NAME} \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\n # generate _convert.h for message\n _generate_msg_idlcpp_convert(${ARG_PKG} ${ARG_MSG} \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\nendmacro()\n\n# Generate .idl -> dds code generation and _convert.h\n# The generated files should be added to ALL_GEN_OUTPUT_FILES_idlcpp\nmacro(_generate_srv_idlcpp ARG_PKG ARG_SRV ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR)\n #message(\"srv ${ARG_PKG} ${ARG_SRV} ${ARG_IFLAGS} ${ARG_MSG_DEPS}\")\n\n # generate dds code for service as well as request and response messages\n get_filename_component(SRV_SHORT_NAME ${ARG_SRV} NAME_WE)\n _generate_msg_idlcpp_dds(${ARG_PKG} \"${SRV_SHORT_NAME}\" \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\n _generate_msg_idlcpp_dds(${ARG_PKG} \"${SRV_SHORT_NAME}Request\" \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\n _generate_msg_idlcpp_dds(${ARG_PKG} \"${SRV_SHORT_NAME}Response\" \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\n # generate _convert.h for request and response\n _generate_msg_idlcpp_convert(${ARG_PKG} ${ARG_SRV} \"${ARG_IFLAGS}\" \"${ARG_MSG_DEPS}\" ${ARG_GEN_OUTPUT_DIR})\nendmacro()\n\nmacro(_generate_msg_idlcpp_dds ARG_PKG MSG_SHORT_NAME ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR)\n #message(\"msg_dds ${ARG_PKG} ${MSG_SHORT_NAME} ${ARG_IFLAGS} ${ARG_MSG_DEPS}\")\n\n set(IDL_INPUT_FILE \"${CATKIN_DEVEL_PREFIX}\/${CATKIN_GLOBAL_SHARE_DESTINATION}\/${ARG_PKG}\/dds_idl\/${MSG_SHORT_NAME}_.idl\")\n set(GEN_OUTPUT_FILES\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_.h\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_.cpp\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_Dcps.h\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_Dcps.cpp\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_Dcps_impl.h\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_Dcps_impl.cpp\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_SplDcps.h\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_SplDcps.cpp\"\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/ccpp_${MSG_SHORT_NAME}_.h\"\n )\n\n set(IDL_DEPS \"\")\n foreach(dep ${ARG_MSG_DEPS})\n get_filename_component(dep_name ${dep} NAME_WE)\n get_filename_component(dep_pkg ${dep} PATH)\n get_filename_component(dep_pkg ${dep_pkg} PATH)\n get_filename_component(dep_pkg ${dep_pkg} NAME)\n list(APPEND IDL_DEPS \"${CATKIN_DEVEL_PREFIX}\/${CATKIN_GLOBAL_SHARE_DESTINATION}\/${dep_pkg}\/dds_idl\/${dep_name}_.idl\")\n list(APPEND ${ARG_PKG}_MSG_DEPENDENCIES \"${dep_pkg}\")\n endforeach()\n\n set(COMMAND \"${GENIDLCPP_PP_BIN}\" -I \"@(CATKIN_DEVEL_PREFIX)\/@(CATKIN_GLOBAL_SHARE_DESTINATION)\" -S -l cpp -o dds-types -d \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\" \"${IDL_INPUT_FILE}\")\n\n string(REPLACE \";\" \" \" COMMAND_STR \"${COMMAND}\")\n #message(\"${COMMAND_STR}\")\n\n file(MAKE_DIRECTORY ${ARG_GEN_OUTPUT_DIR}\/dds_impl)\n\n add_custom_command(OUTPUT ${GEN_OUTPUT_FILES}\n DEPENDS ${IDL_DEPS} ${IDL_INPUT_FILE}\n COMMAND ${COMMAND}\n COMMENT \"Generating DDS C++ code from ${ARG_PKG}\/${MSG_SHORT_NAME}_.idl\"\n )\n list(APPEND ALL_GEN_OUTPUT_FILES_idlcpp ${GEN_OUTPUT_FILES})\n\n genidlcpp_append_include_dirs()\nendmacro()\n\nmacro(_generate_msg_idlcpp_convert ARG_PKG ARG_MSG ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR)\n #message(\"msg_convert ${ARG_PKG} ${ARG_MSG} ${ARG_IFLAGS} ${ARG_MSG_DEPS}\")\n\n get_filename_component(MSG_SHORT_NAME ${ARG_MSG} NAME_WE)\n set(GEN_OUTPUT_FILES\n \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\/${MSG_SHORT_NAME}_convert.h\"\n )\n\n set(COMMAND ${GENIDLCPP_BIN} ${ARG_MSG} ${ARG_PKG} -o \"${ARG_GEN_OUTPUT_DIR}\/dds_impl\" -e ${GENIDLCPP_TEMPLATE_DIR})\n\n string(REPLACE \";\" \" \" COMMAND_STR \"${COMMAND}\")\n #message(\"${COMMAND_STR}\")\n\n get_filename_component(MSG_NAME ${ARG_MSG} NAME)\n\n assert(CATKIN_ENV)\n add_custom_command(OUTPUT ${GEN_OUTPUT_FILES}\n DEPENDS ${GENIDLCPP_BIN} ${ARG_MSG} \"${GENIDLCPP_TEMPLATE_DIR}\/msg_convert.h.template\"\n COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE} ${COMMAND}\n COMMENT \"Generating conversion code between ROS and DDS message instances for ${ARG_PKG}\/${MSG_NAME}\"\n )\n list(APPEND ALL_GEN_OUTPUT_FILES_idlcpp ${GEN_OUTPUT_FILES})\n\n genidlcpp_append_include_dirs()\nendmacro()\n\nmacro(_generate_module_idlcpp ARG_PKG ARG_GEN_OUTPUT_DIR)\n include_directories(BEFORE ${genidlcpp_INCLUDE_DIRS})\n if(${ARG_PKG}_MSG_DEPENDENCIES)\n list(REMOVE_DUPLICATES ${ARG_PKG}_MSG_DEPENDENCIES)\n endif()\n set(dds_impl_libs \"\")\n foreach(dep ${${ARG_PKG}_MSG_DEPENDENCIES})\n include_directories(BEFORE ${CATKIN_DEVEL_PREFIX}\/include\/${dep}\/dds_impl)\n list(APPEND dds_impl_libs ${dep}_dds_msgs)\n endforeach()\n if(NOT \"${ARGN}\" STREQUAL \"\")\n add_library(${PROJECT_NAME}_dds_msgs ${ARGN})\n target_link_libraries(${PROJECT_NAME}_dds_msgs ${dds_impl_libs} ${OPENSPLICE_LIBRARIES})\n list(APPEND ${PROJECT_NAME}_LIBRARIES ${PROJECT_NAME}_dds_msgs)\n endif()\nendmacro()\n\nset(genidlcpp_INSTALL_DIR include)\n\nmacro(genidlcpp_append_include_dirs)\n if(NOT genidlcpp_APPENDED_INCLUDE_DIRS)\n # make sure we can find generated messages and that they overlay all other includes\n include_directories(BEFORE ${CATKIN_DEVEL_PREFIX}\/${genidlcpp_INSTALL_DIR})\n # pass the include directory to catkin_package()\n list(APPEND ${PROJECT_NAME}_INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}\/${genidlcpp_INSTALL_DIR})\n set(genidlcpp_APPENDED_INCLUDE_DIRS TRUE)\n endif()\nendmacro()\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"ab006e710df9094d8d1a9dd7aca59be74264fccc","subject":"Install apt transport https (#551)","message":"Install apt transport https (#551)\n\n* dont' overwrite default sources\r\n\r\n* Revert \"dont' overwrite default sources\"\r\n\r\nThis reverts commit 0d2c3a4fec23bb1ddc28509f0d4ae37437f084ec.\r\n\r\n* add template to install apt-transport-https on debian\r\n\r\n* install apt-transport-https in image templates\r\n\r\n* change branch name accordingly\r\n\r\n* Install apt-transport-https for the cloudfront servers.\r\n\r\nSigned-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@openrobotics.org>\r\n\r\n* update comment\r\n\r\n* More installation of apt-transport-https before changing mirrors.\r\n\r\nSigned-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@openrobotics.org>\r\n\r\n* Switch back to master.\r\n\r\nSigned-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@openrobotics.org>\r\n","repos":"ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm","old_file":"ros_buildfarm\/templates\/snippet\/add_additional_repositories.Dockerfile.em","new_file":"ros_buildfarm\/templates\/snippet\/add_additional_repositories.Dockerfile.em","new_contents":"@[if os_name == 'ubuntu']@\n@{\nfrom itertools import product\n}@\n@[ if arch in ['amd64', 'i386']]@\n@{\narchive_commands = []\nold_releases_commands = []\nfor distribution, archive_type in product((os_code_name, os_code_name + '-updates', os_code_name + '-security'), ('deb', 'deb-src')):\n archive_entry = '%s http:\/\/archive.ubuntu.com\/ubuntu\/ %s multiverse' % (archive_type, distribution)\n archive_pattern = '%s http:\/\/archive\\.ubuntu\\.com\/ubuntu\/? %s ([-a-z]+ )*multiverse( [-a-z])*' % (archive_type, distribution)\n old_releases_entry = '%s http:\/\/old-releases.ubuntu.com\/ubuntu\/ %s multiverse' % (archive_type, distribution)\n old_releases_pattern = '%s http:\/\/old-releases\\.ubuntu\\.com\/ubuntu\/? %s ([-a-z]+ )*multiverse( [-a-z]+)*' % (archive_type, distribution)\n archive_commands.append('(grep -q -E -x -e \"%s\" \/etc\/apt\/sources.list || echo \"%s\" >> \/etc\/apt\/sources.list)' % (archive_pattern, archive_entry))\n old_releases_commands.append('(grep -q -E -x -e \"%s\" \/etc\/apt\/sources.list || echo \"%s\" >> \/etc\/apt\/sources.list)' % (old_releases_pattern, old_releases_entry))\n}@\nRUN grep -q -F -e \"deb http:\/\/old-releases.ubuntu.com\" \/etc\/apt\/sources.list && (@(' && '.join(old_releases_commands))) || (@(' && '.join(archive_commands)))\n@[ elif arch in ['armhf', 'armv8']]@\n@{\ncommands = []\nfor distribution, archive_type in product((os_code_name, os_code_name + '-updates', os_code_name + '-security'), ('deb', 'deb-src')):\n entry = '%s http:\/\/ports.ubuntu.com\/ %s multiverse' % (archive_type, distribution)\n pattern = '%s http:\/\/ports\\.ubuntu\\.com\/? %s ([-a-z]+ )*multiverse( [-a-z])*' % (archive_type, distribution)\n commands.append('(grep -q -E -x -e \"%s\" \/etc\/apt\/sources.list || echo \"%s\" >> \/etc\/apt\/sources.list)' % (pattern, entry))\n}@\nRUN @(' && '.join(commands))\n@[ end if]@\n@[else if os_name == 'debian']@\n# Add contrib and non-free to debian images\n# Using httpredir here to match mirror used in osrf image\n# (https:\/\/github.com\/osrf\/multiarch-docker-image-generation\/blob\/d251b9a\/build-image.sh#L46)\n@{\ncommands = []\nfor component in ('contrib', 'non-free'):\n entry = 'deb http:\/\/httpredir.debian.org\/debian %s %s' % (os_code_name, component)\n pattern = 'deb http:\/\/httpredir\\.debian\\.org\/debian\/? %s ([-a-z] )*%s( [-a-z])*' % (os_code_name, component)\n commands.append('(grep -q -E -x -e \"%s\" \/etc\/apt\/sources.list || echo \"%s\" >> \/etc\/apt\/sources.list)' % (pattern, entry))\n}@\nRUN @(' && '.join(commands))\n# Make sure to install apt-transport-https since some CloudFront mirrors are currently being redirected to https\nRUN for i in 1 2 3; do apt-get update && apt-get install -q -y apt-transport-https && apt-get clean && break || if [[ $i < 3 ]]; then sleep 5; else false; fi; done\n# Hit cloudfront mirror because of corrupted packages on fastly mirrors (https:\/\/github.com\/ros-infrastructure\/ros_buildfarm\/issues\/455)\n# You can remove this line to target the default mirror or replace this to use the mirror of your preference\nRUN sed -i 's\/httpredir\\.debian\\.org\/cloudfront.debian.net\/' \/etc\/apt\/sources.list\n@[end if]@\n","old_contents":"@[if os_name == 'ubuntu']@\n@{\nfrom itertools import product\n}@\n@[ if arch in ['amd64', 'i386']]@\n@{\narchive_commands = []\nold_releases_commands = []\nfor distribution, archive_type in product((os_code_name, os_code_name + '-updates', os_code_name + '-security'), ('deb', 'deb-src')):\n archive_entry = '%s http:\/\/archive.ubuntu.com\/ubuntu\/ %s multiverse' % (archive_type, distribution)\n archive_pattern = '%s http:\/\/archive\\.ubuntu\\.com\/ubuntu\/? %s ([-a-z]+ )*multiverse( [-a-z])*' % (archive_type, distribution)\n old_releases_entry = '%s http:\/\/old-releases.ubuntu.com\/ubuntu\/ %s multiverse' % (archive_type, distribution)\n old_releases_pattern = '%s http:\/\/old-releases\\.ubuntu\\.com\/ubuntu\/? %s ([-a-z]+ )*multiverse( [-a-z]+)*' % (archive_type, distribution)\n archive_commands.append('(grep -q -E -x -e \"%s\" \/etc\/apt\/sources.list || echo \"%s\" >> \/etc\/apt\/sources.list)' % (archive_pattern, archive_entry))\n old_releases_commands.append('(grep -q -E -x -e \"%s\" \/etc\/apt\/sources.list || echo \"%s\" >> \/etc\/apt\/sources.list)' % (old_releases_pattern, old_releases_entry))\n}@\nRUN grep -q -F -e \"deb http:\/\/old-releases.ubuntu.com\" \/etc\/apt\/sources.list && (@(' && '.join(old_releases_commands))) || (@(' && '.join(archive_commands)))\n@[ elif arch in ['armhf', 'armv8']]@\n@{\ncommands = []\nfor distribution, archive_type in product((os_code_name, os_code_name + '-updates', os_code_name + '-security'), ('deb', 'deb-src')):\n entry = '%s http:\/\/ports.ubuntu.com\/ %s multiverse' % (archive_type, distribution)\n pattern = '%s http:\/\/ports\\.ubuntu\\.com\/? %s ([-a-z]+ )*multiverse( [-a-z])*' % (archive_type, distribution)\n commands.append('(grep -q -E -x -e \"%s\" \/etc\/apt\/sources.list || echo \"%s\" >> \/etc\/apt\/sources.list)' % (pattern, entry))\n}@\nRUN @(' && '.join(commands))\n@[ end if]@\n@[else if os_name == 'debian']@\n# Add contrib and non-free to debian images\n# Using httpredir here to match mirror used in osrf image\n# (https:\/\/github.com\/osrf\/multiarch-docker-image-generation\/blob\/d251b9a\/build-image.sh#L46)\n@{\ncommands = []\nfor component in ('contrib', 'non-free'):\n entry = 'deb http:\/\/httpredir.debian.org\/debian %s %s' % (os_code_name, component)\n pattern = 'deb http:\/\/httpredir\\.debian\\.org\/debian\/? %s ([-a-z] )*%s( [-a-z])*' % (os_code_name, component)\n commands.append('(grep -q -E -x -e \"%s\" \/etc\/apt\/sources.list || echo \"%s\" >> \/etc\/apt\/sources.list)' % (pattern, entry))\n}@\nRUN @(' && '.join(commands))\n# Hit cloudfront mirror because of corrupted packages on fastly mirrors (https:\/\/github.com\/ros-infrastructure\/ros_buildfarm\/issues\/455)\n# You can remove this line to target the default mirror or replace this to use the mirror of your preference\nRUN sed -i 's\/httpredir\\.debian\\.org\/cloudfront.debian.net\/' \/etc\/apt\/sources.list\n@[end if]@\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"eb04979d8efddf61b7c45f0f31032be1a63e1520","subject":"use job specific ghprb commit status context","message":"use job specific ghprb commit status context\n","repos":"ruffsl\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,mistoll\/ros_buildfarm,ruffsl\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ruffsl\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,mistoll\/ros_buildfarm,mistoll\/ros_buildfarm","old_file":"ros_buildfarm\/templates\/snippet\/trigger_github-pull-request-builder.xml.em","new_file":"ros_buildfarm\/templates\/snippet\/trigger_github-pull-request-builder.xml.em","new_contents":" \n \n \n \n true<\/allowMembersOfWhitelistedOrgsAsAdmin>\n @ESCAPE(github_orgunit)<\/orgslist>\n \n \n false<\/onlyTriggerPhrase>\n true<\/useGitHubHooks>\n true<\/permitAll>\n \n false<\/autoCloseFailedPullRequests>\n false<\/displayBuildErrorsOnDownstreamBuilds>\n \n \n @ESCAPE(branch_name)<\/branch>\n <\/org.jenkinsci.plugins.ghprb.GhprbBranch>\n <\/whiteListTargetBranches>\n @ESCAPE(job_name)<\/project>\n \n \n @ESCAPE(job_name)<\/commitStatusContext>\n \n \n \n <\/org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>\n <\/extensions>\n <\/org.jenkinsci.plugins.ghprb.GhprbTrigger>\n","old_contents":" \n \n \n true<\/allowMembersOfWhitelistedOrgsAsAdmin>\n @ESCAPE(github_orgunit)<\/orgslist>\n \n \n false<\/onlyTriggerPhrase>\n true<\/useGitHubHooks>\n true<\/permitAll>\n \n \n false<\/autoCloseFailedPullRequests>\n false<\/displayBuildErrorsOnDownstreamBuilds>\n \n \n @ESCAPE(branch_name)<\/branch>\n <\/org.jenkinsci.plugins.ghprb.GhprbBranch>\n <\/whiteListTargetBranches>\n \n \n @ESCAPE(job_name)<\/project>\n <\/org.jenkinsci.plugins.ghprb.GhprbTrigger>\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"b25438fe9185178713d5085a5c900af1a9676f09","subject":"fix logic of publisher warnings argument","message":"fix logic of publisher warnings argument\n","repos":"ruffsl\/ros_buildfarm,mistoll\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ruffsl\/ros_buildfarm,ruffsl\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,mistoll\/ros_buildfarm,mistoll\/ros_buildfarm","old_file":"ros_buildfarm\/templates\/snippet\/publisher_warnings.xml.em","new_file":"ros_buildfarm\/templates\/snippet\/publisher_warnings.xml.em","new_contents":" \n \n \n low<\/thresholdLimit>\n [WARNINGS]<\/pluginName>\n \n false<\/canRunOnFailed>\n false<\/usePreviousBuildAsReference>\n false<\/useStableBuildAsReference>\n false<\/useDeltaValues>\n \n@[if unstable_threshold != '']@\n @unstable_threshold<\/unstableTotalAll>\n@[else]@\n \n@[end if]@\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <\/thresholds>\n false<\/shouldDetectModules>\n true<\/dontComputeNew>\n true<\/doNotResolveRelativePaths>\n \n \n \n \n \n \n GNU C Compiler 4 (gcc)<\/parserName>\n <\/hudson.plugins.warnings.ConsoleParser>\n <\/consoleParsers>\n <\/hudson.plugins.warnings.WarningsPublisher>\n","old_contents":" \n \n \n low<\/thresholdLimit>\n [WARNINGS]<\/pluginName>\n \n false<\/canRunOnFailed>\n false<\/usePreviousBuildAsReference>\n false<\/useStableBuildAsReference>\n false<\/useDeltaValues>\n \n@[if unstable_threshold]@\n @unstable_threshold<\/unstableTotalAll>\n@[else]@\n \n@[end if]@\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <\/thresholds>\n false<\/shouldDetectModules>\n true<\/dontComputeNew>\n true<\/doNotResolveRelativePaths>\n \n \n \n \n \n \n GNU C Compiler 4 (gcc)<\/parserName>\n <\/hudson.plugins.warnings.ConsoleParser>\n <\/consoleParsers>\n <\/hudson.plugins.warnings.WarningsPublisher>\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"f16f796e67732e38ad61c1b350d29914f2970f5e","subject":"Tweeking gazeboX template formatting","message":"Tweeking gazeboX template\nformatting\n","repos":"ruffsl\/docker_templates,ros-infrastructure\/docker_images,ruffsl\/docker_templates,osrf\/docker_templates,osrf\/docker_templates,ros-infrastructure\/docker_images","old_file":"ros_docker_images\/templates\/docker_images\/create_gzserverX_image.Dockerfile.em","new_file":"ros_docker_images\/templates\/docker_images\/create_gzserverX_image.Dockerfile.em","new_contents":"@(TEMPLATE(\n 'snippet\/add_generated_comment.Dockerfile.em',\n user_name=user_name,\n tag_name=tag_name,\n source_template_name=template_name,\n now_str=now_str,\n))@\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n template_packages=template_packages,\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n base_image=base_image,\n))@\nMAINTAINER Nate Koenig nkoenig@@osrfoundation.org\n\nRUN apt-get update && apt-get install -y \\\n software-properties-common \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\nRUN apt-add-repository ppa:libccd-debs \\\n && apt-add-repository ppa:fcl-debs \\\n && apt-add-repository ppa:dartsim\n\n@[if 'ros_packages' in locals()]@\n@[if ros_packages]@\n# ROS Setup ####################################################################\n# setup environment\nRUN locale-gen en_US.UTF-8\nENV LANG en_US.UTF-8\n\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.ros.org\/ros\/@os_name @os_code_name main\" > \/etc\/apt\/sources.list.d\/ros-latest.list\n\n# install bootstrap tools\nENV ROS_DISTRO @rosdistro_name\nRUN apt-get update && apt-get install --no-install-recommends -y \\\n python-rosdep \\\n python-rosinstall \\\n python-vcstools \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n# bootstrap rosdep\nRUN rosdep init \\\n && rosdep update\n\n# install ros packages\nRUN apt-get update && apt-get install -y \\\n @(' \\\\\\n '.join(ros_packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n@[end if]@\n@[end if]@\n\n@[if 'gazebo_packages' in locals()]@\n@[if gazebo_packages]@\n# Gazebo Setup #################################################################\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys D2486D2DD83DB69272AFE98867170598AF249743\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.osrfoundation.org\/gazebo\/ubuntu `lsb_release -cs` main\" > \/etc\/apt\/sources.list.d\/gazebo-latest.list\n\n# install gazebo packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(gazebo_packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n@[end if]@\n@[end if]@\n\n@[if 'packages' in locals()]@\n@[if packages]@\n# install packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n@[end if]@\n@[end if]@\n\n@[if 'pip_install' in locals()]@\n@[if pip_install]@\n# install python packages\nRUN pip install \\\n @(' \\\\\\n '.join(pip_install))@\n\n@[end if]@\n@[end if]@\n\n@[if 'sources' in locals()]@\n@[if sources]@\n# clone source\nRUN mkdir -p @(ws)\/src\n@(TEMPLATE(\n 'snippet\/clone_sources.Dockerfile.em',\n sources=sources,\n ws=ws,\n))@\n\n# build source\nWORKDIR @(ws)\nRUN catkin init \\\n && catkin build \\\n -vi \\\n --cmake-args \\\n @(' \\\\\\n '.join(cmake_args))@\n\n@[end if]@\n@[end if]@\n\n# setup environment\nEXPOSE 11345\n\n@[if 'entrypoint_name' in locals()]@\n@[if entrypoint_name]@\n@{\nentrypoint_file = entrypoint_name.split('\/')[-1]\n}@\n# setup entrypoint\nCOPY .\/@entrypoint_file \/\n\nENTRYPOINT [\"\/@entrypoint_file\"]\n@[end if]@\n@[end if]@\n@{\ncmds = [\n'gzserver',\n]\n}@\nCMD [\"@(' && '.join(cmds))\"]\n","old_contents":"@(TEMPLATE(\n 'snippet\/add_generated_comment.Dockerfile.em',\n user_name=user_name,\n tag_name=tag_name,\n source_template_name=template_name,\n now_str=now_str,\n))@\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n template_packages=template_packages,\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n base_image=base_image,\n))@\nMAINTAINER Nate Koenig nkoenig@@osrfoundation.org\n\nRUN apt-get update && apt-get install -y \\\n software-properties-common \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\nRUN apt-add-repository ppa:libccd-debs \\\n && apt-add-repository ppa:fcl-debs \\\n && apt-add-repository ppa:dartsim\n\n@[if 'ros_packages' in locals()]@\n@[if ros_packages]@\n# ROS Setup ####################################################################\n# setup environment\nRUN locale-gen en_US.UTF-8\nENV LANG en_US.UTF-8\n\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.ros.org\/ros\/@os_name @os_code_name main\" > \/etc\/apt\/sources.list.d\/ros-latest.list\n\n# install bootstrap tools\nENV ROS_DISTRO @rosdistro_name\nRUN apt-get update && apt-get install --no-install-recommends -y \\\n python-rosdep \\\n python-rosinstall \\\n python-vcstools \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n# bootstrap rosdep\nRUN rosdep init \\\n && rosdep update\n\n# install ros packages\nRUN apt-get update && apt-get install -y \\\n @(' \\\\\\n '.join(ros_packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n@[end if]@\n@[end if]@\n\n@[if 'gazebo_packages' in locals()]@\n@[if gazebo_packages]@\n# Gazebo Setup #################################################################\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys D2486D2DD83DB69272AFE98867170598AF249743\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.osrfoundation.org\/gazebo\/ubuntu `lsb_release -cs` main\" > \/etc\/apt\/sources.list.d\/gazebo-latest.list\n\n# install gazebo packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(gazebo_packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n@[end if]@\n@[end if]@\n\n@[if 'packages' in locals()]@\n@[if packages]@\n# install packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n@[end if]@\n@[end if]@\n\n@[if 'pip_install' in locals()]@\n@[if pip_install]@\n# install python packages\nRUN pip install \\\n @(' \\\\\\n '.join(pip_install))@\n@[end if]@\n@[end if]@\n\n@[if 'sources' in locals()]@\n@[if sources]@\n# clone source\nENV WS @(ws)\nRUN mkdir -p @(ws)\/src\n@(TEMPLATE(\n 'snippet\/clone_sources.Dockerfile.em',\n sources=sources,\n ws=ws,\n))@\n\n# build source\nRUN cd @(ws) \\\n && catkin init \\\n && catkin build \\\n -vi \\\n --cmake-args \\\n @(' \\\\\\n '.join(cmake_args))@\n@[end if]@\n@[end if]@\n\n# setup environment\nEXPOSE 11345\n\n@[if 'entrypoint_name' in locals()]@\n@[if entrypoint_name]@\n@{\nentrypoint_file = entrypoint_name.split('\/')[-1]\n}@\n# setup entrypoint\nCOPY .\/@entrypoint_file \/\n\nENTRYPOINT [\"\/@entrypoint_file\"]\n@[end if]@\n@[end if]@\n@{\ncmds = [\n'gzserver',\n]\n}@\nCMD [\"@(' && '.join(cmds))\"]\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"3662486b727f4dbc12bcb54a0025e931201fa9c2","subject":"add an argument to the import_upstream job to support test runs Fixes #128","message":"add an argument to the import_upstream job to support test runs\nFixes #128\n","repos":"ruffsl\/ros_buildfarm,mistoll\/ros_buildfarm,ruffsl\/ros_buildfarm,ruffsl\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,mistoll\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,mistoll\/ros_buildfarm","old_file":"ros_buildfarm\/templates\/release\/import_upstream_job.xml.em","new_file":"ros_buildfarm\/templates\/release\/import_upstream_job.xml.em","new_contents":"\n \n Generated at @ESCAPE(now_str) from template '@ESCAPE(template_name)'<\/description>\n@(SNIPPET(\n 'log-rotator',\n days_to_keep=100,\n num_to_keep=100,\n))@\n false<\/keepDependencies>\n \n@(SNIPPET(\n 'property_parameters-definition',\n parameters=[\n {\n 'type': 'string',\n 'name': 'config_file',\n 'description': 'A specific yaml file or files. If unset it defaults to aggregating all yaml files in the directory defined by upstream_config in reprepro-updater.ini',\n },\n ],\n))@\n@(SNIPPET(\n 'property_parameters-definition',\n parameters=[\n {\n 'type': 'boolean',\n 'name': 'EXECUTE_IMPORT',\n 'description': 'If this is not true, it will only do a dry run and print the expect import but not execute.',\n 'default_value': 'false',\n },\n ],\n))@\n@(SNIPPET(\n 'property_requeue-job',\n))@\n <\/properties>\n@(SNIPPET(\n 'scm_git',\n url='https:\/\/github.com\/ros-infrastructure\/reprepro-updater.git',\n branch_name='refactor',\n relative_target_dir='reprepro-updater',\n refspec=None,\n))@\n building_repository<\/assignedNode>\n false<\/canRoam>\n false<\/disabled>\n false<\/blockBuildWhenDownstreamBuilding>\n false<\/blockBuildWhenUpstreamBuilding>\n \n false<\/concurrentBuild>\n \n@(SNIPPET(\n 'builder_shell',\n script='\\n'.join([\n 'echo \"# BEGIN SECTION: import debian packages\"',\n 'if [ \"$EXECUTE_IMPORT\" = \"true\" ]; then',\n ' export COMMIT_ARG=\"--commit\"',\n 'fi',\n 'export PYTHONPATH=$WORKSPACE\/reprepro-updater\/src:$PYTHONPATH',\n 'echo \"# BEGIN SUBSECTION: import debian packages for ubuntu_building\"',\n 'python -u $WORKSPACE\/reprepro-updater\/scripts\/import_upstream.py ubuntu_building $config_file $COMMIT_ARG',\n 'echo \"# END SUBSECTION\"',\n 'echo \"# BEGIN SUBSECTION: import debian packages for ubuntu_testing\"',\n 'python -u $WORKSPACE\/reprepro-updater\/scripts\/import_upstream.py ubuntu_testing $config_file $COMMIT_ARG',\n 'echo \"# END SUBSECTION\"',\n 'echo \"# BEGIN SUBSECTION: import debian packages for ubuntu_main\"',\n 'python -u $WORKSPACE\/reprepro-updater\/scripts\/import_upstream.py ubuntu_main $config_file $COMMIT_ARG',\n 'echo \"# END SUBSECTION\"',\n 'echo \"# END SECTION\"',\n ]),\n))@\n <\/builders>\n \n@(SNIPPET(\n 'publisher_mailer',\n recipients=recipients,\n dynamic_recipients=[],\n send_to_individuals=False,\n))@\n <\/publishers>\n \n@(SNIPPET(\n 'build-wrapper_timestamper',\n))@\n <\/buildWrappers>\n<\/project>\n","old_contents":"\n \n Generated at @ESCAPE(now_str) from template '@ESCAPE(template_name)'<\/description>\n@(SNIPPET(\n 'log-rotator',\n days_to_keep=100,\n num_to_keep=100,\n))@\n false<\/keepDependencies>\n \n@(SNIPPET(\n 'property_parameters-definition',\n parameters=[\n {\n 'type': 'string',\n 'name': 'config_file',\n 'description': 'A specific yaml file or files. If unset it defaults to aggregating all yaml files in the directory defined by upstream_config in reprepro-updater.ini',\n },\n ],\n))@\n@(SNIPPET(\n 'property_requeue-job',\n))@\n <\/properties>\n@(SNIPPET(\n 'scm_git',\n url='https:\/\/github.com\/ros-infrastructure\/reprepro-updater.git',\n branch_name='refactor',\n relative_target_dir='reprepro-updater',\n refspec=None,\n))@\n building_repository<\/assignedNode>\n false<\/canRoam>\n false<\/disabled>\n false<\/blockBuildWhenDownstreamBuilding>\n false<\/blockBuildWhenUpstreamBuilding>\n \n false<\/concurrentBuild>\n \n@(SNIPPET(\n 'builder_shell',\n script='\\n'.join([\n 'echo \"# BEGIN SECTION: import debian packages\"',\n 'export PYTHONPATH=$WORKSPACE\/reprepro-updater\/src:$PYTHONPATH',\n 'echo \"# BEGIN SUBSECTION: import debian packages for ubuntu_building\"',\n 'python -u $WORKSPACE\/reprepro-updater\/scripts\/import_upstream.py ubuntu_building $config_file --commit',\n 'echo \"# END SUBSECTION\"',\n 'echo \"# BEGIN SUBSECTION: import debian packages for ubuntu_testing\"',\n 'python -u $WORKSPACE\/reprepro-updater\/scripts\/import_upstream.py ubuntu_testing $config_file --commit',\n 'echo \"# END SUBSECTION\"',\n 'echo \"# BEGIN SUBSECTION: import debian packages for ubuntu_main\"',\n 'python -u $WORKSPACE\/reprepro-updater\/scripts\/import_upstream.py ubuntu_main $config_file --commit',\n 'echo \"# END SUBSECTION\"',\n 'echo \"# END SECTION\"',\n ]),\n))@\n <\/builders>\n \n@(SNIPPET(\n 'publisher_mailer',\n recipients=recipients,\n dynamic_recipients=[],\n send_to_individuals=False,\n))@\n <\/publishers>\n \n@(SNIPPET(\n 'build-wrapper_timestamper',\n))@\n <\/buildWrappers>\n<\/project>\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"fed07b1e151c788f5a3acce4377cebe52a026093","subject":"Shifting set of locales to after package install","message":"Shifting set of locales to after package install\n\nand adding LC_ALL evn as well","repos":"ruffsl\/docker_templates,ros-infrastructure\/docker_images,ruffsl\/docker_templates,ros-infrastructure\/docker_images,osrf\/docker_templates,osrf\/docker_templates","old_file":"ros_docker_images\/templates\/docker_images\/create_ros2_image.Dockerfile.em","new_file":"ros_docker_images\/templates\/docker_images\/create_ros2_image.Dockerfile.em","new_contents":"@(TEMPLATE(\n 'snippet\/add_generated_comment.Dockerfile.em',\n user_name=user_name,\n tag_name=tag_name,\n source_template_name=template_name,\n now_str=now_str,\n))@\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n template_packages=template_packages,\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n base_image=base_image,\n maintainer_name=maintainer_name,\n))@\n\n# ROS1 Repo Setup ##############################################################\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.ros.org\/ros\/@os_name @os_code_name main\" > \/etc\/apt\/sources.list.d\/ros-latest.list\n\n# OSRF Repo Setup ##############################################################\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys D2486D2DD83DB69272AFE98867170598AF249743\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.osrfoundation.org\/gazebo\/ubuntu-stable @os_code_name main\" > \/etc\/apt\/sources.list.d\/gazebo-latest.list\n\n# ROS2 Setup ###################################################################\n@[if 'packages' in locals()]@\n@[if packages]@\n# install packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n@[end if]@\n@[end if]@\n\n@[if 'pip3_install' in locals()]@\n@[if pip3_install]@\n# install python packages\nRUN pip3 install -U \\\n @(' \\\\\\n '.join(pip3_install))@\n\n@[end if]@\n@[end if]@\n\n@[if 'vcs' in locals()]@\n@[if vcs]@\n# setup environment\nRUN locale-gen en_US.UTF-8\nENV LANG en_US.UTF-8\nENV LC_ALL en_US.UTF-8\n\n# clone source\nENV WS @(ws)\nRUN mkdir -p @(ws)\n@(TEMPLATE(\n 'snippet\/vcs_import.Dockerfile.em',\n vcs=vcs,\n ws=ws,\n))@\n@[end if]@\n@[end if]@\n\n@[if 'ament_args' in locals()]@\n@[if ament_args]@\n# build source\nWORKDIR @(ws)\/..\nRUN src\/ament\/ament_tools\/scripts\/ament.py \\\n @(' \\\\\\n '.join(ament_args))@\n\n@[end if]@\n@[end if]@\n\n@[if 'entrypoint_name' in locals()]@\n@[if entrypoint_name]@\n@{\nentrypoint_file = entrypoint_name.split('\/')[-1]\n}@\n# setup entrypoint\nCOPY .\/@entrypoint_file \/\n\nENTRYPOINT [\"\/@entrypoint_file\"]\n@[end if]@\n@[end if]@\n@{\ncmds = [\n'bash',\n]\n}@\nCMD [\"@(' && '.join(cmds))\"]\n","old_contents":"@(TEMPLATE(\n 'snippet\/add_generated_comment.Dockerfile.em',\n user_name=user_name,\n tag_name=tag_name,\n source_template_name=template_name,\n now_str=now_str,\n))@\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n template_packages=template_packages,\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n base_image=base_image,\n maintainer_name=maintainer_name,\n))@\n\n# ROS1 Repo Setup ##############################################################\n# setup environment\nRUN locale-gen en_US.UTF-8\nENV LANG en_US.UTF-8\n\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.ros.org\/ros\/@os_name @os_code_name main\" > \/etc\/apt\/sources.list.d\/ros-latest.list\n\n# OSRF Repo Setup ##############################################################\n# setup keys\nRUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys D2486D2DD83DB69272AFE98867170598AF249743\n\n# setup sources.list\nRUN echo \"deb http:\/\/packages.osrfoundation.org\/gazebo\/ubuntu-stable @os_code_name main\" > \/etc\/apt\/sources.list.d\/gazebo-latest.list\n\n# ROS2 Setup ###################################################################\n@[if 'packages' in locals()]@\n@[if packages]@\n# install packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n@[end if]@\n@[end if]@\n\n@[if 'pip3_install' in locals()]@\n@[if pip3_install]@\n# install python packages\nRUN pip3 install -U \\\n @(' \\\\\\n '.join(pip3_install))@\n\n@[end if]@\n@[end if]@\n\n@[if 'vcs' in locals()]@\n@[if vcs]@\n# clone source\nENV WS @(ws)\nRUN mkdir -p @(ws)\n@(TEMPLATE(\n 'snippet\/vcs_import.Dockerfile.em',\n vcs=vcs,\n ws=ws,\n))@\n@[end if]@\n@[end if]@\n\n@[if 'ament_args' in locals()]@\n@[if ament_args]@\n# build source\nWORKDIR @(ws)\/..\nRUN src\/ament\/ament_tools\/scripts\/ament.py \\\n @(' \\\\\\n '.join(ament_args))@\n\n@[end if]@\n@[end if]@\n\n@[if 'entrypoint_name' in locals()]@\n@[if entrypoint_name]@\n@{\nentrypoint_file = entrypoint_name.split('\/')[-1]\n}@\n# setup entrypoint\nCOPY .\/@entrypoint_file \/\n\nENTRYPOINT [\"\/@entrypoint_file\"]\n@[end if]@\n@[end if]@\n@{\ncmds = [\n'bash',\n]\n}@\nCMD [\"@(' && '.join(cmds))\"]\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"f083eab63ab1a976578ee61f74b7ac69cf9b6313","subject":"Enable RPM debug packages (#829)","message":"Enable RPM debug packages (#829)\n\nNow that the pulp infrastructure can handle the separate debug packages,\r\nenable RPM debuginfo extraction. This should reduce the install size\r\nsubstantially.","repos":"ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm","old_file":"ros_buildfarm\/templates\/release\/rpm\/mock_config.cfg.em","new_file":"ros_buildfarm\/templates\/release\/rpm\/mock_config.cfg.em","new_contents":"include('\/etc\/mock\/default.cfg')\n\n# Change the root name since we're modifying the chroot\nconfig_opts['root'] += '-ros-buildfarm'\n\n# Disable mock bootstrapping\nconfig_opts['use_bootstrap'] = False\n\n# Add python3-rpm-macros to resolve %{python3_pkgversion} in rosdep rules\nconfig_opts['chroot_setup_cmd'] += ' python3-rpm-macros'\n\n# Install weak dependencies to get group members\nconfig_opts[f'{config_opts.package_manager}_builddep_opts'] = config_opts.get(f'{config_opts.package_manager}_builddep_opts', []) + ['--setopt=install_weak_deps=True']\n\n@[if env_vars]@\n# Set environment vars from the build config\n@[for env_key, env_val in env_vars.items()]@\nconfig_opts['environment']['@env_key'] = '@env_val'\n@[end for]\n@[end if]@\n# Make debuginfo\/debugsource packages best-effort\nconfig_opts['macros']['%_empty_manifest_terminate_build'] = '%{nil}'\nconfig_opts['macros']['%_missing_build_ids_terminate_build'] = '%{nil}'\n\n# Hack the %{dist} macro to allow release suffixing\nconfig_opts['macros']['%dist'] = '.' + config_opts['dist'] + '%{?dist_suffix}'\n\n# Required for running mock in Docker\nconfig_opts['use_nspawn'] = False\n\n@[if os_name in ['centos', 'rhel'] and os_code_name == '7']@\n# Inject g++ 8 into RHEL 7 builds\nconfig_opts['chroot_setup_cmd'] += ' devtoolset-8-gcc-c++ devtoolset-8-make-nonblocking'\nconfig_opts['macros']['%_buildshell'] = '\/usr\/bin\/scl enable devtoolset-8 -- \/bin\/sh'\n\n# Disable weak dependencies on RHEL 7 builds\nconfig_opts['macros']['%_without_weak_deps'] = '1'\n@[else]@\n# Add g++, which is an assumed dependency in ROS\nconfig_opts['chroot_setup_cmd'] += ' gcc-c++ make'\n@[end if]@\n\nconfig_opts[f'{config_opts.package_manager}.conf'] += \"\"\"\n@[for i, url in enumerate(distribution_repository_urls)]@\n[ros-buildfarm-@(i)]\nname=ROS Buildfarm Repository @(i) - $basearch\nbaseurl=@(url)\ngpgkey=file:\/\/\/etc\/pki\/mock\/RPM-GPG-KEY-ros-buildfarm-@(i)\nrepo_gpgcheck=@(1 if i < len(distribution_repository_keys) and distribution_repository_keys[i] else 0)\ngpgcheck=0\nenabled=1\nskip_if_unavailable=False\n\n@[end for]@\n@[if target_repository]@\n[ros-buildfarm-target-source]\nname=ROS Buildfarm Repository Target - SRPMS\nbaseurl=@(target_repository)\nrepo_gpgcheck=0\ngpgcheck=0\nenabled=0\nskip_if_unavailable=False\n\n@[end if]@\n\"\"\"\n","old_contents":"include('\/etc\/mock\/default.cfg')\n\n# Change the root name since we're modifying the chroot\nconfig_opts['root'] += '-ros-buildfarm'\n\n# Disable mock bootstrapping\nconfig_opts['use_bootstrap'] = False\n\n# Add python3-rpm-macros to resolve %{python3_pkgversion} in rosdep rules\nconfig_opts['chroot_setup_cmd'] += ' python3-rpm-macros'\n\n# Install weak dependencies to get group members\nconfig_opts[f'{config_opts.package_manager}_builddep_opts'] = config_opts.get(f'{config_opts.package_manager}_builddep_opts', []) + ['--setopt=install_weak_deps=True']\n\n@[if env_vars]@\n# Set environment vars from the build config\n@[for env_key, env_val in env_vars.items()]@\nconfig_opts['environment']['@env_key'] = '@env_val'\n@[end for]\n@[end if]@\n# Disable debug packages until infrastructure can handle it\nconfig_opts['macros']['%debug_package'] = '%{nil}'\n\n# Hack the %{dist} macro to allow release suffixing\nconfig_opts['macros']['%dist'] = '.' + config_opts['dist'] + '%{?dist_suffix}'\n\n# Required for running mock in Docker\nconfig_opts['use_nspawn'] = False\n\n@[if os_name in ['centos', 'rhel'] and os_code_name == '7']@\n# Inject g++ 8 into RHEL 7 builds\nconfig_opts['chroot_setup_cmd'] += ' devtoolset-8-gcc-c++ devtoolset-8-make-nonblocking'\nconfig_opts['macros']['%_buildshell'] = '\/usr\/bin\/scl enable devtoolset-8 -- \/bin\/sh'\n\n# Disable weak dependencies on RHEL 7 builds\nconfig_opts['macros']['%_without_weak_deps'] = '1'\n@[else]@\n# Add g++, which is an assumed dependency in ROS\nconfig_opts['chroot_setup_cmd'] += ' gcc-c++ make'\n@[end if]@\n\nconfig_opts[f'{config_opts.package_manager}.conf'] += \"\"\"\n@[for i, url in enumerate(distribution_repository_urls)]@\n[ros-buildfarm-@(i)]\nname=ROS Buildfarm Repository @(i) - $basearch\nbaseurl=@(url)\ngpgkey=file:\/\/\/etc\/pki\/mock\/RPM-GPG-KEY-ros-buildfarm-@(i)\nrepo_gpgcheck=@(1 if i < len(distribution_repository_keys) and distribution_repository_keys[i] else 0)\ngpgcheck=0\nenabled=1\nskip_if_unavailable=False\n\n@[end for]@\n@[if target_repository]@\n[ros-buildfarm-target-source]\nname=ROS Buildfarm Repository Target - SRPMS\nbaseurl=@(target_repository)\nrepo_gpgcheck=0\ngpgcheck=0\nenabled=0\nskip_if_unavailable=False\n\n@[end if]@\n\"\"\"\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"2d6929b324e88acb345cde5949e8fc12ef22071c","subject":"fixing ordering lost in review","message":"fixing ordering lost in review\n","repos":"mistoll\/ros_buildfarm,mistoll\/ros_buildfarm,mani-monaj\/ros_buildfarm,130s\/ros_buildfarm,clearpathrobotics\/ros_buildfarm,ruffsl\/ros_buildfarm,clearpathrobotics\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,clearpathrobotics\/ros_buildfarm,ruffsl\/ros_buildfarm,mistoll\/ros_buildfarm,130s\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ruffsl\/ros_buildfarm,mani-monaj\/ros_buildfarm,130s\/ros_buildfarm,mani-monaj\/ros_buildfarm","old_file":"ros_buildfarm\/templates\/release\/binarydeb_task.Dockerfile.em","new_file":"ros_buildfarm\/templates\/release\/binarydeb_task.Dockerfile.em","new_contents":"# generated from @template_name\n\n\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n))@\nMAINTAINER Dirk Thomas dthomas+buildfarm@@osrfoundation.org\n\nVOLUME [\"\/var\/cache\/apt\/archives\"]\n\nENV DEBIAN_FRONTEND noninteractive\nRUN locale-gen en_US.UTF-8\nENV LANG en_US.UTF-8\n\nRUN useradd -u @uid -m buildfarm\n\n@(TEMPLATE(\n 'snippet\/old_release_set.Dockerfile.em',\n os_name=os_name,\n os_code_name=os_code_name,\n))@\n\n@(TEMPLATE(\n 'snippet\/add_distribution_repositories.Dockerfile.em',\n distribution_repository_keys=distribution_repository_keys,\n distribution_repository_urls=distribution_repository_urls,\n os_code_name=os_code_name,\n add_source=False,\n))@\n\n@(TEMPLATE(\n 'snippet\/add_wrapper_scripts.Dockerfile.em',\n wrapper_scripts=wrapper_scripts,\n))@\n\n# automatic invalidation once every day\nRUN echo \"@today_str\"\n\n@(TEMPLATE(\n 'snippet\/install_python3.Dockerfile.em',\n os_name=os_name,\n os_code_name=os_code_name,\n))@\n\nRUN python3 -u \/tmp\/wrapper_scripts\/apt-get.py update-and-install -q -y ccache\n\n@(TEMPLATE(\n 'snippet\/install_dependencies.Dockerfile.em',\n dependencies=dependencies,\n dependency_versions=dependency_versions,\n))@\n\nUSER buildfarm\nENTRYPOINT [\"sh\", \"-c\"]\n@{\ncmd = \\\n 'PYTHONPATH=\/tmp\/ros_buildfarm:$PYTHONPATH' + \\\n ' PATH=\/usr\/lib\/ccache:$PATH' + \\\n ' python3 -u' + \\\n ' \/tmp\/ros_buildfarm\/scripts\/release\/build_binarydeb.py' + \\\n ' ' + rosdistro_name + \\\n ' ' + package_name + \\\n ' --sourcedeb-dir ' + binarydeb_dir\n}@\nCMD [\"@cmd\"]\n","old_contents":"# generated from @template_name\n\n\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n))@\nMAINTAINER Dirk Thomas dthomas+buildfarm@@osrfoundation.org\n\nVOLUME [\"\/var\/cache\/apt\/archives\"]\n\nENV DEBIAN_FRONTEND noninteractive\nRUN locale-gen en_US.UTF-8\nENV LANG en_US.UTF-8\n\nRUN useradd -u @uid -m buildfarm\n\n@(TEMPLATE(\n 'snippet\/old_release_set.Dockerfile.em',\n os_name=os_name,\n os_code_name=os_code_name,\n))@\n\n@(TEMPLATE(\n 'snippet\/add_distribution_repositories.Dockerfile.em',\n distribution_repository_keys=distribution_repository_keys,\n distribution_repository_urls=distribution_repository_urls,\n os_code_name=os_code_name,\n add_source=False,\n))@\n\n@(TEMPLATE(\n 'snippet\/add_wrapper_scripts.Dockerfile.em',\n wrapper_scripts=wrapper_scripts,\n))@\n\n# automatic invalidation once every day\nRUN echo \"@today_str\"\n\n@(TEMPLATE(\n 'snippet\/install_python3.Dockerfile.em',\n os_name=os_name,\n os_code_name=os_code_name,\n))@\n\nRUN python3 -u \/tmp\/wrapper_scripts\/apt-get.py update-and-install -q -y ccache\n\n@(TEMPLATE(\n 'snippet\/install_dependencies.Dockerfile.em',\n dependencies=dependencies,\n dependency_versions=dependency_versions,\n))@\n\nUSER buildfarm\nENTRYPOINT [\"sh\", \"-c\"]\n@{\ncmd = \\\n 'PYTHONPATH=\/tmp\/ros_buildfarm:$PYTHONPATH python3 -u' + \\\n ' PATH=\/usr\/lib\/ccache:$PATH' + \\\n ' \/tmp\/ros_buildfarm\/scripts\/release\/build_binarydeb.py' + \\\n ' ' + rosdistro_name + \\\n ' ' + package_name + \\\n ' --sourcedeb-dir ' + binarydeb_dir\n}@\nCMD [\"@cmd\"]\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"0db18abb2195e4885e38e747a9c92b9f6ff90ce5","subject":"GtkScale: remove inner radius from the trough - SL #3983","message":"GtkScale: remove inner radius from the trough - SL #3983\n\nThis is specially noticeable when the scale slider is not visible,\nwhich is the case of the current palettes. But is good to fix it\nanyway because we cannot depend on the slider to hide it, the bug\nmight be noticeable with the slider above too.\n\nSigned-off-by: Manuel Qui\u00f1ones <6f5069c5b6be23302a13accec56587944be09079@laptop.org>\nAcked-by: Simon Schampijer <088e16a1019277b15d58faf0541e11910eb756f6@laptop.org>\nSigned-off-by: Ajay Garg <1c58a446a63e719d7b90156a8998ccc461609ed7@activitycentral.com>\n","repos":"ceibal-tatu\/sugar-artwork,ceibal-tatu\/sugar-artwork,ceibal-tatu\/sugar-artwork","old_file":"gtk3\/theme\/gtk-widgets.css.em","new_file":"gtk3\/theme\/gtk-widgets.css.em","new_contents":"${\nimport math\n\ndef my_floor(num):\n return int(math.floor(num))\n\ndef my_ceil(num):\n return int(math.ceil(num))\n\n\n# Should we set the line width in the engine to 2.25, and draw non pixel aligned lines?\n# Are these already the correct sizes for the XO?\n\n# These sizes need to be sanity checked ...\nif scaling == \"100\":\n xo = True\n line_width = 2.0 # 2.25px, rounded down\n thick_line_width = 3.5 # 3.5\n subcell_size = 15\n icon_base = 11\n bullet_size = 9.5\n font_height = 24\n default_padding = 6\n toolbutton_padding = 10\nelse: # About 72% of the XO size, adjusted so that eg. toolbuttons work\n xo = False\n line_width = 2.0 # 1.62 rounded up\n thick_line_width = 3.0 # 2.52\n subcell_size = 11 # 10.8\n icon_base = 8 # 7.92\n bullet_size = 6.5 # 6.84\n # This is a guess on the font size (Sans 10 at 96 DPI)\n font_height = 17\n default_padding = 4 # 4.32\n toolbutton_padding = 7 # 7.68\n\n\n# Radio size used to be:\n#\n# radio_size = my_floor(subcell_size + bullet_size + line_width)\n#\n# But a screenshot shows that the graphic was actually rendered at 26px\n# so the SVG displays at the correct size.\n# FIXME this only works for 100, has not been tested in 75 resolution\nradio_size = 26\nscale_slider_width = my_floor(2 * subcell_size + line_width)\nthickness = my_ceil(line_width)\n\nicon_small = icon_base * 3\nicon_large = icon_base * 5\n\n}\n\n* {\n -sugar-focus-line: @white;\n\n \/* A lot of these will probably need to be changed, but this has to\n be done when the exact sizes are known *\/\n -GtkWidget-interior-focus: 0;\n\n \/* we have to disable focus border for GtkTreeView, see #1261 *\/\n -GtkTreeView-interior-focus: 1;\n -GtkTreeView-focus-line-width: 0;\n\n -GtkTextView-interior-focus: 1;\n\n -GtkWidget-focus-line-width: 0; \/* Prevents some drawing glitches *\/\n -GtkEntry-focus-line-width: 0;\n -GtkScale-focus-line-width: 0;\n -GtkWidget-focus-padding: 0;\n \/* 0.05 works good for both the sugar and sugar-xo themes *\/\n -GtkWidget-cursor-aspect-ratio: 0.05;\n\n -GtkWidget-wide-separators: false;\n -GtkWidget-separator-height: $thickness;\n -GtkWidget-separator-width: $thickness;\n\n -GtkWidget-scroll-arrow-hlength: $subcell_size;\n -GtkWidget-scroll-arrow-vlength: $subcell_size;\n\n -GtkRange-activate-slider: 1;\n\n \/* We fake the default border in the theme *\/\n -GtkButton-default-border: 0 0 0 0;\n -GtkButton-default-outside-border: 0 0 0 0;\n -GtkButton-image-spacing: $subcell_size;\n\n -GtkEntry-progress-border: $thickness $thickness $thickness $thickness;\n\n -GtkScrolledWindow-scrollbar-spacing: 0;\n\n -GtkExpander-expander-size: $font_height;\n -GtkExpander-expander-spacing: 2;\n\n -GtkTreeView-expander-size: $font_height;\n\n -GtkArrow-arrow-size: 1.0;\n\n -GtkToolbar-space-size: $(2*subcell_size);\n -GtkToolbar-shadow-type: none;\n\n -GtkProgressBar-min-horizontal-bar-height: $subcell_size;\n -GtkProgressBar-min-vertical-bar-width: $subcell_size;\n\n -GtkButtonBox-child-min-height: $(3*subcell_size);\n -GtkButtonBox-child-min-width: $(3*subcell_size);\n -GtkButtonBox-child-internal-pad-x: 0;\n -GtkButtonBox-child-internal-pad-y: 0;\n\n -GtkCheckButton-indicator-size: $radio_size;\n -GtkCheckButton-indicator-spacing: 3;\n\n -GtkWidget-text-handle-width: 55px;\n -GtkWidget-text-handle-height: 55px;\n}\n\n\/* Backgrounds and windows *\/\n\nGtkWindow {\n background-color: @panel_grey;\n color: @black;\n}\n\nGtkDialog {\n background-color: @black;\n color: @white;\n}\n\nSugarIntroWindow {\n background-color: @white;\n}\n\nSugarIntroWindow {\n color: @black;\n}\n\nGtkLabel, GtkLabel:insensitive {\n background-color: transparent;\n}\n\n\/* Handle this differently? *\/\n.window *:insensitive {\n background-color: @panel_grey;\n}\n\n\/* Buttons *\/\n\n.button {\n ${ border = max(0, my_ceil((3*subcell_size\/2.0 - icon_small \/ 2.0))) }\n \/* It would be nicer to just set the inner-border, but that does not work\n for combo boxes ... The combobox ignores it, so set it to 0px\n See http:\/\/bugzilla.gnome.org\/show_bug.cgi?id=485762 *\/\n\n -GtkButton-inner-border: 0 0 0 0;\n padding: $(border)px $(border)px $(border)px $(border)px;\n\n border-width: $(thickness)px;\n border-color: @button_grey;\n border-style: solid;\n border-radius: $(2*subcell_size)px;\n background-color: @button_grey;\n color: @white;\n}\n\n.button:focused,\n.button:active {\n border-color: @white;\n}\n\n.button:active {\n background-color: @white;\n}\n\n.button:active:focused {\n color: @black;\n}\n\n\/* Spin buttons *\/\n\n.spinbutton.button {\n border-radius: 0px;\n border-width: 0px;\n border-style: solid;\n background-color: @button_grey;\n}\n\n.spinbutton.button:last-child {\n border-radius: 0px $(2*subcell_size)px $(2*subcell_size)px 0px;\n border-width: 0px 0px 0px $(thickness)px;\n border-style: solid;\n border-color: @selection_grey;\n}\n\n\n.spinbutton.button:active {\n background-color: @black;\n}\n\n.spinbutton.button:insensitive {\n background-color: @selection_grey;\n}\n\n\/* Toggle buttons *\/\n\nGtkToggleButton.button:active {\n background-color: @white;\n color: @black;\n}\n\n\/* Entries and views *\/\n\n.view {\n border-width: 0px;\n border-style: none;\n border-radius: 0px;\n padding: 0px;\n background-color: @white;\n color: @black;\n}\n\nGtkTreeView {\n background-color: @button_grey;\n}\n\nGtkTreeView row:nth-child(even) {\n background-color: @row_even;\n}\nGtkTreeView row:nth-child(odd) {\n background-color: @row_odd;\n}\n\n.entry {\n border-radius: $(2 * subcell_size)px;\n border-width: $(thickness)px;\n border-color: @text_field_grey;\n border-style: solid;\n background-color: @text_field_grey;\n color: @black;\n ${ entry_ythickness = my_ceil(0.2 * (subcell_size*3.0\/2.0 - thickness) + thickness) }\n ${ entry_xthickness = my_ceil(0.32 * (subcell_size*3.0\/2.0 - thickness) + thickness) }\n padding: $(2 * max(my_ceil((3*subcell_size - font_height - entry_ythickness*2)\/2.0),0))px $(2 * max(subcell_size - entry_xthickness, 0))px $(2 * max(my_floor((3*subcell_size - font_height - entry_ythickness*2)\/2.0), 0))px $(2 * max(subcell_size - entry_xthickness, 0))px;\n}\n\n.entry.progressbar {\n border-radius: $(2 * subcell_size)px;\n border-width: $(thickness)px;\n background-color: @selection_grey;\n}\n\n.entry:focused {\n background-color: @white;\n}\n\n.toolbar .entry:focused {\n border-color: @white;\n}\n\n.entry:insensitive, .view:insensitive {\n background-color: @button_grey;\n}\n\n.entry:insensitive {\n border-color: @button_grey;\n}\n\n.view:selected {\n background-color: @panel_grey;\n color: @black;\n}\n\n.entry:selected, .entry:selected:focused, \n.view:selected:focused {\n background-color: @selection_grey;\n color: @black;\n}\n\n.entry:selected, .entry:selected:focused {\n border-color: @selection_grey;\n}\n\n\/* Frames *\/\n\nGtkScrolledWindow.frame {\n border-style: solid;\n border-color: @selection_grey;\n border-width: $(thickness)px;\n border-radius: 0;\n padding: $(default_padding)px;\n}\n\n\/* Combo boxes *\/\n\nGtkComboBox {\n color: @white;\n}\n\nGtkComboBox .separator {\n \/* Remove the separator turning it transparent *\/\n color: alpha(@theme_base_color, 0.0);\n}\n\n\/* Notebooks *\/\n\n.notebook {\n background-color: @selection_grey;\n color: @black;\n padding: 0px;\n -GtkNotebook-tab-overlap: -2;\n -GtkNotebook-tab-curvature: $default_padding;\n}\n\n.notebook tab {\n background-color: @selection_grey;\n}\n\n\/* Setting white color to the tab labels using only the previous rule *\/\n\/* doesn't work, so we have to set white color to the GtkLabel, and make *\/\n\/* sure the buttons get black color in the next two rules: *\/\n.notebook tab GtkLabel {\n color: @white;\n}\n\n.notebook tab .button GtkLabel {\n color: @black;\n}\n\n.notebook tab:active {\n background-color: @toolbar_grey;\n}\n\n.notebook tab .button {\n border-radius: $(toolbutton_padding)px;\n}\n\n\/* Browse Widgets *\/\n\nBrowseTabPage {\n background-color: @black;\n}\n\n\/* Control panel *\/\n\nSugarSectionView {\n background-color: @white;\n color: @black;\n}\n\nSugarSectionView *:insensitive {\n background-color: @white;\n}\n\n\/* Alert *\/\n\nSugarAlert {\n background-color: @black;\n color: @white;\n}\n\nSugarAlert *:insensitive {\n background-color: @black;\n}\n\n.button SugarTimeoutIcon GtkLabel,\n.button SugarTimeoutIcon GtkLabel:prelight {\n background-color: @white;\n color: @button_grey;\n border-radius: $(2 * subcell_size)px;\n}\n\n.button SugarTimeoutIcon GtkLabel:active {\n background-color: @toolbar_grey;\n color: @white;\n}\n\n\/* Tray *\/\n\nSugarHTray * , SugarVTray * { background-color: @toolbar_grey;}\n\n\/* Menus and palettes *\/\n\nSugarPaletteWindowWidget {\n background-color: @black;\n color: @white;\n}\n\nSugarPaletteMenuWidget {\n background-color: @black;\n}\n\nSugarPaletteMenuWidget * {\n color: @white;\n}\n\nSugarPaletteWindow SugarGroupBox {\n background-color: @toolbar_grey;\n color: @white;\n}\n\nSugarPaletteWindow SugarGroupBox *:insensitive {\n background-color: @toolbar_grey;\n}\n\n.menu {\n background-color: @black;\n color: @white;\n\n -GtkMenu-scroll-arrow-vlength: $(my_floor(subcell_size\/0.7 + 2*thickness));\n -GtkMenu-horizontal-padding: $thickness;\n -GtkMenu-vertical-padding : $thickness;\n \/* This means the outline of the submenu overlaps with a palette.\n * However in the case of two normal menus, they are next to each other.\n * It is not possible to be smarter about this, because the style comes from\n * the submenu. *\/\n -GtkMenu-horizontal-offset : 0;\n -GtkMenu-vertical-offset : 0;\n\n padding: 0px 0px $(subcell_size)px 0px;\n border-width: 2px;\n border-color: @button_grey;\n border-style: solid;\n}\n\n.menu :active {\n background-color: @button_grey;\n}\n\n.menuitem {\n padding: $(subcell_size)px $((subcell_size * 3 - font_height) \/ 2)px;\n}\n\n.menuitem:prelight {\n background-color: @button_grey;\n}\n\n.menuitem.separator {\n padding: $(subcell_size)px 0px;\n color: @button_grey;\n}\n\nSugarPaletteHeader.menuitem {\n padding: 0px $((subcell_size * 3 - font_height) \/ 2)px;\n}\n\nSugarPaletteHeader.menuitem:prelight {\n background-color: @black;\n}\n\nSugarPaletteHeaderSeparator.menuitem.separator {\n padding: 0px 0px $(subcell_size)px 0px;\n}\n\n.tooltip {\n background-color: @black;\n border-style: solid;\n border-width: $(thickness)px;\n border-color: @button_grey;\n}\n\n.tooltip * {\n color: @white;\n}\n\n\/* Scrollbars *\/\n\n.scrollbar {\n -GtkRange-slider-width: $subcell_size;\n -GtkRange-trough-border: 0;\n -GtkRange-stepper-size: 0;\n -GtkScrollbar-min-slider-length: $(3*subcell_size);\n -GtkScrollbar-has-forward-stepper: 0;\n -GtkScrollbar-has-backward-stepper: 0;\n -GtkScrollbar-has-secondary-forward-stepper: 0;\n -GtkScrollbar-has-secondary-backward-stepper: 0;\n}\n\n.scrollbar.trough {\n background-color: @button_grey;\n border-width: 0px;\n}\n\n.scrollbar.slider {\n background-color: @white;\n border-radius: $(2*subcell_size)px;\n border-width: 0px;\n}\n\n.scrollbar.slider:active {\n background-color: @text_field_grey;\n}\n\n\/* Progress bars *\/\n\n\/* Scrollbar padding hack? What was that about? *\/\n\nGtkProgressBar.progressbar {\n background-color: @white;\n border-color: @white;\n border-radius: 10px;\n border-style: solid;\n border-width: 0px;\n}\n\nGtkProgressBar.trough {\n background-color: alpha (@black, 0.0);\n border-style: solid;\n border-radius: 10px;\n border-color: @button_grey;\n border-width: 2px;\n}\n\n\/* Separators *\/\n\nGtkVSeparator, GtkHSeparator,\n.toolbar GtkSeparatorToolItem {\n color: @button_grey;\n}\n\n\/* Tool buttons *\/\n\n.toolbar {\npadding: 0px;\nbackground-color: @toolbar_grey;\ncolor: @white;\n}\n\n.toolbar .button,\nSugarPaletteWindowWidget SugarRadioToolButton .button {\n border-color: transparent;\n border-radius: 0px;\n border-style: none;\n}\n\n.toolbar GtkToolButton .button,\n.toolbar SugarRadioToolButton *,\nSugarPaletteWindowWidget SugarRadioToolButton *,\nSugarPaletteWindowWidget GtkToolButton .button {\n background-color: transparent;\n border-radius: $(toolbutton_padding)px;\n padding: $(toolbutton_padding)px;\n}\n\n.toolbar GtkToolButton .button:prelight,\nSugarPaletteWindowWidget GtkToolButton .button:prelight {\n background-color: @black;\n}\n\n.toolbar SugarRadioToolButton *:active,\nSugarPaletteWindowWidget SugarRadioToolButton *:active {\n background-color: @button_grey;\n border-radius: $(toolbutton_padding)px;\n}\n\nSugarPaletteWindowWidget GtkToolButton .button:active {\n background-color: @transparent;\n}\n\n.toolbar GtkToolButton .button:active {\n background-color: @button_grey;\n border-radius: $(toolbutton_padding)px;\n}\n\nSugarPaletteWindowWidget GtkScrolledWindow * {\n background-color: @black;\n}\n\n.toolbar GtkComboBox .button {\n border-radius: $(2*subcell_size)px;\n}\n\n\/* Scales *\/\n\n.scale {\n -GtkScale-slider-length: $scale_slider_width;\n -GtkRange-slider-width: $scale_slider_width;\n}\n\n.scale.trough {\n background-color: @button_grey;\n border-style: solid;\n border-color: @button_grey;\n border-width: $(thickness)px;\n}\n\n.scale.trough:focused {\n border-color: @white;\n}\n\n.scale.trough.top,\n.scale.trough.left {\n background-color: @white;\n}\n\n.scale.trough.top:focused,\n.scale.trough.left:focused {\n border-color: @selection_grey;\n}\n\n.scale.trough {\n border-radius: 0px $(2*subcell_size)px $(2*subcell_size)px 0px;\n}\n\n.scale.trough.vertical {\n border-radius: 0px 0px $(2*subcell_size)px $(2*subcell_size)px;\n}\n\n.scale.trough.top {\n border-radius: $(2*subcell_size)px $(2*subcell_size)px 0px 0px;\n}\n\n.scale.trough.left {\n border-radius: $(2*subcell_size)px 0px 0px $(2*subcell_size)px;\n}\n\n.scale.slider,\n.scale.slider:active {\n background-color: transparent;\n}\n\n.scale.slider {\n background-image: url(\"assets\/scale-slider.svg\");\n}\n\n.scale.slider:active {\n background-image: url(\"assets\/scale-slider-active.svg\");\n}\n\n\/* Radio and check buttons *\/\n\nGtkCheckButton {\n color: @black;\n}\n\nGtkCheckButton:prelight {\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.toolbar GtkCheckButton *:active,\nSugarPaletteWindowWidget GtkCheckButton *:active {\n color: @theme_base_color;\n}\n\n.radio,\n.radio row:selected,\n.radio row:selected:focused {\n background-image: url(\"assets\/radio.svg\");\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.radio:selected,\n.radio:selected row:selected,\n.radio:selected row:selected:focused {\n background-image: url(\"assets\/radio-selected.svg\");\n}\n\n.radio:active,\n.radio row:selected:active,\n.radio row:selected:focused:active {\n background-image: url(\"assets\/radio-active.svg\");\n}\n\n.radio:active:selected,\n.radio:selected row:selected:active,\n.radio:selected row:selected:focused:active {\n background-image: url(\"assets\/radio-active-selected.svg\");\n}\n\n.check,\n.check row:selected,\n.check row:selected:focused {\n background-image: url(\"assets\/checkbox-unchecked.svg\");\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.check:selected,\n.check:selected row:selected,\n.check:selected row:selected:focused {\n background-image: url(\"assets\/checkbox-unchecked-selected.svg\");\n}\n\n.check:active,\n.check row:selected:active,\n.check row:selected:focused:active {\n background-image: url(\"assets\/checkbox-checked.svg\");\n}\n\n.check:active:selected,\n.check:selected row:selected:active,\n.check:selected row:selected:focused:active {\n background-image: url(\"assets\/checkbox-checked-selected.svg\");\n}\n\n\/* Tool items *\/\n\n.toolitem {\n \/* arrow in the toolbarbox *\/\n color: @white;\n \/* outline of the toolbarbutton when palette is expanded *\/\n border-style: solid;\n border-width: 2px;\n border-color: @button_grey;\n}\n\n\/* GtkImage *\/\n\nGtkImage {\n background-color: transparent;\n}\n\n\/* Sugar Frame Window *\/\n\nSugarFrameWindow {\n background-color: @toolbar_grey;\n}\n\n\/* Sugar Canvas icon *\/\n\nSugarCanvasIcon {\n border-color: transparent;\n border-radius: $(4 * thickness)px;\n border-width: 2px;\n border-style: solid;\n}\n\nSugarCanvasIcon:prelight {\n border-color: @zoom_views_prelight;\n background-color: @zoom_views_prelight;\n}\n\nSugarCanvasIcon:active {\n border-color: @zoom_views_active;\n background-color: @zoom_views_active;\n}\n\n\/* Text cursor handles *\/\n\n.cursor-handle.top,\n.cursor-handle.bottom {\n background-color: transparent;\n box-shadow: none;\n border-style: none;\n border-image: none;\n border-radius: 0px;\n border-width: 0px;\n}\n\n.cursor-handle.bottom {\n background-image: url(\"assets\/cursor-handle-bottom.svg\");\n}\n\n.cursor-handle.top {\n background-image: url(\"assets\/cursor-handle-top.svg\");\n}\n\n.cursor-handle.insert-cursor {\n background-image: url(\"assets\/cursor-handle-insert.svg\");\n}\n","old_contents":"${\nimport math\n\ndef my_floor(num):\n return int(math.floor(num))\n\ndef my_ceil(num):\n return int(math.ceil(num))\n\n\n# Should we set the line width in the engine to 2.25, and draw non pixel aligned lines?\n# Are these already the correct sizes for the XO?\n\n# These sizes need to be sanity checked ...\nif scaling == \"100\":\n xo = True\n line_width = 2.0 # 2.25px, rounded down\n thick_line_width = 3.5 # 3.5\n subcell_size = 15\n icon_base = 11\n bullet_size = 9.5\n font_height = 24\n default_padding = 6\n toolbutton_padding = 10\nelse: # About 72% of the XO size, adjusted so that eg. toolbuttons work\n xo = False\n line_width = 2.0 # 1.62 rounded up\n thick_line_width = 3.0 # 2.52\n subcell_size = 11 # 10.8\n icon_base = 8 # 7.92\n bullet_size = 6.5 # 6.84\n # This is a guess on the font size (Sans 10 at 96 DPI)\n font_height = 17\n default_padding = 4 # 4.32\n toolbutton_padding = 7 # 7.68\n\n\n# Radio size used to be:\n#\n# radio_size = my_floor(subcell_size + bullet_size + line_width)\n#\n# But a screenshot shows that the graphic was actually rendered at 26px\n# so the SVG displays at the correct size.\n# FIXME this only works for 100, has not been tested in 75 resolution\nradio_size = 26\nscale_slider_width = my_floor(2 * subcell_size + line_width)\nthickness = my_ceil(line_width)\n\nicon_small = icon_base * 3\nicon_large = icon_base * 5\n\n}\n\n* {\n -sugar-focus-line: @white;\n\n \/* A lot of these will probably need to be changed, but this has to\n be done when the exact sizes are known *\/\n -GtkWidget-interior-focus: 0;\n\n \/* we have to disable focus border for GtkTreeView, see #1261 *\/\n -GtkTreeView-interior-focus: 1;\n -GtkTreeView-focus-line-width: 0;\n\n -GtkTextView-interior-focus: 1;\n\n -GtkWidget-focus-line-width: 0; \/* Prevents some drawing glitches *\/\n -GtkEntry-focus-line-width: 0;\n -GtkScale-focus-line-width: 0;\n -GtkWidget-focus-padding: 0;\n \/* 0.05 works good for both the sugar and sugar-xo themes *\/\n -GtkWidget-cursor-aspect-ratio: 0.05;\n\n -GtkWidget-wide-separators: false;\n -GtkWidget-separator-height: $thickness;\n -GtkWidget-separator-width: $thickness;\n\n -GtkWidget-scroll-arrow-hlength: $subcell_size;\n -GtkWidget-scroll-arrow-vlength: $subcell_size;\n\n -GtkRange-activate-slider: 1;\n\n \/* We fake the default border in the theme *\/\n -GtkButton-default-border: 0 0 0 0;\n -GtkButton-default-outside-border: 0 0 0 0;\n -GtkButton-image-spacing: $subcell_size;\n\n -GtkEntry-progress-border: $thickness $thickness $thickness $thickness;\n\n -GtkScrolledWindow-scrollbar-spacing: 0;\n\n -GtkExpander-expander-size: $font_height;\n -GtkExpander-expander-spacing: 2;\n\n -GtkTreeView-expander-size: $font_height;\n\n -GtkArrow-arrow-size: 1.0;\n\n -GtkToolbar-space-size: $(2*subcell_size);\n -GtkToolbar-shadow-type: none;\n\n -GtkProgressBar-min-horizontal-bar-height: $subcell_size;\n -GtkProgressBar-min-vertical-bar-width: $subcell_size;\n\n -GtkButtonBox-child-min-height: $(3*subcell_size);\n -GtkButtonBox-child-min-width: $(3*subcell_size);\n -GtkButtonBox-child-internal-pad-x: 0;\n -GtkButtonBox-child-internal-pad-y: 0;\n\n -GtkCheckButton-indicator-size: $radio_size;\n -GtkCheckButton-indicator-spacing: 3;\n\n -GtkWidget-text-handle-width: 55px;\n -GtkWidget-text-handle-height: 55px;\n}\n\n\/* Backgrounds and windows *\/\n\nGtkWindow {\n background-color: @panel_grey;\n color: @black;\n}\n\nGtkDialog {\n background-color: @black;\n color: @white;\n}\n\nSugarIntroWindow {\n background-color: @white;\n}\n\nSugarIntroWindow {\n color: @black;\n}\n\nGtkLabel, GtkLabel:insensitive {\n background-color: transparent;\n}\n\n\/* Handle this differently? *\/\n.window *:insensitive {\n background-color: @panel_grey;\n}\n\n\/* Buttons *\/\n\n.button {\n ${ border = max(0, my_ceil((3*subcell_size\/2.0 - icon_small \/ 2.0))) }\n \/* It would be nicer to just set the inner-border, but that does not work\n for combo boxes ... The combobox ignores it, so set it to 0px\n See http:\/\/bugzilla.gnome.org\/show_bug.cgi?id=485762 *\/\n\n -GtkButton-inner-border: 0 0 0 0;\n padding: $(border)px $(border)px $(border)px $(border)px;\n\n border-width: $(thickness)px;\n border-color: @button_grey;\n border-style: solid;\n border-radius: $(2*subcell_size)px;\n background-color: @button_grey;\n color: @white;\n}\n\n.button:focused,\n.button:active {\n border-color: @white;\n}\n\n.button:active {\n background-color: @white;\n}\n\n.button:active:focused {\n color: @black;\n}\n\n\/* Spin buttons *\/\n\n.spinbutton.button {\n border-radius: 0px;\n border-width: 0px;\n border-style: solid;\n background-color: @button_grey;\n}\n\n.spinbutton.button:last-child {\n border-radius: 0px $(2*subcell_size)px $(2*subcell_size)px 0px;\n border-width: 0px 0px 0px $(thickness)px;\n border-style: solid;\n border-color: @selection_grey;\n}\n\n\n.spinbutton.button:active {\n background-color: @black;\n}\n\n.spinbutton.button:insensitive {\n background-color: @selection_grey;\n}\n\n\/* Toggle buttons *\/\n\nGtkToggleButton.button:active {\n background-color: @white;\n color: @black;\n}\n\n\/* Entries and views *\/\n\n.view {\n border-width: 0px;\n border-style: none;\n border-radius: 0px;\n padding: 0px;\n background-color: @white;\n color: @black;\n}\n\nGtkTreeView {\n background-color: @button_grey;\n}\n\nGtkTreeView row:nth-child(even) {\n background-color: @row_even;\n}\nGtkTreeView row:nth-child(odd) {\n background-color: @row_odd;\n}\n\n.entry {\n border-radius: $(2 * subcell_size)px;\n border-width: $(thickness)px;\n border-color: @text_field_grey;\n border-style: solid;\n background-color: @text_field_grey;\n color: @black;\n ${ entry_ythickness = my_ceil(0.2 * (subcell_size*3.0\/2.0 - thickness) + thickness) }\n ${ entry_xthickness = my_ceil(0.32 * (subcell_size*3.0\/2.0 - thickness) + thickness) }\n padding: $(2 * max(my_ceil((3*subcell_size - font_height - entry_ythickness*2)\/2.0),0))px $(2 * max(subcell_size - entry_xthickness, 0))px $(2 * max(my_floor((3*subcell_size - font_height - entry_ythickness*2)\/2.0), 0))px $(2 * max(subcell_size - entry_xthickness, 0))px;\n}\n\n.entry.progressbar {\n border-radius: $(2 * subcell_size)px;\n border-width: $(thickness)px;\n background-color: @selection_grey;\n}\n\n.entry:focused {\n background-color: @white;\n}\n\n.toolbar .entry:focused {\n border-color: @white;\n}\n\n.entry:insensitive, .view:insensitive {\n background-color: @button_grey;\n}\n\n.entry:insensitive {\n border-color: @button_grey;\n}\n\n.view:selected {\n background-color: @panel_grey;\n color: @black;\n}\n\n.entry:selected, .entry:selected:focused, \n.view:selected:focused {\n background-color: @selection_grey;\n color: @black;\n}\n\n.entry:selected, .entry:selected:focused {\n border-color: @selection_grey;\n}\n\n\/* Frames *\/\n\nGtkScrolledWindow.frame {\n border-style: solid;\n border-color: @selection_grey;\n border-width: $(thickness)px;\n border-radius: 0;\n padding: $(default_padding)px;\n}\n\n\/* Combo boxes *\/\n\nGtkComboBox {\n color: @white;\n}\n\nGtkComboBox .separator {\n \/* Remove the separator turning it transparent *\/\n color: alpha(@theme_base_color, 0.0);\n}\n\n\/* Notebooks *\/\n\n.notebook {\n background-color: @selection_grey;\n color: @black;\n padding: 0px;\n -GtkNotebook-tab-overlap: -2;\n -GtkNotebook-tab-curvature: $default_padding;\n}\n\n.notebook tab {\n background-color: @selection_grey;\n}\n\n\/* Setting white color to the tab labels using only the previous rule *\/\n\/* doesn't work, so we have to set white color to the GtkLabel, and make *\/\n\/* sure the buttons get black color in the next two rules: *\/\n.notebook tab GtkLabel {\n color: @white;\n}\n\n.notebook tab .button GtkLabel {\n color: @black;\n}\n\n.notebook tab:active {\n background-color: @toolbar_grey;\n}\n\n.notebook tab .button {\n border-radius: $(toolbutton_padding)px;\n}\n\n\/* Browse Widgets *\/\n\nBrowseTabPage {\n background-color: @black;\n}\n\n\/* Control panel *\/\n\nSugarSectionView {\n background-color: @white;\n color: @black;\n}\n\nSugarSectionView *:insensitive {\n background-color: @white;\n}\n\n\/* Alert *\/\n\nSugarAlert {\n background-color: @black;\n color: @white;\n}\n\nSugarAlert *:insensitive {\n background-color: @black;\n}\n\n.button SugarTimeoutIcon GtkLabel,\n.button SugarTimeoutIcon GtkLabel:prelight {\n background-color: @white;\n color: @button_grey;\n border-radius: $(2 * subcell_size)px;\n}\n\n.button SugarTimeoutIcon GtkLabel:active {\n background-color: @toolbar_grey;\n color: @white;\n}\n\n\/* Tray *\/\n\nSugarHTray * , SugarVTray * { background-color: @toolbar_grey;}\n\n\/* Menus and palettes *\/\n\nSugarPaletteWindowWidget {\n background-color: @black;\n color: @white;\n}\n\nSugarPaletteMenuWidget {\n background-color: @black;\n}\n\nSugarPaletteMenuWidget * {\n color: @white;\n}\n\nSugarPaletteWindow SugarGroupBox {\n background-color: @toolbar_grey;\n color: @white;\n}\n\nSugarPaletteWindow SugarGroupBox *:insensitive {\n background-color: @toolbar_grey;\n}\n\n.menu {\n background-color: @black;\n color: @white;\n\n -GtkMenu-scroll-arrow-vlength: $(my_floor(subcell_size\/0.7 + 2*thickness));\n -GtkMenu-horizontal-padding: $thickness;\n -GtkMenu-vertical-padding : $thickness;\n \/* This means the outline of the submenu overlaps with a palette.\n * However in the case of two normal menus, they are next to each other.\n * It is not possible to be smarter about this, because the style comes from\n * the submenu. *\/\n -GtkMenu-horizontal-offset : 0;\n -GtkMenu-vertical-offset : 0;\n\n padding: 0px 0px $(subcell_size)px 0px;\n border-width: 2px;\n border-color: @button_grey;\n border-style: solid;\n}\n\n.menu :active {\n background-color: @button_grey;\n}\n\n.menuitem {\n padding: $(subcell_size)px $((subcell_size * 3 - font_height) \/ 2)px;\n}\n\n.menuitem:prelight {\n background-color: @button_grey;\n}\n\n.menuitem.separator {\n padding: $(subcell_size)px 0px;\n color: @button_grey;\n}\n\nSugarPaletteHeader.menuitem {\n padding: 0px $((subcell_size * 3 - font_height) \/ 2)px;\n}\n\nSugarPaletteHeader.menuitem:prelight {\n background-color: @black;\n}\n\nSugarPaletteHeaderSeparator.menuitem.separator {\n padding: 0px 0px $(subcell_size)px 0px;\n}\n\n.tooltip {\n background-color: @black;\n border-style: solid;\n border-width: $(thickness)px;\n border-color: @button_grey;\n}\n\n.tooltip * {\n color: @white;\n}\n\n\/* Scrollbars *\/\n\n.scrollbar {\n -GtkRange-slider-width: $subcell_size;\n -GtkRange-trough-border: 0;\n -GtkRange-stepper-size: 0;\n -GtkScrollbar-min-slider-length: $(3*subcell_size);\n -GtkScrollbar-has-forward-stepper: 0;\n -GtkScrollbar-has-backward-stepper: 0;\n -GtkScrollbar-has-secondary-forward-stepper: 0;\n -GtkScrollbar-has-secondary-backward-stepper: 0;\n}\n\n.scrollbar.trough {\n background-color: @button_grey;\n border-width: 0px;\n}\n\n.scrollbar.slider {\n background-color: @white;\n border-radius: $(2*subcell_size)px;\n border-width: 0px;\n}\n\n.scrollbar.slider:active {\n background-color: @text_field_grey;\n}\n\n\/* Progress bars *\/\n\n\/* Scrollbar padding hack? What was that about? *\/\n\nGtkProgressBar.progressbar {\n background-color: @white;\n border-color: @white;\n border-radius: 10px;\n border-style: solid;\n border-width: 0px;\n}\n\nGtkProgressBar.trough {\n background-color: alpha (@black, 0.0);\n border-style: solid;\n border-radius: 10px;\n border-color: @button_grey;\n border-width: 2px;\n}\n\n\/* Separators *\/\n\nGtkVSeparator, GtkHSeparator,\n.toolbar GtkSeparatorToolItem {\n color: @button_grey;\n}\n\n\/* Tool buttons *\/\n\n.toolbar {\npadding: 0px;\nbackground-color: @toolbar_grey;\ncolor: @white;\n}\n\n.toolbar .button,\nSugarPaletteWindowWidget SugarRadioToolButton .button {\n border-color: transparent;\n border-radius: 0px;\n border-style: none;\n}\n\n.toolbar GtkToolButton .button,\n.toolbar SugarRadioToolButton *,\nSugarPaletteWindowWidget SugarRadioToolButton *,\nSugarPaletteWindowWidget GtkToolButton .button {\n background-color: transparent;\n border-radius: $(toolbutton_padding)px;\n padding: $(toolbutton_padding)px;\n}\n\n.toolbar GtkToolButton .button:prelight,\nSugarPaletteWindowWidget GtkToolButton .button:prelight {\n background-color: @black;\n}\n\n.toolbar SugarRadioToolButton *:active,\nSugarPaletteWindowWidget SugarRadioToolButton *:active {\n background-color: @button_grey;\n border-radius: $(toolbutton_padding)px;\n}\n\nSugarPaletteWindowWidget GtkToolButton .button:active {\n background-color: @transparent;\n}\n\n.toolbar GtkToolButton .button:active {\n background-color: @button_grey;\n border-radius: $(toolbutton_padding)px;\n}\n\nSugarPaletteWindowWidget GtkScrolledWindow * {\n background-color: @black;\n}\n\n.toolbar GtkComboBox .button {\n border-radius: $(2*subcell_size)px;\n}\n\n\/* Scales *\/\n\n.scale {\n -GtkScale-slider-length: $scale_slider_width;\n -GtkRange-slider-width: $scale_slider_width;\n}\n\n.scale.trough {\n background-color: @button_grey;\n border-style: solid;\n border-radius: $(2*subcell_size)px;\n border-color: @button_grey;\n border-width: $(thickness)px;\n}\n\n.scale.trough:focused {\n border-color: @white;\n}\n\n.scale.trough.top,\n.scale.trough.left {\n background-color: @white;\n}\n\n.scale.trough.top:focused,\n.scale.trough.left:focused {\n border-color: @selection_grey;\n}\n\n.scale.slider,\n.scale.slider:active {\n background-color: transparent;\n}\n\n.scale.slider {\n background-image: url(\"assets\/scale-slider.svg\");\n}\n\n.scale.slider:active {\n background-image: url(\"assets\/scale-slider-active.svg\");\n}\n\n\/* Radio and check buttons *\/\n\nGtkCheckButton {\n color: @black;\n}\n\nGtkCheckButton:prelight {\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.toolbar GtkCheckButton *:active,\nSugarPaletteWindowWidget GtkCheckButton *:active {\n color: @theme_base_color;\n}\n\n.radio,\n.radio row:selected,\n.radio row:selected:focused {\n background-image: url(\"assets\/radio.svg\");\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.radio:selected,\n.radio:selected row:selected,\n.radio:selected row:selected:focused {\n background-image: url(\"assets\/radio-selected.svg\");\n}\n\n.radio:active,\n.radio row:selected:active,\n.radio row:selected:focused:active {\n background-image: url(\"assets\/radio-active.svg\");\n}\n\n.radio:active:selected,\n.radio:selected row:selected:active,\n.radio:selected row:selected:focused:active {\n background-image: url(\"assets\/radio-active-selected.svg\");\n}\n\n.check,\n.check row:selected,\n.check row:selected:focused {\n background-image: url(\"assets\/checkbox-unchecked.svg\");\n background-color: alpha(@theme_base_color, 0.0);\n}\n\n.check:selected,\n.check:selected row:selected,\n.check:selected row:selected:focused {\n background-image: url(\"assets\/checkbox-unchecked-selected.svg\");\n}\n\n.check:active,\n.check row:selected:active,\n.check row:selected:focused:active {\n background-image: url(\"assets\/checkbox-checked.svg\");\n}\n\n.check:active:selected,\n.check:selected row:selected:active,\n.check:selected row:selected:focused:active {\n background-image: url(\"assets\/checkbox-checked-selected.svg\");\n}\n\n\/* Tool items *\/\n\n.toolitem {\n \/* arrow in the toolbarbox *\/\n color: @white;\n \/* outline of the toolbarbutton when palette is expanded *\/\n border-style: solid;\n border-width: 2px;\n border-color: @button_grey;\n}\n\n\/* GtkImage *\/\n\nGtkImage {\n background-color: transparent;\n}\n\n\/* Sugar Frame Window *\/\n\nSugarFrameWindow {\n background-color: @toolbar_grey;\n}\n\n\/* Sugar Canvas icon *\/\n\nSugarCanvasIcon {\n border-color: transparent;\n border-radius: $(4 * thickness)px;\n border-width: 2px;\n border-style: solid;\n}\n\nSugarCanvasIcon:prelight {\n border-color: @zoom_views_prelight;\n background-color: @zoom_views_prelight;\n}\n\nSugarCanvasIcon:active {\n border-color: @zoom_views_active;\n background-color: @zoom_views_active;\n}\n\n\/* Text cursor handles *\/\n\n.cursor-handle.top,\n.cursor-handle.bottom {\n background-color: transparent;\n box-shadow: none;\n border-style: none;\n border-image: none;\n border-radius: 0px;\n border-width: 0px;\n}\n\n.cursor-handle.bottom {\n background-image: url(\"assets\/cursor-handle-bottom.svg\");\n}\n\n.cursor-handle.top {\n background-image: url(\"assets\/cursor-handle-top.svg\");\n}\n\n.cursor-handle.insert-cursor {\n background-image: url(\"assets\/cursor-handle-insert.svg\");\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"EmberScript"} {"commit":"99b64e4a1c98cd7faffc4316a2c834761460e99a","subject":"remove unnecessary source dep","message":"remove unnecessary source dep\n","repos":"ruffsl\/docker_images,ruffsl\/docker_images","old_file":"ros2\/source\/images.yaml.em","new_file":"ros2\/source\/images.yaml.em","new_contents":"%YAML 1.1\n# ROS2 Dockerfile database\n---\nimages:\n source:\n base_image: @(os_name):@(os_code_name)\n maintainer_name: @(maintainer_name)\n template_name: docker_images\/create_ros2_source_image.Dockerfile.em\n entrypoint_name: docker_images\/ros2_source_entrypoint.sh\n template_packages:\n - docker_templates\n upstream_packages:\n - bash-completion\n - build-essential\n - clang-format\n - cmake\n - cppcheck\n - git\n - libasio-dev\n - libassimp-dev\n - libcurl4-openssl-dev\n - libeigen3-dev\n - libfreetype6-dev\n - libgles2-mesa-dev\n - libglu1-mesa\n - libopencv-dev\n - libpoco-dev\n - libqt5core5a\n - libqt5gui5\n - libqt5opengl5\n - libqt5widgets5\n - libssl-dev\n - libtinyxml-dev\n - libtinyxml2-dev\n - libxaw7-dev\n - libxrandr-dev\n - openssl\n - pydocstyle\n - pyflakes\n - python3-coverage\n - python3-dev\n - python3-empy\n - python3-mock\n - python3-nose\n - python3-pep8\n - python3-pyparsing\n - python3-pytest\n - python3-pytest-cov\n - python3-pytest-runner\n - python3-setuptools\n - python3-yaml\n - qtbase5-dev\n - wget\n ros2_repo_packages:\n - libopensplice67\n - python3-catkin-pkg-modules\n - python3-vcstool\n pip3_install:\n - argcomplete\n - flake8\n - flake8-blind-except\n - flake8-builtins\n - flake8-class-newline\n - flake8-comprehensions\n - flake8-deprecated\n - flake8-docstrings\n - flake8-import-order\n - flake8-quotes\n - pytest-repeat\n - pytest-rerunfailures\n ws: \/root\/ros2_ws\n colcon_args:\n - build\n - --cmake-args\n -DSECURITY=ON --no-warn-unused-cli\n - --symlink-install\n vcs:\n ros2:\n repos: https:\/\/raw.githubusercontent.com\/ros2\/ros2\/master\/ros2.repos\n","old_contents":"%YAML 1.1\n# ROS2 Dockerfile database\n---\nimages:\n source:\n base_image: @(os_name):@(os_code_name)\n maintainer_name: @(maintainer_name)\n template_name: docker_images\/create_ros2_source_image.Dockerfile.em\n entrypoint_name: docker_images\/ros2_source_entrypoint.sh\n template_packages:\n - docker_templates\n upstream_packages:\n - bash-completion\n - build-essential\n - clang-format\n - cmake\n - cppcheck\n - git\n - libasio-dev\n - libassimp-dev\n - libcurl4-openssl-dev\n - libeigen3-dev\n - libfreetype6-dev\n - libgles2-mesa-dev\n - libglu1-mesa\n - libopencv-dev\n - libpoco-dev\n - libqt5core5a\n - libqt5gui5\n - libqt5opengl5\n - libqt5widgets5\n - libssl-dev\n - libtinyxml-dev\n - libtinyxml2-dev\n - libxaw7-dev\n - libxrandr-dev\n - openssl\n - pydocstyle\n - pyflakes\n # - python-empy\n - python3-coverage\n - python3-dev\n - python3-empy\n - python3-mock\n - python3-nose\n - python3-pep8\n - python3-pyparsing\n - python3-pytest\n - python3-pytest-cov\n - python3-pytest-runner\n - python3-setuptools\n - python3-yaml\n - qtbase5-dev\n - uncrustify\n - wget\n ros2_repo_packages:\n - libopensplice67\n - python3-catkin-pkg-modules\n - python3-vcstool\n pip3_install:\n - argcomplete\n - flake8\n - flake8-blind-except\n - flake8-builtins\n - flake8-class-newline\n - flake8-comprehensions\n - flake8-deprecated\n - flake8-docstrings\n - flake8-import-order\n - flake8-quotes\n - pytest-repeat\n - pytest-rerunfailures\n ws: \/root\/ros2_ws\n colcon_args:\n - build\n - --cmake-args\n -DSECURITY=ON --no-warn-unused-cli\n - --symlink-install\n vcs:\n ros2:\n repos: https:\/\/raw.githubusercontent.com\/ros2\/ros2\/master\/ros2.repos\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"72001ed770954d77fa09681d68a6dd9e56084000","subject":"Updating gzweb launch command","message":"Updating gzweb launch command\n","repos":"osrf\/docker_templates,ros-infrastructure\/docker_images,osrf\/docker_templates,ros-infrastructure\/docker_images","old_file":"docker_templates\/templates\/docker_images\/create_gzweb_image.Dockerfile.em","new_file":"docker_templates\/templates\/docker_images\/create_gzweb_image.Dockerfile.em","new_contents":"@(TEMPLATE(\n 'snippet\/add_generated_comment.Dockerfile.em',\n user_name=user_name,\n tag_name=tag_name,\n source_template_name=template_name,\n))@\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n template_packages=template_packages,\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n base_image=base_image,\n maintainer_name=maintainer_name,\n))@\n@[if 'packages' in locals()]@\n@[if packages]@\n\n# install packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n@[end if]@\n@[end if]@\n# install gazebo packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(gazebo_packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n# clone gzweb\nENV GZWEB_WS \/root\/gzweb\nRUN hg clone https:\/\/bitbucket.org\/osrf\/gzweb $GZWEB_WS\nWORKDIR $GZWEB_WS\n\n# build gzweb\nRUN hg up default \\\n && xvfb-run -s \"-screen 0 1280x1024x24\" .\/deploy.sh -m\n\n# setup environment\nEXPOSE 8080\nEXPOSE 7681\n\n# run gzserver and gzweb\n@{\ncmds = [\n'npm start',\n'gzserver',\n]\n}@\nCMD @(' && '.join(cmds))\n","old_contents":"@(TEMPLATE(\n 'snippet\/add_generated_comment.Dockerfile.em',\n user_name=user_name,\n tag_name=tag_name,\n source_template_name=template_name,\n))@\n@(TEMPLATE(\n 'snippet\/from_base_image.Dockerfile.em',\n template_packages=template_packages,\n os_name=os_name,\n os_code_name=os_code_name,\n arch=arch,\n base_image=base_image,\n maintainer_name=maintainer_name,\n))@\n@[if 'packages' in locals()]@\n@[if packages]@\n\n# install packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n@[end if]@\n@[end if]@\n# install gazebo packages\nRUN apt-get update && apt-get install -q -y \\\n @(' \\\\\\n '.join(gazebo_packages))@ \\\n && rm -rf \/var\/lib\/apt\/lists\/*\n\n# clone gzweb\nRUN hg clone https:\/\/bitbucket.org\/osrf\/gzweb ~\/gzweb\n\n# build gzweb\nRUN cd ~\/gzweb \\\n && hg up default \\\n && xvfb-run -s \"-screen 0 1280x1024x24\" .\/deploy.sh -m\n\n# setup environment\nEXPOSE 8080\nEXPOSE 7681\n\n# run gzserver and gzweb\n@{\ncmds = [\n'.\/root\/gzweb\/start_gzweb.sh',\n'gzserver',\n]\n}@\nCMD @(' && '.join(cmds))\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"9907a4b0d11f3c0610ad6ad32b67bf3c6c121e46","subject":"fix folding of install commands","message":"fix folding of install commands\n","repos":"clearpathrobotics\/ros_buildfarm,mistoll\/ros_buildfarm,mani-monaj\/ros_buildfarm,clearpathrobotics\/ros_buildfarm,mani-monaj\/ros_buildfarm,clearpathrobotics\/ros_buildfarm,130s\/ros_buildfarm,mistoll\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,ruffsl\/ros_buildfarm,ruffsl\/ros_buildfarm,ros-infrastructure\/ros_buildfarm,130s\/ros_buildfarm,ruffsl\/ros_buildfarm,130s\/ros_buildfarm,mistoll\/ros_buildfarm,mani-monaj\/ros_buildfarm,ros-infrastructure\/ros_buildfarm","old_file":"templates\/snippet\/install_dependencies.Dockerfile.em","new_file":"templates\/snippet\/install_dependencies.Dockerfile.em","new_contents":"# for each dependency: echo version, apt-get update, apt-get install\n@{\n# in order to not exceed the maximum layer limit of docker\n# fold lines if they would exceed the limit\n#\n# for N dependencies and M maximum lines\n# there needs to be an average of N \/ M entries per line\n# the first block of lines will contain floor(N \/ M) entries\n# the second block of lines will contain ceil(N \/ M) entries\n#\n# if there are more dependencies then the limit\n# the folding will generate exactly the number of lines as allowed by the limit\nimport math\nmax_lines = 80\nfold_factor = 1.0 * len(dependencies) \/ max_lines\n# can be zero if no folding is necessary\nbegin_entries_for_line = int(math.floor(fold_factor))\n# can be zero if there are no dependencies\nend_entries_for_line = int(math.ceil(fold_factor))\nnumber_of_begin_blocks = int(round((end_entries_for_line - fold_factor) * max_lines))\nswitch_index = number_of_begin_blocks * begin_entries_for_line\n\ndef get_run_command(index, dependencies, dependency_versions):\n name = dependencies[index]\n return \\\n ('echo \"{name}: {version}\" && ' +\n 'python3 -u \/tmp\/wrapper_scripts\/apt-get.py update && ' +\n 'python3 -u \/tmp\/wrapper_scripts\/apt-get.py install -q -y {name}').format(\n name=name, version=dependency_versions[name])\n}@\n@[if fold_factor > 1]@\n# to prevent exceeding the docker layer limit several lines have been folded\n@[end if]@\n@[if begin_entries_for_line]@\n@[for i in range(0, switch_index, begin_entries_for_line)]@\n@{\ncmds = []\nfor j in range(begin_entries_for_line):\n cmds.append(get_run_command(i + j, dependencies, dependency_versions))\n}@\nRUN @(' && '.join(cmds))\n@[end for]@\n@[end if]@\n@[if end_entries_for_line]@\n@[for i in range(switch_index, len(dependencies), end_entries_for_line)]@\n@{\ncmds = []\nfor j in range(end_entries_for_line):\n cmds.append(get_run_command(i + j, dependencies, dependency_versions))\n}@\nRUN @(' && '.join(cmds))\n@[end for]@\n@[end if]@\n","old_contents":"# for each dependency: echo version, apt-get update, apt-get install\n@{\n# in order to not exceed the maximum layer limit of docker\n# fold lines if they would exceed the limit\n#\n# for N dependencies and M maximum lines\n# there needs to be an average of N \/ M entries per line\n# the first block of lines will contain floor(N \/ M) entries\n# the second block of lines will contain ceil(N \/ M) entries\n#\n# if there are more dependencies then the limit\n# the folding will generate exactly the number of lines as allowed by the limit\nimport math\nmax_lines = 80\nfold_factor = 1.0 * len(dependencies) \/ max_lines\nbegin_entries_for_line = int(math.floor(fold_factor))\nend_entries_for_line = int(math.ceil(fold_factor))\nnumber_of_begin_blocks = int(round((end_entries_for_line - fold_factor) * max_lines))\nswitch_index = number_of_begin_blocks * begin_entries_for_line\n\ndef get_run_command(index, dependencies, dependency_versions):\n name = dependencies[index]\n return \\\n ('echo \"{name}: {version}\" && ' +\n 'python3 -u \/tmp\/wrapper_scripts\/apt-get.py update && ' +\n 'python3 -u \/tmp\/wrapper_scripts\/apt-get.py install -q -y {name}').format(\n name=name, version=dependency_versions[name])\n}@\n@[if fold_factor > 1]@\n# to prevent exceeding the docker layer limit several lines have been folded\n@[end if]@\n@[for i in range(0, switch_index, begin_entries_for_line)]@\n@{\ncmds = []\nfor j in range(begin_entries_for_line):\n cmds.append(get_run_command(i + j, dependencies, dependency_versions))\n}@\nRUN @(' && '.join(cmds))\n@[end for]@\n@[for i in range(switch_index, len(dependencies), end_entries_for_line)]@\n@{\ncmds = []\nfor j in range(end_entries_for_line):\n cmds.append(get_run_command(i + j, dependencies, dependency_versions))\n}@\nRUN @(' && '.join(cmds))\n@[end for]@\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"EmberScript"} {"commit":"28af0f856848ebefb0811e7fb46f2568aab1385e","subject":"Missing parens around in expression in scripting gui made us try to execute callbacks for non-existent actions when when we clicked action selector and no actions were available.","message":"Missing parens around in expression in scripting gui made us try to\nexecute callbacks for non-existent actions when when we clicked action\nselector and no actions were available.\n","repos":"sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata","old_file":"liboh\/plugins\/js\/scripts\/std\/scriptingGui\/scriptingGui.em","new_file":"liboh\/plugins\/js\/scripts\/std\/scriptingGui\/scriptingGui.em","new_contents":"system.require('std\/core\/simpleInput.em');\n\n\n(function()\n {\n\n \/**\n @param {std.ScriptingGui.Controller} controller\n\n @param {std.client.Default} simulator\n \n @param {object: } nearbyVisMap\n -- all the visible objects that satisfy scripter's proximity\n query.\n\n @param {object: scriptedVisMap -- A record\n of all visibles that we have scripted at some point.\n\n @param {object: actionMap -- Which\n actions are selectable by scripter.\n\n @param {std.ScriptingGui.Console} console -- has several\n scripting events.\n *\/\n std.ScriptingGui =\n function(controller,simulator,nearbyVisMap,\n scriptedVisMap,actionMap,console)\n {\n if (typeof(simulator) == 'undefined')\n {\n throw new Error('Cannot initialize scripting gui without ' +\n 'simulator graphics.'); \n }\n\n\n this.controller = controller;\n this.nearbyVisMap = nearbyVisMap;\n this.scriptedVisMap = scriptedVisMap;\n this.actionMap = actionMap;\n this.console = console;\n this.console.setScriptingGui(this);\n \n this.nameMap = {};\n this.nameMap[system.self.toString()] = 'self';\n\n \n this.guiMod = simulator.addGUITextModule(\n guiName(),\n getGuiText(),\n std.core.bind(guiInitFunc,undefined,this));\n this.hasInited = false;\n this.isReady = false;\n \n \/\/if get message that we should redraw with a particular\n \/\/selected, then change heldSelected to not be undefined\n this.heldSelected = undefined;\n };\n\n system.require('scriptingGuiUtil.em');\n\n\n \/**\n @param {String: vis\/presId} selected (optional). If called with\n this field, then gui should actually change currentlySelectedVisible\n *\/\n std.ScriptingGui.prototype.redraw = function(selected)\n {\n \/\/have to wait for ace libraries to load. after they do, js\n \/\/will send an amReady event back to emerson code. emerson\n \/\/code will redraw with the last not undefined heldSelected.\n if ((!this.hasInited) || (!this.isReady))\n {\n if (typeof(selected) != 'undefined')\n this.heldSelected =selected;\n return;\n }\n\n \/\/trigger redraw call\n this.guiMod.call(\n 'ishmaelRedraw',toHtmlNearbyMap(this),toHtmlScriptedMap(this),\n toHtmlActionMap(this),toHtmlFileMap(this),toHtmlNameMap(this),\n toHtmlConsoleMap(this),selected);\n };\n\n\n \n \n \/**\n @param {String} visId -- Id of visible.\n *\/\n \/\/called by html to add the visible with id \n std.ScriptingGui.prototype.hAddVisible = function(visId)\n {\n \/\/already can script the visible.\n if (visId in this.scriptedVisMap)\n {\n this.console.guiEvent();\n this.redraw();\n return;\n }\n\n\n if (!(visId in this.nearbyVisMap))\n {\n \/\/visible is no longer available.\n this.console.guiEvent();\n this.redraw();\n return;\n }\n\n \/\/redraw called from inside of addVisible.\n this.controller.addVisible(this.nearbyVisMap[visId]);\n };\n\n std.ScriptingGui.prototype.hRemoveVisible = function(visId)\n {\n \/\/FIXME: should finish this call\n throw new Error('FIXME: must finish hRemoveVisible call ' +\n 'in scriptingGui');\n };\n\n std.ScriptingGui.prototype.hRenameVisible = function (visId,visName)\n {\n var userQuery =\n 'Enter new name for visible previously named ' + visName +\n ' and with id: ' + visId;\n \n var newInput = std.core.SimpleInput(\n std.core.SimpleInput.ENTER_TEXT,\n userQuery,\n std.core.bind(renameVisibleInputCB,undefined,this,visId));\n };\n\n\n function renameVisibleInputCB(scriptingGui,visId,newName)\n {\n scriptingGui.nameMap[visId] = newName;\n scriptingGui.redraw();\n }\n \n\n \/**\n @param{String} text -- gets displayed as a warning message to\n user.\n *\/\n std.ScriptingGui.prototype.hWarn = function (text)\n {\n var newInput = std.core.SimpleInput(\n std.core.SimpleInput.NO_INPUT,\n text,function(){});\n };\n\n \n \/**\n @param {String?} actId -- Should be parsedInt to get an index\n into actionMap\n @param {String} newText -- What action with actId should set as\n its text.\n *\/\n std.ScriptingGui.prototype.hSaveAction = function(actId,newText)\n {\n this.controller.editAction(parseInt(actId),newText);\n };\n\n \/**\n @param {String?} actId -- Should be parsedInt to get an index\n into actionMap\n @param {String} newText -- What action with actId should set as\n its text.\n @param {String} visId -- Id of visible to execute action on.\n *\/\n std.ScriptingGui.prototype.hSaveAndExecuteAction =\n function(actId,newText, visId)\n {\n this.hSaveAction(actId,newText);\n this.controller.execAction(actId,visId);\n };\n\n \/**\n Prompt user for the name of the new action using\n std.core.SimpleInput.\n *\/\n std.ScriptingGui.prototype.hNewAction =\n function()\n {\n var newInput = std.core.SimpleInput(\n std.core.SimpleInput.ENTER_TEXT,\n 'Enter new action\\'s name',\n std.core.bind(addActionInputCB,undefined,this));\n };\n\n \/**\n @param {std.ScriptingGui} scriptingGui\n @param {String} userResp_actionName - The name of the new action\n that the user wants.\n *\/\n function addActionInputCB(scriptingGui,userResp_actionName)\n {\n \/\/new action won't have any text in it.\n scriptingGui.controller.addAction(userResp_actionName,'');\n scriptingGui.redraw();\n }\n\n \/**\n @param {String?} actId -- Should be parsedInt to get an index\n into actionMap\n *\/\n std.ScriptingGui.prototype.hRemoveAction =\n function(actId)\n {\n this.controller.removeAction(parseInt(actId));\n this.redraw();\n };\n \n\n std.ScriptingGui.prototype.hAddFile =\n function(visId)\n {\n var newInput = std.core.SimpleInput(\n std.core.SimpleInput.ENTER_TEXT,\n 'Enter new file\\'s name',\n std.core.bind(addFileInputCB,undefined,this,visId));\n };\n\n \n function addFileInputCB(scriptingGui,visId,userResp_filename)\n {\n scriptingGui.controller.addExistingFileIfCan(\n visId,userResp_filename);\n scriptingGui.redraw();\n }\n\n\n \/\/reread file first, then send it to visible.\n std.ScriptingGui.prototype.hUpdateAndSendFile =\n function(visId,filename)\n {\n this.controller.rereadFile(visId,filename);\n this.controller.updateFile(visId,filename);\n };\n\n std.ScriptingGui.prototype.hUpdateAndSendAllFiles =\n function(visId)\n {\n this.controller.rereadAllFiles(visId);\n this.controller.updateAll(visId);\n };\n\n\n std.ScriptingGui.prototype.hRemoveFile =\n function(visId,filename)\n {\n this.controller.removeFile(visId,filename);\n this.redraw();\n };\n\n\n std.ScriptingGui.prototype.hExecScript =\n function(visId,toExec)\n {\n this.controller.execScriptAction(visId,toExec);\n };\n\n std.ScriptingGui.prototype.hAmReady =\n function()\n {\n this.isReady =true;\n this.redraw(this.heldSelected);\n this.heldSelected = undefined;\n };\n\n \n \n \/**\n @param {std.ScriptingGui} \n *\/\n function guiInitFunc(scriptingGui)\n {\n scriptingGui.hasInited = true;\n \n \/\/when a user clicks on any of the nearby visibles to script\n \/\/them, want that object to move into scripted objects. \n scriptingGui.guiMod.bind(\n 'addVisible',\n std.core.bind(scriptingGui.hAddVisible,scriptingGui));\n\n \/\/when a user clicks to remove any of the scripted visibles\n \/\/from scripted map, then destroy it.\n scriptingGui.guiMod.bind(\n 'removeVisible',\n std.core.bind(scriptingGui.hRemoveVisible,scriptingGui));\n\n scriptingGui.guiMod.bind(\n 'renameVisible',\n std.core.bind(scriptingGui.hRenameVisible,scriptingGui));\n \n \/\/when a user updates a particular action, and clicks to save\n \/\/the new action text.\n scriptingGui.guiMod.bind(\n 'saveAction',\n std.core.bind(scriptingGui.hSaveAction,scriptingGui));\n\n\n \/\/saves and executes action to visible.\n scriptingGui.guiMod.bind(\n 'saveAndExecuteAction',\n std.core.bind(scriptingGui.hSaveAndExecuteAction,scriptingGui));\n\n\n scriptingGui.guiMod.bind(\n 'newAction',\n std.core.bind(scriptingGui.hNewAction,scriptingGui));\n\n scriptingGui.guiMod.bind(\n 'removeAction',\n std.core.bind(scriptingGui.hRemoveAction,scriptingGui));\n\n scriptingGui.guiMod.bind(\n 'addFile',\n std.core.bind(scriptingGui.hAddFile,scriptingGui));\n\n scriptingGui.guiMod.bind(\n 'updateAndSendFile',\n std.core.bind(scriptingGui.hUpdateAndSendFile,scriptingGui));\n\n scriptingGui.guiMod.bind(\n 'updateAndSendAllFiles',\n std.core.bind(scriptingGui.hUpdateAndSendAllFiles,scriptingGui));\n\n scriptingGui.guiMod.bind(\n 'removeFile',\n std.core.bind(scriptingGui.hRemoveFile,scriptingGui));\n\n scriptingGui.guiMod.bind(\n 'execScript',\n std.core.bind(scriptingGui.hExecScript,scriptingGui));\n\n\n scriptingGui.guiMod.bind(\n 'amReady',\n std.core.bind(scriptingGui.hAmReady,scriptingGui));\n\n\n scriptingGui.guiMod.bind(\n 'warn',\n std.core.bind(scriptingGui.hWarn,scriptingGui));\n\n \n scriptingGui.redraw();\n }\n \n \/**\n @returns {object: }\n scriptingGui -- Takes the list of nearby objects and turns it\n into an object that (for now) maps visibleIds to visibleIds.\n\n @see ishmaelRedraw\n *\/\n function toHtmlNearbyMap(scriptingGui)\n {\n var returner = { };\n for (var s in scriptingGui.nearbyVisMap)\n returner[s] = s;\n return returner;\n }\n\n\n \/**\n @returns {object: }\n scriptingGui -- Takes the list of nearby objects and turns it\n into an object that (for now) maps visibleIds to visibleIds.\n\n @see ishmaelRedraw\n *\/\n function toHtmlScriptedMap(scriptingGui)\n {\n var returner = { };\n for (var s in scriptingGui.scriptedVisMap)\n returner[s] = s;\n return returner;\n }\n\n\n function toHtmlActionMap(scriptingGui)\n {\n return scriptingGui.actionMap;\n }\n\n\n function toHtmlFileMap(scriptingGui)\n {\n return scriptingGui.controller.htmlFileMap();\n }\n\n function toHtmlNameMap(scriptingGui)\n {\n return scriptingGui.nameMap;\n }\n\n function toHtmlConsoleMap(scriptingGui)\n {\n return scriptingGui.console.toHtmlMap();\n }\n \n \n function guiName()\n {\n return 'ishmaelEditor';\n }\n\n\n function getGuiText()\n {\n\n var returner = \"sirikata.ui('\" + guiName() + \"',\";\n returner += 'function(){ ';\n\n returner += @\n\n\n $LAB\n .script(\"..\/ace\/build\/src\/ace-uncompressed.js\")\n .script(\"..\/ace\/build\/src\/theme-dawn.js\")\n .script(\"..\/ace\/build\/src\/mode-javascript.js\").wait(\n function()\n {\n\n\t var newcsslink =\n $(\"\").attr({rel:'stylesheet', type:'text\/css', href:'..\/scripting\/prompt.css'});\n\t $(\"head\").append(newcsslink);\n\n \n function ishmaelWindowId()\n {\n return 'ishmael__windowID_';\n }\n\n \/\/the div that surrounds all the nearby objects.\n function nearbyListId()\n {\n return 'ishmael__nearbyListID__';\n }\n\n \/\/the div that surrounds all the scripted objects.\n function scriptedListId()\n {\n return 'ishmael__scriptedListID__';\n }\n\n\n function actionListId()\n {\n return 'ishmael__actionListID__';\n }\n\n function actionTareaId()\n {\n return 'ishmael__actionEditor__';\n }\n \n function saveActionButtonId()\n {\n return 'ishmael__saveActionButton__';\n }\n\n function execActionButtonId()\n {\n return 'ishmael__execActionButton__';\n }\n\n function newActionButtonId()\n {\n return 'ishmael__newActionButton__';\n }\n\n function removeActionButtonId()\n {\n return 'ishmael__removeActionButton__';\n }\n\n function fileSelectId()\n {\n return 'ishmael__fileSelectId__';\n }\n\n\n function addFileButtonId()\n {\n return 'ishmael__addFileButtonId__';\n }\n\n function updateAndSendFileButtonId()\n {\n return 'ishmael__updateAndSendFileButtonId__';\n }\n\n function updateAndSendAllFilesButtonId()\n {\n return 'ishmael__updateAndSendAllFilesButtonId__';\n }\n\n function removeFileButtonId()\n {\n return 'ishmael__removeFileButtonId__';\n }\n \n\n function renameVisibleButtonId()\n {\n return 'ishmael__renameVisibleId__';\n }\n\n function consoleId()\n {\n return 'ishmael__consoleId__';\n }\n\n function actionDivId()\n {\n return 'ishmael__actionDivId__';\n }\n\n function fileDivId()\n {\n return 'ishmael__fileDivId__';\n }\n\n function actionFileTabId()\n {\n return 'ishmael__actionFileTabId__';\n }\n\n function nearbyScriptedTabId()\n {\n return 'ishmael__nearbyScriptedTabId__';\n }\n\n function scriptConsoleDivId()\n {\n return 'ishmael__scriptConsoleDivId__';\n }\n \n function execScriptButtonId()\n {\n return 'ishmael__execScriptButtonId__';\n }\n\n\n function execTareaId()\n {\n return 'ishmael__execTareaId__';\n }\n\n \n \/**\n \\param {String} nearbyObj (id of visible that we are\n communicating with).\n gives the div for each nearby object.\n *\/\n function generateNearbyDivId(nearbyObj)\n {\n var visIdDivable = divizeVisibleId(nearbyObj);\n return 'ishmael__nearbyDivID___' + visIdDivable;\n }\n\n\n \n \/**\n \\param {String} scriptedObj (id of visible that we are\n communicating with).\n gives the div for each scripted object.\n *\/\n function generateScriptedDivId(scriptedObj)\n {\n var visIdDivable = divizeVisibleId(scriptedObj);\n return 'ishmael__scriptedDivID___' + visIdDivable;\n }\n\n \n function divizeVisibleId(visId)\n {\n return visId.replace(':','');\n }\n\n\n\n $('
' +\n \n \/\/which presences are available\n '
' +\n '