Esempio n. 1
0
 def has_requirements():
     if is_preferred_browser("mozilla"):
         return True
     elif is_preferred_browser("firefox") or is_preferred_browser("iceweasel"):
         if MozillaBookmarksHandler.has_firefox_version():
             return True
         
         MozillaHistoryHandler.INSTRUCTIONS = \
             _("Firefox version must be at least %s and less than %s") % (MIN_FF_VERSION_STRING, MAX_FF_VERSION_STRING)
         return False
     else:
         MozillaHistoryHandler.INSTRUCTIONS = _("Mozilla/Firefox is not your preferred browser.")
         return False
Esempio n. 2
0
    def has_requirements():
        if is_preferred_browser("mozilla"):
            return True
        elif is_preferred_browser("firefox") or is_preferred_browser(
                "iceweasel"):
            if MozillaBookmarksHandler.has_firefox_version():
                return True

            MozillaHistoryHandler.INSTRUCTIONS = \
                _("Firefox version must be at least %s and less than %s") % (MIN_FF_VERSION_STRING, MAX_FF_VERSION_STRING)
            return False
        else:
            MozillaHistoryHandler.INSTRUCTIONS = _(
                "Mozilla/Firefox is not your preferred browser.")
            return False
Esempio n. 3
0
 def has_requirements():
     if is_preferred_browser("epiphany"):
         EpiphanySearchHandler.INSTRUCTIONS = _("You can set shortcuts for your searches.")
         return True
     else:
         EpiphanySearchHandler.INSTRUCTIONS = _("Epiphany is not your preferred browser.")
         return False
Esempio n. 4
0
 def has_requirements():
     if is_preferred_browser("epiphany"):
         EpiphanySearchHandler.INSTRUCTIONS = _("You can set shortcuts for your searches.")
         return True
     else:
         EpiphanySearchHandler.INSTRUCTIONS = _("Epiphany is not your preferred browser.")
         return False
Esempio n. 5
0
 def has_requirements():
     if is_preferred_browser("firefox") or is_preferred_browser("iceweasel"):
         if is_preferred_browser("firefox") and not MozillaBookmarksHandler.has_firefox_version():
             
             MozillaSearchHandler.INSTRUCTIONS = \
                 _("Firefox version must be at least %s and less than %s") % (MIN_FF_VERSION_STRING, MAX_FF_VERSION_STRING)
             return False
         
         # Correct firefox version or iceweasel
         MozillaSearchHandler.INSTRUCTIONS = _("You can customize which search engines are offered.")
         return True
     elif is_preferred_browser("mozilla"):
         # TODO - similar functionality for old-school mozilla (not firefox)
         return True
     else:
         MozillaSearchHandler.INSTRUCTIONS = _("Mozilla/Firefox is not your preferred browser.")
         return False
Esempio n. 6
0
    def has_requirements():
        if is_preferred_browser("firefox") or is_preferred_browser(
                "iceweasel"):
            if is_preferred_browser(
                    "firefox"
            ) and not MozillaBookmarksHandler.has_firefox_version():

                MozillaSearchHandler.INSTRUCTIONS = \
                    _("Firefox version must be at least %s and less than %s") % (MIN_FF_VERSION_STRING, MAX_FF_VERSION_STRING)
                return False

            # Correct firefox version or iceweasel
            MozillaSearchHandler.INSTRUCTIONS = _(
                "You can customize which search engines are offered.")
            return True
        elif is_preferred_browser("mozilla"):
            # TODO - similar functionality for old-school mozilla (not firefox)
            return True
        else:
            MozillaSearchHandler.INSTRUCTIONS = _(
                "Mozilla/Firefox is not your preferred browser.")
            return False
Esempio n. 7
0
import logging
import os
import re
import subprocess
import urllib
LOGGER = logging.getLogger(__name__)

# Check for presence of set to be compatible with python 2.3
try:
    set
except NameError:
    from sets import Set as set

# Whether we will index firefox or mozilla bookmarks
USING_FIREFOX = False
if is_preferred_browser("firefox") or is_preferred_browser("iceweasel"):
    USING_FIREFOX = True
    
# Minimum and maximum version of Firefox
MIN_FF_VERSION = [2, 0, 0, 0]
MAX_FF_VERSION = [3, 0, 0, 0] # exclusively
MIN_FF_VERSION_STRING = "2.0.0.0"
MAX_FF_VERSION_STRING = "3.0.0.0"
        
# File returned here should be checked for existence
def get_mozilla_home_file(needed_file):    
    default_profile_dir = expanduser("~/.mozilla/default")
    if exists(default_profile_dir):
        for d in os.listdir(default_profile_dir):
            return join(default_profile_dir, d, needed_file)
    
Esempio n. 8
0
 def has_requirements():
     if is_preferred_browser("epiphany"):
         return True
     else:
         EpiphanyBookmarksHandler.INSTRUCTIONS = _("Epiphany is not your preferred browser.")
         return False
Esempio n. 9
0
 def has_requirements():
     if is_preferred_browser("epiphany"):
         return True
     else:
         EpiphanyBookmarksHandler.INSTRUCTIONS = _("Epiphany is not your preferred browser.")
         return False
Esempio n. 10
0
import logging
import os
import re
import subprocess
import urllib
LOGGER = logging.getLogger(__name__)

# Check for presence of set to be compatible with python 2.3
try:
    set
except NameError:
    from sets import Set as set

# Whether we will index firefox or mozilla bookmarks
USING_FIREFOX = False
if is_preferred_browser("firefox") or is_preferred_browser("iceweasel"):
    USING_FIREFOX = True

# Minimum and maximum version of Firefox
MIN_FF_VERSION = [2, 0, 0, 0]
MAX_FF_VERSION = [3, 0, 0, 0]  # exclusively
MIN_FF_VERSION_STRING = "2.0.0.0"
MAX_FF_VERSION_STRING = "3.0.0.0"


# File returned here should be checked for existence
def get_mozilla_home_file(needed_file):
    default_profile_dir = expanduser("~/.mozilla/default")
    if exists(default_profile_dir):
        for d in os.listdir(default_profile_dir):
            return join(default_profile_dir, d, needed_file)