Esempio n. 1
0
    def setupOptionParser(self, parser):
        Application.setupOptionParser(self, parser)

        parser.add_option("-n",
                          "--noaction",
                          help="no action, just say what to do",
                          action="store_true",
                          dest="noaction",
                          default=False)

        parser.add_option("-u",
                          "--unsafely",
                          help="skip safety loop",
                          action="store_false",
                          dest="safely",
                          default=True)

        parser.add_option("-r",
                          "--recurse",
                          help="recurse into subdirs",
                          action="store_true",
                          dest="recurse",
                          default=False)

        parser.add_option("-i",
                          "--ignore",
                          help="ignore files that match the pattern",
                          action="append",
                          type="string",
                          dest="ignore")
Esempio n. 2
0
def getMainSession():
    #global _main
    if _main is None:
        from lino.console.application import Application
        a = Application()
        a.main()
    return _main
Esempio n. 3
0
    def __init__(self,
                 geometryOptions=None,
                 documentOptions=None,
                 songnames=None,
                 **kw):
        
        Application.__init__(self)
        
        if geometryOptions is None: geometryOptions={}
        if documentOptions is None: documentOptions={}
        self.documentOptions=DocumentOptions(**documentOptions)
        self.geometryOptions=GeometryOptions(**geometryOptions)
        self.songCounter=0
        self.songs = []
        
        
        MyOptionDict.__init__(self,**kw)
        
        assert self.output_dir is not None

        if self.filename is None:
            basename,ext = os.path.splitext(sys.argv[0])
            self.update(filename=basename)
        
        if songnames is not None:
            self.loadsongs(songnames)
Esempio n. 4
0
    def setupOptionParser(self,parser):
        Application.setupOptionParser(self,parser)
    
        parser.add_option("-o", "--output",
                          help="""\
write to OUTFILE rather than FILE.pdf""",
                          action="store",
                          type="string",
                          dest="outFile",
                          default=None)
    
        parser.add_option("-e", "--encoding",
                          help="""\
FILE is encoded using ENCODING instead of sys.stdin.encoding.""",
                          action="store",
                          type="string",
                          dest="encoding",
                          default=sys.stdin.encoding)
        parser.add_option("--fontName",
                          help="""\
use the named font. Default is "Courier". Alternatives are "LucidaSansTypewriter".""",
                          action="store",
                          type="string",
                          dest="fontName",
                          default="Courier")

        parser.add_option("-s", "--fontSize",
                          help="use FONTSIZE characters per inch as default font size.",
                          action="store",
                          type="int",
                          dest="fontSize",
                          default=12)
Esempio n. 5
0
    def setupOptionParser(self,parser):
        Application.setupOptionParser(self,parser)

        parser.add_option(
            "-s", "--simulate",
            help="simulate only, don't do it",
            action="store_true",
            dest="simulate",
            default=False)

        parser.add_option(
            "-d", "--timediff",
            help="correct EXIF time by adding TIMEDIFF minutes",
            action="store", type="int",
            dest="timediff",
            default=0)
        
        parser.add_option(
            "-f", "--format",
            help="format template for new filename (1=YYYY_MM_DD-hh_mm_ss,2=YYYMMDD-SEQ,...)",
            action="store", type="int",
            dest="format",
            default=3)
        
        parser.add_option(
            "--suffix",
            help="add SUFFIX to each filename",
            action="store", type="string",
            dest="suffix",
            default="")
Esempio n. 6
0
    def setupOptionParser(self, parser):
        Application.setupOptionParser(self, parser)

        parser.add_option("-s",
                          "--simulate",
                          help="simulate only, don't do it",
                          action="store_true",
                          dest="simulate",
                          default=False)

        parser.add_option("-d",
                          "--timediff",
                          help="correct EXIF time by adding TIMEDIFF minutes",
                          action="store",
                          type="int",
                          dest="timediff",
                          default=0)

        parser.add_option(
            "-f",
            "--format",
            help=
            "format template for new filename (1=YYYY_MM_DD-hh_mm_ss,2=YYYMMDD-SEQ,...)",
            action="store",
            type="int",
            dest="format",
            default=3)

        parser.add_option("--suffix",
                          help="add SUFFIX to each filename",
                          action="store",
                          type="string",
                          dest="suffix",
                          default="")
Esempio n. 7
0
def getMainSession():
    #global _main
    if _main is None:
        from lino.console.application import Application
        a=Application()
        a.main()
    return _main
Esempio n. 8
0
    def setupOptionParser(self,parser):
        Application.setupOptionParser(self,parser)

        parser.add_option(
            "-n", "--noaction",
            help="no action, just say what to do",
            action="store_true",
            dest="noaction",
            default=False)
        
        parser.add_option(
            "-u", "--unsafely",
            help="skip safety loop",
            action="store_false",
            dest="safely",
            default=True)
        
        parser.add_option(
            "-r", "--recurse",
            help="recurse into subdirs",
            action="store_true",
            dest="recurse",
            default=False)

        parser.add_option(
            "-i", "--ignore",
            help="ignore files that match the pattern",
            action="append",
            type="string",
            dest="ignore")
