How to use filename method in ts-auto-mock

Best JavaScript code snippet using ts-auto-mock

FILES.cfg

Source:FILES.cfg Github

copy

Full Screen

1# -*- python -*-2# ex: set syntax=python:3# Copyright (c) 2012 The Chromium Authors. All rights reserved.4# Use of this source code is governed by a BSD-style license that can be5# found in the LICENSE file.6# This is a buildbot configuration file containing a tagged list of files7# processed by the stage/archive scripts. The known tags are:8#9# filename: Name of the file in the build output directory.10# arch: List of CPU architectures for which this file should be processed11# Leave this unspecified to process for all architectures.12# Acceptable values are 64bit, 32bit and arm.13# buildtype: List of build types for which this file should be processed.14# archive: The name of the archive file to store filename in. If not specified,15# filename is added to the default archive (e.g. platform.zip). If16# archive == filename, filename is archived directly, not zipped.17# direct_archive: Force a file to be archived as-is, bypassing zip creation.18# NOTE: This flag will not apply if more than one file has the19# same 'archive' name, which will create a zip of all the20# files instead.21# filegroup: List of named groups to which this file belongs.22# default: Legacy "default archive". TODO(mmoss): These should23# be updated to specify an 'archive' name and then this24# filegroup and the related archive_utils.ParseLegacyList()25# should go away.26# symsrc: Files to upload to the symbol server.27# optional: List of buildtypes for which the file might not exist, and it's not28# considered an error.29FILES = [30 {31 'filename': 'browser_tests.exe',32 'buildtype': ['official'],33 'archive': 'browser_tests.exe',34 'optional': ['official'],35 },36 {37 'filename': 'sync_integration_tests.exe',38 'buildtype': ['official'],39 'archive': 'sync_integration_tests.exe',40 'optional': ['official'],41 },42 {43 'filename': 'chrome.exe',44 'buildtype': ['dev', 'official'],45 'filegroup': ['default', 'symsrc'],46 },47 {48 'filename': 'nacl64.exe',49 'arch': ['32bit'],50 'buildtype': ['dev', 'official'],51 'filegroup': ['default', 'symsrc'],52 },53 {54 'filename': 'chrome.dll',55 'buildtype': ['dev', 'official'],56 'filegroup': ['default', 'symsrc'],57 },58 {59 'filename': 'chrome_child.dll',60 'buildtype': ['dev', 'official'],61 'filegroup': ['default', 'symsrc'],62 'optional': ['dev', 'official'],63 },64 {65 'filename': 'chrome_elf.dll',66 'buildtype': ['dev', 'official'],67 'filegroup': ['default', 'symsrc'],68 },69 {70 'filename': 'eventlog_provider.dll',71 'buildtype': ['dev', 'official'],72 'filegroup': ['default'],73 },74 {75 'filename': '*.manifest',76 'buildtype': ['dev', 'official'],77 'filegroup': ['default'],78 },79 {80 'filename': 'chrome_100_percent.pak',81 'buildtype': ['dev', 'official'],82 },83 {84 'filename': 'chrome_200_percent.pak',85 'buildtype': ['dev', 'official'],86 'optional': ['dev', 'official'],87 },88 {89 'filename': 'First Run',90 'buildtype': ['dev', 'official'],91 },92 {93 'filename': 'icudtl.dat',94 'buildtype': ['dev', 'official'],95 'optional': ['dev', 'official'],96 },97 {98 'filename': 'icudt.dll',99 'buildtype': ['dev', 'official'],100 'optional': ['dev', 'official'],101 },102 {103 'filename': 'mojo_core.dll',104 'buildtype': ['dev', 'official'],105 'optional': ['dev', 'official'],106 },107 {108 'filename': 'v8_context_snapshot.bin',109 'buildtype': ['dev', 'official'],110 'optional': ['dev', 'official'],111 },112 {113 'filename': 'locales/ar.pak',114 'buildtype': ['dev', 'official'],115 },116 {117 'filename': 'locales/bg.pak',118 'buildtype': ['dev', 'official'],119 },120 {121 'filename': 'locales/bn.pak',122 'buildtype': ['dev', 'official'],123 },124 {125 'filename': 'locales/ca.pak',126 'buildtype': ['dev', 'official'],127 },128 {129 'filename': 'locales/cs.pak',130 'buildtype': ['dev', 'official'],131 },132 {133 'filename': 'locales/da.pak',134 'buildtype': ['dev', 'official'],135 },136 {137 'filename': 'locales/de.pak',138 'buildtype': ['dev', 'official'],139 },140 {141 'filename': 'locales/el.pak',142 'buildtype': ['dev', 'official'],143 },144 {145 'filename': 'locales/en-GB.pak',146 'buildtype': ['dev', 'official'],147 },148 {149 'filename': 'locales/en-US.pak',150 'buildtype': ['dev', 'official'],151 },152 {153 'filename': 'locales/es-419.pak',154 'buildtype': ['dev', 'official'],155 },156 {157 'filename': 'locales/es.pak',158 'buildtype': ['dev', 'official'],159 },160 {161 'filename': 'locales/et.pak',162 'buildtype': ['dev', 'official'],163 },164 {165 'filename': 'locales/fi.pak',166 'buildtype': ['dev', 'official'],167 },168 {169 'filename': 'locales/fil.pak',170 'buildtype': ['dev', 'official'],171 },172 {173 'filename': 'locales/fr.pak',174 'buildtype': ['dev', 'official'],175 },176 {177 'filename': 'locales/gu.pak',178 'buildtype': ['dev', 'official'],179 },180 {181 'filename': 'locales/he.pak',182 'buildtype': ['dev', 'official'],183 },184 {185 'filename': 'locales/hi.pak',186 'buildtype': ['dev', 'official'],187 },188 {189 'filename': 'locales/hr.pak',190 'buildtype': ['dev', 'official'],191 },192 {193 'filename': 'locales/hu.pak',194 'buildtype': ['dev', 'official'],195 },196 {197 'filename': 'locales/id.pak',198 'buildtype': ['dev', 'official'],199 },200 {201 'filename': 'locales/it.pak',202 'buildtype': ['dev', 'official'],203 },204 {205 'filename': 'locales/ja.pak',206 'buildtype': ['dev', 'official'],207 },208 {209 'filename': 'locales/kn.pak',210 'buildtype': ['dev', 'official'],211 },212 {213 'filename': 'locales/ko.pak',214 'buildtype': ['dev', 'official'],215 },216 {217 'filename': 'locales/lt.pak',218 'buildtype': ['dev', 'official'],219 },220 {221 'filename': 'locales/lv.pak',222 'buildtype': ['dev', 'official'],223 },224 {225 'filename': 'locales/ml.pak',226 'buildtype': ['dev', 'official'],227 },228 {229 'filename': 'locales/mr.pak',230 'buildtype': ['dev', 'official'],231 },232 {233 'filename': 'locales/ms.pak',234 'buildtype': ['dev', 'official'],235 },236 {237 'filename': 'locales/nb.pak',238 'buildtype': ['dev', 'official'],239 },240 {241 'filename': 'locales/nl.pak',242 'buildtype': ['dev', 'official'],243 },244 {245 'filename': 'locales/pl.pak',246 'buildtype': ['dev', 'official'],247 },248 {249 'filename': 'locales/pt-BR.pak',250 'buildtype': ['dev', 'official'],251 },252 {253 'filename': 'locales/pt-PT.pak',254 'buildtype': ['dev', 'official'],255 },256 {257 'filename': 'locales/ro.pak',258 'buildtype': ['dev', 'official'],259 },260 {261 'filename': 'locales/ru.pak',262 'buildtype': ['dev', 'official'],263 },264 {265 'filename': 'locales/sk.pak',266 'buildtype': ['dev', 'official'],267 },268 {269 'filename': 'locales/sl.pak',270 'buildtype': ['dev', 'official'],271 },272 {273 'filename': 'locales/sr.pak',274 'buildtype': ['dev', 'official'],275 },276 {277 'filename': 'locales/sv.pak',278 'buildtype': ['dev', 'official'],279 },280 {281 'filename': 'locales/ta.pak',282 'buildtype': ['dev', 'official'],283 },284 {285 'filename': 'locales/te.pak',286 'buildtype': ['dev', 'official'],287 },288 {289 'filename': 'locales/th.pak',290 'buildtype': ['dev', 'official'],291 },292 {293 'filename': 'locales/tr.pak',294 'buildtype': ['dev', 'official'],295 },296 {297 'filename': 'locales/uk.pak',298 'buildtype': ['dev', 'official'],299 },300 {301 'filename': 'locales/vi.pak',302 'buildtype': ['dev', 'official'],303 },304 {305 'filename': 'locales/zh-CN.pak',306 'buildtype': ['dev', 'official'],307 },308 {309 'filename': 'locales/zh-TW.pak',310 'buildtype': ['dev', 'official'],311 },312 {313 'filename': 'policy_templates.zip',314 'buildtype': ['official'],315 'archive': 'policy_templates.zip',316 },317 {318 'filename': 'resources.pak',319 'buildtype': ['dev', 'official'],320 },321 # PNaCl translator (archive only, component updater used for shipping).322 {323 'filename': 'pnacl',324 'buildtype': ['dev', 'official'],325 'archive': 'pnacl.zip',326 },327 # Widevine CDM files:328 {329 'filename': 'WidevineCdm/manifest.json',330 'buildtype': ['official'],331 },332 {333 'filename': 'WidevineCdm/LICENSE',334 'buildtype': ['official'],335 },336 {337 'filename': 'WidevineCdm/_platform_specific/win_x86/widevinecdm.dll',338 'arch': ['32bit'],339 'buildtype': ['official'],340 },341 {342 'filename': 'WidevineCdm/_platform_specific/win_x86/widevinecdm.dll.sig',343 'arch': ['32bit'],344 'buildtype': ['official'],345 },346 {347 'filename': 'WidevineCdm/_platform_specific/win_x64/widevinecdm.dll',348 'arch': ['64bit'],349 'buildtype': ['official'],350 },351 {352 'filename': 'WidevineCdm/_platform_specific/win_x64/widevinecdm.dll.sig',353 'arch': ['64bit'],354 'buildtype': ['official'],355 },356 # ANGLE files:357 {358 'filename': 'D3DCompiler_47.dll',359 'buildtype': ['dev', 'official'],360 },361 {362 'filename': 'libEGL.dll',363 'buildtype': ['dev', 'official'],364 'filegroup': ['default', 'symsrc'],365 },366 {367 'filename': 'libGLESv2.dll',368 'buildtype': ['dev', 'official'],369 'filegroup': ['default', 'symsrc'],370 },371 # SwiftShader files:372 {373 'filename': 'swiftshader/libEGL.dll',374 'buildtype': ['dev', 'official'],375 'filegroup': ['default', 'symsrc'],376 },377 {378 'filename': 'swiftshader/libGLESv2.dll',379 'buildtype': ['dev', 'official'],380 'filegroup': ['default', 'symsrc'],381 },382 # Native Client plugin files:383 {384 'filename': 'nacl_irt_x86_32.nexe',385 'arch': ['32bit'],386 'buildtype': ['dev', 'official'],387 },388 {389 'filename': 'nacl_irt_x86_64.nexe',390 'buildtype': ['dev', 'official'],391 },392 # Remoting files:393 {394 'filename': 'chromoting.msi',395 'arch': ['32bit'],396 'buildtype': ['dev', 'official'],397 'archive': 'remoting-host.msi',398 'direct_archive': 1,399 'optional': ['dev'],400 },401 {402 'filename': 'remoting-me2me-host-win.zip',403 'arch': ['32bit'],404 'buildtype': ['dev', 'official'],405 'archive': 'remoting-me2me-host-win.zip',406 'direct_archive': 1,407 'optional': ['dev'],408 },409 {410 'filename': 'remoting-me2me-host-win-unsupported.zip',411 'arch': ['64bit'],412 'buildtype': ['dev', 'official'],413 'archive': 'remoting-me2me-host-win-unsupported.zip',414 'direct_archive': 1,415 'optional': ['dev'],416 },417 {418 'filename': 'remote_assistance_host.exe',419 'buildtype': ['official'],420 'archive': 'remoting-win32.zip',421 'filegroup': ['symsrc'],422 },423 {424 'filename': 'remote_assistance_host.exe.pdb',425 'buildtype': ['official'],426 'archive': 'remoting-win32.zip',427 },428 {429 'filename': 'remote_assistance_host_uiaccess.exe',430 'buildtype': ['official'],431 'archive': 'remoting-win32.zip',432 'filegroup': ['symsrc'],433 },434 {435 'filename': 'remote_assistance_host_uiaccess.exe.pdb',436 'buildtype': ['official'],437 'archive': 'remoting-win32.zip',438 },439 {440 'filename': 'remote_security_key.exe',441 'buildtype': ['official'],442 'archive': 'remoting-win32.zip',443 'filegroup': ['symsrc'],444 },445 {446 'filename': 'remote_security_key.exe.pdb',447 'buildtype': ['official'],448 'archive': 'remoting-win32.zip',449 },450 {451 'filename': 'remoting_core.dll',452 'buildtype': ['official'],453 'archive': 'remoting-win32.zip',454 'filegroup': ['symsrc'],455 },456 {457 'filename': 'remoting_core.dll.pdb',458 'buildtype': ['official'],459 'archive': 'remoting-win32.zip',460 'optional': ['official'],461 },462 {463 'filename': 'remoting_desktop.exe',464 'buildtype': ['official'],465 'archive': 'remoting-win32.zip',466 'filegroup': ['symsrc'],467 },468 {469 'filename': 'remoting_desktop.exe.pdb',470 'buildtype': ['official'],471 'archive': 'remoting-win32.zip',472 'optional': ['official'],473 },474 {475 'filename': 'remoting_host.exe',476 'buildtype': ['official'],477 'archive': 'remoting-win32.zip',478 'filegroup': ['symsrc'],479 },480 {481 'filename': 'remoting_host.exe.pdb',482 'buildtype': ['official'],483 'archive': 'remoting-win32.zip',484 },485 {486 'filename': 'remoting_native_messaging_host.exe',487 'buildtype': ['official'],488 'archive': 'remoting-win32.zip',489 'filegroup': ['symsrc'],490 },491 {492 'filename': 'remoting_native_messaging_host.exe.pdb',493 'buildtype': ['official'],494 'archive': 'remoting-win32.zip',495 },496 {497 'filename': 'remoting_start_host.exe',498 'buildtype': ['official'],499 'archive': 'remoting-win32.zip',500 'filegroup': ['symsrc'],501 },502 {503 'filename': 'remoting_start_host.exe.pdb',504 'buildtype': ['official'],505 'archive': 'remoting-win32.zip',506 },507 # Credential Provider:508 {509 'filename': 'gcp_setup.exe',510 'buildtype': ['dev', 'official'],511 'optional': ['dev', 'official'],512 'filegroup': ['symsrc'],513 },514 {515 'filename': 'gcp_setup.exe.pdb',516 'buildtype': ['dev', 'official'],517 'optional': ['dev', 'official'],518 'archive': 'chrome-win32-syms.zip',519 },520 {521 'filename': 'gaia1_0.dll',522 'buildtype': ['dev', 'official'],523 'optional': ['dev', 'official'],524 'filegroup': ['symsrc'],525 },526 {527 'filename': 'gaia1_0.dll.pdb',528 'buildtype': ['dev', 'official'],529 'optional': ['dev', 'official'],530 'archive': 'chrome-win32-syms.zip',531 },532 {533 'filename': 'gcp_installer.exe',534 'buildtype': ['official'],535 'archive': 'gcp_installer.exe',536 'filegroup': ['symsrc'],537 },538 # Cloud Print files:539 {540 'filename': 'gcp_portmon.dll',541 'buildtype': ['official'],542 'archive': 'cloud_print.zip',543 'filegroup': ['symsrc'],544 },545 {546 'filename': 'gcp_portmon.dll.pdb',547 'buildtype': ['official'],548 'archive': 'cloud_print.zip',549 'optional': ['official'],550 },551 {552 'filename': 'gcp_portmon64.dll',553 'buildtype': ['official'],554 'archive': 'cloud_print.zip',555 'filegroup': ['symsrc'],556 },557 {558 'filename': 'gcp_driver.inf',559 'buildtype': ['official'],560 'archive': 'cloud_print.zip',561 },562 {563 'filename': 'gcp_driver.gpd',564 'buildtype': ['official'],565 'archive': 'cloud_print.zip',566 },567 {568 'filename': 'virtual_driver_setup.exe',569 'buildtype': ['official'],570 'archive': 'cloud_print.zip',571 'filegroup': ['symsrc'],572 },573 {574 'filename': 'virtual_driver_setup.exe.pdb',575 'buildtype': ['official'],576 'archive': 'cloud_print.zip',577 },578 # Test binaries for external QA:579 {580 'filename': 'interactive_ui_tests.exe',581 'buildtype': ['dev', 'official'],582 'optional': ['dev', 'official'],583 },584 # Notification helper files:585 {586 'filename': 'notification_helper.exe',587 'buildtype': ['dev', 'official'],588 'filegroup': ['default', 'symsrc'],589 },590 {591 'filename': 'notification_helper.exe.pdb',592 'buildtype': ['dev', 'official'],593 'archive': 'chrome-win32-syms.zip',594 },595 # Installer files (official build only):596 {597 'filename': 'setup.exe',598 'buildtype': ['official'],599 'archive': 'setup.exe',600 'filegroup': ['symsrc'],601 },602 {603 'filename': 'mini_installer.exe',604 'buildtype': ['dev', 'official'],605 'archive': 'mini_installer.exe',606 'filegroup': ['symsrc'],607 },608 {609 'filename': 'chrome.packed.7z',610 'buildtype': ['official'],611 'archive': 'chrome.packed.7z',612 },613 {614 'filename': 'mini_installer_exe_version.rc',615 'buildtype': ['official'],616 'archive': 'mini_installer_exe_version.rc',617 },618 {619 'filename': 'courgette.exe',620 'buildtype': ['official'],621 'archive': 'courgette.exe',622 },623 {624 'filename': 'courgette64.exe',625 'buildtype': ['official'],626 'archive': 'courgette64.exe',627 },628 {629 'filename': 'zucchini.exe',630 'buildtype': ['official'],631 'optional': ['official'],632 'archive': 'zucchini.exe',633 },634 {635 'filename': 'zucchini.exe.pdb',636 'buildtype': ['official'],637 'optional': ['official'],638 'archive': 'chrome-win32-syms.zip',639 },640 {641 'filename': 'chrome.dll.pdb',642 'buildtype': ['dev', 'official'],643 'archive': 'chrome-win32-syms.zip',644 },645 {646 'filename': 'chrome_child.dll.pdb',647 'buildtype': ['dev', 'official'],648 'optional': ['dev', 'official'],649 'archive': 'chrome-win32-syms.zip',650 },651 {652 'filename': 'chrome_elf.dll.pdb',653 'buildtype': ['dev', 'official'],654 'archive': 'chrome-win32-syms.zip',655 },656 {657 'filename': 'chrome.exe.pdb',658 'buildtype': ['dev', 'official'],659 'archive': 'chrome-win32-syms.zip',660 },661 {662 'filename': 'eventlog_provider.dll.pdb',663 'buildtype': ['dev', 'official'],664 'archive': 'chrome-win32-syms.zip',665 },666 {667 'filename': 'libEGL.dll.pdb',668 'buildtype': ['dev', 'official'],669 'archive': 'chrome-win32-syms.zip',670 },671 {672 'filename': 'libGLESv2.dll.pdb',673 'buildtype': ['dev', 'official'],674 'archive': 'chrome-win32-syms.zip',675 },676 {677 'filename': 'mojo_core.dll.pdb',678 'buildtype': ['dev', 'official'],679 'archive': 'chrome-win32-syms.zip',680 },681 {682 'filename': 'swiftshader/libEGL.dll.pdb',683 'buildtype': ['dev', 'official'],684 'archive': 'chrome-win32-syms.zip',685 },686 {687 'filename': 'swiftshader/libGLESv2.dll.pdb',688 'buildtype': ['dev', 'official'],689 'archive': 'chrome-win32-syms.zip',690 },691 {692 'filename': 'mini_installer.exe.pdb',693 'buildtype': ['dev', 'official'],694 'archive': 'chrome-win32-syms.zip',695 },696 {697 'filename': 'nacl64.exe.pdb',698 'arch': ['32bit'],699 'buildtype': ['dev', 'official'],700 'archive': 'chrome-win32-syms.zip',701 },702 {703 'filename': 'setup.exe.pdb',704 'buildtype': ['dev', 'official'],705 'archive': 'chrome-win32-syms.zip',706 },707 # Updater files (official build only):708 {709 'filename': 'updater.exe',710 'buildtype': ['official'],711 'archive': 'updater.exe',712 },713 {714 'filename': 'UpdaterSetup.exe',715 'buildtype': ['official'],716 'archive': 'UpdaterSetup.exe',717 },718 # Partner API files.719 {720 'filename': 'gcapi.h',721 'buildtype': ['dev', 'official'],722 'archive': 'gcapi.zip',723 },724 {725 'filename': 'gcapi_dll.dll',726 'buildtype': ['dev', 'official'],727 'archive': 'gcapi.zip',728 'filegroup': ['symsrc'],729 },730 {731 'filename': 'gcapi_dll.dll.lib',732 'buildtype': ['dev', 'official'],733 'archive': 'gcapi.zip',734 },735 {736 'filename': 'gcapi_dll.dll.pdb',737 'buildtype': ['dev', 'official'],738 'archive': 'chrome-win32-syms.zip',739 },740 {741 'filename': 'nacl_irt_x86_32.nexe.debug',742 'arch': ['32bit'],743 'buildtype': ['official'],744 'archive': 'chrome-win32-nacl-irt-syms.zip',745 },746 {747 'filename': 'nacl_irt_x86_64.nexe.debug',748 'buildtype': ['official'],749 'archive': 'chrome-win32-nacl-irt-syms.zip',750 },751 # Content shell files:752 {753 'filename': 'blink_deprecated_test_plugin.dll',754 'buildtype': ['dev'],755 'archive': 'content-shell.zip',756 'optional': ['dev'],757 },758 {759 'filename': 'blink_test_plugin.dll',760 'buildtype': ['dev'],761 'archive': 'content-shell.zip',762 'optional': ['dev'],763 },764 {765 'filename': 'content_shell.exe',766 'buildtype': ['dev'],767 'archive': 'content-shell.zip',768 'optional': ['dev'],769 },770 {771 'filename': 'content_shell.pak',772 'buildtype': ['dev'],773 'archive': 'content-shell.zip',774 'optional': ['dev'],775 },776 {777 'filename': 'icudtl.dat',778 'buildtype': ['dev'],779 'archive': 'content-shell.zip',780 'optional': ['dev'],781 },782 {783 'filename': 'v8_context_snapshot.bin',784 'buildtype': ['dev'],785 'archive': 'content-shell.zip',786 'optional': ['dev'],787 },788 {789 'filename': 'resources',790 'buildtype': ['dev'],791 'archive': 'content-shell.zip',792 'optional': ['dev'],793 },794 # Metrics metadata files:795 {796 'filename': 'actions.xml',797 'buildtype': ['dev', 'official'],798 'archive': 'metrics-metadata.zip',799 'optional': ['dev', 'official'],800 },801 {802 'filename': 'histograms.xml',803 'buildtype': ['dev', 'official'],804 'archive': 'metrics-metadata.zip',805 'optional': ['dev', 'official'],806 },807 {808 'filename': 'rappor.xml',809 'buildtype': ['dev', 'official'],810 'archive': 'metrics-metadata.zip',811 'optional': ['dev', 'official'],812 },813 {814 'filename': 'ukm.xml',815 'buildtype': ['dev', 'official'],816 'archive': 'metrics-metadata.zip',817 'optional': ['dev', 'official'],818 },819 # MEI Preload files:820 {821 'filename': 'MEIPreload/manifest.json',822 'buildtype': ['dev', 'official'],823 },824 {825 'filename': 'MEIPreload/preloaded_data.pb',826 'buildtype': ['dev', 'official'],827 },828 # ChromeDriver binary:829 {830 'filename': 'chromedriver.exe',831 'arch': ['32bit'],832 'buildtype': ['dev', 'official'],833 'archive': 'chromedriver_win32.zip',834 'optional': ['dev', 'official'],835 'filegroup': ['symsrc'],836 },837 {838 'filename': 'chromedriver.exe.pdb',839 'buildtype': ['dev', 'official'],840 'archive': 'chromedriver_win32-syms.zip',841 'optional': ['dev', 'official'],842 },843 # Elevation service files:844 {845 'filename': 'elevation_service.exe',846 'buildtype': ['dev', 'official'],847 'filegroup': ['default', 'symsrc'],848 },849 {850 'filename': 'elevation_service.exe.pdb',851 'buildtype': ['dev', 'official'],852 'archive': 'chrome-win32-syms.zip',853 },854 # Bookmark apps shortcut target:855 {856 'filename': 'chrome_proxy.exe',857 'buildtype': ['dev', 'official'],858 'filegroup': ['default', 'symsrc'],859 },860 {861 'filename': 'chrome_proxy.exe.pdb',862 'buildtype': ['dev', 'official'],863 'archive': 'chrome-win32-syms.zip',864 },865 # DevTools front-end files:866 {867 'filename': 'resources/inspector',868 'buildtype': ['dev', 'official'],869 'archive': 'devtools-frontend.zip',870 },871 # Policy cloud documentation source files:872 {873 'filename': 'gen/chrome/app/policy/translations/policy_templates_de-DE.json',874 'buildtype': ['official'],875 'archive': 'policy_templates_de-DE.json',876 'direct_archive': 1,877 'optional': ['official'],878 },879 {880 'filename': 'gen/chrome/app/policy/translations/policy_templates_en-US.json',881 'buildtype': ['official'],882 'archive': 'policy_templates_en-US.json',883 'direct_archive': 1,884 'optional': ['official'],885 },886 {887 'filename': 'gen/chrome/app/policy/translations/policy_templates_es-419.json',888 'buildtype': ['official'],889 'archive': 'policy_templates_es-419.json',890 'direct_archive': 1,891 'optional': ['official'],892 },893 {894 'filename': 'gen/chrome/app/policy/translations/policy_templates_es-ES.json',895 'buildtype': ['official'],896 'archive': 'policy_templates_es-ES.json',897 'direct_archive': 1,898 'optional': ['official'],899 },900 {901 'filename': 'gen/chrome/app/policy/translations/policy_templates_fr-FR.json',902 'buildtype': ['official'],903 'archive': 'policy_templates_fr-FR.json',904 'direct_archive': 1,905 'optional': ['official'],906 },907 {908 'filename': 'gen/chrome/app/policy/translations/policy_templates_id-ID.json',909 'buildtype': ['official'],910 'archive': 'policy_templates_id-ID.json',911 'direct_archive': 1,912 'optional': ['official'],913 },914 {915 'filename': 'gen/chrome/app/policy/translations/policy_templates_it-IT.json',916 'buildtype': ['official'],917 'archive': 'policy_templates_it-IT.json',918 'direct_archive': 1,919 'optional': ['official'],920 },921 {922 'filename': 'gen/chrome/app/policy/translations/policy_templates_ja-JP.json',923 'buildtype': ['official'],924 'archive': 'policy_templates_ja-JP.json',925 'direct_archive': 1,926 'optional': ['official'],927 },928 {929 'filename': 'gen/chrome/app/policy/translations/policy_templates_ko-KR.json',930 'buildtype': ['official'],931 'archive': 'policy_templates_ko-KR.json',932 'direct_archive': 1,933 'optional': ['official'],934 },935 {936 'filename': 'gen/chrome/app/policy/translations/policy_templates_nl-NL.json',937 'buildtype': ['official'],938 'archive': 'policy_templates_nl-NL.json',939 'direct_archive': 1,940 'optional': ['official'],941 },942 {943 'filename': 'gen/chrome/app/policy/translations/policy_templates_pt-BR.json',944 'buildtype': ['official'],945 'archive': 'policy_templates_pt-BR.json',946 'direct_archive': 1,947 'optional': ['official'],948 },949 {950 'filename': 'gen/chrome/app/policy/translations/policy_templates_ru-RU.json',951 'buildtype': ['official'],952 'archive': 'policy_templates_ru-RU.json',953 'direct_archive': 1,954 'optional': ['official'],955 },956 {957 'filename': 'gen/chrome/app/policy/translations/policy_templates_th-TH.json',958 'buildtype': ['official'],959 'archive': 'policy_templates_th-TH.json',960 'direct_archive': 1,961 'optional': ['official'],962 },963 {964 'filename': 'gen/chrome/app/policy/translations/policy_templates_tr-TR.json',965 'buildtype': ['official'],966 'archive': 'policy_templates_tr-TR.json',967 'direct_archive': 1,968 'optional': ['official'],969 },970 {971 'filename': 'gen/chrome/app/policy/translations/policy_templates_uk-UA.json',972 'buildtype': ['official'],973 'archive': 'policy_templates_uk-UA.json',974 'direct_archive': 1,975 'optional': ['official'],976 },977 {978 'filename': 'gen/chrome/app/policy/translations/policy_templates_vi-VN.json',979 'buildtype': ['official'],980 'archive': 'policy_templates_vi-VN.json',981 'direct_archive': 1,982 'optional': ['official'],983 },984 {985 'filename': 'gen/chrome/app/policy/translations/policy_templates_zh-CN.json',986 'buildtype': ['official'],987 'archive': 'policy_templates_zh-CN.json',988 'direct_archive': 1,989 'optional': ['official'],990 },991 {992 'filename': 'gen/chrome/app/policy/translations/policy_templates_zh-TW.json',993 'buildtype': ['official'],994 'archive': 'policy_templates_zh-TW.json',995 'direct_archive': 1,996 'optional': ['official'],997 },998 # Progressive Web App launcher executable:999 {1000 'filename': 'chrome_pwa_launcher.exe',1001 'buildtype': ['dev', 'official'],1002 'filegroup': ['default', 'symsrc'],1003 },1004 {1005 'filename': 'chrome_pwa_launcher.exe.pdb',1006 'buildtype': ['dev', 'official'],1007 'archive': 'chrome-win32-syms.zip',1008 },...

