PPTools/Ppgen/Using/MacUser1

From DPWiki
< PPTools‎ | Ppgen‎ | Using
Jump to navigation Jump to search

"Drag and drop" method

Using ppgen will mean using a command-line interface, in other words the "Terminal" app. You can find it in Applications/Utilities. This unfriendly "black box" can be very intimidating, but don't worry! Here's a way to make it easier with drag-and-drop.

Requirements

Besides the Terminal (which is included with your Mac), you'll also need Python 3 and ppgen itself. You should already have installed those; if you haven't, go take care of that and come back. Here are some instructions: PPTools/Ppgen/Installation/MacInstallUser1

Using ppgen with drag-and-drop

  1. Open Terminal.
  2. Type the following: python3 and then press "Space" (but do not press Return)
  3. Drag and drop your ppgen program from the Finder, then type -i and press "Space" again (but do not press Return)
  4. Drag and drop your source file from the Finder (e.g. projectname-src.txt)

Your command line should now look similar to the below. The exact file paths will be different on your computer.

python3 /Users/dan/dp/ppgen/ppgen.py -i /Users/dan/dp/pp/{project}/{project}-src.txt

If you press "Return" you'll either create all 3 output files, or you'll receive a message indicating a problem occurred.

Other possible options

Only generate one output type

By default, ppgen will create both text and HTML output. You can control this behavior and only output one or the other with the -oflag. You can add this to the end of the above command (only one or the other of the below options),

-o h will only generate the HTML file

-o t will only generate the text file

Advanced method (if comfortable with command line)

You'll need to know the path to your project, and to the location of ppgen.py.

python3 /path/to/ppgen.py -i /path/to/project-src.txt

The output files will be placed in the same directory as the source file. Therefore you don't have to really care much about which directory you run PPgen from if you fully qualify the paths.

Debugging options

You can use the -d flag for debugging . This can be useful if you are having a problem, e.g. receiving errors. Even if you don't understand the output, you can post it on the forums when asking for help.

You can use any combination of the below, e.g. -d ds or -d sp or -d a or -d pda, or whatever combination makes sense to you.

From the FAQ page here I've copied Roger's explanation below.


There are four debugging options. One of them can be very useful. Here is the complete list:

 "d" print names of selected generator routines as they are invoked.
 "s" keep generated styles, do no run class composer
 "a" show all lines as processed
 "p" display detected processor type

The third one, invoked with ppgen.py -d a -i filename-src.txt, is very helpful when the program crashes with a confusing error message. By looking at how far it got, the PPer can see within a line or two the source file line that caused the crash.