Skip to content

Commit

Permalink
Merge pull request #7 from alexanderquispe/server
Browse files Browse the repository at this point in the history
bat file
  • Loading branch information
TJhon authored Jun 29, 2023
2 parents 8196cb1 + 1bea631 commit b824fed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions osrmareas/osrm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def prepare_server(self):
gen_route = self.gen_routes
osrm_file = self.osrm_file
pbf_file = self.pbf_file
run_first="No"
comand = f'''
{gen_osrm}
{gen_route}
'''
comand1 = comand.copy()

run_first = 'no'
run_second = 'no'
Expand All @@ -57,15 +57,19 @@ def prepare_server(self):
comand = f'''
{gen_route}
'''
fl = tempfile.NamedTemporaryFile(delete=False, suffix='.bat')
file = fl.name

if os.path.exists(self._contract_file):
print('Found contract file')
run_second=input(f"Contract found, run again?")
else:
with open(file, 'w') as bt:
bt.write(comand1)
subprocess.Popen(['start', 'cmd', '/c', 'call', file], shell = True)

if 'n' in run_second:
comand = ''
fl = tempfile.NamedTemporaryFile(delete=False, suffix='.bat')
file = fl.name
with open(file, 'w') as bt:
bt.write(comand)
subprocess.Popen(['start', 'cmd', '/c', 'call', file], shell = True)
Expand Down
2 changes: 1 addition & 1 deletion osrmareas/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1'
__version__ = '0.1.5'

0 comments on commit b824fed

Please sign in to comment.