Full Screen

Full Screen

fileManaging.py

Source:fileManaging.py Github

copy

Full Screen

...434 fullfilename = fullfilename + '.yml'435 return fullfilename436437438def get_short_parameters_filename(full_filename):439 parameters_directory_path = directory_parameter_files_annulus()440 short_filename = full_filename[len(parameters_directory_path):]441 return short_filename442443444def filename_spectrum_vs_magnetic_flux(MminL, MmaxL, edge_states, N, hamiltonian_labels, parameters):445 hamiltonian_args = [str(hamiltonian_labels[i]) + '_' + str(parameters[i]) for i in range(len(hamiltonian_labels))]446 args = [MminL, MmaxL, edge_states, N, 'Ham_lbls', *hamiltonian_args]447 args = [str(a) for a in args]448 filename = 'spectrum_vs_magnetic_flux_' + "_".join(args) + '.pkl'449 directory = directory_full_spectrum(MminL, MmaxL, edge_states, N)450 filename = directory + filename451 return filename452 ...

Full Screen

Full Screen

test_filestorage.py

Source:test_filestorage.py Github

copy

Full Screen

...88 FileStorage.objects.filter(filename=filename).values_list(89 "filename", flat=True90 ),91 )92 def test_add_file_fails_with_no_filename(self):93 response = self.make_API_POST_request(94 None, fileObj=factory.make_file_upload()95 )96 self.assertEqual(http.client.BAD_REQUEST, response.status_code)97 self.assertIn("text/plain", response["Content-Type"])98 self.assertEqual(b"Filename not supplied", response.content)99 def test_add_empty_file(self):100 filename = "filename"101 response = self.make_API_POST_request(102 None,103 filename=filename,104 fileObj=factory.make_file_upload(content=b""),105 )106 self.assertEqual(http.client.CREATED, response.status_code)107 self.assertItemsEqual(108 [filename],109 FileStorage.objects.filter(filename=filename).values_list(110 "filename", flat=True111 ),112 )113 def test_add_file_fails_with_no_file_attached(self):114 response = self.make_API_POST_request(None, "foo")115 self.assertEqual(http.client.BAD_REQUEST, response.status_code)116 self.assertIn("text/plain", response["Content-Type"])117 self.assertEqual(b"File not supplied", response.content)118 def test_add_file_fails_with_too_many_files(self):119 foo = factory.make_file_upload(name="foo")120 foo2 = factory.make_file_upload(name="foo2")121 response = self.client.post(122 reverse("files_handler"),123 {"filename": "foo", "file": foo, "file2": foo2},124 )125 self.assertEqual(http.client.BAD_REQUEST, response.status_code)126 self.assertIn("text/plain", response["Content-Type"])127 self.assertEqual(128 b"Exactly one file must be supplied", response.content129 )130 def test_add_file_can_overwrite_existing_file_of_same_name(self):131 # Write file one.132 response = self.make_API_POST_request(133 None, "foo", factory.make_file_upload(content=b"file one")134 )135 self.assertEqual(http.client.CREATED, response.status_code)136 # Write file two with the same name but different contents.137 response = self.make_API_POST_request(138 None, "foo", factory.make_file_upload(content=b"file two")139 )140 self.assertEqual(http.client.CREATED, response.status_code)141 # Retrieve the file and check its contents are the new contents.142 response = self.make_API_GET_request("get", "foo")143 self.assertEqual(b"file two", response.content)144 def test_get_file_succeeds(self):145 filename = factory.make_name("file")146 factory.make_FileStorage(147 filename=filename, content=b"give me rope", owner=self.user148 )149 response = self.make_API_GET_request("get", filename)150 self.assertEqual(http.client.OK, response.status_code)151 self.assertEqual(b"give me rope", response.content)152 def test_get_file_checks_owner(self):153 filename = factory.make_name("file")154 factory.make_FileStorage(155 filename=filename,156 content=b"give me rope",157 owner=factory.make_User(),158 )159 response = self.make_API_GET_request("get", filename)160 self.assertEqual(http.client.NOT_FOUND, response.status_code)161 def test_get_fetches_the_most_recent_file(self):162 filename = factory.make_name("file")163 factory.make_FileStorage(filename=filename, owner=self.user)164 storage = factory.make_FileStorage(filename=filename, owner=self.user)165 response = self.make_API_GET_request("get", filename)166 self.assertEqual(http.client.OK, response.status_code)167 self.assertEqual(storage.content, response.content)168 def test_get_file_fails_with_no_filename(self):169 response = self.make_API_GET_request("get")170 self.assertEqual(http.client.BAD_REQUEST, response.status_code)171 self.assertIn("text/plain", response["Content-Type"])172 self.assertEqual(b"No provided filename!", response.content)173 def test_get_file_fails_with_missing_file(self):174 response = self.make_API_GET_request("get", filename="missingfilename")175 self.assertEqual(http.client.NOT_FOUND, response.status_code)176 self.assertIn("text/plain", response["Content-Type"])177 self.assertEqual(b"File not found", response.content)178 def test_list_files_returns_ordered_list(self):179 filenames = ["myfiles/a", "myfiles/z", "myfiles/b"]180 for filename in filenames:181 factory.make_FileStorage(182 filename=filename, content=b"test content", owner=self.user...