Esempio n. 9
0
    def setupOptionParser(self,parser):
        Application.setupOptionParser(self,parser)
    
        parser.add_option("-m", "--make",
                          help="""\
make only this type of files (midi or pdf)""",
                          action="store",
                          type="string",
                          dest="make",
                          default="midi,pdf")
Esempio n. 10
0
    def setupOptionParser(self,parser):
        Application.setupOptionParser(self,parser)
    
        parser.add_option("-o", "--output",
                          help="""\
write to OUTFILE rather than FILE.pdf""",
                          action="store",
                          type="string",
                          dest="outFile",
                          default=None)
Esempio n. 11
0
    def setupOptionParser(self, parser):
        Application.setupOptionParser(self, parser)

        parser.add_option("-p",
                          "--printer",
                          help="""\
print on PRINTERNAME rather than on Default Printer.""",
                          action="store",
                          type="string",
                          dest="printerName",
                          default=None)

        parser.add_option("-e",
                          "--encoding",
                          help="""\
FILE is encoded using ENCODING rather than sys.stdin.encoding.""",
                          action="store",
                          type="string",
                          dest="encoding",
                          default=sys.stdin.encoding)

        parser.add_option("-c",
                          "--copies",
                          help="""\
print NUM copies.""",
                          action="store",
                          type="int",
                          dest="copies",
                          default=1)

        parser.add_option("--fontName",
                          help="""\
Name of font to be used. This sould be a fixed-pitch font. 
Default is "Courier New".""",
                          action="store",
                          type="string",
                          dest="fontName")

        parser.add_option("-o",
                          "--output",
                          help="""\
write to SPOOLFILE instead of really printing.""",
                          action="store",
                          type="string",
                          dest="spoolFile",
                          default=None)

        parser.add_option(
            "-s",
            "--fontSize",
            help="use FONTSIZE characters per inch as default font size.",
            action="store",
            type="int",
            dest="fontSize",
            default=12)
Esempio n. 12
0
    def setupOptionParser(self, parser):
        Application.setupOptionParser(self, parser)

        parser.add_option("-o",
                          "--output",
                          help="""\
write to OUTFILE rather than FILE.pdf""",
                          action="store",
                          type="string",
                          dest="outFile",
                          default=None)
Esempio n. 13
0
    def setupConfigParser(self, parser):

        parser.add_option("fontWeights",
                          help="""\
a tuple of fontweight values expressing the boldnesses of 
normal and bold text.
Default is (400,700). Another reasonable value is (600,800).
""",
                          dest="fontWeights",
                          default=None,
                          metavar="(NORMAL,BOLD)")

        Application.setupConfigParser(self, parser)
Esempio n. 14
0
    def setupConfigParser(self,parser):
        
        parser.add_option("fontWeights",
                          help="""\
a tuple of fontweight values expressing the boldnesses of 
normal and bold text.
Default is (400,700). Another reasonable value is (600,800).
""",
                          dest="fontWeights",
                          default=None,
                          metavar="(NORMAL,BOLD)")

        Application.setupConfigParser(self,parser)
Esempio n. 15
0
    def setupOptionParser(self,parser):
        Application.setupOptionParser(self,parser)
    
        parser.add_option("-p", "--printer",
                          help="""\
print on PRINTERNAME rather than on Default Printer.""",
                          action="store",
                          type="string",
                          dest="printerName",
                          default=None)
    
        parser.add_option("-e", "--encoding",
                          help="""\
FILE is encoded using ENCODING rather than sys.stdin.encoding.""",
                          action="store",
                          type="string",
                          dest="encoding",
                          default=sys.stdin.encoding)
    
        parser.add_option("-c", "--copies",
                          help="""\
print NUM copies.""",
                          action="store",
                          type="int",
                          dest="copies",
                          default=1)
    
        parser.add_option("--fontName",
                          help="""\
Name of font to be used. This sould be a fixed-pitch font. 
Default is "Courier New".""",
                          action="store",
                          type="string",
                          dest="fontName")

        parser.add_option("-o", "--output",
                          help="""\
write to SPOOLFILE instead of really printing.""",
                          action="store",
                          type="string",
                          dest="spoolFile",
                          default=None)
        
        parser.add_option("-s", "--fontSize",
                          help="use FONTSIZE characters per inch as default font size.",
                          action="store",
                          type="int",
                          dest="fontSize",
                          default=12)
