A special case for REPLIT. Checks both the OS and for the existance of the number of environment variable REPL_OWNER Currently, Trinket only has ONE environment variable. This fact is used to figure out if Trinket is being used. Returns True if running on "replit" :return: True
()
| 323 | |
| 324 | |
| 325 | def running_replit(): |
| 326 | """ |
| 327 | A special case for REPLIT. Checks both the OS and for the existance of the number of environment variable REPL_OWNER |
| 328 | Currently, Trinket only has ONE environment variable. This fact is used to figure out if Trinket is being used. |
| 329 | |
| 330 | Returns True if running on "replit" |
| 331 | |
| 332 | :return: True if sys.platform indicates Linux and setting REPL_OWNER is found in the environment variables |
| 333 | :rtype: (bool) |
| 334 | """ |
| 335 | if 'REPL_OWNER' in os.environ and sys.platform.startswith('linux'): |
| 336 | return True |
| 337 | return False |
| 338 | |
| 339 | |
| 340 | # Handy python statements to increment and decrement with wrapping that I don't want to forget |