Full Screen

Full Screen

current_files_for_cluster_jobs.py

Source:current_files_for_cluster_jobs.py Github

copy

Full Screen

1from DataManaging import fileManaging as FM23"""4send_off_spectrum_flux():5"""678filename_start = 'FM_parameter_scaling/spectrum_vs_flux_edge=2_N='9# Ns = ['7', '8', '9']10Ns = ['8']11filename_end = '_linear_m_space_flux=0.0001_FM_alt_spatial_flux_edge=0.002'12filenames = [filename_start + N + filename_end for N in Ns]1314filename_start = 'testing_different_FM_terms/spectrum_vs_flux_edge=2_N=6_linear_m_space_flux=0.0001_FM_'15# FM_terms = ['spatial2', 'spatial6_flux']16# FM_terms = ['spatial3','spatialL3','spatialL2','spatial6L_flux','spatial4L_flux']17FM_terms = ['spatial_fixed1', 'spatial_fixed2', 'spatial_fixed_mixed']18filename_ends = ['0.001', '0.002', '0.003', '0.004', '0.005', '0.006', '0.007']19filenames1 = []20for filename_end in filename_ends:21 for FM_term in FM_terms:22 filenames1.append(filename_start + FM_term + filename_end)2324filename_start = 'testing_different_FM_terms/spectrum_vs_flux_edge=3_N=6_linear_m_space_flux=0.0001_FM_'25# FM_terms = ['spatial2', 'spatial3', 'spatial6_flux', 'spatial4_flux']26# FM_terms = ['spatialL3','spatialL2','spatial6L_flux','spatial4L_flux']27# FM_terms = ['spatial_fixed1', 'spatial_fixed2']2829filenames2 = []30for filename_end in filename_ends:31 for FM_term in FM_terms:32 filenames2.append(filename_start + FM_term + filename_end)3334filenames = filenames1 + filenames23536# filename_start = 'FM_parameter_scaling/spectrum_vs_flux_edge=2_N='37# Ns = ['7', '8', '9']38# Ns = ['7']39# filename_end = '_linear_m_space_flux=0.0001_FM_alt_spatial_flux_edge=0.002'40# filenames = [filename_start + N + filename_end for N in Ns]4142# filenames = ['spectrum_vs_flux_edge=2_N=6_linear_m_space_flux_conf_pot=0.0001_interactions']434445"""46HISTORY47"""4849"""50 full_spectrum_luttinger_test():51"""52# filename_p1 = 'luttinger_parm/luttinger_parm_calc_N='53filename_p1 = 'luttinger_parm/bigger_lut_parm_N='54filename_p2 = '_edges='55filename_p3 = '_MminL='56N_edges = [(6, 2), (6, 3), (6, 4), (6, 5), (6, 6), (7, 2), (7, 3), (7, 4)]57filenames_start = [filename_p1 + str(N_edges[i][0]) + filename_p2 + str(N_edges[i][1]) + filename_p3 for i in58 range(len(N_edges))]5960"""61full_spectrum_for_thesis():62"""63filename = 'full_spectrum_graph_for_thesis_v4'64params_filename = FM.filename_parameters_annulus(filename)6566"""67density_luttinger_calculations():68"""69filename_starts = ['luttinger_parm_calc_N=6_edges=2_MminL=', 'luttinger_parm_calc_N=6_edges=3_MminL=',70 'luttinger_parm_calc_N=6_edges=4_MminL=', 'luttinger_parm_calc_N=6_edges=5_MminL=',71 'luttinger_parm_calc_N=6_edges=6_MminL=', 'luttinger_parm_calc_N=7_edges=2_MminL=',72 'luttinger_parm_calc_N=7_edges=3_MminL=',73 'luttinger_parm/luttinger_parm_calc_N=8_edges=2_MminL=']74filename_end = [str(i) for i in range(5, 20)]7576"""77send_test_luttinger_parm():78"""79# filename_start = 'luttinger_parm/testing_size_luttinger_parm_calc_MminL=10_edges=3_N='80# filename_start = 'luttinger_parm/testing_size_luttinger_parm_calc_MminL=10_edges=4_N='81# filename_start = 'luttinger_parm/testing_size_luttinger_parm_calc_MminL=10_edges=5_N='82filename_start = 'luttinger_parm/testing_size_luttinger_parm_calc_MminL=10_edges=6_N='83filenames = [filename_start + str(N) for N in range(7, 8)]8485"""86send_luttinger_parm_calcs():87"""88# filename_start2 = 'luttinger_parm_calc_N=6_edges=5_MminL='89# filename_start3 = 'luttinger_parm_calc_N=6_edges=6_MminL='90# filename_start4 = 'luttinger_parm_calc_N=7_edges=4_MminL='91# filename_start = 'luttinger_parm/luttinger_parm_calc_N=8_edges=2_MminL='92# filename_start = 'luttinger_parm/luttinger_parm_calc_N=7_edges=4_MminL='93# filename_start = 'luttinger_parm/luttinger_parm_calc_N=7_edges=6_MminL='94# filename_start = 'luttinger_parm/luttinger_parm_calc_N=9_edges=2_MminL='95# filename_start = 'luttinger_parm/luttinger_parm_calc_N=7_edges=5_MminL='9697# filename_end = [str(i) for i in range(5, 20)]98# filename_end = [str(i) for i in range(7, 27)]99# filename_end = [str(i) for i in range(7, 30)]100# filenames2 = [filename_start2 + end for end in filename_end]101# filenames3 = [filename_start3 + end for end in filename_end]102# filenames4 = [filename_start4 + end for end in filename_end]103# filenames = filenames2 + filenames3 + filenames4104# filenames = [filename_start + end for end in filename_end]105# filenames = [filename_start2 + '8', filename_start3 + '8', filename_start4 + '8']106107# filename_p1 = 'luttinger_parm/luttinger_parm_calc_N='108filename_p1 = 'luttinger_parm/bigger_lut_parm_N='109filename_p2 = '_edges='110filename_p3 = '_MminL='111# N_edges = [(6, 2), (6, 3), (6, 4), (6, 5), (6, 6), (7, 2), (7, 3), (7, 4), (7, 5), (7, 6), (8, 2), (8, 3), (9, 2)]112# N_edges = [(7, 5), (7, 6), (8, 2), (8, 3)]113# N_edges = [(9, 2)]114N_edges = [(7, 3), (7, 4)]115# N_edges = [(9, 2), (9, 3), (9, 4)]116N_edges = [(8, 4), (8, 5), (8, 6), (9, 2), (9, 3), (9, 4)]117# filename_end = [str(i) for i in range(7, 30)]118# N_edges = [(8, 5)]119# N_edges = [(8, 4)]120# N_edges = [(8, 5), (9, 2)]121N_edges = [(8, 6)]122123# filename_end = [str(i) for i in range(11, 16)]124filename_end = [str(i) for i in range(19, 26)]125126# N_edges = [(9, 2)]127# filename_end = [str(i) for i in range(10, 16)] + [str(i) for i in range(17, 24)]128129# N_edges = [(9, 4)]130# filename_end = [str(i) for i in range(29, 30)]131132# filename_end = ['10']133134filenames_start = [filename_p1 + str(N_edges[i][0]) + filename_p2 + str(N_edges[i][1]) + filename_p3 for i in135 range(len(N_edges))]136137"""138send_off_spectrum_flux():139"""140141filename_start = 'FM_parameter_scaling/spectrum_vs_flux_edge=2_N=6_linear_m_space_flux=0.0001_FM_alt_spatial_flux_edge='142# endings = ['0.002', '0.005', '0.001', '0.0001', '0.0005']143endings = ['0.0002']144endings = ['0.0001', '0.0002', '0.0003', '0.0004', '0.0005', '0.0006', '0.0007', '0.0008', '0.0009', '0.001',145 '0.0011', '0.0012', '0.0013', '0.0014', '0.0015', '0.0016', '0.0017', '0.0018', '0.0019', '0.002']146# endings = ['0.0021', '0.0022', '0.0023', '0.0024', '0.0025', '0.0026', '0.0027', '0.0028', '0.0029', '0.003',147# '0.0031', '0.0032', '0.0033', '0.0034', '0.0035', '0.0036', '0.0037', '0.0038', '0.0039', '0.004',148# '0.0041', '0.0042', '0.0043', '0.0044', '0.0045', '0.0046', '0.0047', '0.0048', '0.0049', '0.005']149150# filename_start = 'FM_single_term/spectrum_vs_flux_edge=2_N=6_linear_m_space_flux=0.0001_FM_spatial1='151# endings = ['0.0001', '0.002', '0.005']152# endings = ['0.004', '0.01', '0.007']153filenames = [filename_start + end for end in endings]154155filename_start = 'FM_parameter_scaling/spectrum_vs_flux_edge=2_N='156# Ns = ['7', '8', '9']157Ns = ['8']158filename_end = '_linear_m_space_flux=0.0001_FM_alt_spatial_flux_edge=0.002'159filenames = [filename_start + N + filename_end for N in Ns]160161# filename_end1 = '=0.002'162# filename_end2 = '=0.003'163# filename_end2 = '=0.004'164filename_ends = ['0.001', '=0.002', '=0.003', '0.004', '0.005', '0.006', '0.007']165166filename_start = 'testing_different_FM_terms/spectrum_vs_flux_edge=2_N=6_linear_m_space_flux=0.0001_FM_'167# FM_terms = ['spatial2', 'spatial6_flux']168# FM_terms = ['spatial3','spatialL3','spatialL2','spatial6L_flux','spatial4L_flux']169FM_terms = ['spatial_fixed1', 'spatial_fixed2', 'spatial_fixed_mixed']170filenames1 = []171for filename_end in filename_ends:172 for FM_term in FM_terms:173 filenames1.append(filename_start + FM_term + filename_end)174175filename_start = 'testing_different_FM_terms/spectrum_vs_flux_edge=3_N=6_linear_m_space_flux=0.0001_FM_'176# FM_terms = ['spatial2', 'spatial3', 'spatial6_flux', 'spatial4_flux']177# FM_terms = ['spatialL3','spatialL2','spatial6L_flux','spatial4L_flux']178# FM_terms = ['spatial_fixed1', 'spatial_fixed2']179180filenames2 = []181for filename_end in filename_ends:182 for FM_term in FM_terms:183 filenames2.append(filename_start + FM_term + filename_end)184185filenames = filenames1 + filenames2186187# filename_start = 'FM_parameter_scaling/spectrum_vs_flux_edge=2_N='188# Ns = ['7', '8', '9']189# Ns = ['7']190# filename_end = '_linear_m_space_flux=0.0001_FM_alt_spatial_flux_edge=0.002'191# filenames = [filename_start + N + filename_end for N in Ns]192193# filenames = ['spectrum_vs_flux_edge=2_N=6_linear_m_space_flux_conf_pot=0.0001_interactions']194195196"""197calc_lz_spectrum(filename)198"""199200files_to_calc = ['parms_for_FM_range_N=6_edge=2', 'parms_for_FM_range_N=6_edge=2_random',201 'parms_for_FM_range_N=6_edge=1', 'parms_for_FM_range_N=6_edge=1_random',202 'parms_for_FM_range_N=6_edge=2_random_smaller_FM', 'parms_for_FM_range_N=6_edge=2_smaller_FM']203204# filename = 'lz_spectrum_for_IQH_flux_params_torus_like_conf_pot=0.001_interactions'205206207"""208calc_full_spectrum(filename)209"""210211filename_start = 'luttinger_parm_calc_N=6_edges=2_MminL='212filename_end = [str(i) for i in range(5, 15)] ...

