-
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathremove_unused_platform_options.py
More file actions
27 lines (20 loc) · 1021 Bytes
/
remove_unused_platform_options.py
File metadata and controls
27 lines (20 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class RemoveUnusedPlatformOptions(object):
"""
Options for the RemoveUnusedPlatform transform
This can be passed to the minify function as the remove_unused_platforms argument
:param platform_test_key: The key used to indicate a platform check statement
:type platform_test_key: str
:param platform_preserve_value: The value of the test to keep
:type platform_preserve_value: str
"""
platform_test_key = "_PLATFORM"
platform_preserve_value = "linux"
def __init__(self, platform_test_key="", platform_preserve_value=""):
self.platform_test_key = platform_test_key
self.platform_preserve_value = platform_preserve_value
def __repr__(self):
return 'RemoveUnusedPlatformOptions(platform_test_key=%s, platform_preserve_value=%s)' % (self.platform_test_key, self.platform_preserve_value)
def __nonzero__(self):
return any((self.platform_test_key, self.platform_preserve_value))
def __bool__(self):
return self.__nonzero__()