(self)
| 21 | os.chdir(cwd) |
| 22 | |
| 23 | def check_admin(self): |
| 24 | # Returns whether or not we're admin |
| 25 | try: |
| 26 | is_admin = os.getuid() == 0 |
| 27 | except AttributeError: |
| 28 | is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0 |
| 29 | return is_admin |
| 30 | |
| 31 | def elevate(self, file): |
| 32 | # Runs the passed file as admin |