Full Screen

Full Screen

demo_progressive_saliency_encoding.py

Source:demo_progressive_saliency_encoding.py Github

copy

Full Screen

1#!/usr/bin/env python32# Copyright (c) the JPEG XL Project Authors. All rights reserved.3#4# Use of this source code is governed by a BSD-style5# license that can be found in the LICENSE file.6"""Produces demos for how progressive-saliency encoding would look like.7As long as we do not have a progressive decoder that allows showing images8generated from partially-available data, we can resort to building9animated gifs that show how progressive loading would look like.10Method:111. JPEG-XL encode the image, but stop at the pre-final (2nd) step.122. Use separate tool to compute a heatmap which shows where differences between13 the pre-final and final image are expected to be perceptually worst.143. Use this heatmap to JPEG-XL encode the image with the final step split into15 'salient parts only' and 'non-salient parts'. Generate a sequence of images16 that stop decoding after the 1st, 2nd, 3rd, 4th step. JPEG-XL decode these17 truncated images back to PNG.184. Measure byte sizes of the truncated-encoded images.195. Build an animated GIF with variable delays by calling ImageMagick's20 `convert` command.21"""22from __future__ import absolute_import23from __future__ import division24from __future__ import print_function25from six.moves import zip26import ast # For ast.literal_eval() only.27import os28import re29import shlex30import subprocess31import sys32_BLOCKSIZE = 833_CONF_PARSERS = dict(34 keep_tempfiles=lambda s: bool(ast.literal_eval(s)),35 heatmap_command=shlex.split,36 simulated_progressive_loading_time_sec=float,37 simulated_progressive_loading_delay_until_looparound_sec=float,38 jpegxl_encoder=shlex.split,39 jpegxl_decoder=shlex.split,40 blurring=lambda s: s.split(),41)42def parse_config(config_filename):43 """Parses the configuration file."""44 conf = {}45 re_comment = re.compile(r'^\s*(?:#.*)?$')46 re_param = re.compile(r'^(?P<option>\w+)\s*:\s*(?P<value>.*?)\s*$')47 try:48 with open(config_filename) as h:49 for line in h:50 if re_comment.match(line):51 continue52 m = re_param.match(line)53 if not m:54 raise ValueError('Syntax error')55 conf[m.group('option')] = (56 _CONF_PARSERS[m.group('option')](m.group('value')))57 except Exception as exn:58 raise ValueError('Bad Configuration line ({}): {}'.format(exn, line))59 missing_options = set(_CONF_PARSERS) - set(conf)60 if missing_options:61 raise ValueError('Missing configuration options: ' + ', '.join(62 sorted(missing_options)))63 return conf64def generate_demo_image(config, input_filename, output_filename):65 tempfiles = []66 #67 def encode_img(input_filename, output_filename, num_steps,68 heatmap_filename=None):69 replacements = {70 '${INPUT}': input_filename,71 '${OUTPUT}': output_filename,72 '${STEPS}': str(num_steps),73 # Heatmap argument will be provided in --param=value form.74 '${HEATMAP_ARG}': ('--saliency_map_filename=' + heatmap_filename75 if heatmap_filename is not None else '')76 }77 # Remove empty args. This removes the heatmap-argument if no heatmap78 # is provided..79 cmd = [80 _f for _f in81 [replacements.get(arg, arg) for arg in config['jpegxl_encoder']] if _f82 ]83 tempfiles.append(output_filename)84 subprocess.call(cmd)85 #86 def decode_img(input_filename, output_filename):87 replacements = {'${INPUT}': input_filename, '${OUTPUT}': output_filename}88 cmd = [replacements.get(arg, arg) for arg in config['jpegxl_decoder']]89 tempfiles.append(output_filename)90 subprocess.call(cmd)91 #92 def generate_heatmap(orig_image_filename, coarse_grained_filename,93 heatmap_filename):94 cmd = config['heatmap_command'] + [95 str(_BLOCKSIZE), orig_image_filename, coarse_grained_filename,96 heatmap_filename]97 tempfiles.append(heatmap_filename)98 subprocess.call(cmd)99 #100 try:101 encode_img(input_filename, output_filename + '._step1.pik', 1)102 decode_img(output_filename + '._step1.pik', output_filename + '._step1.png')103 encode_img(input_filename, output_filename + '._step2.pik', 2)104 decode_img(output_filename + '._step2.pik', output_filename + '._step2.png')105 generate_heatmap(input_filename, output_filename + '._step2.png',106 output_filename + '._heatmap.png')107 encode_img(input_filename,108 output_filename + '._step3.pik', 3,109 output_filename + '._heatmap.png')110 encode_img(input_filename,111 output_filename + '._step4.pik', 4,112 output_filename + '._heatmap.png')113 decode_img(output_filename + '._step3.pik', output_filename + '._step3.png')114 decode_img(output_filename + '._step4.pik', output_filename + '._step4.png')115 data_sizes = [116 os.stat('{}._step{}.pik'.format(output_filename, num_step)).st_size117 for num_step in (1, 2, 3, 4)]118 time_offsets = [0] + [119 # Imagemagick's `convert` accepts delays in units of 1/100 sec.120 round(100 * config['simulated_progressive_loading_time_sec'] * size /121 data_sizes[-1]) for size in data_sizes]122 time_delays = [t_next - t_prev123 for t_next, t_prev in zip(time_offsets[1:], time_offsets)]124 # Add a fake white initial image. As long as no usable image data is125 # available, the user will see a white background.126 subprocess.call(['convert',127 output_filename + '._step1.png',128 '-fill', 'white', '-colorize', '100%',129 output_filename + '._step0.png'])130 tempfiles.append(output_filename + '._step0.png')131 subprocess.call(132 ['convert', '-loop', '0', output_filename + '._step0.png'] +133 [arg for args in [134 ['-delay', str(time_delays[n - 1]),135 '-blur', config['blurring'][n - 1],136 '{}._step{}.png'.format(output_filename, n)]137 for n in (1, 2, 3, 4)] for arg in args] +138 ['-delay', str(round(100 * config[139 'simulated_progressive_loading_delay_until_looparound_sec'])),140 output_filename + '._step4.png',141 output_filename])142 finally:143 if not config['keep_tempfiles']:144 for filename in tempfiles:145 try:146 os.unlink(filename)147 except OSError:148 pass # May already have been deleted otherwise.149def main():150 if sys.version.startswith('2.'):151 sys.exit('This is a python3-only script.')152 if (len(sys.argv) != 4 or not sys.argv[-1].endswith('.gif')153 or not sys.argv[-2].endswith('.png')):154 sys.exit(155 'Usage: {} [config_options_file] [input.png] [output.gif]'.format(156 sys.argv[0]))157 try:158 _, config_filename, input_filename, output_filename = sys.argv159 config = parse_config(config_filename)160 generate_demo_image(config, input_filename, output_filename)161 except ValueError as exn:162 sys.exit(exn)163if __name__ == '__main__':...

