File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/bindings/python/flux/job Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1919from itertools import chain
2020
2121import flux .constants
22- from flux .core .inner import raw
22+ from flux .core .inner import ffi , raw
2323from flux .job .JobID import JobID
2424from flux .job .stats import JobStats
2525from flux .memoized_property import memoized_property
@@ -42,6 +42,12 @@ def statetostr(stateid, fmt="L"):
4242 return raw .flux_job_statetostr (stateid , fmt ).decode ("utf-8" )
4343
4444
45+ def strtostate (state ):
46+ result = ffi .new ("flux_job_state_t [1]" )
47+ raw .flux_job_strtostate (state , result )
48+ return int (result [0 ])
49+
50+
4551def statetoemoji (stateid ):
4652 statestr = raw .flux_job_statetostr (stateid , "S" ).decode ("utf-8" )
4753 if statestr == "N" :
@@ -81,6 +87,12 @@ def resulttostr(resultid, fmt="L"):
8187 return raw .flux_job_resulttostr (resultid , fmt ).decode ("utf-8" )
8288
8389
90+ def strtoresult (arg ):
91+ result = ffi .new ("flux_job_result_t [1]" )
92+ raw .flux_job_strtoresult (arg , result )
93+ return int (result [0 ])
94+
95+
8496def resulttoemoji (resultid ):
8597 if resultid != "" :
8698 resultstr = raw .flux_job_resulttostr (resultid , "S" ).decode ("utf-8" )
You can’t perform that action at this time.
0 commit comments