Esempio n. 1
0
    def __init__(self):
        self.programmers = []
        self.defaults = []

        try:
            self.programmers.extend(self.readCustomProgrammers())
        except:
            pass
        try:
            self.programmers.extend(self.readArduinoProgrammers())
        except:
            self.programmers.extend(misc.readGnoduinoConfFile("PROGRAMMERS"))

        #renumber ids in case we grown with customs
        for i in range(len(self.programmers)):
            self.programmers[i]['id'] = i + 1

        self.p = prefs.preferences()
        if config.cur_programmer == -1:
            try:
                config.cur_programmer = self.getProgrammerIdByName(
                    self.p.getSafeValue("programmer",
                                        "arduino:avrispmkii")) - 1
            except:
                config.cur_programmer = self.getProgrammerIdByName(
                    "arduino:avrispmkii") - 1
Esempio n. 2
0
 def __init__(self):
     global client
     self.board = 0
     self.boards = []
     self.programmers = []
     self.defaults = []
     try:
         self.boards.extend(self.readCustomBoards())
     except:
         pass
     try:
         self.boards.extend(self.readArduinoBoards())
     except:
         self.boards.extend(misc.readGnoduinoConfFile("BOARDS"))
     #renumber ids in case we grown with customs
     for i in range(len(self.boards)):
         self.boards[i]['id'] = i + 1
     self.p = prefs.preferences()
     if config.cur_board == -1:
         """error can occur when placing different types of hardware in sketchdir"""
         try:
             config.cur_board = self.getBoardIdByName(
                 self.p.getSafeValue("board", "uno")) - 1
         except:
             config.cur_board = self.getBoardIdByName("uno") - 1
Esempio n. 3
0
	def __init__(self):
		self.programmers = []
		self.defaults = []

		try:
			self.programmers.extend(self.readCustomProgrammers())
		except: pass
		try:
			self.programmers.extend(self.readArduinoProgrammers())
		except:	self.programmers.extend(misc.readGnoduinoConfFile("PROGRAMMERS"))

		#renumber ids in case we grown with customs
		for i in range(len(self.programmers)): self.programmers[i]['id'] = i+1

		self.p = prefs.preferences()
		if config.cur_programmer == -1:
			try:
				config.cur_programmer = self.getProgrammerIdByName(self.p.getSafeValue("programmer", "arduino:avrispmkii")) - 1
			except:
				config.cur_programmer = self.getProgrammerIdByName("arduino:avrispmkii") - 1
Esempio n. 4
0
	def __init__(self):
		global client
		self.board = 0
		self.boards = []
		self.programmers = []
		self.defaults = []
		try:
			self.boards.extend(self.readCustomBoards())
		except: pass
		try:
			self.boards.extend(self.readArduinoBoards())
		except:
			self.boards.extend(misc.readGnoduinoConfFile("BOARDS"))
		#renumber ids in case we grown with customs
		for i in range(len(self.boards)): self.boards[i]['id'] = i+1
		self.p = prefs.preferences()
		if config.cur_board == -1:
			"""error can occur when placing different types of hardware in sketchdir"""
			try:
				config.cur_board = self.getBoardIdByName(self.p.getSafeValue("board", "uno")) - 1
			except:
				config.cur_board = self.getBoardIdByName("uno") - 1