Full Screen

Full Screen

embedthumbnail.py

Source:embedthumbnail.py Github

copy

Full Screen

1# coding: utf-82from __future__ import unicode_literals3import os4import subprocess5from .ffmpeg import FFmpegPostProcessor6from ..utils import (7 check_executable,8 encodeArgument,9 encodeFilename,10 PostProcessingError,11 prepend_extension,12 replace_extension,13 shell_quote14)15class EmbedThumbnailPPError(PostProcessingError):16 pass17class EmbedThumbnailPP(FFmpegPostProcessor):18 def __init__(self, downloader=None, already_have_thumbnail=False):19 super(EmbedThumbnailPP, self).__init__(downloader)20 self._already_have_thumbnail = already_have_thumbnail21 def run(self, info):22 filename = info['filepath']23 temp_filename = prepend_extension(filename, 'temp')24 if not info.get('thumbnails'):25 self._downloader.to_screen('[embedthumbnail] There aren\'t any thumbnails to embed')26 return [], info27 thumbnail_filename = info['thumbnails'][-1]['filename']28 if not os.path.exists(encodeFilename(thumbnail_filename)):29 self._downloader.report_warning(30 'Skipping embedding the thumbnail because the file is missing.')31 return [], info32 def is_webp(path):33 with open(encodeFilename(path), 'rb') as f:34 b = f.read(12)35 return b[0:4] == b'RIFF' and b[8:] == b'WEBP'36 # Correct extension for WebP file with wrong extension (see #25687, #25717)37 _, thumbnail_ext = os.path.splitext(thumbnail_filename)38 if thumbnail_ext:39 thumbnail_ext = thumbnail_ext[1:].lower()40 if thumbnail_ext != 'webp' and is_webp(thumbnail_filename):41 self._downloader.to_screen(42 '[ffmpeg] Correcting extension to webp and escaping path for thumbnail "%s"' % thumbnail_filename)43 thumbnail_webp_filename = replace_extension(thumbnail_filename, 'webp')44 os.rename(encodeFilename(thumbnail_filename), encodeFilename(thumbnail_webp_filename))45 thumbnail_filename = thumbnail_webp_filename46 thumbnail_ext = 'webp'47 # Convert unsupported thumbnail formats to JPEG (see #25687, #25717)48 if thumbnail_ext not in ['jpg', 'png']:49 # NB: % is supposed to be escaped with %% but this does not work50 # for input files so working around with standard substitution51 escaped_thumbnail_filename = thumbnail_filename.replace('%', '#')52 os.rename(encodeFilename(thumbnail_filename), encodeFilename(escaped_thumbnail_filename))53 escaped_thumbnail_jpg_filename = replace_extension(escaped_thumbnail_filename, 'jpg')54 self._downloader.to_screen('[ffmpeg] Converting thumbnail "%s" to JPEG' % escaped_thumbnail_filename)55 self.run_ffmpeg(escaped_thumbnail_filename, escaped_thumbnail_jpg_filename, ['-bsf:v', 'mjpeg2jpeg'])56 os.remove(encodeFilename(escaped_thumbnail_filename))57 thumbnail_jpg_filename = replace_extension(thumbnail_filename, 'jpg')58 # Rename back to unescaped for further processing59 os.rename(encodeFilename(escaped_thumbnail_jpg_filename), encodeFilename(thumbnail_jpg_filename))60 thumbnail_filename = thumbnail_jpg_filename61 if info['ext'] == 'mp3':62 options = [63 '-c', 'copy', '-map', '0', '-map', '1',64 '-metadata:s:v', 'title="Album cover"', '-metadata:s:v', 'comment="Cover (Front)"']65 self._downloader.to_screen('[ffmpeg] Adding thumbnail to "%s"' % filename)66 self.run_ffmpeg_multiple_files([filename, thumbnail_filename], temp_filename, options)67 if not self._already_have_thumbnail:68 os.remove(encodeFilename(thumbnail_filename))69 os.remove(encodeFilename(filename))70 os.rename(encodeFilename(temp_filename), encodeFilename(filename))71 elif info['ext'] in ['m4a', 'mp4']:72 if not check_executable('AtomicParsley', ['-v']):73 raise EmbedThumbnailPPError('AtomicParsley was not found. Please install.')74 cmd = [encodeFilename('AtomicParsley', True),75 encodeFilename(filename, True),76 encodeArgument('--artwork'),77 encodeFilename(thumbnail_filename, True),78 encodeArgument('-o'),79 encodeFilename(temp_filename, True)]80 self._downloader.to_screen('[atomicparsley] Adding thumbnail to "%s"' % filename)81 if self._downloader.params.get('verbose', False):82 self._downloader.to_screen('[debug] AtomicParsley command line: %s' % shell_quote(cmd))83 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)84 stdout, stderr = p.communicate()85 if p.returncode != 0:86 msg = stderr.decode('utf-8', 'replace').strip()87 raise EmbedThumbnailPPError(msg)88 if not self._already_have_thumbnail:89 os.remove(encodeFilename(thumbnail_filename))90 # for formats that don't support thumbnails (like 3gp) AtomicParsley91 # won't create to the temporary file92 if b'No changes' in stdout:93 self._downloader.report_warning('The file format doesn\'t support embedding a thumbnail')94 else:95 os.remove(encodeFilename(filename))96 os.rename(encodeFilename(temp_filename), encodeFilename(filename))97 else:98 raise EmbedThumbnailPPError('Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.')...

