# Path: kano_profile/badges.py
# def calculate_min_current_max_xp():
#     level_rules = read_json(levels_file)
#     if not level_rules:
#         return -1, 0
# 
#     max_level = max([int(n) for n in level_rules.keys()])
#     xp_now = calculate_xp()
# 
#     level_min = 0
#     level_max = 0
# 
#     for level in xrange(1, max_level + 1):
#         level_min = level_rules[str(level)]
# 
#         if level != max_level:
#             level_max = level_rules[str(level + 1)]
#         else:
#             level_max = float('inf')
# 
#         if level_min <= xp_now <= level_max:
#             return level_min, xp_now, level_max
# 
# Path: kano_profile_gui/paths.py



import os
from gi.repository import Gtk
from kano_profile.badges import calculate_min_current_max_xp
from kano.gtk3.apply_styles import apply_styling_to_screen
from kano_profile_gui.paths import media_dir
#!/usr/bin/env python

# progress_bar.py
#
# Copyright (C) 2014, 2015 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
# This displays orange progress bar along top of each screen



class ProgressBar(Gtk.Fixed):

    def __init__(self, window_width):

        Gtk.Fixed.__init__(self)


# Path: kano_profile/badges.py
# def calculate_min_current_max_xp():
#     level_rules = read_json(levels_file)
#     if not level_rules:
#         return -1, 0
# 
#     max_level = max([int(n) for n in level_rules.keys()])
#     xp_now = calculate_xp()
# 
#     level_min = 0
#     level_max = 0
# 
#     for level in xrange(1, max_level + 1):
#         level_min = level_rules[str(level)]
# 
#         if level != max_level:
#             level_max = level_rules[str(level + 1)]
#         else:
#             level_max = float('inf')
# 
#         if level_min <= xp_now <= level_max:
#             return level_min, xp_now, level_max
# 
# Path: kano_profile_gui/paths.py



# Path: kano_profile_gui/progress_bar.py
import os
from gi.repository import Gtk
from kano_profile.badges import calculate_min_current_max_xp
from kano.gtk3.apply_styles import apply_styling_to_screen
from kano_profile_gui.paths import media_dir

#!/usr/bin/env python

# progress_bar.py
#
# Copyright (C) 2014, 2015 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
# This displays orange progress bar along top of each screen



class ProgressBar(Gtk.Fixed):

    def __init__(self, window_width):

        Gtk.Fixed.__init__(self)


        css_path = os.path.join(media_dir, "CSS/progress_bar.css")