| OLD | NEW |
| 1 #!/usr/bin/python2.4 | 1 #!/usr/bin/python2.4 |
| 2 # Copyright 2008, Google Inc. | 2 # Copyright 2008, Google Inc. |
| 3 # All rights reserved. | 3 # All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 args: List of bit names to set. | 184 args: List of bit names to set. |
| 185 """ | 185 """ |
| 186 _CheckDeclared(args) | 186 _CheckDeclared(args) |
| 187 _CheckExclusive(env['_BITS'], args) | 187 _CheckExclusive(env['_BITS'], args) |
| 188 env['_BITS'] = env['_BITS'].union(args) | 188 env['_BITS'] = env['_BITS'].union(args) |
| 189 | 189 |
| 190 #------------------------------------------------------------------------------ | 190 #------------------------------------------------------------------------------ |
| 191 | 191 |
| 192 | 192 |
| 193 def ClearBits(env, *args): | 193 def ClearBits(env, *args): |
| 194 """Sets the bits in the environment. | 194 """Clears the bits in the environment. |
| 195 | 195 |
| 196 Args: | 196 Args: |
| 197 env: Environment to check. | 197 env: Environment to check. |
| 198 args: List of bit names to set. | 198 args: List of bit names to clear (remove). |
| 199 """ | 199 """ |
| 200 _CheckDeclared(args) | 200 _CheckDeclared(args) |
| 201 env['_BITS'] = env['_BITS'].difference(args) | 201 env['_BITS'] = env['_BITS'].difference(args) |
| 202 | 202 |
| 203 #------------------------------------------------------------------------------ | 203 #------------------------------------------------------------------------------ |
| 204 | 204 |
| 205 | 205 |
| 206 def SetBitFromOption(env, bit_name, default): | 206 def SetBitFromOption(env, bit_name, default): |
| 207 """Sets the bit in the environment from a command line option. | 207 """Sets the bit in the environment from a command line option. |
| 208 | 208 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 # Add methods to environment | 250 # Add methods to environment |
| 251 env.AddMethod(AllBits) | 251 env.AddMethod(AllBits) |
| 252 env.AddMethod(AnyBits) | 252 env.AddMethod(AnyBits) |
| 253 env.AddMethod(Bit) | 253 env.AddMethod(Bit) |
| 254 env.AddMethod(ClearBits) | 254 env.AddMethod(ClearBits) |
| 255 env.AddMethod(SetBitFromOption) | 255 env.AddMethod(SetBitFromOption) |
| 256 env.AddMethod(SetBits) | 256 env.AddMethod(SetBits) |
| 257 | 257 |
| 258 env['_BITS'] = set() | 258 env['_BITS'] = set() |
| OLD | NEW |