Full Screen

Full Screen

uniturl.py

Source:uniturl.py Github

copy

Full Screen

1import unittest2from bots.botslib import Uri3'''no plugin4'''5class TestTranslate(unittest.TestCase):6 def setUp(self):7 pass8 def testcombinations(self):9 self.assertEqual('scheme://username:password@hostname:80/path1/path2/filename',str(Uri(scheme='scheme',username='username',password='password',hostname='hostname',port=80,path='path1/path2',filename= 'filename',query={'query':'argument'},fragment='fragment')),'basis')10 self.assertEqual('scheme://username:password@hostname:80/path1/path2/filename',str(Uri(scheme='scheme',username='username',password='password',hostname='hostname',port=80,path='path1/path2',filename= 'filename')),'basis')11 12 self.assertEqual('scheme:/path1/path2/filename',str(Uri(scheme='scheme',path='/path1/path2',filename='filename')),'')13 self.assertEqual('scheme:path1/path2/filename',str(Uri(scheme='scheme',path='path1/path2',filename='filename')),'')14 self.assertEqual('path1/path2/filename',str(Uri(path='path1/path2',filename='filename')),'')15 self.assertEqual('path1/path2/',str(Uri(path='path1/path2')),'')16 self.assertEqual('filename',str(Uri(filename='filename')),'')17 self.assertEqual('scheme:path1/path2/',str(Uri(scheme='scheme',path='path1/path2')),'')18 self.assertEqual('scheme:filename',str(Uri(scheme='scheme',filename='filename')),'')19 self.assertEqual('scheme://username:password@hostname:80/path1/path2/',str(Uri(scheme='scheme',username='username',password='password',hostname='hostname',port=80,path='path1/path2')),'basis')20 self.assertEqual('scheme://username:password@hostname:80/filename',str(Uri(scheme='scheme',username='username',password='password',hostname='hostname',port=80,filename= 'filename')),'basis')21 self.assertEqual('scheme://username:password@hostname:80',str(Uri(scheme='scheme',username='username',password='password',hostname='hostname',port=80)),'bas')22 self.assertEqual('scheme://username:password@hostname',str(Uri(scheme='scheme',username='username',password='password',hostname='hostname')),'bas')23 self.assertEqual('scheme://username@hostname',str(Uri(scheme='scheme',username='username',hostname='hostname')),'bas')24 self.assertEqual('scheme://hostname',str(Uri(scheme='scheme',hostname='hostname')),'bas')25 self.assertEqual('scheme://username@hostname:80/path1/path2/filename',str(Uri(scheme='scheme',username='username',hostname='hostname',port=80,path='path1/path2',filename= 'filename')),'no password')26 self.assertEqual('scheme://hostname:80/path1/path2/filename',str(Uri(scheme='scheme',password='password',hostname='hostname',port=80,path='path1/path2',filename= 'filename')),'no username')27 self.assertEqual('scheme:path1/path2/filename',str(Uri(scheme='scheme',username='username',password='password',path='path1/path2',filename= 'filename')),'no hostname')28 self.assertEqual('//username:password@hostname:80/path1/path2/filename',str(Uri(username='username',password='password',hostname='hostname',port=80,path='path1/path2',filename= 'filename')),'no scheme')29 self.assertEqual('path1/path2/filename',str(Uri(username='username',password='password',port=80,path='path1/path2',filename= 'filename')),'no scheme no hostname')30 31 def testempty(self):32 #tests for empty values33 self.assertEqual('//username:password@hostname:80/path1/path2/filename',str(Uri(scheme=None,username='username',password='password',hostname='hostname',port=80,path='path1/path2',filename= 'filename')),'basis')34 self.assertEqual('//username:password@hostname:80/path1/path2/filename',str(Uri(scheme='',username='username',password='password',hostname='hostname',port=80,path='path1/path2',filename= 'filename')),'basis')35 self.assertEqual('scheme://hostname:80/path1/path2/filename',str(Uri(scheme='scheme',username=None,password=None,hostname='hostname',port=80,path='path1/path2',filename= 'filename')),'basis')36 self.assertEqual('scheme://hostname:80/path1/path2/filename',str(Uri(scheme='scheme',username='',password='',hostname='hostname',port=80,path='path1/path2',filename= 'filename')),'basis')37 #~ self.assertEqual('scheme://username:password@hostname:80/path1/path2/filename',str(Uri(scheme='scheme',username='username',password='password',hostname='hostname',port=80,path='path1/path2',filename= 'filename')),'basis')38 def testcalls(self):39 self.assertEqual('scheme:/path1/path2/filename2',Uri(scheme='scheme',path='/path1/path2',filename='filename').uri(filename='filename2'),'')40if __name__ == '__main__':...

