Esempio n. 1
0
            # Only recognize lines that begin with an alphabetic letter or number
            if LI[0].isalnum():
                changes_lines.append(LI)

            # These lines are indented
            elif LI.strip(' ') and LI.strip(' ')[0] in ('-', '*', '\t'):
                changes_lines.append(LI.strip(' '))

    if len(changes_lines):
        return changes_lines

    return None


# Version details
new_version = GetInfoValue('VERSION')
dev_version = GetInfoValue('VERSION_dev')
if dev_version.isdigit():
    dev_version = int(dev_version)

    if dev_version:
        new_version = '{}-dev{}'.format(new_version, dev_version)

# Check if we are importing changes from a text file
if len(sys.argv) > 1:
    CHANGES = AddChanges(sys.argv[1])

if CHANGES != None and len(CHANGES):
    for LI in CHANGES:
        l_index = CHANGES.index(LI)
Esempio n. 2
0
# MIT licensing
# See: docs/LICENSE.txt


import os, sys, errno
from scripts_globals import version_files, GetInfoValue


for F in version_files:
	if not os.path.isfile(version_files[F]):
		print('[ERROR] Required file not found: {}'.format(version_files[F]))
		sys.exit(errno.ENOENT)


VERSION = GetInfoValue('VERSION')
VER_MAJ = VERSION.split('.')[0]
VER_MIN = VERSION.split('.')[1]
VER_REL = VERSION.split('.')[2]
VERSION_dev = GetInfoValue('VERSION_dev')


def UpdateSingleLineFile(filename, testline, newvalue=VERSION, suffix=''):
	FILE = open(filename, 'r')
	lines_orig = FILE.read().split('\n')
	FILE.close()

	lines_new = list(lines_orig)

	for l in lines_new:
		l_index = lines_new.index(l)
Esempio n. 3
0
	print('ERROR: Unknown command: {}'.format(cmd))
	sys.exit(1)


FILE_pot = ConcatPaths(DIR_locale, 'debreate.pot')
YEAR = time.strftime('%Y')

# Make sure we are using a clean slate
if os.path.isfile(FILE_pot):
	if not os.access(FILE_pot, os.W_OK):
		print('ERROR: .pot file exists & is not writable: {}'.format(FILE_pot))
		sys.exit(1)

	os.remove(FILE_pot)

PACKAGE = GetInfoValue('NAME')
AUTHOR = GetInfoValue('AUTHOR')
EMAIL = GetInfoValue('EMAIL')
VERSION = GetInfoValue('VERSION')

# Format
gt_language = '--language=Python'
gt_keyword = '--keyword=GT -k'

# Package
gt_author = '--copyright-holder="{}"'.format(AUTHOR)
gt_package = '--package-name={}'.format(PACKAGE.title())
gt_version = '--package-version={}'.format(VERSION)
gt_email = '--msgid-bugs-address={}'.format(EMAIL)

# Output
Esempio n. 4
0
			if LI[0].isalnum():
				changes_lines.append(LI)

			# These lines are indented
			elif LI.strip(' ') and LI.strip(' ')[0] in ('-', '*', '\t'):
				changes_lines.append(LI.strip(' '))

	if len(changes_lines):
		return changes_lines

	return None


# Version details
new_version = GetInfoValue('VERSION')
dev_version = GetInfoValue('VERSION_dev')
if dev_version.isdigit():
	dev_version = int(dev_version)

	if dev_version:
		new_version = '{}-dev{}'.format(new_version, dev_version)


# Check if we are importing changes from a text file
if len(sys.argv) > 1:
	CHANGES = AddChanges(sys.argv[1])

if CHANGES != None and len(CHANGES):
	for LI in CHANGES:
		l_index = CHANGES.index(LI)
Esempio n. 5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# MIT licensing
# See: docs/LICENSE.txt

import os, sys, errno
from scripts_globals import version_files, GetInfoValue

for F in version_files:
    if not os.path.isfile(version_files[F]):
        print('[ERROR] Required file not found: {}'.format(version_files[F]))
        sys.exit(errno.ENOENT)

VERSION = GetInfoValue('VERSION')
VER_MAJ = VERSION.split('.')[0]
VER_MIN = VERSION.split('.')[1]
VER_REL = VERSION.split('.')[2]
VERSION_dev = GetInfoValue('VERSION_dev')


def UpdateSingleLineFile(filename, testline, newvalue=VERSION, suffix=''):
    FILE = open(filename, 'r')
    lines_orig = FILE.read().split('\n')
    FILE.close()

    lines_new = list(lines_orig)

    for l in lines_new:
        l_index = lines_new.index(l)
        if l.strip(' ').startswith(testline):
# See: docs/LICENSE.txt


import os, sys, errno, time

from scripts_globals import GetInfoValue
from scripts_globals import debian_files


# Ubuntu release
DIST = GetInfoValue('DIST')
URGENCY = GetInfoValue('URGENCY')
AUTHOR = GetInfoValue('AUTHOR')
EMAIL = GetInfoValue('EMAIL')

DEV = GetInfoValue('VERSION_dev')

if DEV.isdigit():
	DEV = int(DEV)

else:
	DEV = 0

# Reading source log
if not os.path.isfile(debian_files['changelog']):
	print('ERROR: Source changelog does not exist, can\'t continue: {}'.format(debian_files['changelog']))

	sys.exit(errno.ENOENT)

TEMP = open(debian_files['changelog'], 'r')
changelog_data = TEMP.read().split('\n')
Esempio n. 7
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# MIT licensing
# See: docs/LICENSE.txt

import os, sys, errno, time

from scripts_globals import GetInfoValue
from scripts_globals import debian_files

# Ubuntu release
DIST = GetInfoValue('DIST')
URGENCY = GetInfoValue('URGENCY')
AUTHOR = GetInfoValue('AUTHOR')
EMAIL = GetInfoValue('EMAIL')

DEV = GetInfoValue('VERSION_dev')

if DEV.isdigit():
    DEV = int(DEV)

else:
    DEV = 0

# Reading source log
if not os.path.isfile(debian_files['changelog']):
    print('ERROR: Source changelog does not exist, can\'t continue: {}'.format(
        debian_files['changelog']))

    sys.exit(errno.ENOENT)