Beispiel #1
0
 def path_tools(child):
     if os.name == "posix":
         if platform.uname().system == "Darwin":
             return path(child, "seeed/tools-darwin/")
         return path(child, "seeed/tools-linux/")
     else:
         return path(child, "seeed/tools-win/")
Beispiel #2
0
 def setup(self, modes):
     """
     Define the available modes and ensure there's a default working
     directory.
     """
     self.modes = modes
     logger.info('Available modes: {}'.format(', '.join(self.modes.keys())))
     # Ensure there is a workspace directory.
     wd = self.modes['python'].workspace_dir()
     if not os.path.exists(wd):
         logger.debug('Creating directory: {}'.format(wd))
         os.makedirs(wd)
     # Ensure PyGameZero assets are copied over.
     images_path = os.path.join(wd, 'images')
     sounds_path = os.path.join(wd, 'sounds')
     if not os.path.exists(images_path):
         logger.debug('Creating directory: {}'.format(images_path))
         os.makedirs(images_path)
         shutil.copy(path('alien.png', 'pygamezero/'),
                     os.path.join(images_path, 'alien.png'))
         shutil.copy(path('alien_hurt.png', 'pygamezero/'),
                     os.path.join(images_path, 'alien_hurt.png'))
     if not os.path.exists(sounds_path):
         logger.debug('Creating directory: {}'.format(sounds_path))
         os.makedirs(sounds_path)
         shutil.copy(path('eep.wav', 'pygamezero/'),
                     os.path.join(sounds_path, 'eep.wav'))
     # Start the timer to poll every second for an attached or removed
     # USB device.
     self._view.set_usb_checker(1, self.check_usb)
Beispiel #3
0
 def setup(self, modes):
     """
     Define the available modes and ensure there's a default working
     directory.
     """
     self.modes = modes
     logger.info('Available modes: {}'.format(', '.join(self.modes.keys())))
     # Ensure there is a workspace directory.
     wd = self.modes['python'].workspace_dir()
     if not os.path.exists(wd):
         logger.debug('Creating directory: {}'.format(wd))
         os.makedirs(wd)
     # Ensure PyGameZero assets are copied over.
     images_path = os.path.join(wd, 'images')
     sounds_path = os.path.join(wd, 'sounds')
     if not os.path.exists(images_path):
         logger.debug('Creating directory: {}'.format(images_path))
         os.makedirs(images_path)
         shutil.copy(path('alien.png', 'pygamezero/'),
                     os.path.join(images_path, 'alien.png'))
         shutil.copy(path('alien_hurt.png', 'pygamezero/'),
                     os.path.join(images_path, 'alien_hurt.png'))
     if not os.path.exists(sounds_path):
         logger.debug('Creating directory: {}'.format(sounds_path))
         os.makedirs(sounds_path)
         shutil.copy(path('eep.wav', 'pygamezero/'),
                     os.path.join(sounds_path, 'eep.wav'))
     # Start the timer to poll every second for an attached or removed
     # USB device.
     self._view.set_usb_checker(1, self.check_usb)
Beispiel #4
0
 def path_tools(child):
     if os.name == 'posix':
         if platform.uname().system == 'Darwin':
             return path(child, 'seeed/tools-darwin/')
         return path(child, 'seeed/tools-linux/')
     else:
         return path(child, 'seeed/tools-win/')
Beispiel #5
0
def seeed_path(child):
    return path(child, "seeed/")
Beispiel #6
0
 def path(child):
     return path(child, 'seeed/')