How to use _output method in fMBT

Best Python code snippet using fMBT_python

_sysconfigdata.py

Source:_sysconfigdata.py Github

copy

Full Screen

1# system configuration generated and used by the sysconfig module2build_time_vars = {'AC_APPLE_UNIVERSAL_BUILD': 0,3 'AIX_GENUINE_CPLUSPLUS': 0,4 'AR': '/%%PACBIO_BUILD_ROOTDIR%%/artifacts/thirdparty.prebuilt/gcc/gcc_8.3.0/libc_2.12.1/gcc_8.3.0/bin/ar',5 'ARFLAGS': 'rc',6 'ATHEOS_THREADS': 0,7 'BASECFLAGS': '-fno-strict-aliasing',8 'BASEMODLIBS': '',9 'BEOS_THREADS': 0,10 'BINDIR': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/bin',11 'BINLIBDEST': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/python2.7',12 'BLDLIBRARY': 'libpython2.7.a',13 'BLDSHARED': '/%%PACBIO_BUILD_ROOTDIR%%/artifacts/thirdparty.prebuilt/gcc/gcc_8.3.0/libc_2.12.1/gcc_8.3.0/bin/gcc -pthread -shared -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/openssl/openssl_1.1.1b/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/readline/readline_8.0/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/bzip2/bzip2_1.0.6/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/zlib/zlib_1.2.11/_output/install/lib',14 'BUILDEXE': '',15 'BUILDPYTHON': 'python',16 'CC': '/%%PACBIO_BUILD_ROOTDIR%%/artifacts/thirdparty.prebuilt/gcc/gcc_8.3.0/libc_2.12.1/gcc_8.3.0/bin/gcc -pthread',17 'CCSHARED': '-fPIC',18 'CFLAGS': '-fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes',19 'CFLAGSFORSHARED': '',20 'CONFIGFILES': 'configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in',21 'CONFIG_ARGS': "'--prefix' '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install' '--without-cxx-main' '--enable-unicode=ucs4' 'CC=/%%PACBIO_BUILD_ROOTDIR%%/artifacts/thirdparty.prebuilt/gcc/gcc_8.3.0/libc_2.12.1/gcc_8.3.0/bin/gcc' 'LDFLAGS= -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/openssl/openssl_1.1.1b/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/readline/readline_8.0/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/bzip2/bzip2_1.0.6/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/zlib/zlib_1.2.11/_output/install/lib ' 'LIBS=-ltinfo' 'CPPFLAGS= -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/openssl/openssl_1.1.1b/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/readline/readline_8.0/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/include/ncurses -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/bzip2/bzip2_1.0.6/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/zlib/zlib_1.2.11/_output/install/include '",22 'CONFINCLUDEDIR': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/include',23 'CONFINCLUDEPY': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/include/python2.7',24 'COREPYTHONPATH': ':plat-linux2:lib-tk:lib-old',25 'COVERAGE_INFO': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/build-static/Python-2.7.16/coverage.info',26 'COVERAGE_REPORT': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/build-static/Python-2.7.16/lcov-report',27 'COVERAGE_REPORT_OPTIONS': '--no-branch-coverage --title "CPython lcov report"',28 'CPPFLAGS': '-I. -IInclude -I./Include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/openssl/openssl_1.1.1b/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/readline/readline_8.0/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/include/ncurses -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/bzip2/bzip2_1.0.6/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/zlib/zlib_1.2.11/_output/install/include',29 'CXX': 'c++ -pthread',30 'C_THREADS': 0,31 'DESTDIRS': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install /%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib /%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/python2.7 /%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/python2.7/lib-dynload',32 'DESTLIB': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/python2.7',33 'DESTPATH': '',34 'DESTSHARED': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/python2.7/lib-dynload',35 'DIRMODE': 755,36 'DIST': 'README ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Demo Ext-dummy',37 'DISTDIRS': 'Include Lib Misc Demo Ext-dummy',38 'DISTFILES': 'README ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in',39 'DLINCLDIR': '.',40 'DLLLIBRARY': '',41 'DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754': 0,42 'DOUBLE_IS_BIG_ENDIAN_IEEE754': 0,43 'DOUBLE_IS_LITTLE_ENDIAN_IEEE754': 1,44 'DYNLOADFILE': 'dynload_shlib.o',45 'ENABLE_IPV6': 1,46 'ENSUREPIP': 'no',47 'EXE': '',48 'EXEMODE': 755,49 'EXTRAMACHDEPPATH': '',50 'EXTRAPLATDIR': '',51 'EXTRATESTOPTS': '',52 'EXTRA_CFLAGS': '',53 'FILEMODE': 644,54 'FLOCK_NEEDS_LIBBSD': 0,55 'GETPGRP_HAVE_ARG': 0,56 'GETTIMEOFDAY_NO_TZ': 0,57 'GITBRANCH': '',58 'GITTAG': '',59 'GITVERSION': '',60 'GLHACK': '-Dclear=__GLclear',61 'GNULD': 'yes',62 'HAVE_ACOSH': 1,63 'HAVE_ADDRINFO': 1,64 'HAVE_ALARM': 1,65 'HAVE_ALLOCA_H': 1,66 'HAVE_ALTZONE': 0,67 'HAVE_ASINH': 1,68 'HAVE_ASM_TYPES_H': 1,69 'HAVE_ATANH': 1,70 'HAVE_ATTRIBUTE_FORMAT_PARSETUPLE': 0,71 'HAVE_BIND_TEXTDOMAIN_CODESET': 1,72 'HAVE_BLUETOOTH_BLUETOOTH_H': 0,73 'HAVE_BLUETOOTH_H': 0,74 'HAVE_BROKEN_NICE': 0,75 'HAVE_BROKEN_PIPE_BUF': 0,76 'HAVE_BROKEN_POLL': 0,77 'HAVE_BROKEN_POSIX_SEMAPHORES': 0,78 'HAVE_BROKEN_PTHREAD_SIGMASK': 0,79 'HAVE_BROKEN_SEM_GETVALUE': 0,80 'HAVE_BROKEN_UNSETENV': 0,81 'HAVE_C99_BOOL': 1,82 'HAVE_CHFLAGS': 0,83 'HAVE_CHOWN': 1,84 'HAVE_CHROOT': 1,85 'HAVE_CLOCK': 1,86 'HAVE_COMPUTED_GOTOS': 1,87 'HAVE_CONFSTR': 1,88 'HAVE_CONIO_H': 0,89 'HAVE_COPYSIGN': 1,90 'HAVE_CRYPT_H': 1,91 'HAVE_CTERMID': 1,92 'HAVE_CTERMID_R': 0,93 'HAVE_CURSES_FILTER': 1,94 'HAVE_CURSES_H': 1,95 'HAVE_CURSES_HAS_KEY': 1,96 'HAVE_CURSES_IMMEDOK': 1,97 'HAVE_CURSES_IS_PAD': 1,98 'HAVE_CURSES_IS_TERM_RESIZED': 1,99 'HAVE_CURSES_RESIZETERM': 1,100 'HAVE_CURSES_RESIZE_TERM': 1,101 'HAVE_CURSES_SYNCOK': 1,102 'HAVE_CURSES_TYPEAHEAD': 1,103 'HAVE_CURSES_USE_ENV': 1,104 'HAVE_CURSES_WCHGAT': 1,105 'HAVE_DECL_ISFINITE': 1,106 'HAVE_DECL_ISINF': 1,107 'HAVE_DECL_ISNAN': 1,108 'HAVE_DECL_TZNAME': 0,109 'HAVE_DEVICE_MACROS': 1,110 'HAVE_DEV_PTC': 0,111 'HAVE_DEV_PTMX': 1,112 'HAVE_DIRECT_H': 0,113 'HAVE_DIRENT_H': 1,114 'HAVE_DLFCN_H': 1,115 'HAVE_DLOPEN': 1,116 'HAVE_DUP2': 1,117 'HAVE_DYNAMIC_LOADING': 1,118 'HAVE_EPOLL': 1,119 'HAVE_ERF': 1,120 'HAVE_ERFC': 1,121 'HAVE_ERRNO_H': 1,122 'HAVE_EXECV': 1,123 'HAVE_EXPM1': 1,124 'HAVE_FCHDIR': 1,125 'HAVE_FCHMOD': 1,126 'HAVE_FCHOWN': 1,127 'HAVE_FCNTL_H': 1,128 'HAVE_FDATASYNC': 1,129 'HAVE_FINITE': 1,130 'HAVE_FLOCK': 1,131 'HAVE_FORK': 1,132 'HAVE_FORKPTY': 1,133 'HAVE_FPATHCONF': 1,134 'HAVE_FSEEK64': 0,135 'HAVE_FSEEKO': 1,136 'HAVE_FSTATVFS': 1,137 'HAVE_FSYNC': 1,138 'HAVE_FTELL64': 0,139 'HAVE_FTELLO': 1,140 'HAVE_FTIME': 1,141 'HAVE_FTRUNCATE': 1,142 'HAVE_GAI_STRERROR': 1,143 'HAVE_GAMMA': 1,144 'HAVE_GCC_ASM_FOR_X87': 1,145 'HAVE_GETADDRINFO': 1,146 'HAVE_GETCWD': 1,147 'HAVE_GETC_UNLOCKED': 1,148 'HAVE_GETENTROPY': 0,149 'HAVE_GETGROUPS': 1,150 'HAVE_GETHOSTBYNAME': 0,151 'HAVE_GETHOSTBYNAME_R': 1,152 'HAVE_GETHOSTBYNAME_R_3_ARG': 0,153 'HAVE_GETHOSTBYNAME_R_5_ARG': 0,154 'HAVE_GETHOSTBYNAME_R_6_ARG': 1,155 'HAVE_GETITIMER': 1,156 'HAVE_GETLOADAVG': 1,157 'HAVE_GETLOGIN': 1,158 'HAVE_GETNAMEINFO': 1,159 'HAVE_GETPAGESIZE': 1,160 'HAVE_GETPEERNAME': 1,161 'HAVE_GETPGID': 1,162 'HAVE_GETPGRP': 1,163 'HAVE_GETPID': 1,164 'HAVE_GETPRIORITY': 1,165 'HAVE_GETPWENT': 1,166 'HAVE_GETRESGID': 1,167 'HAVE_GETRESUID': 1,168 'HAVE_GETSID': 1,169 'HAVE_GETSPENT': 1,170 'HAVE_GETSPNAM': 1,171 'HAVE_GETTIMEOFDAY': 1,172 'HAVE_GETWD': 1,173 'HAVE_GRP_H': 1,174 'HAVE_HSTRERROR': 1,175 'HAVE_HYPOT': 1,176 'HAVE_IEEEFP_H': 0,177 'HAVE_INET_ATON': 1,178 'HAVE_INET_PTON': 1,179 'HAVE_INITGROUPS': 1,180 'HAVE_INT32_T': 1,181 'HAVE_INT64_T': 1,182 'HAVE_INTTYPES_H': 1,183 'HAVE_IO_H': 0,184 'HAVE_KILL': 1,185 'HAVE_KILLPG': 1,186 'HAVE_KQUEUE': 0,187 'HAVE_LANGINFO_H': 1,188 'HAVE_LARGEFILE_SUPPORT': 0,189 'HAVE_LCHFLAGS': 0,190 'HAVE_LCHOWN': 1,191 'HAVE_LGAMMA': 1,192 'HAVE_LIBDL': 1,193 'HAVE_LIBDLD': 0,194 'HAVE_LIBIEEE': 0,195 'HAVE_LIBINTL_H': 1,196 'HAVE_LIBREADLINE': 1,197 'HAVE_LIBRESOLV': 0,198 'HAVE_LIBUTIL_H': 0,199 'HAVE_LINK': 1,200 'HAVE_LINUX_NETLINK_H': 1,201 'HAVE_LINUX_TIPC_H': 1,202 'HAVE_LOG1P': 1,203 'HAVE_LONG_DOUBLE': 1,204 'HAVE_LONG_LONG': 1,205 'HAVE_LSTAT': 1,206 'HAVE_MAKEDEV': 1,207 'HAVE_MEMMOVE': 1,208 'HAVE_MEMORY_H': 1,209 'HAVE_MKFIFO': 1,210 'HAVE_MKNOD': 1,211 'HAVE_MKTIME': 1,212 'HAVE_MMAP': 1,213 'HAVE_MREMAP': 1,214 'HAVE_NCURSES_H': 1,215 'HAVE_NDIR_H': 0,216 'HAVE_NETPACKET_PACKET_H': 1,217 'HAVE_NICE': 1,218 'HAVE_OPENPTY': 1,219 'HAVE_OSX105_SDK': 0,220 'HAVE_PATHCONF': 1,221 'HAVE_PAUSE': 1,222 'HAVE_PLOCK': 0,223 'HAVE_POLL': 1,224 'HAVE_POLL_H': 1,225 'HAVE_PROCESS_H': 0,226 'HAVE_PROTOTYPES': 1,227 'HAVE_PTH': 0,228 'HAVE_PTHREAD_ATFORK': 1,229 'HAVE_PTHREAD_DESTRUCTOR': 0,230 'HAVE_PTHREAD_H': 1,231 'HAVE_PTHREAD_INIT': 0,232 'HAVE_PTHREAD_SIGMASK': 1,233 'HAVE_PTY_H': 1,234 'HAVE_PUTENV': 1,235 'HAVE_READLINK': 1,236 'HAVE_REALPATH': 1,237 'HAVE_RL_CALLBACK': 1,238 'HAVE_RL_CATCH_SIGNAL': 1,239 'HAVE_RL_COMPLETION_APPEND_CHARACTER': 1,240 'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK': 1,241 'HAVE_RL_COMPLETION_MATCHES': 1,242 'HAVE_RL_COMPLETION_SUPPRESS_APPEND': 1,243 'HAVE_RL_PRE_INPUT_HOOK': 1,244 'HAVE_RL_RESIZE_TERMINAL': 1,245 'HAVE_ROUND': 1,246 'HAVE_SELECT': 1,247 'HAVE_SEM_GETVALUE': 1,248 'HAVE_SEM_OPEN': 1,249 'HAVE_SEM_TIMEDWAIT': 1,250 'HAVE_SEM_UNLINK': 1,251 'HAVE_SETEGID': 1,252 'HAVE_SETEUID': 1,253 'HAVE_SETGID': 1,254 'HAVE_SETGROUPS': 1,255 'HAVE_SETITIMER': 1,256 'HAVE_SETLOCALE': 1,257 'HAVE_SETPGID': 1,258 'HAVE_SETPGRP': 1,259 'HAVE_SETREGID': 1,260 'HAVE_SETRESGID': 1,261 'HAVE_SETRESUID': 1,262 'HAVE_SETREUID': 1,263 'HAVE_SETSID': 1,264 'HAVE_SETUID': 1,265 'HAVE_SETVBUF': 1,266 'HAVE_SHADOW_H': 1,267 'HAVE_SIGACTION': 1,268 'HAVE_SIGINTERRUPT': 1,269 'HAVE_SIGNAL_H': 1,270 'HAVE_SIGRELSE': 1,271 'HAVE_SNPRINTF': 1,272 'HAVE_SOCKADDR_SA_LEN': 0,273 'HAVE_SOCKADDR_STORAGE': 1,274 'HAVE_SOCKETPAIR': 1,275 'HAVE_SPAWN_H': 1,276 'HAVE_SSIZE_T': 1,277 'HAVE_STATVFS': 1,278 'HAVE_STAT_TV_NSEC': 1,279 'HAVE_STAT_TV_NSEC2': 0,280 'HAVE_STDARG_PROTOTYPES': 1,281 'HAVE_STDINT_H': 1,282 'HAVE_STDLIB_H': 1,283 'HAVE_STRDUP': 1,284 'HAVE_STRFTIME': 1,285 'HAVE_STRINGS_H': 1,286 'HAVE_STRING_H': 1,287 'HAVE_STROPTS_H': 1,288 'HAVE_STRUCT_STAT_ST_BIRTHTIME': 0,289 'HAVE_STRUCT_STAT_ST_BLKSIZE': 1,290 'HAVE_STRUCT_STAT_ST_BLOCKS': 1,291 'HAVE_STRUCT_STAT_ST_FLAGS': 0,292 'HAVE_STRUCT_STAT_ST_GEN': 0,293 'HAVE_STRUCT_STAT_ST_RDEV': 1,294 'HAVE_STRUCT_TM_TM_ZONE': 1,295 'HAVE_SYMLINK': 1,296 'HAVE_SYSCONF': 1,297 'HAVE_SYSEXITS_H': 1,298 'HAVE_SYS_AUDIOIO_H': 0,299 'HAVE_SYS_BSDTTY_H': 0,300 'HAVE_SYS_DIR_H': 0,301 'HAVE_SYS_EPOLL_H': 1,302 'HAVE_SYS_EVENT_H': 0,303 'HAVE_SYS_FILE_H': 1,304 'HAVE_SYS_LOADAVG_H': 0,305 'HAVE_SYS_LOCK_H': 0,306 'HAVE_SYS_MKDEV_H': 0,307 'HAVE_SYS_MODEM_H': 0,308 'HAVE_SYS_NDIR_H': 0,309 'HAVE_SYS_PARAM_H': 1,310 'HAVE_SYS_POLL_H': 1,311 'HAVE_SYS_RANDOM_H': 0,312 'HAVE_SYS_RESOURCE_H': 1,313 'HAVE_SYS_SELECT_H': 1,314 'HAVE_SYS_SOCKET_H': 1,315 'HAVE_SYS_STATVFS_H': 1,316 'HAVE_SYS_STAT_H': 1,317 'HAVE_SYS_SYSMACROS_H': 1,318 'HAVE_SYS_TERMIO_H': 0,319 'HAVE_SYS_TIMES_H': 1,320 'HAVE_SYS_TIME_H': 1,321 'HAVE_SYS_TYPES_H': 1,322 'HAVE_SYS_UN_H': 1,323 'HAVE_SYS_UTSNAME_H': 1,324 'HAVE_SYS_WAIT_H': 1,325 'HAVE_TCGETPGRP': 1,326 'HAVE_TCSETPGRP': 1,327 'HAVE_TEMPNAM': 1,328 'HAVE_TERMIOS_H': 1,329 'HAVE_TERM_H': 1,330 'HAVE_TGAMMA': 1,331 'HAVE_THREAD_H': 0,332 'HAVE_TIMEGM': 1,333 'HAVE_TIMES': 1,334 'HAVE_TMPFILE': 1,335 'HAVE_TMPNAM': 1,336 'HAVE_TMPNAM_R': 1,337 'HAVE_TM_ZONE': 1,338 'HAVE_TRUNCATE': 1,339 'HAVE_TZNAME': 0,340 'HAVE_UCS4_TCL': 0,341 'HAVE_UINT32_T': 1,342 'HAVE_UINT64_T': 1,343 'HAVE_UINTPTR_T': 1,344 'HAVE_UNAME': 1,345 'HAVE_UNISTD_H': 1,346 'HAVE_UNSETENV': 1,347 'HAVE_USABLE_WCHAR_T': 0,348 'HAVE_UTIL_H': 0,349 'HAVE_UTIMES': 1,350 'HAVE_UTIME_H': 1,351 'HAVE_WAIT3': 1,352 'HAVE_WAIT4': 1,353 'HAVE_WAITPID': 1,354 'HAVE_WCHAR_H': 1,355 'HAVE_WCSCOLL': 1,356 'HAVE_WORKING_TZSET': 1,357 'HAVE_ZLIB_COPY': 1,358 'HAVE__GETPTY': 0,359 'HOST_GNU_TYPE': 'x86_64-pc-linux-gnu',360 'HURD_C_THREADS': 0,361 'INCLDIRSTOMAKE': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/include /%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/include /%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/include/python2.7 /%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/include/python2.7',362 'INCLUDEDIR': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/include',363 'INCLUDEPY': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/include/python2.7',364 'INSTALL': '/usr/bin/install -c',365 'INSTALL_DATA': '/usr/bin/install -c -m 644',366 'INSTALL_PROGRAM': '/usr/bin/install -c',367 'INSTALL_SCRIPT': '/usr/bin/install -c',368 'INSTALL_SHARED': '/usr/bin/install -c -m 555',369 'INSTSONAME': 'libpython2.7.a',370 'LDCXXSHARED': 'c++ -pthread -shared',371 'LDFLAGS': '-L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/openssl/openssl_1.1.1b/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/readline/readline_8.0/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/bzip2/bzip2_1.0.6/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/zlib/zlib_1.2.11/_output/install/lib',372 'LDLAST': '',373 'LDLIBRARY': 'libpython2.7.a',374 'LDLIBRARYDIR': '',375 'LDSHARED': '/%%PACBIO_BUILD_ROOTDIR%%/artifacts/thirdparty.prebuilt/gcc/gcc_8.3.0/libc_2.12.1/gcc_8.3.0/bin/gcc -pthread -shared -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/openssl/openssl_1.1.1b/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/readline/readline_8.0/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/bzip2/bzip2_1.0.6/_output/install/lib -L/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/zlib/zlib_1.2.11/_output/install/lib',376 'LIBC': '',377 'LIBDEST': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/python2.7',378 'LIBDIR': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib',379 'LIBFFI_INCLUDEDIR': '',380 'LIBM': '-lm',381 'LIBOBJDIR': 'Python/',382 'LIBOBJS': '',383 'LIBP': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/python2.7',384 'LIBPC': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/pkgconfig',385 'LIBPL': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/python2.7/config',386 'LIBRARY': 'libpython2.7.a',387 'LIBRARY_OBJS': '\\',388 'LIBS': '-lpthread -ldl -ltinfo -lutil',389 'LIBSUBDIRS': 'lib-tk lib-tk/test lib-tk/test/test_tkinter \\',390 'LINKCC': '/%%PACBIO_BUILD_ROOTDIR%%/artifacts/thirdparty.prebuilt/gcc/gcc_8.3.0/libc_2.12.1/gcc_8.3.0/bin/gcc -pthread',391 'LINKFORSHARED': '-Xlinker -export-dynamic',392 'LLVM_PROF_ERR': 'no',393 'LLVM_PROF_FILE': '',394 'LLVM_PROF_MERGER': 'true',395 'LN': 'ln',396 'LOCALMODLIBS': '',397 'MACHDEP': 'linux2',398 'MACHDEPPATH': ':plat-linux2',399 'MACHDEPS': 'plat-linux2',400 'MACHDEP_OBJS': '',401 'MACHDESTLIB': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib/python2.7',402 'MACH_C_THREADS': 0,403 'MACOSX_DEPLOYMENT_TARGET': '',404 'MAINCC': '/%%PACBIO_BUILD_ROOTDIR%%/artifacts/thirdparty.prebuilt/gcc/gcc_8.3.0/libc_2.12.1/gcc_8.3.0/bin/gcc -pthread',405 'MAJOR_IN_MKDEV': 0,406 'MAJOR_IN_SYSMACROS': 0,407 'MAKESETUP': './Modules/makesetup',408 'MANDIR': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/share/man',409 'MEMTESTOPTS': '-l -x test_subprocess test_io test_lib2to3 \\ -x test_dl test___all__ test_fork1 \\',410 'MKDIR_P': '/usr/bin/mkdir -p',411 'MODLIBS': '',412 'MODOBJS': 'Modules/threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/zipimport.o Modules/symtablemodule.o Modules/xxsubtype.o',413 'MODULE_OBJS': '\\',414 'MULTIARCH': '',415 'MVWDELCH_IS_EXPRESSION': 1,416 'OBJECT_OBJS': '\\',417 'OLDPATH': ':lib-old',418 'OPT': '-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes',419 'OTHER_LIBTOOL_OPT': '',420 'PACKAGE_BUGREPORT': 0,421 'PACKAGE_NAME': 0,422 'PACKAGE_STRING': 0,423 'PACKAGE_TARNAME': 0,424 'PACKAGE_URL': 0,425 'PACKAGE_VERSION': 0,426 'PARSER_HEADERS': '\\',427 'PARSER_OBJS': '\\ Parser/myreadline.o Parser/tokenizer.o',428 'PGEN': 'Parser/pgen',429 'PGENOBJS': '\\ \\',430 'PGENSRCS': '\\ \\',431 'PGOBJS': '\\',432 'PGO_PROF_GEN_FLAG': '-fprofile-generate',433 'PGO_PROF_USE_FLAG': '-fprofile-use -fprofile-correction',434 'PGSRCS': '\\',435 'PLATDIR': 'plat-linux2',436 'PLATMACDIRS': 'plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \\',437 'PLATMACPATH': ':plat-mac:plat-mac/lib-scriptpackages',438 'POBJS': '\\',439 'POSIX_SEMAPHORES_NOT_ENABLED': 0,440 'PROFILE_TASK': '-m test.regrtest --pgo -x test_asyncore test_gdb test_multiprocessing test_subprocess',441 'PSRCS': '\\',442 'PTHREAD_SYSTEM_SCHED_SUPPORTED': 1,443 'PURIFY': '',444 'PYLONG_BITS_IN_DIGIT': 0,445 'PYTHON': 'python',446 'PYTHONFRAMEWORK': '',447 'PYTHONFRAMEWORKDIR': 'no-framework',448 'PYTHONFRAMEWORKINSTALLDIR': '',449 'PYTHONFRAMEWORKPREFIX': '',450 'PYTHONPATH': ':plat-linux2:lib-tk:lib-old',451 'PYTHON_FOR_BUILD': './python -E',452 'PYTHON_FOR_REGEN': 'python2.7',453 'PYTHON_HEADERS': '\\',454 'PYTHON_OBJS': '\\',455 'PY_CFLAGS': '-fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/openssl/openssl_1.1.1b/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/readline/readline_8.0/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/ncurses/ncurses_6.1/_output/install/include/ncurses -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/bzip2/bzip2_1.0.6/_output/install/include -I/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/zlib/zlib_1.2.11/_output/install/include -DPy_BUILD_CORE',456 'PY_FORMAT_LONG_LONG': '"ll"',457 'PY_FORMAT_SIZE_T': '"z"',458 'PY_UNICODE_TYPE': 0,459 'Py_DEBUG': 0,460 'Py_ENABLE_SHARED': 0,461 'Py_UNICODE_SIZE': 4,462 'Py_USING_UNICODE': 1,463 'QUICKTESTOPTS': '-l -x test_subprocess test_io test_lib2to3 \\',464 'RANLIB': '/%%PACBIO_BUILD_ROOTDIR%%/artifacts/thirdparty.prebuilt/gcc/gcc_8.3.0/libc_2.12.1/gcc_8.3.0/bin/ranlib',465 'RESSRCDIR': 'Mac/Resources/framework',466 'RETSIGTYPE': 'void',467 'RUNSHARED': '',468 'SCRIPTDIR': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/lib',469 'SETPGRP_HAVE_ARG': 0,470 'SGI_ABI': '',471 'SHELL': '/bin/sh',472 'SHLIBS': '-lpthread -ldl -ltinfo -lutil',473 'SHLIB_EXT': '".so"',474 'SIGNAL_OBJS': '',475 'SIGNED_RIGHT_SHIFT_ZERO_FILLS': 0,476 'SITEPATH': '',477 'SIZEOF_DOUBLE': 8,478 'SIZEOF_FLOAT': 4,479 'SIZEOF_FPOS_T': 16,480 'SIZEOF_INT': 4,481 'SIZEOF_LONG': 8,482 'SIZEOF_LONG_DOUBLE': 16,483 'SIZEOF_LONG_LONG': 8,484 'SIZEOF_OFF_T': 8,485 'SIZEOF_PID_T': 4,486 'SIZEOF_PTHREAD_T': 8,487 'SIZEOF_SHORT': 2,488 'SIZEOF_SIZE_T': 8,489 'SIZEOF_TIME_T': 8,490 'SIZEOF_UINTPTR_T': 8,491 'SIZEOF_VOID_P': 8,492 'SIZEOF_WCHAR_T': 4,493 'SIZEOF__BOOL': 1,494 'SO': '.so',495 'SRCDIRS': 'Parser Objects Python Modules',496 'SRC_GDB_HOOKS': './Tools/gdb/libpython.py',497 'STDC_HEADERS': 1,498 'STRICT_SYSV_CURSES': "/* Don't use ncurses extensions */",499 'STRINGLIB_HEADERS': '\\',500 'SUBDIRS': '',501 'SUBDIRSTOO': 'Include Lib Misc Demo',502 'SYSLIBS': '-lm',503 'SYS_SELECT_WITH_SYS_TIME': 1,504 'TANH_PRESERVES_ZERO_SIGN': 1,505 'TCLTK_INCLUDES': '',506 'TCLTK_LIBS': '',507 'TESTOPTS': '-l',508 'TESTPATH': '',509 'TESTPROG': './Lib/test/regrtest.py',510 'TESTPYTHON': './python -Wd -3 -E -tt',511 'TESTPYTHONOPTS': '',512 'THREADOBJ': 'Python/thread.o',513 'TIME_WITH_SYS_TIME': 1,514 'TKPATH': ':lib-tk',515 'TM_IN_SYS_TIME': 0,516 'UNICODE_OBJS': 'Objects/unicodeobject.o Objects/unicodectype.o',517 'UNIVERSALSDK': '',518 'USE_COMPUTED_GOTOS': 0,519 'USE_TOOLBOX_OBJECT_GLUE': 0,520 'VA_LIST_IS_ARRAY': 1,521 'VERSION': '2.7',522 'WANT_SIGFPE_HANDLER': 0,523 'WANT_WCTYPE_FUNCTIONS': 0,524 'WINDOW_HAS_FLAGS': 1,525 'WITH_DOC_STRINGS': 1,526 'WITH_DYLD': 0,527 'WITH_LIBINTL': 0,528 'WITH_NEXT_FRAMEWORK': 0,529 'WITH_PYMALLOC': 1,530 'WITH_THREAD': 1,531 'WITH_TSC': 0,532 'WITH_VALGRIND': 0,533 'X87_DOUBLE_ROUNDING': 0,534 'XMLLIBSUBDIRS': 'xml xml/dom xml/etree xml/parsers xml/sax',535 'abs_builddir': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/build-static/Python-2.7.16',536 'abs_srcdir': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/build-static/Python-2.7.16',537 'build': 'x86_64-pc-linux-gnu',538 'datarootdir': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install/share',539 'exec_prefix': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install',540 'host': 'x86_64-pc-linux-gnu',541 'prefix': '/%%PACBIO_BUILD_ROOTDIR%%/_output/modulebuilds/repos/thirdparty.src/python/python_2.7.16/_output/install',...

