Package theia :: Package helpers :: Module interaction
[hide private]
[frames] | no frames]

Source Code for Module theia.helpers.interaction

 1  '''Module to define interaction functions for theia.''' 
 2   
 3  # Provides: 
 4  #       usage 
 5  #       lhelp 
 6  #       welcome 
 7  #       errorRecursion 
 8  #       errorAtSpecifiedLocation 
 9  #       errorWhereIs 
10  #       errorUnknown 
11   
12  usage = "Usage: theia [options] FNAME\n\nArguments:\n"\ 
13          + "  FNAME\t\t .tia format input file name." 
14   
15  lhelp = "specify the FreeCAD library location. If none is specified, theia "\ 
16                  + "finds it  using the UNIX `whereis` command. If option '-c', "\ 
17                  + "'--no-CAD'  is used, the FreeCAD search and import are skipped "\ 
18                  + "as a whole." 
19   
20  welcome = u''' 
21  \ttheia Copyright (C) 2017 Rapha\u00EBl Duque 
22  \tLicense: GNU GPLv3+ <http://gnu.org/licenses/gpl.html> 
23  \tThis is free software: you are free to change and redistribute it. 
24  \tThere is ABSOLUTELY NO WARRANTY, to the extent permitted by law. 
25  ''' 
26   
27  errorRecursion = ''' 
28   
29  It looks like you reached the maximum recursion depth of your Python 
30  implementation (generally around 1000). The beam tracer builds the beam tree 
31  recursively and in your case the recursion went to far. The order and threshold 
32  simulation parameters were made to prevent this situation. What you can do: 
33   
34  \t1. Make sure you're running with reasonable order and threshold parameters, 
35  \t2. Increase the maximum recursion depth of your Python environment by placing 
36  \t   `sys.setrecursionlimit([whatever you need])`, 
37  \t   right under the `"if __name__ == '__main__'` line in bin/theia, rebuild 
38  \t   theia with `make build-theia` in the project root and rerun your simulation; 
39  \t3. Contact your local administrator to increase the maximum recursion depth 
40  \t   on a system-wide basis and rerun your simulation. 
41  ''' 
42   
43  errorAtSpecifiedLocation = "theia: Error: The FreeCAD library was not found "\ 
44          + "at the specified location %s. Usually it is in /usr/lib/freecad/lib. "\ 
45          + "If you are not sure, omit the '-l', '--FREECAD-lib' option and theia "\ 
46          + "will find the library on its own.\nAborting." 
47   
48  errorWhereIs = "theia: Error: Unix command 'whereis freecad' did not yield "\ 
49          + "any directory. Please make sure you have FreeCAD installed and that "\ 
50          + "library location is in your $PATH.\nAborting" 
51   
52  errorUnknown = "theia: Error: %s was used as the source directory for the "\ 
53          + "FreeCAD library but an error occured, make sure your FreeCAD build is "\ 
54          + "correct.\nAborting." 
55