Commit 22459462 authored by Dick Hollenbeck's avatar Dick Hollenbeck

API Documentation improvements, especially noticable when viewing doxygen output.

parent 183afdd0
...@@ -32,20 +32,28 @@ struct GH_CACHE; ...@@ -32,20 +32,28 @@ struct GH_CACHE;
/** /**
Class GITHUB_PLUGIN Class GITHUB_PLUGIN
implements a portion of pcbnew PLUGIN to provide read only access to a github implements a portion of pcbnew's PLUGIN interface to provide read only access
repo consisting of pretty footprints. It could have used version 3 of the to a github repo consisting of pretty footprints, and optionally provides "Copy On Write"
github.com API documented here: support of edited footprints.
<p>It could have used version 3 of the github.com API documented here:
<pre> <pre>
http://developer.github.com http://developer.github.com
https://help.github.com/articles/creating-an-access-token-for-command-line-use https://help.github.com/articles/creating-an-access-token-for-command-line-use
</pre> </pre>
but it does not. Rather it simply reads in a zip file of the repo and unzips but it does not, since a better technique was discovered. Cleverly this
it from RAM as needed. <b>Therefore this "Github" plugin type is read only plugin simply reads in a zip file of the repo and unzips it from RAM as
for accessing remote pretty libraries at https://github.com.</b> The "Library needed. Therefore this "Github" plugin is <b>read only for accessing remote
Path" in the fp-lib-table row for a Github library should be set to the full pretty libraries at https://github.com.</b>
https:// URL. For example:
<p>The fp-lib-table dialog is entered via menu choice "Preferences | Library
Tables". For easy options editing in the current row, click on the "Edit
Options" button. The "Library Path" in the fp-lib-table row for a Github
library should be set to the full https:// URL.
<p>For example:
<pre> <pre>
https://github.com/liftoff-sr/pretty_footprints https://github.com/liftoff-sr/pretty_footprints
...@@ -58,52 +66,79 @@ struct GH_CACHE; ...@@ -58,52 +66,79 @@ struct GH_CACHE;
</pre> </pre>
<p> <p>
This PLUGIN also supports "Copy On Write", a.k.a. "COW". Thus a Github The "Plugin Type" should be set to "Github".
library defined in either fp-lib-table (project or global) will take an
optional option called <b>allow_pretty_writing_to_this_dir</b>. This option <p>This plugin also supports "Copy On Write", a.k.a. "COW". Thus a Github
is essentially the "Library Path" for a local "KiCad" (pretty) type library library may take an optional option called
which is combined to make up the Github library found in the same <b>allow_pretty_writing_to_this_dir</b>. This option is essentially the
fp-lib-table row. If the option is missing, then the Github library is read "Library Path" for a local "KiCad" (pretty) type library which is combined to
only as always. If the option is present for a Github library, then any make up the Github library found in the same fp-lib-table row. If the option
writes to this hybrid library will go to the local *.pretty directory. Note is missing, then the Github library is read only as always. If the option is
that the github.com resident portion of this hybrid COW library is always present for a Github library, then any writes to this hybrid library will go
read only, meaning you cannot delete anything or modify any footprint at to the local *.pretty directory. Note that the github.com resident portion of
github directly. The aggregate library "Type" remains "Github", but it this hybrid COW library is always read only, meaning you cannot delete
consists of a local R/W portion and a remote R/O portion. anything or modify any footprint at github directly. The aggregate library
type remains "Github" in your discussions, but it consists of a local R/W
<p> portion and a remote R/O portion.
Any footprint loads will always give precedence to the local footprints found <p>Below is an fp-lib-table entry for the case without option
in the pretty dir given by option <b>allow_pretty_writing_to_this_dir</b>. So <b>allow_pretty_writing_to_this_dir</b>:
once you have written to the COW library's local directory by doing a
footprint save, no github updates will be seen when loading a footprint by <table>
the same name as one for which you've written locally. <tr>
<th>Nickname</th><th>Library Path</th><th>Plugin Type</th><th>Options</th><th>Description</th>
<p> </tr>
Always keep a separate local *.pretty directory for each Github library, <tr>
<td>github</td><td>https://github.com/liftoff-sr/pretty_footprints</td><td>Github</td>
<td></td><td>Liftoff's GH footprints</td>
</tr>
</table>
Below is an fp-lib-table entry with the COW option given. Note the use of the environment variable
${HOME}, as an example only. The github.pretty directory is based in ${HOME}/pretty/. Anytime you
use option allow_pretty_writing_to_this_dir, you will create that directory manually and it must
end in extension <b>.pretty</b>.
<table>
<tr>
<th>Nickname</th><th>Library Path</th><th>Plugin Type</th><th>Options</th><th>Description</th>
</tr>
<tr>
<td>github</td><td>https://github.com/liftoff-sr/pretty_footprints</td><td>Github</td>
<td>allow_pretty_writing_to_this_dir=${HOME}/pretty/github.pretty</td>
<td>Liftoff's GH footprints</td>
</tr>
</table>
<p>Any footprint loads will always give precedence to the local footprints
found in the pretty dir given by option
<b>allow_pretty_writing_to_this_dir</b>. So once you have written to the COW
library's local directory by doing a footprint save, no github updates will
be seen when loading a footprint by the same name as one for which you've
written locally.
<p>Always keep a separate local *.pretty directory for each Github library,
never combine them by referring to the same directory more than once. Also, never combine them by referring to the same directory more than once. Also,
do not also use the same COW (*.pretty) directory in a "Kicad" fp-lib-table do not also use the same COW (*.pretty) directory in a "KiCad" fp-lib-table
entry. This would likely create a mess. The COW directory should be manually entry. This would likely create a mess. The COW directory should be manually
created in advance, and the directory name must end with ".pretty". The value created in advance, and the directory name must end with ".pretty". The value
of the option <b>allow_pretty_writing_to_this_dir</b> will be path of the option <b>allow_pretty_writing_to_this_dir</b> will be path
substituted with any environment variable strings embedded, just like the substituted with any environment variable strings embedded, just like the
"Library Path" is. "Library Path" is.
<p> <p>What's the point of COW? It is to turbo-charge the sharing of footprints.
If you periodically email your COW pretty footprint modifications to the
What's the point of COW? It is to turbo-charge the sharing of footprints. If Github repo maintainer, you can help update the Github copy. Simply email the
you periodically email your COW pretty footprint modifications to the Github individual *.kicad_mod files you find in your COW directories. After you've
repo maintainer, you can help update the Github copy. Simply email the
individual *.kicad_mod file you find in your COW directories. After you've
received confirmation that your changes have been committed up at github.com, received confirmation that your changes have been committed up at github.com,
you can safely delete your COW file(s) and those from github.com will flow you can safely delete your COW file(s) and those from github.com will flow
down. Your goal should be to keep the COW file set as small as possible by down. Your goal should be to keep the COW file set as small as possible by
contributing frequently to the shared master copies at https://github.com. contributing frequently to the shared master copies at https://github.com.
<p> <p>Note that if you use the module editor to delete a footprint and it is
Note that if you use the module editor to delete a footprint and it is
present in the COW local dir, it will get deleted from there. However, it may present in the COW local dir, it will get deleted from there. However, it may
not be deleted from the library as a whole if the footprint of the same name not be deleted from the library as a whole if the footprint of the same name
also exists in the github repo. In this case deleting the local copy will also exists in the github repo. In this case deleting the local copy will
...@@ -112,6 +147,14 @@ struct GH_CACHE; ...@@ -112,6 +147,14 @@ struct GH_CACHE;
remember you cannot modify the github copy except by emailing a COW remember you cannot modify the github copy except by emailing a COW
modification to the repo maintainer. modification to the repo maintainer.
<p>If you happen to be the repo maintainer, then the obvious solution for you
is to make your COW directory <b>be</b> your working copy directory. From
there you can push to github. And you can receive *.kicad_mod files by email
and put them into your local working copy directory also and do diffs,
reverting or denying when appropriate, editing when appropriate before
pushing or denying the change. Ultimately you would owe the sender either a
note of acceptance or denial by email.
@author Dick Hollenbeck @author Dick Hollenbeck
@date Original date: 10-Sep-2013 @date Original date: 10-Sep-2013
......
...@@ -286,11 +286,11 @@ public: ...@@ -286,11 +286,11 @@ public:
* Function FootprintEnumerate * Function FootprintEnumerate
* returns a list of footprint names contained within the library at @a aLibraryPath. * returns a list of footprint names contained within the library at @a aLibraryPath.
* *
* @param aLibraryPath is a locator for the "library", usually a directory * @param aLibraryPath is a locator for the "library", usually a directory, file,
* or file containing several footprints. * or URL containing several footprints.
* *
* @param aProperties is an associative array that can be used to tell the * @param aProperties is an associative array that can be used to tell the
* plugin how to access the library. * plugin anything needed about how to perform with respect to @a aLibraryPath.
* The caller continues to own this object (plugin may not delete it), and * The caller continues to own this object (plugin may not delete it), and
* plugins should expect it to be optionally NULL. * plugins should expect it to be optionally NULL.
* *
...@@ -307,8 +307,8 @@ public: ...@@ -307,8 +307,8 @@ public:
* loads a footprint having @a aFootprintName from the @a aLibraryPath containing * loads a footprint having @a aFootprintName from the @a aLibraryPath containing
* a library format that this PLUGIN knows about. * a library format that this PLUGIN knows about.
* *
* @param aLibraryPath is a locator for the "library", usually a directory * @param aLibraryPath is a locator for the "library", usually a directory, file,
* or file containing several footprints. * or URL containing several footprints.
* *
* @param aFootprintName is the name of the footprint to load. * @param aFootprintName is the name of the footprint to load.
* *
...@@ -331,9 +331,8 @@ public: ...@@ -331,9 +331,8 @@ public:
* will write @a aModule to an existing library located at @a aLibraryPath. * will write @a aModule to an existing library located at @a aLibraryPath.
* If a footprint by the same name already exists, it is replaced. * If a footprint by the same name already exists, it is replaced.
* *
* @param aLibraryPath is a locator for the "library", usually a directory * @param aLibraryPath is a locator for the "library", usually a directory, file,
* or file containing several footprints. This is where the footprint is * or URL containing several footprints.
* to be stored.
* *
* @param aFootprint is what to store in the library. The caller continues * @param aFootprint is what to store in the library. The caller continues
* to own the footprint after this call. * to own the footprint after this call.
...@@ -351,15 +350,15 @@ public: ...@@ -351,15 +350,15 @@ public:
/** /**
* Function FootprintDelete * Function FootprintDelete
* deletes the @a aFootprintName from the library at @a aLibraryPath. * deletes @a aFootprintName from the library at @a aLibraryPath.
* *
* @param aLibraryPath is a locator for the "library", usually a directory * @param aLibraryPath is a locator for the "library", usually a directory, file,
* or file containing several footprints. * or URL containing several footprints.
* *
* @param aFootprintName is the name of a footprint to delete from the specified library. * @param aFootprintName is the name of a footprint to delete from the specified library.
* *
* @param aProperties is an associative array that can be used to tell the * @param aProperties is an associative array that can be used to tell the
* library create function anything special, because it can take any number of * library delete function anything special, because it can take any number of
* additional named tuning arguments that the plugin is known to support. * additional named tuning arguments that the plugin is known to support.
* The caller continues to own this object (plugin may not delete it), and * The caller continues to own this object (plugin may not delete it), and
* plugins should expect it to be optionally NULL. * plugins should expect it to be optionally NULL.
...@@ -375,8 +374,8 @@ public: ...@@ -375,8 +374,8 @@ public:
* error to attempt to create an existing library or to attempt to create * error to attempt to create an existing library or to attempt to create
* on a "read only" location. * on a "read only" location.
* *
* @param aLibraryPath is a locator for the "library", usually a directory * @param aLibraryPath is a locator for the "library", usually a directory, file,
* or file which will contain footprints. * or URL containing several footprints.
* *
* @param aProperties is an associative array that can be used to tell the * @param aProperties is an associative array that can be used to tell the
* library create function anything special, because it can take any number of * library create function anything special, because it can take any number of
...@@ -414,6 +413,9 @@ public: ...@@ -414,6 +413,9 @@ public:
* returns true iff the library at @a aLibraryPath is writable. (Often * returns true iff the library at @a aLibraryPath is writable. (Often
* system libraries are read only because of where they are installed.) * system libraries are read only because of where they are installed.)
* *
* @param aLibraryPath is a locator for the "library", usually a directory, file,
* or URL containing several footprints.
*
* @throw IO_ERROR if no library at aLibraryPath exists. * @throw IO_ERROR if no library at aLibraryPath exists.
*/ */
virtual bool IsFootprintLibWritable( const wxString& aLibraryPath ); virtual bool IsFootprintLibWritable( const wxString& aLibraryPath );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment