Main function
()
| 132 | |
| 133 | |
| 134 | def main(): |
| 135 | """Main function""" |
| 136 | |
| 137 | print('='*60) |
| 138 | print('OpenOCR Package Build Script') |
| 139 | print('='*60 + '\n') |
| 140 | |
| 141 | try: |
| 142 | # Step 1: Create package structure |
| 143 | print('Step 1: Creating package structure...') |
| 144 | create_package_structure() |
| 145 | |
| 146 | # Step 2: Build wheel |
| 147 | print('\nStep 2: Building wheel package...') |
| 148 | success = build_wheel() |
| 149 | |
| 150 | if success: |
| 151 | print('\n' + '='*60) |
| 152 | print('All steps completed successfully!') |
| 153 | print('='*60) |
| 154 | print('\nTo install the package, run:') |
| 155 | print(f' pip install build/dist/openocr_python-*.whl') |
| 156 | print('\nAfter installation, you can use:') |
| 157 | print(' openocr --help') |
| 158 | else: |
| 159 | print('\nBuild failed. Please check the error messages above.') |
| 160 | sys.exit(1) |
| 161 | |
| 162 | except Exception as e: |
| 163 | print(f'\nError: {e}') |
| 164 | import traceback |
| 165 | traceback.print_exc() |
| 166 | sys.exit(1) |
| 167 | |
| 168 | |
| 169 | if __name__ == '__main__': |
no test coverage detected