sforkowany z mirror/rnsutils
1
0
Forkuj 0

Add -v/--version support on CLIs

master
Olivier Jolly 2016-02-05 00:33:11 +01:00
rodzic 25358be8ae
commit 8a1719b35f
6 zmienionych plików z 22 dodań i 17 usunięć

Wyświetl plik

@ -70,10 +70,10 @@ class Sf2ToXrni(object):
renoise_modulation_set.Devices.SampleAhdsrModulationDevice.Hold.Value = self.to_renoise_time(
sf2_bag.volume_envelope_hold) or default_modulation_set.ahdsr_hold
renoise_modulation_set.Devices.SampleAhdsrModulationDevice.Sustain.Value = (
sf2_bag.volume_envelope_sustain is not None and (
max(0,
1 - sf2_bag.volume_envelope_sustain / 96.))) or default_modulation_set.ahdsr_sustain
renoise_modulation_set.Devices.SampleAhdsrModulationDevice.Sustain.Value = \
(sf2_bag.volume_envelope_sustain is not None and (
max(0,
1 - sf2_bag.volume_envelope_sustain / 96.))) or default_modulation_set.ahdsr_sustain
renoise_modulation_set.Devices.SampleAhdsrModulationDevice.Release.Value = self.to_renoise_time(
sf2_bag.volume_envelope_release) or default_modulation_set.ahdsr_release
@ -218,10 +218,10 @@ class Sf2ToXrni(object):
def main(argv=None):
program_name = os.path.basename(sys.argv[0])
program_version = "v0.6"
program_version = "v0.8"
program_build_date = "%s" % __updated__
program_version_string = '%%prog %s (%s)' % (program_version, program_build_date)
program_version_string = 'sf2toxrni %s (%s)' % (program_version, program_build_date)
program_longdesc = '''Convert sf2 file into renoise instrument'''
program_license = "GPL v3+ 2016 Olivier Jolly"
@ -247,6 +247,7 @@ def main(argv=None):
help="output directory [default: current directory]")
parser.add_argument("-t", dest="template", help="template filename [default: %(default)s]",
default="empty-31.xrni")
parser.add_argument("-v", "--version", action="version", version=program_version_string)
parser.add_argument("sf2_filename", help="input file in SoundFont2 format", nargs="+")

Wyświetl plik

@ -267,10 +267,10 @@ class SfzToXrni(object):
def main(argv=None):
program_name = os.path.basename(sys.argv[0])
program_version = "v0.6"
program_version = "v0.8"
program_build_date = "%s" % __updated__
program_version_string = '%%prog %s (%s)' % (program_version, program_build_date)
program_version_string = 'sfztoxrni %s (%s)' % (program_version, program_build_date)
program_longdesc = '''Convert SFZ file into renoise instrument'''
program_license = "GPL v3+ 2016 Olivier Jolly"
@ -296,6 +296,7 @@ def main(argv=None):
parser.add_argument("-u", "--unused", dest="show_unused", action="store_true", default=True,
help="show unused generators [default: %(default)s]")
parser.add_argument("--no-unused", dest="show_unused", action="store_false")
parser.add_argument("-v", "--version", action="version", version=program_version_string)
parser.add_argument("sfz_filename", help="input file in SFZ format", nargs="+")

Wyświetl plik

@ -39,7 +39,7 @@ def main(argv=None):
program_version = "v0.8"
program_build_date = "%s" % __updated__
program_version_string = '%%prog %s (%s)' % (program_version, program_build_date)
program_version_string = 'xrnicomment %s (%s)' % (program_version, program_build_date)
program_longdesc = '''Display or change XRNI comments'''
program_license = "GPL v3+ 2016 Olivier Jolly"
@ -60,8 +60,7 @@ def main(argv=None):
help="edit message content [default reads from standard input]")
parser.add_argument("-r", "--remove", dest="action", action="store_const", const=ACTION_DELETE,
help="remove comment")
parser.add_argument("-v", "--view", dest="action", action="store_const", const=ACTION_VIEW,
help="view comment [default action]")
parser.add_argument("-v", "--version", action="version", version=program_version_string)
parser.add_argument("xrni_filename", help="input file in XRNI format", nargs="+")

Wyświetl plik

@ -61,7 +61,7 @@ def main(argv=None):
program_version = "v0.8"
program_build_date = "%s" % __updated__
program_version_string = '%%prog %s (%s)' % (program_version, program_build_date)
program_version_string = 'xrniorganise %s (%s)' % (program_version, program_build_date)
program_longdesc = '''Organise XRNI according to their tags'''
program_license = "GPL v3+ 2016 Olivier Jolly"
@ -81,6 +81,7 @@ def main(argv=None):
parser.add_argument("-r", "--recursive", dest="recurse_dir", action="store_true", default=False,
help="recursively parse directories [default: %(default)s]")
parser.add_argument("-o", "--ouput-dir", dest="output_dir", help="output directory", required=True)
parser.add_argument("-v", "--version", action="version", version=program_version_string)
parser.add_argument("xrni_filename", help="input file in XRNI format", nargs="+")

Wyświetl plik

@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""CLI for reencoding XRNI files"""
from __future__ import print_function
import argparse
@ -31,11 +33,12 @@ __author__ = 'olivier@pcedev.com'
def main(argv=None):
"""CLI entry point for reencoding XRNI files"""
program_name = os.path.basename(sys.argv[0])
program_version = "v0.6"
program_build_date = "%s" % __updated__
program_version_string = '%%prog %s (%s)' % (program_version, program_build_date)
program_version_string = 'xrnireencode %s (%s)' % (program_version, program_build_date)
program_longdesc = '''Reencode samples in renoise instrument'''
program_license = "GPL v3+ 2016 Olivier Jolly"
@ -54,6 +57,7 @@ def main(argv=None):
help="quiet operation [default: %(default)s]")
parser.add_argument("-o", "--ouput-dir", dest="output_dir",
help="output directory [default: current directory]")
parser.add_argument("-v", "--version", action="version", version=program_version_string)
parser.add_argument("xrni_filename", help="input file in XRNI format", nargs="+")

Wyświetl plik

@ -40,7 +40,7 @@ def main(argv=None):
program_version = "v0.8"
program_build_date = "%s" % __updated__
program_version_string = '%%prog %s (%s)' % (program_version, program_build_date)
program_version_string = 'xrnitag %s (%s)' % (program_version, program_build_date)
program_longdesc = '''Display or change XRNI tags'''
program_license = "GPL v3+ 2016 Olivier Jolly"
@ -55,10 +55,9 @@ def main(argv=None):
help="debug parsing [default: %(default)s]")
parser.add_argument("-a", "--add", dest="tags_to_add", action="append", help="add a tag")
parser.add_argument("-c", "--clear", dest="action", action="store_const", const=ACTION_CLEAR,
help="clear all tags")
default=ACTION_VIEW, help="clear all tags")
parser.add_argument("-r", "--remove", dest="tags_to_remove", action="append", help="remove a tag")
parser.add_argument("-v", "--view", dest="action", action="store_const", const=ACTION_VIEW,
help="view all tags [default action]")
parser.add_argument("-v", "--version", action="version", version=program_version_string)
parser.add_argument("xrni_filename", help="input file in XRNI format", nargs="+")