Esempio n. 16
0
    def setupOptionParser(self,parser):
        Application.setupOptionParser(self,parser)
    
        parser.add_option("-p", "--printer",
                          help="""\
print on PRINTERNAME rather than on Default Printer.""",
                          action="store",
                          type="string",
                          dest="printerName",
                          default=None)
    
        parser.add_option("-c", "--copies",
                          help="""\
print NUM copies.""",
                          action="store",
                          type="int",
                          dest="copies",
                          default=1)
Esempio n. 17
0
    def setupOptionParser(self, parser):
        Application.setupOptionParser(self, parser)

        parser.add_option("-p",
                          "--printer",
                          help="""\
print on PRINTERNAME rather than on Default Printer.""",
                          action="store",
                          type="string",
                          dest="printerName",
                          default=None)

        parser.add_option("-c",
                          "--copies",
                          help="""\
print NUM copies.""",
                          action="store",
                          type="int",
                          dest="copies",
                          default=1)
Esempio n. 18
0
    def setupOptionParser(self, parser):
        Application.setupOptionParser(self, parser)

        parser.add_option("-o",
                          "--output",
                          help="""\
write to OUTFILE rather than FILE.pdf""",
                          action="store",
                          type="string",
                          dest="outFile",
                          default=None)

        parser.add_option("-e",
                          "--encoding",
                          help="""\
FILE is encoded using ENCODING instead of sys.stdin.encoding.""",
                          action="store",
                          type="string",
                          dest="encoding",
                          default=sys.stdin.encoding)
        parser.add_option("--fontName",
                          help="""\
use the named font. Default is "Courier". Alternatives are "LucidaSansTypewriter".""",
                          action="store",
                          type="string",
                          dest="fontName",
                          default="Courier")

        parser.add_option(
            "-s",
            "--fontSize",
            help="use FONTSIZE characters per inch as default font size.",
            action="store",
            type="int",
            dest="fontSize",
            default=12)
Esempio n. 19
0
    def setupOptionParser(self, parser):
        # self.attach_files = []
        Application.setupOptionParser(self, parser)

        parser.add_option(
            "-s",
            "--subject",
            help="the Subjet: line of the mail",
            action="store",
            type="string",
            dest="subject",
            default=None,
        )

        ##         parser.add_option("-a", "--attach",
        ##                           help="add the specified FILE to the mail as attachment",
        ##                           action="callback",
        ##                           callback=self.attachfile,
        ##                           type="string",
        ##                           default=None)

        parser.add_option(
            "-f",
            "--from",
            help="the From: line (sender) of the mail",
            action="store",
            type="string",
            dest="sender",
            default=None,
        )

        parser.add_option(
            "-t",
            "--to",
            help="""
The To: line (recipient) of the mail.
Taken from addrlist.txt if not given.
""",
            action="store",
            type="string",
            dest="recipient",
            default=None,
        )

        parser.add_option(
            "-r", "--host", help="the SMTP relay host", action="store", type="string", dest="host", default=None
        )

        parser.add_option(
            "-u",
            "--user",
            help="the username for the SMTP host",
            action="store",
            type="string",
            dest="user",
            default=None,
        )

        parser.add_option(
            "-p",
            "--password",
            help="the password for the SMTP host",
            action="store",
            type="string",
            dest="password",
            default=None,
        )
        parser.add_option(
            "-e",
            "--encoding",
            help="the encoding of the .eml input file",
            action="store",
            type="string",
            dest="encoding",
            default=None,
        )
Esempio n. 20
0
    def setupOptionParser(self, parser):
        #self.attach_files = []
        Application.setupOptionParser(self, parser)

        parser.add_option("-s",
                          "--subject",
                          help="the Subjet: line of the mail",
                          action="store",
                          type="string",
                          dest="subject",
                          default=None)

        ##         parser.add_option("-a", "--attach",
        ##                           help="add the specified FILE to the mail as attachment",
        ##                           action="callback",
        ##                           callback=self.attachfile,
        ##                           type="string",
        ##                           default=None)

        parser.add_option("-f",
                          "--from",
                          help="the From: line (sender) of the mail",
                          action="store",
                          type="string",
                          dest="sender",
                          default=None)

        parser.add_option("-t",
                          "--to",
                          help="""
The To: line (recipient) of the mail.
Taken from addrlist.txt if not given.
""",
                          action="store",
                          type="string",
                          dest="recipient",
                          default=None)

        parser.add_option("-r",
                          "--host",
                          help="the SMTP relay host",
                          action="store",
                          type="string",
                          dest="host",
                          default=None)

        parser.add_option("-u",
                          "--user",
                          help="the username for the SMTP host",
                          action="store",
                          type="string",
                          dest="user",
                          default=None)

        parser.add_option("-p",
                          "--password",
                          help="the password for the SMTP host",
                          action="store",
                          type="string",
                          dest="password",
                          default=None)
        parser.add_option("-e",
                          "--encoding",
                          help="the encoding of the .eml input file",
                          action="store",
                          type="string",
                          dest="encoding",
                          default=None)