Module pisicli
[hide private]
[frames] | no frames]

Module pisicli

source code

Command Line Interface to PISI - one implementation of user interaction

This file is part of Pisi.

This module provides the CLI interface to PISI:

A callback is defined as well, which handles all the output coming from the application core.

Pisi 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 3 of the License, or (at your option) any later version.

Pisi 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 Pisi. If not, see <http://www.gnu.org/licenses/>.

Classes [hide private]
  CLICallback
Command Line Interface to PISI
Functions [hide private]
 
testConfiguration()
Checks, whether configuration can be loaded from PISI core.
source code
 
startCLI()
Controls the major flow for PISI (CLI)
source code
 
parseArguments()
Parses command line arguments
source code
 
usage()
Prints a help text to the console
source code
 
list_configurations()
Prints available configurations for data sources
source code
Variables [hide private]
  ACTIONID_ADD = 0
  ACTIONID_DELETE = 1
  ACTIONID_MODIFY = 2
  CONSOLE_PROGRESSBAR_WIDTH = 80
  FILEDOWNLOAD_TIMEOUT = 10
  FILEDOWNLOAD_TMPFILE = '/tmp/pisi-remotebuffer.data'
  FILEPATH_COPYING = '/opt/pisi/COPYING'
  GOOGLE_CALENDAR_APPNAME = 'pisi0.5'
  GOOGLE_CALENDAR_MAXRESULTS = 1000
  GOOGLE_CONTACTS_APPNAME = 'pisi0.5'
  GOOGLE_CONTACTS_MAXRESULTS = 1000
  ICS_BYTES_PER_ENTRY = 200
  MERGEMODE_FLUSH_A = 1
  MERGEMODE_FLUSH_B = 2
  MERGEMODE_MANUALCONFIRM = 5
  MERGEMODE_OVERWRITE_A = 3
  MERGEMODE_OVERWRITE_B = 4
  MERGEMODE_SKIP = 0
  MERGEMODE_STRINGS = ['Skip', 'Flush source 1', 'Flush source 2...
  MODE_CALENDAR = 0
  MODE_CONTACTS = 1
  MODE_STRINGS = ['calendar', 'contacts']
  PISI_AUTHORS = ['Esben Damgaard', 'Michael Pilgermann']
  PISI_COMMENTS = 'PISI is synchronizing information'
  PISI_DOCUMENTERS = ['Michael Pilgermann']
  PISI_HOMEPAGE = 'http://freshmeat.net/projects/pisiom'
  PISI_NAME = 'PISI'
  PISI_TRANSLATOR_CREDITS = None
  PISI_VERSION = '0.5'
  VCF_BYTES_PER_ENTRY = 200
  __package__ = None
Function Details [hide private]

testConfiguration()

source code 

Checks, whether configuration can be loaded from PISI core.

If not possible, an error message is printed and False will be returned.

Returns:
False, if an Error occurs when loading the configration from core; otherwise True

startCLI()

source code 

Controls the major flow for PISI (CLI)

Calls one after another the supporting functions in this module.

parseArguments()

source code 

Parses command line arguments

All information from the command line arguments are returned by this function. If the number of arguments given is not valid, a help text is printed on the console by calling function usage.

usage()

source code 

Prints a help text to the console

The application is shut down afterwards.

list_configurations()

source code 

Prints available configurations for data sources

Parses the configuration file for PISI and prints all available data sources to the console.


Variables Details [hide private]

MERGEMODE_STRINGS

Value:
['Skip',
 'Flush source 1',
 'Flush source 2',
 'Overwrite entry in source 1',
 'Overwrite entry in source 2',
 'Manual confirmation']