Full Screen

Full Screen

tlv_encoder.py

Source:tlv_encoder.py Github

copy

Full Screen

1# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */2#3# Copyright (C) 2014-2018 Regents of the University of California.4# Author: Jeff Thompson <jefft0@remap.ucla.edu>5#6# This program is free software: you can redistribute it and/or modify7# it under the terms of the GNU Lesser General Public License as published by8# the Free Software Foundation, either version 3 of the License, or9# (at your option) any later version.10#11# This program is distributed in the hope that it will be useful,12# but WITHOUT ANY WARRANTY; without even the implied warranty of13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14# GNU Lesser General Public License for more details.15#16# You should have received a copy of the GNU Lesser General Public License17# along with this program. If not, see <http://www.gnu.org/licenses/>.18# A copy of the GNU Lesser General Public License is in the file COPYING.19from pyndn.util.dynamic_byte_array import DynamicByteArray20"""21This module defines the TlvEncoder class for encoding in the NDN-TLV wire22format. It encodes into the bytebuffer in a DynamicByteArray, writing23"backwards" from the back of the buffer.24"""25class TlvEncoder(object):26 """27 Create a new TlvEncoder with an initialCapacity for the encoding buffer.28 :param int initialCapacity: (optional) The initial capacity of the encoding29 buffer. If omitted, use a default value.30 """31 def __init__(self, initialCapacity = 16):32 self._output = DynamicByteArray(initialCapacity)33 # _length is the number of bytes that have been written to the back of34 # self._output._array.35 self._length = 036 def __len__(self):37 """38 Get the number of bytes that have been written to the output. You can39 save this number, write sub TLVs, then subtract the new len from this40 to get the total length of the sub TLVs.41 :return: The number of bytes that have been written to the output.42 :rtype: int43 """44 return self._length45 def writeVarNumber(self, varNumber):46 """47 Encode varNumber as a VAR-NUMBER in NDN-TLV and write it to48 self._output just before self._length from the back.49 Advance self._length.50 :param int varNumber: The non-negative number to encode.51 """52 if varNumber < 253:53 self._length += 154 self._output.ensureLengthFromBack(self._length)55 self._output._array[-self._length] = varNumber & 0xff56 elif varNumber <= 0xffff:57 self._length += 358 self._output.ensureLengthFromBack(self._length)59 self._output._array[-self._length] = 25360 self._output._array[-self._length + 1] = (varNumber >> 8) & 0xff61 self._output._array[-self._length + 2] = varNumber & 0xff62 elif varNumber <= 0xffffffff:63 self._length += 564 self._output.ensureLengthFromBack(self._length)65 self._output._array[-self._length] = 25466 self._output._array[-self._length + 1] = (varNumber >> 24) & 0xff67 self._output._array[-self._length + 2] = (varNumber >> 16) & 0xff68 self._output._array[-self._length + 3] = (varNumber >> 8) & 0xff69 self._output._array[-self._length + 4] = varNumber & 0xff70 else:71 self._length += 972 self._output.ensureLengthFromBack(self._length)73 self._output._array[-self._length] = 25574 self._output._array[-self._length + 1] = (varNumber >> 56) & 0xff75 self._output._array[-self._length + 2] = (varNumber >> 48) & 0xff76 self._output._array[-self._length + 3] = (varNumber >> 40) & 0xff77 self._output._array[-self._length + 4] = (varNumber >> 32) & 0xff78 self._output._array[-self._length + 5] = (varNumber >> 24) & 0xff79 self._output._array[-self._length + 6] = (varNumber >> 16) & 0xff80 self._output._array[-self._length + 7] = (varNumber >> 8) & 0xff81 self._output._array[-self._length + 8] = varNumber & 0xff82 def writeTypeAndLength(self, type, length):83 """84 Encode the type and length as VAR-NUMBER and write to85 self._output just before self._length from the back.86 Advance self._length.87 :param int type: The type of the TLV.88 :param int length: The non-negative length of the TLV.89 """90 # Write backwards.91 self.writeVarNumber(length)92 self.writeVarNumber(type)93 def writeNonNegativeInteger(self, value):94 """95 Encode value as a non-negative integer and write it to self._output96 just before self._length from the back. Advance self._length.97 :param int value: The non-negative integer to encode.98 """99 if value < 0:100 raise ValueError("TLV integer value may not be negative")101 if value <= 0xff:102 self._length += 1103 self._output.ensureLengthFromBack(self._length)104 self._output._array[-self._length] = value & 0xff105 elif value <= 0xffff:106 self._length += 2107 self._output.ensureLengthFromBack(self._length)108 self._output._array[-self._length] = (value >> 8) & 0xff109 self._output._array[-self._length + 1] = value & 0xff110 elif value <= 0xffffffff:111 self._length += 4112 self._output.ensureLengthFromBack(self._length)113 self._output._array[-self._length] = (value >> 24) & 0xff114 self._output._array[-self._length + 1] = (value >> 16) & 0xff115 self._output._array[-self._length + 2] = (value >> 8) & 0xff116 self._output._array[-self._length + 3] = value & 0xff117 else:118 self._length += 8119 self._output.ensureLengthFromBack(self._length)120 self._output._array[-self._length] = (value >> 56) & 0xff121 self._output._array[-self._length + 1] = (value >> 48) & 0xff122 self._output._array[-self._length + 2] = (value >> 40) & 0xff123 self._output._array[-self._length + 3] = (value >> 32) & 0xff124 self._output._array[-self._length + 4] = (value >> 24) & 0xff125 self._output._array[-self._length + 5] = (value >> 16) & 0xff126 self._output._array[-self._length + 6] = (value >> 8) & 0xff127 self._output._array[-self._length + 7] = value & 0xff128 def writeNonNegativeIntegerTlv(self, type, value):129 """130 Write the type, then the length of the encoded value then encode value131 as a non-negative integer and write it to self._output just before132 self._length from the back. Advance self._length.133 :param int type: The type of the TLV.134 :param int value: The non-negative integer to encode.135 """136 # Write backwards.137 saveNBytes = self._length138 self.writeNonNegativeInteger(value)139 self.writeTypeAndLength(type, self._length - saveNBytes)140 def writeOptionalNonNegativeIntegerTlv(self, type, value):141 """142 If value is negative or None then do nothing, otherwise call143 writeNonNegativeIntegerTlv.144 :param int type: The type of the TLV.145 :param int value: If negative or None do nothing, otherwise the integer146 to encode.147 """148 if value != None and value >= 0:149 self.writeNonNegativeIntegerTlv(type, value)150 def writeOptionalNonNegativeIntegerTlvFromFloat(self, type, value):151 """152 If value is negative or None then do nothing, otherwise call153 writeNonNegativeIntegerTlv.154 :param int type: The type of the TLV.155 :param float value: If negative or None do nothing, otherwise use156 int(round(value)).157 """158 if value != None and value >= 0:159 # Note: int() will return int, or long if value is large and this160 # is a 32-bit system.161 self.writeNonNegativeIntegerTlv(type, int(round(value)))162 def writeBuffer(self, buffer):163 """164 Write the buffer value to self._output just before self._length from the165 back. Advance self._length.166 :param buffer: The byte array with the bytes to write. If value is None,167 then do nothing.168 :type value: bytearray or memoryview169 """170 if buffer == None:171 return172 self._length += len(buffer)173 self._output.copyFromBack(buffer, self._length)174 def writeBlobTlv(self, type, value):175 """176 Write the type, then the length of the blob then the blob value177 to self._output just before self._length from the back.178 Advance self._length.179 :param int type: The type of the TLV.180 :param value: The byte array with the bytes of the blob. If value is181 None, then just write the type and length 0.182 :type value: bytearray or memoryview183 """184 if value == None:185 self.writeTypeAndLength(type, 0)186 return187 # Write backwards, starting with the blob array.188 self.writeBuffer(value)189 self.writeTypeAndLength(type, len(value))190 def writeOptionalBlobTlv(self, type, value):191 """192 If the byte array is None or zero length then do nothing, otherwise193 call writeBlobTlv.194 :param int type: The type of the TLV.195 :param value: If None or zero length do nothing, otherwise the byte196 array with the bytes of the blob.197 :type value: bytearray or memoryview198 """199 if value != None and len(value) > 0:200 self.writeBlobTlv(type, value)201 def getOutput(self):202 """203 Get a memoryview slice of the encoded bytes.204 :return: a memoryview backed by the bytearray encoding buffer.205 :rtype: memoryview206 """207 # Create a memoryview from getArray() to make sure we don't copy.208 return memoryview(...

