# Path: uamobile/scrapers/base.py
# class Scraper(object):
#     # subclass must override this property
#     url = None
# 
#     def scrape(self):
#         stream = self.get_stream()
#         doc = self.get_document(stream)
#         return self.do_scrape(doc)
# 
#     def get_document(self, stream):
#         doc = etree.parse(stream, etree.HTMLParser(remove_comments=True))
#         return doc
# 
#     def get_stream(self):
#         return urllib2.urlopen(self.url)
# 
#     def do_scrape(self, doc):
#         raise NotImplementedError()


import re
from uamobile.scrapers.base import Scraper
                    continue

                model = matcher.group(1) + matcher.group(2)
                if model.endswith(u'\u03bc'):
                    model = model[:-1] + 'myu'
                elif model.endswith(u'II'):
                    model = model[:-2] + '2'

                # height, width
                display_text = u''.join(columns[display_index].itertext())
                matcher = re.search(ur'(\d+).(\d+)', display_text)
                if not matcher:
                    continue

                width, height = map(int, matcher.groups())

                # color
                color_text = u''.join(columns[-1].itertext())
                color = color_text.startswith(u'カラー')

                # depth
                matcher = re.search(r'(\d+)', color_text)
                if matcher:
                    depth = int(matcher.group(1))
                else:
                    depth = 1

                res[model] = { 'width' : width,
                               'height': height,
                               'color' : color,

# Path: uamobile/scrapers/base.py
# class Scraper(object):
#     # subclass must override this property
#     url = None
# 
#     def scrape(self):
#         stream = self.get_stream()
#         doc = self.get_document(stream)
#         return self.do_scrape(doc)
# 
#     def get_document(self, stream):
#         doc = etree.parse(stream, etree.HTMLParser(remove_comments=True))
#         return doc
# 
#     def get_stream(self):
#         return urllib2.urlopen(self.url)
# 
#     def do_scrape(self, doc):
#         raise NotImplementedError()


# Path: uamobile/scrapers/display.py
import re
from uamobile.scrapers.base import Scraper

                    continue

                model = matcher.group(1) + matcher.group(2)
                if model.endswith(u'\u03bc'):
                    model = model[:-1] + 'myu'
                elif model.endswith(u'II'):
                    model = model[:-2] + '2'

                # height, width
                display_text = u''.join(columns[display_index].itertext())
                matcher = re.search(ur'(\d+).(\d+)', display_text)
                if not matcher:
                    continue

                width, height = map(int, matcher.groups())

                # color
                color_text = u''.join(columns[-1].itertext())
                color = color_text.startswith(u'カラー')

                # depth
                matcher = re.search(r'(\d+)', color_text)
                if matcher:
                    depth = int(matcher.group(1))
                else:
                    depth = 1

                res[model] = { 'width' : width,
                               'height': height,
                               'color' : color,

                               'depth' : depth,