wdcqc commited on
Commit
d40ed38
1 Parent(s): 11c0069

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -6,8 +6,8 @@ import os
6
  import urllib.request
7
 
8
  def fix_local_file(path):
9
- # probably should include the tile files in the package
10
- if not os.path.exists(target_path):
11
  try:
12
  os.makedirs(os.path.dirname(path))
13
  except Exception as e:
@@ -21,7 +21,7 @@ def fix_local_file(path):
21
  print(e)
22
 
23
  def fix_package_file(path):
24
- # I think this is because I did the setup.py wrong, but pip install git+repo works in colab so idk how to really fix
25
  target_path = "/home/user/.local/lib/python3.8/site-packages/wfd/{}".format(path)
26
  if not os.path.exists(target_path):
27
  try:
@@ -39,10 +39,10 @@ def fix_package_file(path):
39
  print("{} is fixed!".format(path))
40
 
41
  if __name__ == "__main__":
42
- fix_package_file("mpqapi/libstorm.so")
43
- fix_package_file("webui/templates/tempura.css")
44
- fix_package_file("webui/templates/background.css")
45
- fix_package_file("webui/doki_settings.json")
46
  fix_local_file("tile_data/platform.cv5.bin")
47
  fix_local_file("tile_data/platform.png")
48
  fix_local_file("tile_data/platform_mapping.npz")
 
6
  import urllib.request
7
 
8
  def fix_local_file(path):
9
+ # probably should include the tile files in the package. let's get it running first.
10
+ if not os.path.exists(path):
11
  try:
12
  os.makedirs(os.path.dirname(path))
13
  except Exception as e:
 
21
  print(e)
22
 
23
  def fix_package_file(path):
24
+ # fixed by adding files to package_data and set include_package_data=True in setup.py
25
  target_path = "/home/user/.local/lib/python3.8/site-packages/wfd/{}".format(path)
26
  if not os.path.exists(target_path):
27
  try:
 
39
  print("{} is fixed!".format(path))
40
 
41
  if __name__ == "__main__":
42
+ # fix_package_file("mpqapi/libstorm.so")
43
+ # fix_package_file("webui/templates/tempura.css")
44
+ # fix_package_file("webui/templates/background.css")
45
+ # fix_package_file("webui/doki_settings.json")
46
  fix_local_file("tile_data/platform.cv5.bin")
47
  fix_local_file("tile_data/platform.png")
48
  fix_local_file("tile_data/platform_mapping.npz")