Full Screen

Full Screen

utils.py

Source:utils.py Github

copy

Full Screen

1# -*- coding: utf-8 -*-2# =============================================================================>3# ##############################################################################4# ## 5# ## utils.py6# ## 7# ##############################################################################8# =============================================================================>9# imports default1011# =============================================================================>12# imports third party1314# =============================================================================>15# imports local1617# =============================================================================>18# local method1920def to_two_byte(s):21 return s.translate(str.maketrans({chr(0x0021 + i): chr(0xFF01 + i) for i in range(94)})).replace(" ", " ")2223# =============================================================================>24# valorant2526def valorant_agent_to_discord(s):27 return (":" + s.lower() + ":")282930def valorant_rank_to_discord(t):31 return (":" + t[0].lower() + ":") + to_two_byte(str(t[1])) + " "323334def convert_valorant_match_to_discord(result_list, min_out = False):35 # 全角文字にする36 _output_all = []3738 for match_result in result_list:39 _current_team = 140 _output = []41 _output.append("")42 43 _output.append(44 to_two_byte(45 "<" + str(match_result["map"])46 ) + "  " + to_two_byte(47 "{:>2}".format(str(match_result["score"][0])) + " vs " + "{:>2}".format(str(match_result["score"][1])) + ">"48 )49 )50 51 if min_out:52 _header = "  ".join([to_two_byte(i) for i in ["#", "AGENT", " K/D/A "]])53 else:54 _header = "  ".join([to_two_byte(i) for i in ["#", "AGENT", "ACS", " K/D/A ", "+/-", "HS", "FK"]])55 56 _output.append(_header)57 _output.append("-" * (len(_header) + 1))58 for user_data in match_result["user"]:59 if not _current_team == user_data["Team"]:60 _current_team = user_data["Team"]61 _output.append("-" * (len(_header) + 1))62 63 _row = []64 _row.append(to_two_byte(str(user_data["TeamRank"])))65 _row.append(valorant_agent_to_discord(user_data["Agents"]) + " " + valorant_rank_to_discord(user_data["CurrentRank"]))66 if not min_out:67 _row.append(to_two_byte("{:>3}".format(str(user_data["ACS"]))))68 _row.append(to_two_byte("{:>2}/{:>2}/{:<2}".format(user_data["K"], user_data["D"], user_data["A"])))69 if not min_out:70 _row.append(to_two_byte(71 "{:^3}".format(str(user_data["PM"]))72 ))73 _row.append(to_two_byte(74 "{:>2}".format(str(int(user_data["HS"] * 100)))75 ))76 _row.append(to_two_byte(77 "{:>2}".format(str(user_data["FK"]))78 ))79 _row = "  ".join(_row)80 _output.append(_row)81 82 _output.append("-" * (len(_header) + 1))83 _output = "\n".join(_output)84 _output_all.append(_output)85 86 return _output_all878889def convert_valorant_match_to_ascii(result_list):90 row_format = "| {} | PT{} | {:<10} | {:<11} | {: <15}{:>6} | {:>3} | {:>2}/{:>2}/{:<2} {:>3} | {:^3} | {:>5} | {:>2} | {:>2}/{:<2} | {:>2} | {:>4} |"91 _output_all = []9293 for match_result in result_list:94 _output = []95 _current_team = 196 _header = row_format.format(97 "#", " ", "Agents", "Rank", to_two_byte("Username"), "#Tag", "ACS", "K", "D", "A","KD", "+/-", "ADR", "HS", "FK", "FD", "MK", "Econ"98 )99 _hr = "+" + "-" * (3) + "+" + "-" * (5) + "+" + "-" * (12) + "+" + "-" * (13) + "+" + "-" + "-" * (15) + "-" * (7) + "+"100 _hr += "-" * (5) + "+" + "-" * (14) + "+" + "-" * (5) + "+" + "-" * (7) + "+" + "-" * (4) + "+" + "-" * (7) + "+" + "-" * (4) + "+" + "-" * (6) + "+"101 _output.append(_hr)102 _output.append(_header)103 _output.append(_hr)104 for user_data in match_result["user"]:105 _row = row_format.format(106 user_data["TeamRank"],107 user_data["PartyNumber"], 108 user_data["Agents"], 109 user_data["CurrentRank"][0] + str(user_data["CurrentRank"][1]),110 to_two_byte(user_data["Name"]), user_data["NameTag"],111 user_data["ACS"],112 user_data["K"], user_data["D"], user_data["A"],113 user_data["KD"],114 user_data["PM"], user_data["ADR"],115 str(user_data["HS"] * 100)[:2],116 user_data["FK"], user_data["FD"], user_data["MK"], 117 user_data["Econ"]118 )119 if not _current_team == user_data["Team"]:120 _output.append(_hr)121 _current_team = user_data["Team"]122123 _output.append(_row)124 125 _output.append(_hr)126 127 _output_all.append("\n".join(_output))128 129 return _output_all130131# =============================================================================>132# main133134def convert_to_ascii(result_list):135 return result_list136137138def convert_to_discord(result_list):139 return "```sh\n{}\n```".format(convert_to_ascii(result_list))140141# =============================================================================>142 143if __name__ == "__main__": ...

Full Screen

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 fMBT 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