Repository: PokemonGoF/PokemonGo-Bot

Issue:
RuntimeError: unsupported platform 'freebsd10'
Bot crashed when UpdateLiveStat enabled in FreeBSD 10 platform
### Expected Behavior

Bot should run correctly
### Actual Behavior

Bot crashed
### Your FULL config.json (remove your username, password, gmapkey and any other private info)

http://pastebin.com/a9VgmSjt
### Output when issue occurred

Traceback (most recent call last):
  File "pokecli.py", line 802, in <module>
    main()
  File "pokecli.py", line 160, in main
    bot.tick()
  File "/usr/home/madzul/work/PGB-Dev/pokemongo_bot/**init**.py", line 675, in tick 
    if worker.work() == WorkerResult.RUNNING:
  File "/usr/home/madzul/work/PGB-Dev/pokemongo_bot/cell_workers/update_live_stats.py", line 174, in work
    self._update_title(line, _platform)
  File "/usr/home/madzul/work/PGB-Dev/pokemongo_bot/cell_workers/update_live_stats.py", line 238, in _update_title
    raise RuntimeError("unsupported platform '{}'".format(platform))
RuntimeError: unsupported platform 'freebsd10'
### Steps to Reproduce

enable UpdateLiveStats in bot config
### Other Information

OS: 
FreeBSD 10
Branch: 
dev
Git Commit: 
4733d99a534fcb10c9244ebd5debc33d20b12e7c
Python Version: 
Python 2.7.11

Any other relevant files/configs (eg: path files) 
{
        "type": "UpdateLiveStats",
        "config": {
          "enabled": true,
          "min_interval": 120,
          "stats": ["username", "uptime", "stardust_earned", "xp_earned", "xp_pe
r_hour", "stops_visited"],
          "terminal_log": true,
          "terminal_title": true
        }
      },
      {
        "type": "UpdateLiveInventory",
        "config": {
          "enabled": true,
          "min_interval": 120,
          "show_all_multiple_lines": false,
          "items": ["pokemon_bag", "space_info", "pokeballs", "greatballs", "ult
raballs", "razzberries", "luckyegg"]
        }
      },
      {
        "type": "ShowBestPokemon",
        "config": {
          "enabled": true,
          "min_interval": 120,
          "amount": 5,
          "order_by": "cp",
          "info_to_show": ["cp", "ivcp", "dps", "hp"]
        }
      },

<!-- ===============END OF ISSUE SECTION=============== -->



Discussion:
just added freebsd10 as known platform in update_live_stats.py
`elif platform == "freebsd10":
                stdout.write("\033]0;{}\007".format(title))
                stdout.flush()`


Resolving patch:
diff --git a/pokemongo_bot/cell_workers/update_live_stats.py b/pokemongo_bot/cell_workers/update_live_stats.py
--- a/pokemongo_bot/cell_workers/update_live_stats.py
+++ b/pokemongo_bot/cell_workers/update_live_stats.py
@@ -229,13 +229,13 @@ def _update_title(self, title, platform):
             if platform == "linux" or platform == "linux2" or platform == "cygwin":
                 stdout.write("\x1b]2;{}\x07".format(title))
                 stdout.flush()
-            elif platform == "darwin":
+            elif platform == "darwin" or platform == "freebsd10":
                 stdout.write("\033]0;{}\007".format(title))
                 stdout.flush()
             elif platform == "win32":
                 ctypes.windll.kernel32.SetConsoleTitleA(title.encode())
             else:
-                raise RuntimeError("unsupported platform '{}'".format(platform))
+                self.bot.logger.warn("Unable to set window title. OS {} not supported.".format(platform))
         except AttributeError:
             self.emit_event(
                 'log_stats',


Test patch: