Commits

Christian Ebert  committed 2b412be

Move cygwin check from pybrowser to util

  • Participants
  • Parent commits 402705b

Comments (0)

Files changed (2)

File muttils/pybrowser.py

 # $Id$
 
-import os, webbrowser, sys
+import os, webbrowser
 from muttils import ui, urlregex, util
 
 class browser(object):
     def urlvisit(self):
         '''Visit url(s).'''
         textbrowsers = 'w3m', 'lynx', 'links', 'elinks'
-        cygwin = sys.platform == 'cygwin'
+        cygwin = util.cygwin()
         app, tb, cygpath, notty, screen = '', False, False, False, False
         if self.ui.app is not None:
             app = os.path.basename(self.ui.app)

File muttils/util.py

         # I/O operation on closed file
         return False
 
+def cygwin():
+    '''Returns true when we are on cygwin.'''
+    return sys.platform == 'cygwin'
+
 def systemcall(cs, notty=False, screen=False):
     '''Calls command sequence cs in manner suiting
     terminal connectivity.'''