Move OS specific code into its own folder#34779
Move OS specific code into its own folder#34779alalazo wants to merge 1 commit intospack:developfrom
Conversation
|
This is an attempt to avoid having |
| def getuid(): | ||
| if is_windows: | ||
| import ctypes | ||
| if sys.platform == "win32": |
There was a problem hiding this comment.
The assumption here is that we'll import different implementations of the same functions in both conditional branches.
Move all the code that is either Windows or Unix specific into separate folders. The API for both platforms is the same and the correct code is imported based on "sys.platform".
acacb98 to
6d45358
Compare
|
@johnwparent @BetsyMcPhail @tgamblin @scheibelp fyi let me know if this approach is worth polishing / applying to other parts of the code. |
tldahlgren
left a comment
There was a problem hiding this comment.
Real quick pass I noticed there are a couple of copyright end years off.
| @@ -0,0 +1,36 @@ | |||
| # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other | |||
There was a problem hiding this comment.
| # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other | |
| # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other |
| @@ -0,0 +1,104 @@ | |||
| # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other | |||
There was a problem hiding this comment.
| # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other | |
| # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other |
There was a problem hiding this comment.
Great catch, I wonder where I copied those from and more importantly why CI was passing 🤔
|
My general preference is that if a method can abstract Windows-specific details, then having |
|
Since this was just a proof of concept, and is now outdated, close it. |
Move all the
llnl.*code that is either Windows or Unix specific into separate folders. The API for both platforms is the same and the correct code is imported based on "sys.platform".Modifications:
llnl.util.filesystemandllnl.util.symlinkthe correct implementation based on the currentsys.platform