Example #1
0
def buildIOS():
	print("Please know that this will not work with Game Center curretnly")
	if platform.name().lower() != 'darwin':
		print("Not supported on non-OSX hosts")
		return False
	shutil.copytree('android/jni/SDL2', 'SDL2')
	os.chdir('SDL2/build-scripts')
	subprocess.call('sh iosbuild.sh', shell=True)
	os.chdir('../../')
	if not os.path.isdir('/Developer/Platforms/iOS.platform/Developer/Library/XCode/Project Templates/SDL2'):
		shutil.copytree('/Developer/Platforms/iOS.platform/Developer/Library/XCode/Project Templates/SDL2', 'SDL2/Xcode-iOS/Template/SDL iOS Application')
	print('Start a new project using the template /Developer/Platforms/iOS.platform/Developer/Library/XCode/Project Templates/SDL2.  The project should be immediately ready for use with SDL. Just add the source files in src')
Example #2
0
	def _on_sentry_init(self):
		scope = self.sentry_exception_handler.scope
		from fbs_runtime import platform
		scope.set_extra('os', platform.name())
		if self.email is not None:
			scope.set_extra('user', self.email)
check_system() 	
system = platform.system() #defines os as the general operating system type determined above
print system
if system ==  "Windows":#if windows...
	#import pythoncom
	#import pywintypes
	#import datetime
	
	
	
	
	winmem()	
	

# The following runs for Linux (unix based) operating Systems	
if platform.name() == 'Linux':

	class MemoryMonitor(object):

		def __init__(self, username):
			"""Create new MemoryMonitor instance."""
			self.username = username

		def usage(self):
			"""Return int containing memory used by user's processes."""
			self.process = subprocess.Popen("ps -u %s -o rss | awk '{sum+=$1} END {print sum}'" % self.username,
				shell=True,
				stdout=subprocess.PIPE,
				)
			self.stdout_list = self.process.communicate()[0].split('\n')
			return int(self.stdout_list[0])
    return x


check_system()
system = platform.system(
)  #defines os as the general operating system type determined above
print system
if system == "Windows":  #if windows...
    #import pythoncom
    #import pywintypes
    #import datetime

    winmem()

# The following runs for Linux (unix based) operating Systems
if platform.name() == 'Linux':

    class MemoryMonitor(object):
        def __init__(self, username):
            """Create new MemoryMonitor instance."""
            self.username = username

        def usage(self):
            """Return int containing memory used by user's processes."""
            self.process = subprocess.Popen(
                "ps -u %s -o rss | awk '{sum+=$1} END {print sum}'" %
                self.username,
                shell=True,
                stdout=subprocess.PIPE,
            )
            self.stdout_list = self.process.communicate()[0].split('\n')