View source with raw comments or as raw
    1/* le_swish: a prolog module for LE handling of the gitty filesystem.
    2
    3   http://www.apache.org/licenses/LICENSE-2.0
    4
    5Unless required by applicable law or agreed to in writing, software
    6distributed under the License is distributed on an "AS IS" BASIS,
    7WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    8See the License for the specific language governing permissions and
    9limitations under the License.
   10
   11*/
   12
   13:- module(le_swish, 
   14    [load_file_module/3, 
   15     this_capsule/1,
   16     portray_clause_ind/1,
   17     update_file/3, 
   18     myDeclaredModule/1
   19    ]).   20
   21:- use_module(library(pengines_sandbox)). 
   22
   23:- multifile sandbox:safe_primitive/1.   24
   25:- use_module(library(pengines)).   26:- use_module(kp_loader).   27:- use_module(api). 
   28
   29load_file_module(FileName, ModuleName, Flag) :-
   30   load_named_file(FileName, ModuleName, Flag). % in kp_loader
   31
   32this_capsule(M) :-
   33   %le_program_module(M). 
   34   pengine_self(M), !.
   35
   36%this_capsule(user).
   37
   38portray_clause_ind(Clause) :- 
   39   portray_clause(Clause). 
   40
   41update_file(NewFileName, URL, String) :-
   42   catch(update_gitty_file(NewFileName, URL, String), Ex, print_message(warning,"Could not update_gitty_file: ~w"-[Ex])). 
   43   %update_gitty_file(NewFileName, URL, String). 
   44
   45sandbox:safe_primitive(prolog_listing:portray_clause(_)).
   46%sandbox:safe_primitive(write(_)). 
   47%sandbox:safe_primitive(writeq(_)).