Skip to content

Instantly share code, notes, and snippets.

@elliotnev27
Last active December 29, 2022 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elliotnev27/82f87bc125845ada68fe90ae4ee5cc0b to your computer and use it in GitHub Desktop.
Save elliotnev27/82f87bc125845ada68fe90ae4ee5cc0b to your computer and use it in GitHub Desktop.
Python snipped to get local Autodesk Flame Projects
import subprocess
import re
def get_local_flame_projects():
"""Get all flame projets from /opt/Autodesk/io/bin/flame_archive -l
Returns:
list: This is a list of the flame projects that exist on the workstation
"""
project_list = []
proc = subprocess.Popen(['/opt/Autodesk/io/bin/flame_archive', '-l'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = proc.communicate()[0]
if isinstance(output, bytes):
output = output.decode('utf-8')
proj_trip = False
for proj in output.split('\n'):
proj = re.sub(r'^\s+', '', proj)
if re.search(r'(?i)stopping managed threads\.', proj):
break
if re.search(r'(?i)^projects:', proj):
proj_trip = True
continue
if not proj_trip:
continue
project_list.append(proj)
return project_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment