Skip to content

Commit

Permalink
Windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
manuvarkey committed Nov 10, 2023
1 parent 150b10e commit e7b0346
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
6 changes: 3 additions & 3 deletions cmbautomiser/data/datamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def render_cmb(self, folder, replacement_dict, path, recursive = True, progress=
# Run latex on file
if progress is not None:
progress.add_message('Rendering CMB No.' + self.cmbs[path[0]].name)
code = misc.run_latex(misc.posix_path(folder), filename, self.program_settings['latex_path'])
code = misc.run_latex(misc.posix_path(folder), filename)
if progress is not None:
progress.pulse()
if code == misc.CMB_ERROR:
Expand Down Expand Up @@ -699,14 +699,14 @@ def render_bill(self, folder, replacement_dict, path, recursive=True, progress=N
# Render this bill
if progress is not None:
progress.add_message('Rendering Bill No.' + bill.data.cmb_name + ' Abstract')
code = misc.run_latex(misc.posix_path(folder), filename, self.program_settings['latex_path'])
code = misc.run_latex(misc.posix_path(folder), filename)
if progress is not None:
progress.pulse()
if code == misc.CMB_ERROR:
return (misc.CMB_ERROR, 'Rendering of Bill: ' + bill.data.title + ' failed')
if progress is not None:
progress.add_message('Rendering Bill No.' + bill.data.cmb_name + ' Schedule')
code_bill = misc.run_latex(misc.posix_path(folder), filename_bill, self.program_settings['latex_path'])
code_bill = misc.run_latex(misc.posix_path(folder), filename_bill)
if progress is not None:
progress.pulse()
if code_bill == misc.CMB_ERROR:
Expand Down
15 changes: 6 additions & 9 deletions cmbautomiser/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,14 @@ def init_global_platform_vars():

global_settings_dict = dict()

if platform.system() == 'Linux':
global_settings_dict['latex_path'] = 'lualatex'
elif platform.system() == 'Windows':
global_settings_dict['latex_path'] = abs_path(
'miketex\\miktex\\bin\\x64\\lualatex.exe')

global_settings_dict['$cmbissuedto$'] = ''
global_settings_dict['$cmbvarifyingauthority$'] = ''
global_settings_dict['$cmbvarifyingauthorityoffice$'] = ''
global_settings_dict['$cmbissuingauthority$'] = ''
global_settings_dict['$cmbissuingauthorityoffice$'] = ''
return global_settings_dict

global_platform_vars_captions = ['Latex path',
'CMB Issued to (Default Value)',
global_platform_vars_captions = ['CMB Issued to (Default Value)',
'Varifying Authority (Default Value)',
'Varifying Authority Office (Default Value)',
'Issuing Authority (Default Value)',
Expand Down Expand Up @@ -939,8 +932,12 @@ def get_file_path_from_dnd_dropped_uri(uri):

return path

def run_latex(folder, filename, latex_path):
def run_latex(folder, filename):
"""Runs latex on file to folder in two passes"""
if platform.system() == 'Linux':
latex_path = 'lualatex'
elif platform.system() == 'Windows':
latex_path = abs_path('miketex\\miktex\\bin\\x64\\lualatex.exe')
if filename is not None:
latex_exec = Command([latex_path, '-interaction=batchmode', '-output-directory=' + folder, filename])
# First Pass
Expand Down
12 changes: 6 additions & 6 deletions pyinstaller_spec.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
block_cipher = None

added_files = [
( 'cmbautomiser/interface/*.glade', 'interface' ),
( 'cmbautomiser/templates/*.py', 'templates' ),
( 'cmbautomiser/latex/*.tex', 'latex' ),
( 'cmbautomiser/ods_templates/*.xlsx', 'ods_templates' ),
( 'cmbautomiser/documentation/*.pdf', 'documentation' ),
( 'miketex/', 'miketex' )
( 'cmbautomiser/interface/*.glade', 'cmbautomiser/interface' ),
( 'cmbautomiser/templates/*.py', 'cmbautomiser/templates' ),
( 'cmbautomiser/latex/*.tex', 'cmbautomiser/latex' ),
( 'cmbautomiser/ods_templates/*.xlsx', 'cmbautomiser/ods_templates' ),
( 'cmbautomiser/documentation/*.pdf', 'cmbautomiser/documentation' ),
( 'miketex/', 'cmbautomiser/miketex' )
]

a = Analysis(['cmbautomiser_launcher.py'],
Expand Down

0 comments on commit e7b0346

Please sign in to comment.