DrQueueIPython icon indicating copy to clipboard operation
DrQueueIPython copied to clipboard

TODO: change os detection...

Open jedie opened this issue 10 years ago • 2 comments

There is often something like this:

if DRQUEUE_OS in ["Windows", "Win32"]:

-> https://github.com/kaazoo/DrQueueIPython/search?utf8=%E2%9C%93&q=windows

TODO: Just change to:

if sys.platform.startswith('win'):

or maybe:

IS_WIN = sys.platform.startswith('win')

if IS_WIN:

jedie avatar Aug 03 '15 15:08 jedie

DRQUEUE_OS is initialized here: https://github.com/kaazoo/DrQueueIPython/blob/c65a872a01d309ae92adbcbc6ce6dcfd3d576453/DrQueue/init.py#L95

I like sys.platform.startswith('win') or platform.system() in ["Windows", "Win32"].

So the DRQUEUE_OS global variable could be left out.

kaazoo avatar Aug 03 '15 20:08 kaazoo

I would prefer sys.platform.startswith('win') instead of platform.system() in ["Windows", "Win32"] This is the recommended idiom, see: https://docs.python.org/3.4/library/sys.html#sys.platform

Global variables should also be a construction area ;)

jedie avatar Aug 03 '15 20:08 jedie