Best Python code snippet using localstack_python
configurations.py
Source:configurations.py
...46 value_in_gb = value * self.MB_TO_GB_FACTOR47 if isinstance(value_in_gb, int) and value_in_gb >= 1:48 return self.value_in_gb(value_in_gb)49 return self.value_in_mb(value)50 def get_parameter(self, parameter_name, default):51 value = self.databaseinfra.get_parameter_value_by_parameter_name(52 parameter_name=parameter_name53 )54 if not value:55 value = default56 return ParameterObject(value, default)57 def __getattribute__(self, item):58 if item == 'databaseinfra':59 return object.__getattribute__(self, item)60 topology = self.databaseinfra.plan.replication_topology61 try:62 attribute = TopologyParameterCustomValue.objects.get(63 topology=topology, parameter__name=item.replace("_", "-")64 )65 return object.__getattribute__(self, attribute.attr_name)66 except TopologyParameterCustomValue.DoesNotExist:67 return object.__getattribute__(self, item)68class ConfigurationRedis(ConfigurationBase):69 __ENGINE__ = 'redis'70 @property71 def maxmemory(self):72 parameter_name = inspect.stack()[0][3]73 if self.memory_size_in_gb <= 1:74 value = self.memory_size_in_bytes / 275 else:76 value = self.memory_size_in_bytes * 0.7577 default = int(value)78 return self.get_parameter(parameter_name, default)79 @property80 def appendonly(self):81 parameter_name = inspect.stack()[0][3]82 if self.databaseinfra.plan.has_persistence:83 default = 'yes'84 else:85 default = 'no'86 return self.get_parameter(parameter_name, default)87 @property88 def maxmemory_policy(self):89 parameter_name = inspect.stack()[0][3]90 if self.databaseinfra.plan.has_persistence:91 default = 'volatile-lru'92 else:93 default = 'allkeys-lru'94 return self.get_parameter(parameter_name, default)95 @property96 def loglevel(self):97 parameter_name = inspect.stack()[0][3]98 default = 'notice'99 return self.get_parameter(parameter_name, default)100 @property101 def databases(self):102 parameter_name = inspect.stack()[0][3]103 default = '1'104 return self.get_parameter(parameter_name, default)105 @property106 def timeout(self):107 parameter_name = inspect.stack()[0][3]108 default = 0109 return self.get_parameter(parameter_name, default)110 @property111 def rdbcompression(self):112 parameter_name = inspect.stack()[0][3]113 default = 'yes'114 return self.get_parameter(parameter_name, default)115 @property116 def rdbchecksum(self):117 parameter_name = inspect.stack()[0][3]118 default = 'yes'119 return self.get_parameter(parameter_name, default)120 @property121 def slave_serve_stale_data(self):122 parameter_name = inspect.stack()[0][3]123 default = 'yes'124 return self.get_parameter(parameter_name, default)125 @property126 def slave_read_only(self):127 parameter_name = inspect.stack()[0][3]128 default = 'yes'129 return self.get_parameter(parameter_name, default)130 @property131 def maxclients(self):132 parameter_name = inspect.stack()[0][3]133 default = 10000134 return self.get_parameter(parameter_name, default)135 @property136 def appendfsync(self):137 parameter_name = inspect.stack()[0][3]138 default = 'everysec'139 return self.get_parameter(parameter_name, default)140 @property141 def no_appendfsync_on_rewrite(self):142 parameter_name = inspect.stack()[0][3]143 default = 'no'144 return self.get_parameter(parameter_name, default)145 @property146 def auto_aof_rewrite_percentage(self):147 parameter_name = inspect.stack()[0][3]148 default = 100149 return self.get_parameter(parameter_name, default)150 @property151 def auto_aof_rewrite_min_size(self):152 parameter_name = inspect.stack()[0][3]153 default = 1073741824154 return self.get_parameter(parameter_name, default)155 @property156 def lua_time_limit(self):157 parameter_name = inspect.stack()[0][3]158 default = 5000159 return self.get_parameter(parameter_name, default)160 @property161 def slowlog_log_slower_than(self):162 parameter_name = inspect.stack()[0][3]163 default = 10000164 return self.get_parameter(parameter_name, default)165 @property166 def slowlog_max_len(self):167 parameter_name = inspect.stack()[0][3]168 default = 1024169 return self.get_parameter(parameter_name, default)170 @property171 def hash_max_ziplist_entries(self):172 parameter_name = inspect.stack()[0][3]173 default = 512174 return self.get_parameter(parameter_name, default)175 @property176 def hash_max_ziplist_value(self):177 parameter_name = inspect.stack()[0][3]178 default = 64179 return self.get_parameter(parameter_name, default)180 @property181 def set_max_intset_entries(self):182 parameter_name = inspect.stack()[0][3]183 default = 512184 return self.get_parameter(parameter_name, default)185 @property186 def zset_max_ziplist_entries(self):187 parameter_name = inspect.stack()[0][3]188 default = 128189 return self.get_parameter(parameter_name, default)190 @property191 def zset_max_ziplist_value(self):192 parameter_name = inspect.stack()[0][3]193 default = 64194 return self.get_parameter(parameter_name, default)195 @property196 def activerehashing(self):197 parameter_name = inspect.stack()[0][3]198 default = 'yes'199 return self.get_parameter(parameter_name, default)200 @property201 def repl_ping_slave_period(self):202 parameter_name = inspect.stack()[0][3]203 default = 1204 return self.get_parameter(parameter_name, default)205 @property206 def repl_timeout(self):207 parameter_name = inspect.stack()[0][3]208 default = 3600209 return self.get_parameter(parameter_name, default)210 @property211 def repl_disable_tcp_nodelay(self):212 parameter_name = inspect.stack()[0][3]213 default = 'no'214 return self.get_parameter(parameter_name, default)215 @property216 def repl_backlog_size(self):217 parameter_name = inspect.stack()[0][3]218 default = 1048576219 return self.get_parameter(parameter_name, default)220 @property221 def repl_backlog_ttl(self):222 parameter_name = inspect.stack()[0][3]223 default = 3600224 return self.get_parameter(parameter_name, default)225 @property226 def client_output_buffer_limit_normal(self):227 parameter_name = inspect.stack()[0][3]228 default = "0 0 0"229 return self.get_parameter(parameter_name, default)230 @property231 def client_output_buffer_limit_slave(self):232 parameter_name = inspect.stack()[0][3]233 if self.memory_size_in_gb <= 1:234 default = "536870912 536870912 3600"235 elif self.memory_size_in_gb <= 2:236 default = "1073741824 1073741824 3600"237 elif self.memory_size_in_gb <= 4:238 default = "2147483648 2147483648 3600"239 else:240 default = "4294967296 4294967296 3600"241 return self.get_parameter(parameter_name, default)242 @property243 def client_output_buffer_limit_pubsub(self):244 parameter_name = inspect.stack()[0][3]245 default = "33554432 8388608 60"246 return self.get_parameter(parameter_name, default)247 @property248 def cluster_enabled(self):249 return 'no'250 @property251 def cluster_enabled_true(self):252 return 'yes'253 @property254 def save(self):255 parameter_name = inspect.stack()[0][3]256 default = '7200 1 3600 10 1800 10000'257 return self.get_parameter(parameter_name, default)258 @property259 def save_list(self):260 save_value = self.save.value261 save_list = save_value.split()262 if len(save_list) % 2 != 0:263 raise Exception(264 'Invalid argument {} for save parameter.'.format(save_value)265 )266 save_list2 = []267 for i in range(0, len(save_list), 2):268 item = "{} {}".format(save_list[i], save_list[i + 1])269 save_list2.append(item)270 return save_list2271 @property272 def cluster_node_timeout(self):273 parameter_name = inspect.stack()[0][3]274 default = 5000275 return self.get_parameter(parameter_name, default)276class ConfigurationMySQL(ConfigurationBase):277 __ENGINE__ = 'mysql'278 @property279 def query_cache_size(self):280 parameter_name = inspect.stack()[0][3]281 default = 0282 return self.get_parameter(parameter_name, default)283 @property284 def max_allowed_packet(self):285 parameter_name = inspect.stack()[0][3]286 default = 4194304287 return self.get_parameter(parameter_name, default)288 @property289 def sort_buffer_size(self):290 parameter_name = inspect.stack()[0][3]291 default = int(self.memory_size_in_bytes / 204.8)292 return self.get_parameter(parameter_name, default)293 @property294 def tmp_table_size(self):295 parameter_name = inspect.stack()[0][3]296 default = int(self.memory_size_in_bytes / 64)297 return self.get_parameter(parameter_name, default)298 @property299 def max_heap_table_size(self):300 parameter_name = inspect.stack()[0][3]301 default = 16777216302 return self.get_parameter(parameter_name, default)303 @property304 def max_binlog_size(self):305 parameter_name = inspect.stack()[0][3]306 if self.memory_size_in_mb < 2048:307 default = 52428800308 elif self.memory_size_in_mb < 8192:309 default = 104857600310 elif self.memory_size_in_mb < 32768:311 default = 262144000312 else:313 default = 524288000314 return self.get_parameter(parameter_name, default)315 @property316 def key_buffer_size(self):317 parameter_name = inspect.stack()[0][3]318 default = 8388608319 return self.get_parameter(parameter_name, default)320 @property321 def myisam_sort_buffer_size(self):322 parameter_name = inspect.stack()[0][3]323 default = 8388608324 return self.get_parameter(parameter_name, default)325 @property326 def read_buffer_size(self):327 parameter_name = inspect.stack()[0][3]328 default = 131072329 return self.get_parameter(parameter_name, default)330 @property331 def read_rnd_buffer_size(self):332 parameter_name = inspect.stack()[0][3]333 default = 262144334 return self.get_parameter(parameter_name, default)335 @property336 def innodb_buffer_pool_size(self):337 parameter_name = inspect.stack()[0][3]338 if self.memory_size_in_mb < 1024:339 default = self.memory_size_in_bytes / 4340 elif self.memory_size_in_mb < 8192:341 default = self.memory_size_in_bytes / 2342 else:343 default = (self.memory_size_in_bytes * 3) / 4344 default = int(default)345 return self.get_parameter(parameter_name, default)346 @property347 def innodb_log_file_size(self):348 parameter_name = inspect.stack()[0][3]349 default = 50331648350 return self.get_parameter(parameter_name, default)351 @property352 def innodb_log_buffer_size(self):353 parameter_name = inspect.stack()[0][3]354 default = 8388608355 return self.get_parameter(parameter_name, default)356 @property357 def binlog_format(self):358 parameter_name = inspect.stack()[0][3]359 default = 'ROW'360 return self.get_parameter(parameter_name, default)361 @property362 def transaction_isolation(self):363 parameter_name = inspect.stack()[0][3]364 default = 'READ-COMMITTED'365 return self.get_parameter(parameter_name, default)366 @property367 def default_storage_engine(self):368 parameter_name = inspect.stack()[0][3]369 default = 'InnoDB'370 return self.get_parameter(parameter_name, default)371 @property372 def default_tmp_storage_engine(self):373 parameter_name = inspect.stack()[0][3]374 default = 'InnoDB'375 return self.get_parameter(parameter_name, default)376 @property377 def character_set_server(self):378 parameter_name = inspect.stack()[0][3]379 default = 'utf8'380 return self.get_parameter(parameter_name, default)381 @property382 def collation_server(self):383 parameter_name = inspect.stack()[0][3]384 default = 'utf8_general_ci'385 return self.get_parameter(parameter_name, default)386 @property387 def max_connections(self):388 parameter_name = inspect.stack()[0][3]389 default = 1000390 return self.get_parameter(parameter_name, default)391 @property392 def max_connect_errors(self):393 parameter_name = inspect.stack()[0][3]394 default = 999999395 return self.get_parameter(parameter_name, default)396 @property397 def thread_cache_size(self):398 parameter_name = inspect.stack()[0][3]399 default = 32400 return self.get_parameter(parameter_name, default)401 @property402 def table_open_cache(self):403 parameter_name = inspect.stack()[0][3]404 default = 4096405 return self.get_parameter(parameter_name, default)406 @property407 def query_cache_type(self):408 parameter_name = inspect.stack()[0][3]409 default = 'OFF'410 return self.get_parameter(parameter_name, default)411 @property412 def sync_binlog(self):413 parameter_name = inspect.stack()[0][3]414 default = 1415 return self.get_parameter(parameter_name, default)416 @property417 def expire_logs_days(self):418 parameter_name = inspect.stack()[0][3]419 default = 3420 return self.get_parameter(parameter_name, default)421 @property422 def long_query_time(self):423 parameter_name = inspect.stack()[0][3]424 default = '1.000000'425 return self.get_parameter(parameter_name, default)426 @property427 def slow_query_log(self):428 parameter_name = inspect.stack()[0][3]429 default = 'ON'430 return self.get_parameter(parameter_name, default)431 @property432 def innodb_autoextend_increment(self):433 parameter_name = inspect.stack()[0][3]434 default = 8435 return self.get_parameter(parameter_name, default)436 @property437 def innodb_file_per_table(self):438 parameter_name = inspect.stack()[0][3]439 default = 'ON'440 return self.get_parameter(parameter_name, default)441 @property442 def innodb_lock_wait_timeout(self):443 parameter_name = inspect.stack()[0][3]444 default = 50445 return self.get_parameter(parameter_name, default)446 @property447 def innodb_flush_log_at_trx_commit(self):448 parameter_name = inspect.stack()[0][3]449 default = 1450 return self.get_parameter(parameter_name, default)451 @property452 def innodb_thread_concurrency(self):453 parameter_name = inspect.stack()[0][3]454 default = 16455 return self.get_parameter(parameter_name, default)456 @property457 def innodb_max_dirty_pages_pct(self):458 parameter_name = inspect.stack()[0][3]459 default = 90460 return self.get_parameter(parameter_name, default)461 @property462 def innodb_max_purge_lag(self):463 parameter_name = inspect.stack()[0][3]464 default = 0465 return self.get_parameter(parameter_name, default)466 @property467 def explicit_defaults_for_timestamp(self):468 parameter_name = inspect.stack()[0][3]469 default = 'ON'470 return self.get_parameter(parameter_name, default)471 @property472 def performance_schema(self):473 parameter_name = inspect.stack()[0][3]474 if self.memory_size_in_mb < 8192:475 default = 'OFF'476 else:477 default = 'ON'478 return self.get_parameter(parameter_name, default)479 @property480 def thread_stack(self):481 parameter_name = inspect.stack()[0][3]482 default = 196608483 return self.get_parameter(parameter_name, default)484 @property485 def log_slave_updates(self):486 parameter_name = inspect.stack()[0][3]487 default = 'ON'488 return self.get_parameter(parameter_name, default)489 @property490 def innodb_log_files_in_group(self):491 parameter_name = inspect.stack()[0][3]492 default = 3493 return self.get_parameter(parameter_name, default)494 @property495 def innodb_flush_method(self):496 parameter_name = inspect.stack()[0][3]497 default = 'O_DIRECT'498 return self.get_parameter(parameter_name, default)499 @property500 def skip_external_locking(self):501 parameter_name = inspect.stack()[0][3]502 default = 'ON'503 return self.get_parameter(parameter_name, default)504 @property505 def skip_name_resolve(self):506 parameter_name = inspect.stack()[0][3]507 default = 'ON'508 return self.get_parameter(parameter_name, default)509 @property510 def wait_timeout(self):511 parameter_name = inspect.stack()[0][3]512 default = 28800513 return self.get_parameter(parameter_name, default)514 @property515 def interactive_timeout(self):516 parameter_name = inspect.stack()[0][3]517 default = 28800518 return self.get_parameter(parameter_name, default)519 @property520 def log_bin_trust_function_creators(self):521 parameter_name = inspect.stack()[0][3]522 default = 'OFF'523 return self.get_parameter(parameter_name, default)524 @property525 def sql_mode(self):526 parameter_name = inspect.stack()[0][3]527 default = 'default'528 return self.get_parameter(parameter_name, default)529 @property530 def audit_log_format(self):531 parameter_name = inspect.stack()[0][3]532 default = 'NEW'533 return self.get_parameter(parameter_name, default)534 @property535 def audit_log_rotate_on_size(self):536 parameter_name = inspect.stack()[0][3]537 default = 0538 return self.get_parameter(parameter_name, default)539 @property540 def audit_log_exclude_accounts(self):541 parameter_name = inspect.stack()[0][3]542 default = ''543 return self.get_parameter(parameter_name, default)544 @property545 def audit_log_policy(self):546 parameter_name = inspect.stack()[0][3]547 default = 'NONE'548 return self.get_parameter(parameter_name, default)549 @property550 def init_connect(self):551 parameter_name = inspect.stack()[0][3]552 default = ''553 return self.get_parameter(parameter_name, default)554 @property555 def slave_net_timeout(self):556 parameter_name = inspect.stack()[0][3]557 default = 60558 return self.get_parameter(parameter_name, default)559class ConfigurationMongoDB(ConfigurationBase):560 __ENGINE__ = 'mongodb'561 @property562 def systemLog_quiet(self):563 parameter_name = inspect.stack()[0][3]564 default = False565 return self.get_parameter(parameter_name, default)566 def __getattr__(self, item):567 if '.' in item:568 item = item.replace('.', '_')569 return self.__getattribute__(item)570 @property571 def oplogSize(self):572 parameter_name = inspect.stack()[0][3]573 default = Configuration.get_by_name_as_int(574 'parameter_{}'.format(parameter_name), 512575 )576 return self.get_parameter(parameter_name, default)577 @property578 def quiet(self):579 parameter_name = inspect.stack()[0][3]580 default = 'false'581 return self.get_parameter(parameter_name, default)582 @property583 def logLevel(self):584 parameter_name = inspect.stack()[0][3]585 default = 0586 return self.get_parameter(parameter_name, default)587 @property588 def wiredTiger_engineConfig_cacheSizeGB(self):589 parameter_name = inspect.stack()[0][3]590 if self.memory_size_in_mb < 2564:591 cache_mb = 256592 else:593 cache_mb = (self.memory_size_in_mb - 1024) / 2594 default = round(cache_mb / 1024.0, 2)595 return self.get_parameter(parameter_name, default)596class ConfigurationMySQLPercona(ConfigurationMySQL):...
params4.py
Source:params4.py
...5path_dir = str(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))6"""7å·¥å对æ¥æµç¨æ°æ®8"""9def get_parameter(name):10 #å°toolså°è£
æå½æ°11 data = tools1.parse()12 param = data[name]["test"]["request"]13 return param14class Login_00():15 params = get_parameter('å¼ è¶åè´¦å·ç»å½')16 url = params["url"]17 data = params["data"]18 header = params["headers"]19class createtask_01():20 params = get_parameter('å建åèµ·æµç¨')21 url = params["url"]22 data = params["json"]23 header = params["headers"]24class savety_03():25 params = get_parameter('ç¯è1ä¿åæè§')26 url = params["url"]27 data = params["json"]28 header = params["headers"]29class saveform_04():30 params = get_parameter('ç¯è1ä¿å表å')31 url = params["url"]32 data = params["json"]33 header = params["headers"]34class saveupdate_05():35 params = get_parameter('ç¯è1ä¿åæ´æ°')36 url = params["url"]37 data = params["json"]38 header = params["headers"]39class handleTask_06():40 params = get_parameter('æ¨éå¸å±å¨åå个人æå¾ç¨å¤')41 url = params["url"]42 data = params["json"]43 header = params["headers"]44class Login_07():45 params = get_parameter('å¨ååç»å½')46 url = params["url"]47 data = params["data"]48 header = params["headers"]49class savety_08():50 params = get_parameter('å¸å±æ¥æ¶å²ä¿åæè§')51 url = params["url"]52 data = params["json"]53 header = params["headers"]54class handleTask_09():55 params = get_parameter('æ¨éå¸å±å¤çå²')56 url = params["url"]57 data = params["json"]58 header = params["headers"]59class Login_10():60 params = get_parameter('å¾ä¿ç»å½')61 url = params["url"]62 data = params["data"]63 header = params["headers"]64class savety_11():65 params = get_parameter('å¸å±å¤çå²ä¿åæè§')66 url = params["url"]67 data = params["json"]68 header = params["headers"]69class saveform_12():70 params = get_parameter('å¸å±å¤çå²ä¿å表å')71 url = params["url"]72 data = params["json"]73 header = params["headers"]74class saveupdate_13():75 params = get_parameter('å¸å±å¤çå²ä¿åæ´æ°')76 url = params["url"]77 data = params["json"]78 header = params["headers"]79class handleTask_14():80 params = get_parameter('æ¨éå¸å±ç¾åå²')81 url = params["url"]82 data = params["json"]83 header = params["headers"]84class Login_15():85 params = get_parameter('çæ¯
å¹³ç»å½')86 url = params["url"]87 data = params["data"]88 header = params["headers"]89class savety_16():90 params = get_parameter('å¸å±ç¾åå²ä¿åæè§')91 url = params["url"]92 data = params["json"]93 header = params["headers"]94class handleTask_17():95 params = get_parameter('æ¨éæ ¡ç¨¿')96 url = params["url"]97 data = params["json"]98 header = params["headers"]99class getform_18():100 params = get_parameter('è·åæ ¡ç¨¿è¡¨å')101 url = params["url"]102 data = params["params"]103 header = params["headers"]104class savety_19():105 params = get_parameter('æ±æ»æ ¡ç¨¿ä¿åæè§')106 url = params["url"]107 data = params["json"]108 header = params["headers"]109class saveform_20():110 params = get_parameter('ä¿åæ±æ»æ ¡ç¨¿form')111 url = params["url"]112 data = params["json"]113 header = params["headers"]114class saveupdate_21():115 params = get_parameter('ä¿åæ±æ»æ ¡ç¨¿å·¥åæ°æ®')116 url = params["url"]117 data = params["json"]118 header = params["headers"]119class handleTask_22():120 params = get_parameter('æ¨éå°ç¨½æ¥å±13100540666æ±å¸')121 url = params["url"]122 data = params["json"]123 header = params["headers"]124class Login_23():125 params = get_parameter('æ±å¸ç»å½')126 url = params["url"]127 data = params["data"]128 header = params["headers"]129class savety_24():130 params = get_parameter('稽æ¥å±ä¸åæ')131 url = params["url"]132 data = params["json"]133 header = params["headers"]134class handleTask_25():135 params = get_parameter('ä¸åæåæ¨æ±æ»åå')136 url = params["url"]137 data = params["json"]138 header = params["headers"]139class handleTask_26():140 params = get_parameter('å次转ç»ç¨½æ¥å±')141 url = params["url"]142 data = params["json"]143 header = params["headers"]144class savety_27():145 params = get_parameter('稽æ¥å±æ¥æ¶å²åæ')146 url = params["url"]147 data = params["json"]148 header = params["headers"]149class handleTask_28():150 params = get_parameter('æ¨éå°ç¨½æ¥å¤çå²')151 url = params["url"]152 data = params["json"]153 header = params["headers"]154class savety_29():155 params = get_parameter('稽æ¥å¤çå²åæ')156 url = params["url"]157 data = params["json"]158 header = params["headers"]159class handleTask_30():160 params = get_parameter('æ¨éå°ç¨½æ¥å±ç¾æ¶å²')161 url = params["url"]162 data = params["json"]163 header = params["headers"]164class savety_31():165 params = get_parameter('稽æ¥å±ç¾åå²åæ')166 url = params["url"]167 data = params["json"]168 header = params["headers"]169class handleTask_32():170 params = get_parameter('稽æ¥å±ç¾åå²æ¨éæ±æ»æ ¡ç¨¿')171 url = params["url"]172 data = params["json"]173 header = params["headers"]174class savety_33():175 params = get_parameter('转åå±æµç¨åæ')176 url = params["url"]177 data = params["json"]178 header = params["headers"]179class saveupdate_34():180 params = get_parameter('转åå±æµç¨ä¿å表å')181 url = params["url"]182 data = params["json"]183 header = params["headers"]184class handleTask_35():185 params = get_parameter('æ±æ»åå继ç»è½¬åå±æ¥æ¶å²')186 url = params["url"]187 data = params["json"]188 header = params["headers"]189class Login_36():190 params = get_parameter('æ½èå¹³ç»å½')191 url = params["url"]192 data = params["data"]193 header = params["headers"]194class savety_37():195 params = get_parameter('åå±æ¥æ¶å²ä¿å')196 url = params["url"]197 data = params["json"]198 header = params["headers"]199class saveupdate_38():200 params = get_parameter('åå±æ¥æ¶å²ä¿å表å')201 url = params["url"]202 data = params["json"]203 header = params["headers"]204class handleTask_39():205 params = get_parameter('åå±æ¥æ¶å²æµ¦ä¸è½¬å
¶ä»ç§å®¤')206 url = params["url"]207 data = params["json"]208 header = params["headers"]209class savety_40():210 params = get_parameter('ä¸å¡ç§å®¤æ¥æ¶å²ä¿ååæ')211 url = params["url"]212 data = params["json"]213 header = params["headers"]214class handleTask_41():215 params = get_parameter('ä¸å¡ç§å®¤æ¥æ¶å²æ¨éå¤çå²')216 url = params["url"]217 data = params["json"]218 header = params["headers"]219class saveupdate_42():220 params = get_parameter('ä¸å¡å¤çå²ä¿å表å')221 url = params["url"]222 data = params["json"]223 header = params["headers"]224class savety_43():225 params = get_parameter('ä¸å¡å¤çå²ä¿ååæ')226 url = params["url"]227 data = params["json"]228 header = params["headers"]229class handleTask_44():230 params = get_parameter('ä¸å¡ç§å®¤å¤çå²æ¨éç¾åå²')231 url = params["url"]232 data = params["json"]233 header = params["headers"]234class savety_45():235 params = get_parameter('ä¸å¡ç¾åå²åæ')236 url = params["url"]237 data = params["json"]238 header = params["headers"]239class handleTask_46():240 params = get_parameter('ä¸å¡ç§å®¤ç¾åå²æ¨éååºç¨å¡å±æ±æ»å²')241 url = params["url"]242 data = params["json"]243 header = params["headers"]244class saveupdate_47():245 params = get_parameter('ååºæ±æ»è¡¨åä¿å')246 url = params["url"]247 data = params["json"]248 header = params["headers"]249class savety_48():250 params = get_parameter('ååºæ±æ»åæ')251 url = params["url"]252 data = params["json"]253 header = params["headers"]254class handleTask_49():255 params = get_parameter('æ¨éååºç¨å¡å±æ±æ»ç¾åå²')256 url = params["url"]257 data = params["json"]258 header = params["headers"]259class saveupdata_08():260 params = get_parameter('å¸å±æ¥æ¶å²ä¿å表å')261 url = params["url"]262 data = params["json"]263 header = params["headers"]264class saveupdata_16():265 params = get_parameter('å¸å±ç¾æ¶å²ä¿å表å')266 url = params["url"]267 data = params["json"]268 header = params["headers"]269class saveupdata_24():270 params = get_parameter('稽æ¥å±ä¸åæä¿å表å')271 url = params["url"]272 data = params["json"]273 header = params["headers"]274class saveupdata_27():275 params = get_parameter('稽æ¥å±æ¥æ¶å²ä¿å表å')276 url = params["url"]277 data = params["json"]278 header = params["headers"]279class saveupdata_29():280 params = get_parameter('稽æ¥å±å¤çå²ä¿å表å')281 url = params["url"]282 data = params["json"]283 header = params["headers"]284class saveupdata_31():285 params = get_parameter('稽æ¥å±ç¾åå²ä¿å表å')286 url = params["url"]287 data = params["json"]288 header = params["headers"]289class saveupdata_40():290 params = get_parameter('ä¸å¡ç§å®¤æ¥æ¶å²ä¿å表å')291 url = params["url"]292 data = params["json"]293 header = params["headers"]294class saveupdata_45():295 params = get_parameter('ä¸å¡ç¾åå²ä¿å表å')296 url = params["url"]297 data = params["json"]...
media.py
Source:media.py
...12# along with Anaconda. If not, see <http://www.gnu.org/licenses/>.13from mmfparser.player.event.actions.common import Action14class SetMainPan(Action):15 def execute(self):16 value = self.evaluate_expression(self.get_parameter(0))17 self.player.media.set_main_pan(value)18class SetChannelPan(Action):19 def execute(self):20 id = self.evaluate_expression(self.get_parameter(0)) - 121 value = self.evaluate_expression(self.get_parameter(1))22 self.player.media.get_channel(id).set_pan(value)23class SetSamplePan(Action):24 def execute(self):25 name = self.get_parameter(0).handle26 value = self.evaluate_expression(self.get_parameter(1))27 players = self.player.media.get_player(name)28 if not players:29 return30 for player in players:31 player.set_pan(value)32class PlayChannelSample(Action):33 def execute(self):34 handle = self.get_parameter(0).handle35 channel = self.evaluate_expression(self.get_parameter(1)) - 136 self.player.media.play_sound_handle(handle, channel = channel)37class PlayChannelFileSample(Action):38 def execute(self):39 path = self.get_filename(self.get_parameter(0))40 channel = self.evaluate_expression(self.get_parameter(1)) - 141 self.player.media.play_sound_file(path, channel = channel)42class PlayLoopingChannelFileSample(Action):43 def execute(self):44 path = self.get_filename(self.get_parameter(0))45 channel = self.evaluate_expression(self.get_parameter(1)) - 146 loops = self.evaluate_expression(self.get_parameter(2))47 self.player.media.play_sound_file(path, loops, channel)48class PlayLoopingSample(Action):49 def execute(self):50 handle = self.get_parameter(0).handle51 loops = self.evaluate_expression(self.get_parameter(1))52 self.player.media.play_sound_handle(handle, loops)53class PlayLoopingChannelSample(Action):54 def execute(self):55 handle = self.get_parameter(0).handle56 channel = self.evaluate_expression(self.get_parameter(1)) - 157 loops = self.evaluate_expression(self.get_parameter(2))58 self.player.media.play_sound_handle(handle, loops, channel)59class PlaySample(Action):60 def execute(self):61 handle = self.get_parameter(0).handle62 self.player.media.play_sound_handle(handle, 1)63class StopAllSamples(Action):64 def execute(self):65 self.player.media.stop_samples()66class PlayLoopingMusic(Action):67 def execute(self):68 handle = self.get_parameter(0).handle69 loops = self.evaluate_expression(self.get_parameter(1))70 self.player.media.play_music_handle(handle, loops)71class PlayMusic(Action):72 def execute(self):73 handle = self.get_parameter(0).handle74 self.player.media.play_music_handle(handle)75class PlayMusicFile(Action):76 def execute(self):77 filename = self.get_filename(self.get_parameter(0))78 self.player.media.play_music_file(filename)79class PlayLoopingMusicFile(Action):80 def execute(self):81 filename = self.get_filename(self.get_parameter(0))82 loops = self.evaluate_expression(self.get_parameter(1))83 self.player.media.play_music_file(filename, loops)84class StopMusic(Action):85 def execute(self):86 self.player.media.stop_music()87class PauseMusic(Action):88 def execute(self):89 self.player.media.pause_music()90 91class PauseChannel(Action):92 def execute(self):93 self.player.media.pause_channel(self.evaluate_expression(94 self.get_parameter(0)) - 1)95class PauseAllSounds(Action):96 def execute(self):97 self.player.media.pause_sounds()98class PauseSample(Action):99 def execute(self):100 name = self.get_parameter(0).handle101 players = self.player.media.get_player(name)102 if not players:103 return104 for player in players:105 player.paused = True106class ResumeChannel(Action):107 def execute(self):108 self.player.media.resume_channel(self.evaluate_expression(109 self.get_parameter(0)) - 1)110class ResumeSample(Action):111 def execute(self):112 name = self.get_parameter(0).handle113 players = self.player.media.get_player(name)114 if not players:115 return116 for player in players:117 player.paused = False118class ResumeAllSounds(Action):119 def execute(self):120 self.player.media.resume_sounds()121class ResumeMusic(Action):122 def execute(self):123 self.player.media.resume_music()124class StopChannel(Action):125 def execute(self):126 channel = self.evaluate_expression(self.get_parameter(0))127 self.player.media.stop_channel(channel - 1)128class StopSample(Action):129 def execute(self):130 name = self.get_parameter(0).handle131 self.player.media.stop_sample(name)132class SetChannelVolume(Action):133 def execute(self):134 channel = self.evaluate_expression(self.get_parameter(0)) - 1135 volume = self.evaluate_expression(self.get_parameter(1))136 self.player.media.set_channel_volume(channel, volume)137class SetSampleVolume(Action):138 def execute(self):139 name = self.get_parameter(0).handle140 volume = self.evaluate_expression(self.get_parameter(1))141 self.player.media.set_sample_volume(name, volume)142class SetMainVolume(Action):143 def execute(self):144 volume = self.evaluate_expression(self.get_parameter(0))145 self.player.media.set_main_volume(volume)146class SetChannelPosition(Action):147 def execute(self):148 channel = self.evaluate_expression(self.get_parameter(0)) - 1149 position = self.evaluate_expression(self.get_parameter(1))150 self.player.media.set_channel_position(channel, position)151class SetSamplePosition(Action):152 def execute(self):153 name = self.get_parameter(0).handle154 position = self.evaluate_expression(self.get_parameter(1))155 self.player.media.set_sample_position(name, position)156class SetSampleFrequency(Action):157 def execute(self):158 name = self.get_parameter(0).handle159 frequency = self.evaluate_expression(self.get_parameter(1))160 players = self.player.media.get_player(name)161 if not players:162 return163 for player in players:164 player.frequency = frequency165class SetChannelFrequency(Action):166 def execute(self):167 channel = self.evaluate_expression(self.get_parameter(0)) - 1168 frequency = self.evaluate_expression(self.get_parameter(1))169 self.player.media.get_channel(channel).frequency = frequency170class LockChannel(Action):171 def execute(self):172 channel = self.evaluate_expression(self.get_parameter(0)) - 1173 self.player.media.lock_channel(channel)174class UnlockChannel(Action):175 def execute(self):176 channel = self.evaluate_expression(self.get_parameter(0)) - 1...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!