Full Screen

Full Screen

File.py

Source:File.py Github

copy

Full Screen

1# Copyright (C) 2014 Ninbora [admin@ninbora.com]2# Licensed under MIT license [http://opensource.org/licenses/MIT]3import shutil4import os5import os.path6#============================================================================7# create <folder> if does not exist yet8# Params: folder = the folder to9# Return: True if the folder exist or was created successfully 10#============================================================================11def ensureFolder(folder):12 if not os.path.exists(folder):13 try:14 os.makedirs(folder)15 except:16 return False17 return True18#============================================================================19# Clean the name for invalid characters20# Params: filename = the filename to clean21# Return: The filename without invalid characters22#============================================================================23def cleanName(filename):24 filename = filename.replace("'","")25 filename = filename.replace('"',"")26 filename = filename.replace("?","")27 filename = filename.replace("<","")28 filename = filename.replace(">","")29 filename = filename.replace("*","")30 filename = filename.replace("|","")31 filename = filename.replace(":","")32 filename = filename.replace("!","")33 filename = filename.replace("\\","")34 filename = filename.replace("/","_")35 filename = filename.replace("\t","")36 return filename37#==============================================================================38# Deletes files in a <folder> and its sub-folders.39# Params : folder = path to local folder40# extension = extension of the files to remove. if empty all files will be removed.41# prefix = prefix of the files to remove. if empty all files will be removed.42#==============================================================================43def delFiles(folder, extension = '', prefix = ''):44 if (extension != '' ) :45 extension = '.' + extension46 try:47 for root, dirs, files in os.walk(folder, topdown=False):48 for name in files:49 filename = os.path.join(root, name)50 if extension == '' and prefix == '':51 os.remove(filename)52 elif extension != '' and filename.endswith(extension):53 os.remove(filename)54 elif prefix != '' and name.startswith(prefix):55 os.remove(filename)56 for name in dirs:57 dir = os.path.join(root, name)58 os.rmdir(dir)59 except IOError:...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import {filename} from 'ts-auto-mock';2import {filename} from 'ts-auto-mock';3import {filename} from 'ts-auto-mock';4import {filename} from 'ts-auto-mock';5import {filename} from 'ts-auto-mock';6import {filename} from 'ts-auto-mock';7import {filename} from 'ts-auto-mock';8import {filename} from 'ts-auto-mock';9import {filename} from 'ts-auto-mock';10import {filename} from 'ts-auto-mock';11import {filename} from 'ts-auto-mock';12import {filename} from 'ts-auto-mock';13import {filename} from 'ts-auto-mock';14import {filename} from 'ts-auto-mock';15import {filename} from 'ts-auto-mock';16import {filename} from 'ts-auto-mock';17import {filename} from 'ts-auto-mock';18import {filename} from 'ts-auto-mock';19import {filename} from 'ts-auto-mock';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createMock } from 'ts-auto-mock';2import { MyInterface } from './test2';3const mock: MyInterface = createMock<MyInterface>();4console.log(mock);5import { createMock } from 'ts-auto-mock';6import { MyInterface } from './test2';7const mock: MyInterface = createMock<MyInterface>();8console.log(mock);9import { createMock } from 'ts-auto-mock';10import { MyInterface } from './test2';11const mock: MyInterface = createMock<MyInterface>();12console.log(mock);13import { createMock } from 'ts-auto-mock';14import { MyInterface } from './test2';15const mock: MyInterface = createMock<MyInterface>();16console.log(mock);17import { createMock } from 'ts-auto-mock';18import { MyInterface } from './test2';19const mock: MyInterface = createMock<MyInterface>();20console.log(mock);21import { createMock } from 'ts-auto-mock';22import { MyInterface } from './test2';23const mock: MyInterface = createMock<MyInterface>();24console.log(mock);25import { createMock } from 'ts-auto-mock';26import { MyInterface } from './test2';27const mock: MyInterface = createMock<MyInterface>();28console.log(mock);29import { createMock } from 'ts-auto-mock';30import { MyInterface } from './test2';31const mock: MyInterface = createMock<MyInterface>();32console.log(mock);33import { createMock } from 'ts-auto-mock';34import { MyInterface } from './test2';35const mock: MyInterface = createMock<MyInterface>();36console.log(mock);

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createMock } from 'ts-auto-mock';2import { Interface1 } from './test2';3const mock1: Interface1 = createMock<Interface1>();4console.log(mock1);5export interface Interface1 {6 prop1: string;7 prop2: number;8}

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createMock } from 'ts-auto-mock';2const mock = createMock<SomeInterface>('test1.ts');3console.log(mock);4import { createMock } from 'ts-auto-mock';5const mock = createMock<SomeInterface>('test2.ts');6console.log(mock);7import { createMock } from 'ts-auto-mock';8const mock = createMock<SomeInterface>('test.ts');9console.log(mock);10import { createMock } from 'ts-auto-mock';11const mock = createMock<SomeInterface>('test2.ts');12console.log(mock);13import { createMock } from 'ts-auto-mock';14const mock = createMock<SomeInterface>('test.ts');15console.log(mock);16import { createMock } from 'ts-auto-mock';17const mock = createMock<SomeInterface>('test2.ts');18console.log(mock);19import { createMock } from 'ts-auto-mock';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createMock } from 'ts-auto-mock'2const mock = createMock<test1>()3import { createMock } from 'ts-auto-mock'4interface test2 {5}6const mock = createMock<test2>()7{8 "compilerOptions": {

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createMock } from 'ts-auto-mock';2const mock = createMock<ClassName>();3console.log(mock)4import { createMock } from 'ts-auto-mock';5import { ClassName } from './path/to/ClassName';6const mock = createMock<ClassName>();7console.log(mock)8import { createMock } from 'ts-auto-mock';9import { ClassName } from './path/to/ClassName';10const mock = createMock<ClassName>();11console.log(mock)12import { createMock } from 'ts-auto-mock';13import { ClassName } from './path/to/ClassName';14const mock = createMock<ClassName>();15console.log(mock)16import { createMock } from 'ts-auto-mock';17import { ClassName } from './path/to/ClassName';18const mock = createMock<ClassName>();19console.log(mock)20import { createMock } from 'ts-auto-mock';21import { ClassName } from './path/to/ClassName';22const mock = createMock<ClassName>();23console.log(mock)24import { createMock } from 'ts-auto-mock';25import { ClassName } from './path/to/ClassName';26const mock = createMock<ClassName>();27console.log(mock)28import { createMock } from 'ts-auto-mock';29import { ClassName } from './path/to/ClassName';30const mock = createMock<ClassName>();31console.log(mock)32import { createMock } from 'ts-auto-mock';33import { ClassName } from './path/to/ClassName';34const mock = createMock<ClassName>();35console.log(mock)36import { createMock } from 'ts-auto-mock';37import { ClassName } from './path/to/ClassName';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createMock } from 'ts-auto-mock';2import { MyInterface } from './test2';3const mock: MyInterface = createMock<MyInterface>();4console.log(mock);5export interface MyInterface {6 myProp: string;7}8{9 "compilerOptions": {10 "paths": {11 }12 }13}14I am using the latest version of ts-auto-mock and I have the same problem. I have a monorepo and I have a library (let's call it libA) which has a dependency on another library (let's call it libB). I want to use ts-auto-mock in a test file of libA to mock a type defined in libB. However, I can't get it to work. I get the error "Cannot find module 'libB' or its corresponding type declarations."15{16 "compilerOptions": {17 "paths": {18 }19 }20}21I have the same issue. I have a monorepo and I have a library (let's call it libA) which has a dependency on another library (let's call it libB). I want to use ts-auto-mock in a test file of libA to mock a type defined in libB. However, I can't get it to work. I get the error "Cannot find module 'libB' or its corresponding type declarations."

Full Screen

Using AI Code Generation

copy

Full Screen

1const tsAutoMock = require('ts-auto-mock');2const {filename} = tsAutoMock;3const path = require('path');4const filename = path.join(__dirname, 'test1.ts');5tsAutoMock.createMock(filename);6const tsAutoMock = require('ts-auto-mock');7const {filename} = tsAutoMock;8const filename = 'test2.ts';9tsAutoMock.createMock(filename);10const tsAutoMock = require('ts-auto-mock');11const {filename} = tsAutoMock;12const filename = 'test3.ts';13tsAutoMock.createMock(filename);14I am trying to mock a function that returns a promise. I have tried mocking the function using jest but it does not work. I have tried mocking the function using ts-auto-mock but it does not work. I have tried mocking the function using ts-mock-imports but it does not work. I have tried mocking the function using ts-auto-mock , ts-mock-imports and jest together but it does not work. I have tried mocking the function using ts-auto-mock , ts-mock-imports , jest and sinon together but it does not work. I have tried mocking the function using ts-auto-mock , ts-mock-imports , jest , sinon and rewire together but it does not work. I have tried mocking the function using ts-auto-mock , ts-mock-imports , jest , sinon , rewire and proxyquire together but it does not work. I have tried mocking the function using ts-auto-mock , ts-mock-imports , jest , sinon , rewire , proxyquire and mock-require together but it does not work. I have tried mocking the function using ts-auto-mock , ts-mock-imports , jest , sinon , rewire , proxyquire , mock-require and mock-fs together but it does not work. I have tried mocking the function using ts-auto-mock , ts-mock

Full Screen

Using AI Code Generation

copy

Full Screen

1const { createMock } = require('ts-auto-mock');2const mock = createMock('test1.ts');3console.log(mock);4export interface test1 {5 name: string;6}7{ name: '' }8const { createMock } = require('ts-auto-mock');9const mock = createMock('test2.ts');10console.log(mock);11export interface test2 {12 name: string;13}14{ name: '' }15const { createMock } = require('ts-auto-mock');16const mock = createMock('test3.ts');17console.log(mock);18export interface test3 {19 name: string;20}21{ name: '' }

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run ts-auto-mock automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful