From 83239e0d3844d67eed3d109d21f6bd8c3a5adf8c Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 19 Aug 2017 21:09:19 +0300 Subject: Drop: example3.py It would need trickery to work for both py2 and py3, because it uses urlparse. I'd rather have a simpler example and not distract readers with that kind of thing. --- example3.py | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 example3.py diff --git a/example3.py b/example3.py deleted file mode 100644 index e0965da..0000000 --- a/example3.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (C) 2012 Lars Wirzenius -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -'''Example for cliapp framework. - -Demonstrate the compute_setting_values method. - -''' - - -import urlparse - -import cliapp - - -class ExampleApp(cliapp.Application): - - '''A little fgrep-like tool.''' - - def add_settings(self): - self.settings.string(['url'], 'a url') - self.settings.string(['protocol'], 'the protocol') - - def compute_setting_values(self, settings): - if not self.settings['protocol']: - schema = urlparse.urlparse(self.settings['url'])[0] - self.settings['protocol'] = schema - - def process_args(self, args): - return - - -app = ExampleApp() -app.run() -- cgit v1.2.1