import os, platform
# I intend to hide the Operating Specific details of opening a folder
#   here in this module.
#
# On Mac OS X you do this with "open"
#   e.g. "open '\Users\golliher\Documents\Tickler File'"
# On Windows you do this with "explorer"
#   e.g. "explorer c:\Documents and Settings\Tickler File"


def open_folder(path):
    path = os.path.normpath(path)

    format_string = {'Darwin': "open '%s'",  # note the quotation marks around path
                     'Linux':  "xdg-open '%s'",
                     'Windows': "explorer %s"}[platform.system()]

    os.popen(format_string % path)

import os, platform
# I intend to hide the Operating Specific details of opening a folder
#   here in this module.
#
# On Mac OS X you do this with "open"
#   e.g. "open '\Users\golliher\Documents\Tickler File'"
# On Windows you do this with "explorer"
#   e.g. "explorer c:\Documents and Settings\Tickler File"
# On Linux xdg-open is a desktop-independant tool

def open_folder(path):
    '''Runs operating specific command to open a folder.  MacOS, Linux & Windows supported'''

    path = os.path.normpath(path)

    try:
        platform_cmd_formatstring = { 'Darwin':  "open '%s'",  # note the quotation marks around path
                                      'Linux':   "xdg-open '%s'",
                                      'Windows': "explorer %s"}[platform.system()]
    except:
        raise Exception("Your operating system was not recognized.  Unable to determine how to open folders for you.")


    platform_cmd = platform_cmd_formatstring % path

    os.popen(platform_cmd)

Raise exception if we don't know how to handle users operating system
Raise exception if we don't know how to handle users operating system
  import os, platform
  # I intend to hide the Operating Specific details of opening a folder
  #   here in this module.
  #
  # On Mac OS X you do this with "open"
  #   e.g. "open '\Users\golliher\Documents\Tickler File'"
  # On Windows you do this with "explorer"
  #   e.g. "explorer c:\Documents and Settings\Tickler File"
+ # On Linux xdg-open is a desktop-independant tool
+ 
+ def open_folder(path):
+     '''Runs operating specific command to open a folder.  MacOS, Linux & Windows supported'''
+ 
+     path = os.path.normpath(path)
+ 
+     try:
+         platform_cmd_formatstring = { 'Darwin':  "open '%s'",  # note the quotation marks around path
+                                       'Linux':   "xdg-open '%s'",
+                                       'Windows': "explorer %s"}[platform.system()]
+     except:
+         raise Exception("Your operating system was not recognized.  Unable to determine how to open folders for you.")
  
  
+     platform_cmd = platform_cmd_formatstring % path
- def open_folder(path):
-     path = os.path.normpath(path)
  
+     os.popen(platform_cmd)
-     format_string = {'Darwin': "open '%s'",  # note the quotation marks around path
-                      'Linux':  "xdg-open '%s'",
-                      'Windows': "explorer %s"}[platform.system()]
  
-     os.popen(format_string % path)
- 
Raise exception if we don't know how to handle users operating system
## Code Before:
import os, platform
# I intend to hide the Operating Specific details of opening a folder
#   here in this module.
#
# On Mac OS X you do this with "open"
#   e.g. "open '\Users\golliher\Documents\Tickler File'"
# On Windows you do this with "explorer"
#   e.g. "explorer c:\Documents and Settings\Tickler File"


def open_folder(path):
    path = os.path.normpath(path)

    format_string = {'Darwin': "open '%s'",  # note the quotation marks around path
                     'Linux':  "xdg-open '%s'",
                     'Windows': "explorer %s"}[platform.system()]

    os.popen(format_string % path)

## Instruction:
Raise exception if we don't know how to handle users operating system
## Code After:
import os, platform
# I intend to hide the Operating Specific details of opening a folder
#   here in this module.
#
# On Mac OS X you do this with "open"
#   e.g. "open '\Users\golliher\Documents\Tickler File'"
# On Windows you do this with "explorer"
#   e.g. "explorer c:\Documents and Settings\Tickler File"
# On Linux xdg-open is a desktop-independant tool

def open_folder(path):
    '''Runs operating specific command to open a folder.  MacOS, Linux & Windows supported'''

    path = os.path.normpath(path)

    try:
        platform_cmd_formatstring = { 'Darwin':  "open '%s'",  # note the quotation marks around path
                                      'Linux':   "xdg-open '%s'",
                                      'Windows': "explorer %s"}[platform.system()]
    except:
        raise Exception("Your operating system was not recognized.  Unable to determine how to open folders for you.")


    platform_cmd = platform_cmd_formatstring % path

    os.popen(platform_cmd)
