Upload debug_conversion.py with huggingface_hub
Browse files- debug_conversion.py +28 -0
debug_conversion.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pyhwp.html_converter import HwpToHtmlConverter
|
| 2 |
+
import os
|
| 3 |
+
import sys
|
| 4 |
+
|
| 5 |
+
def main():
|
| 6 |
+
try:
|
| 7 |
+
print("Starting conversion...")
|
| 8 |
+
converter = HwpToHtmlConverter('test.hwp')
|
| 9 |
+
converter.convert('test.html')
|
| 10 |
+
print("Conversion finished.")
|
| 11 |
+
|
| 12 |
+
if os.path.exists('styles.css'):
|
| 13 |
+
print("styles.css created.")
|
| 14 |
+
else:
|
| 15 |
+
print("styles.css NOT created.")
|
| 16 |
+
|
| 17 |
+
if os.path.exists('bindata'):
|
| 18 |
+
print("bindata directory created.")
|
| 19 |
+
else:
|
| 20 |
+
print("bindata directory NOT created.")
|
| 21 |
+
|
| 22 |
+
except Exception as e:
|
| 23 |
+
print(f"Error during conversion: {e}")
|
| 24 |
+
import traceback
|
| 25 |
+
traceback.print_exc()
|
| 26 |
+
|
| 27 |
+
if __name__ == "__main__":
|
| 28 |
+
main()
|