ysharma HF Staff commited on
Commit
f2b7407
·
verified ·
1 Parent(s): dfdbf8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -26,6 +26,11 @@ os.environ['GRADIO_TEMP_DIR'] = new_directory_path
26
 
27
  ######
28
 
 
 
 
 
 
29
  def create():
30
  """
31
  Create a blank image with the specified dimensions, color, and filename.
@@ -46,16 +51,11 @@ def create():
46
  # Specify the directory you want to search in, e.g., the current directory
47
  directory = 'temp_dir'
48
  # List all entries in the directory
49
- entries = os.listdir(directory)
50
- # Filter out hidden directories
51
- hidden_directories = [d for d in entries if os.path.isdir(os.path.join(directory, d)) and d.startswith('.')]
52
- print("------Hidden directories:------")
53
- for d in hidden_directories:
54
- print(d)
55
- hidden_directories_listing = os.listdir(d)
56
- print(os.listdir(d))
57
- print("-------------------------------")
58
- return temp_file.name, hidden_directories_listing
59
 
60
 
61
  with gr.Blocks(delete_cache=(2,2),
 
26
 
27
  ######
28
 
29
+ # Get the path of the system's temporary directory
30
+ temp_directory = tempfile.gettempdir()
31
+ print(f"System's temporary directory is: {temp_directory}")
32
+
33
+
34
  def create():
35
  """
36
  Create a blank image with the specified dimensions, color, and filename.
 
51
  # Specify the directory you want to search in, e.g., the current directory
52
  directory = 'temp_dir'
53
  # List all entries in the directory
54
+ entries = os.listdir(directory)
55
+ print(f"listdir of temp_dir directory = {entries}")
56
+ temp_directory_file_list = os.listdir(temp_directory)
57
+ print(f'temp_directory_file_list is = {temp_directory_file_list}')
58
+ return temp_file.name, temp_directory_file_list
 
 
 
 
 
59
 
60
 
61
  with gr.Blocks(delete_cache=(2,2),