rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
'access_acl': "%s,g:%s:r-x,g:www-data:--x,%s" % (acl_base,
'access_acl': "%s,g:%s:r-x,g:www-data:--x,%s" % ( acl_base,
def check_user(user, minimal = minimal, batch = batch, auto_answer = auto_answer):
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
logging.progress("Checking user home dir %s contents, this can take a while..." % styles.stylize(
logging.progress("Checking user home dir %s contents," " this can take a while..." % styles.stylize(
def check_user(user, minimal = minimal, batch = batch, auto_answer = auto_answer):
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
[ home_dir_info ], batch, auto_answer, UsersController.groups, self)
[ home_dir_info ], batch, auto_answer, UsersController.groups, self)
def check_user(user, minimal = minimal, batch = batch, auto_answer = auto_answer):
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
logging.warning("User home dir %s is missing, please repair this first." % styles.stylize(
logging.warning("User home dir %s is missing," " please repair this first." % styles.stylize(
def check_user(user, minimal = minimal, batch = batch, auto_answer = auto_answer):
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
special_dirs, batch, auto_answer, UsersController.groups, self)
special_dirs, batch, auto_answer, UsersController.groups, self)
def check_user(user, minimal = minimal, batch = batch, auto_answer = auto_answer):
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
logging.warning("Extended checks are not yet implemented for users.")
logging.warning( "Extended checks are not yet implemented for users.")
def check_user(user, minimal = minimal, batch = batch, auto_answer = auto_answer):
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
raise exceptions.LicornCheckError("Some user(s) check(s) didn't pass, or weren't corrected.")
raise exceptions.LicornCheckError( "Some user(s) check(s) didn't pass, or weren't corrected.")
def check_user(user, minimal = minimal, batch = batch, auto_answer = auto_answer):
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
raise exceptions.BadArgumentError("You must specify an UID or a login to test existence of.")
raise exceptions.BadArgumentError( "You must specify an UID or a login to test existence of.")
def user_exists(uid = None, login = None): if uid: return UsersController.users.has_key(uid) if login: return UsersController.login_cache.has_key(login)
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
logging.warning("You passed an uid to login_to_uid(): %d (guess its login is « %s » )." % (login, UsersController.users[login]['login']))
logging.warning("You passed an uid to login_to_uid():" " %d (guess its login is « %s » )." % ( login, UsersController.users[login]['login']))
def login_to_uid(login): """ Return the uid of the user 'login' """ try: # use the cache, Luke ! return UsersController.login_cache[login] except KeyError: try: int(login) logging.warning("You passed an uid to login_to_uid(): %d (guess its login is « %s » )." % (login, UsersController.users[login]['login'])) except ValueError: pass raise exceptions.LicornRuntimeException(logging.SYSU_USER_DOESNT_EXIST % login)
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
raise exceptions.LicornRuntimeException(logging.SYSU_USER_DOESNT_EXIST % login)
raise exceptions.LicornRuntimeException( logging.SYSU_USER_DOESNT_EXIST % login)
def login_to_uid(login): """ Return the uid of the user 'login' """ try: # use the cache, Luke ! return UsersController.login_cache[login] except KeyError: try: int(login) logging.warning("You passed an uid to login_to_uid(): %d (guess its login is « %s » )." % (login, UsersController.users[login]['login'])) except ValueError: pass raise exceptions.LicornRuntimeException(logging.SYSU_USER_DOESNT_EXIST % login)
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
return uid < UsersController.configuration.users.uid_min or uid > UsersController.configuration.users.uid_max
return uid < UsersController.configuration.users.uid_min or \ uid > UsersController.configuration.users.uid_max
def is_system_uid(uid): """ Return true if uid is system.""" return uid < UsersController.configuration.users.uid_min or uid > UsersController.configuration.users.uid_max
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
return UsersController.is_system_uid(UsersController.login_cache[login])
return UsersController.is_system_uid( UsersController.login_cache[login])
def is_system_login(login): """ return true if login is system. """ try: return UsersController.is_system_uid(UsersController.login_cache[login]) except KeyError: raise exceptions.LicornRuntimeException(logging.SYSU_USER_DOESNT_EXIST % login)
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
raise exceptions.LicornRuntimeException(logging.SYSU_USER_DOESNT_EXIST % login)
raise exceptions.LicornRuntimeException( logging.SYSU_USER_DOESNT_EXIST % login)
def is_system_login(login): """ return true if login is system. """ try: return UsersController.is_system_uid(UsersController.login_cache[login]) except KeyError: raise exceptions.LicornRuntimeException(logging.SYSU_USER_DOESNT_EXIST % login)
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
login = hlstr.validate_name(str(firstname + '.' + lastname), maxlenght = UsersController.configuration.users.login_maxlenght)
login = hlstr.validate_name(str(firstname + '.' + lastname), maxlenght = UsersController.configuration.users.login_maxlenght)
def make_login(lastname = "", firstname = "", inputlogin = ""): """ Make a valid login from user's firstname and lastname."""
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
login = hlstr.validate_name(str(inputlogin), maxlenght = UsersController.configuration.users.login_maxlenght)
login = hlstr.validate_name(str(inputlogin), maxlenght = UsersController.configuration.users.login_maxlenght)
def make_login(lastname = "", firstname = "", inputlogin = ""): """ Make a valid login from user's firstname and lastname."""
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
raise exceptions.LicornRuntimeError("Can't build a valid login (got %s, which doesn't verify %s) with the firstname/lastname you provided (%s %s)." % (login, hlstr.regex['login'], firstname, lastname) )
raise exceptions.LicornRuntimeError( "Can't build a valid login (got %s, which doesn't verify %s)" " with the firstname/lastname you provided (%s %s)." % ( login, hlstr.regex['login'], firstname, lastname) )
def make_login(lastname = "", firstname = "", inputlogin = ""): """ Make a valid login from user's firstname and lastname."""
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
raise exceptions.BadArgumentError("You must specify an UID or a login to get primary_group of.")
raise exceptions.BadArgumentError( "You must specify an UID or a login to get primary_group of.")
def primary_group(login = None, uid = None): if login: return UsersController.users[UsersController.login_cache[login]]['primary_group'] if uid: return UsersController.users[uid]['primary_group']
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
socket.gethostbyaddr(self.server.server_address[0])[0], wmi_port, retdata))
hostaddr, wmi_port, retdata))
def serve_virtual_uri(self): """ Serve dynamic URIs with our own code, and create pages on the fly. """
8a7aea775d17319b66b0ba784a15b1460a34e424 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/8a7aea775d17319b66b0ba784a15b1460a34e424/wmi.py
def strip_dates(str):
def strip_moving_data(str):
def strip_dates(str): """ strip dates from warnings and traces, else outputs and references always compare false .""" return re.sub(r'(\.\d\d\d\d\d\d\d\d-\d\d\d\d\d\d|\s\[\d\d\d\d/\d\d/\d\d\s\d\d:\d\d:\d\d\.\d\d\d\d\]\s)', r' [D/T] ', str)
df7f2fc19ff24093cc1abc91e8666ec3ecb2090a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/df7f2fc19ff24093cc1abc91e8666ec3ecb2090a/core.py
r' [D/T] ', str)
r' [D/T] ',re.sub(r'Autogenerated\spassword\sfor\suser\s(.*):\s.*', r'Autogenerated password for user \1: [Password]', str))
def strip_dates(str): """ strip dates from warnings and traces, else outputs and references always compare false .""" return re.sub(r'(\.\d\d\d\d\d\d\d\d-\d\d\d\d\d\d|\s\[\d\d\d\d/\d\d/\d\d\s\d\d:\d\d:\d\d\.\d\d\d\d\]\s)', r' [D/T] ', str)
df7f2fc19ff24093cc1abc91e8666ec3ecb2090a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/df7f2fc19ff24093cc1abc91e8666ec3ecb2090a/core.py
strip_dates(output))
strip_moving_data(output))
def SaveOutput(self, cmdnum, output, code):
df7f2fc19ff24093cc1abc91e8666ec3ecb2090a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/df7f2fc19ff24093cc1abc91e8666ec3ecb2090a/core.py
output = strip_dates(output)
output = strip_moving_data(output)
def RunCommand(self, cmdnum, batch=False):
df7f2fc19ff24093cc1abc91e8666ec3ecb2090a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/df7f2fc19ff24093cc1abc91e8666ec3ecb2090a/core.py
def RunCommand(self, cmdnum, batch=False):
df7f2fc19ff24093cc1abc91e8666ec3ecb2090a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/df7f2fc19ff24093cc1abc91e8666ec3ecb2090a/core.py
strip_dates(output),
strip_moving_data(output),
def RunCommand(self, cmdnum, batch=False):
df7f2fc19ff24093cc1abc91e8666ec3ecb2090a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/df7f2fc19ff24093cc1abc91e8666ec3ecb2090a/core.py
return (strip_dates(output), retcode)
return (strip_moving_data(output), retcode)
def RunCommand(self, cmdnum, batch=False):
df7f2fc19ff24093cc1abc91e8666ec3ecb2090a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/df7f2fc19ff24093cc1abc91e8666ec3ecb2090a/core.py
file = gzip.GzipFile( filename='%s/%s/out.txt.gz' % (self.base_path, cmdnum), mode='wb', compresslevel=9)
try: os.unlink(filename_txt) except (OSError, IOError), e: if e.errno != 2: raise e file = gzip.GzipFile(filename=filename_gz, mode='wb', compresslevel=9)
def SaveOutput(self, cmdnum, output, code):
4a39be2a839d5859b17f80ac690543414526444a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/4a39be2a839d5859b17f80ac690543414526444a/core.py
file = open('%s/%s/out.txt' % (self.base_path, cmdnum), 'w')
try: os.unlink(filename_gz) except (OSError, IOError), e: if e.errno != 2: raise e file = open(filename_txt, 'w')
def SaveOutput(self, cmdnum, output, code):
4a39be2a839d5859b17f80ac690543414526444a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/4a39be2a839d5859b17f80ac690543414526444a/core.py
ref_code = int(open( '%s/%s/code.txt' % (self.base_path, cmdnum)).read())
ref_code = int( open('%s/%s/code.txt' % (self.base_path, cmdnum)).read() )
def RunCommand(self, cmdnum, batch=False):
4a39be2a839d5859b17f80ac690543414526444a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/4a39be2a839d5859b17f80ac690543414526444a/core.py
for login in opts.login.split(','):
for login in opts.login.split(',') if opts.login != None else [ None ]:
def add_user(opts, args): """ Add a user account on the system. """ configuration = LicornConfiguration() users = UsersController(configuration) groups = GroupsController(configuration, users) if opts.profile: profiles = ProfilesController(configuration, groups, users) if opts.firstname is None: firstname = None else: firstname = unicode(opts.firstname) if opts.lastname is None: lastname = None else: lastname = unicode(opts.lastname) if opts.gecos is None: gecos = None else: gecos = unicode(opts.gecos) if opts.password is None: password = None else: password = unicode(opts.password) if opts.primary_gid: # if the opts.primary_gid is not an existing GID, try to guess if it is # an existing group name, and then convert it to a GID. if not groups.has_key(opts.primary_gid): opts.primary_gid = groups.name_to_gid(opts.primary_gid) for login in opts.login.split(','): if login != '': try: users.AddUser(lastname=lastname, firstname=firstname, password=password, primary_gid=opts.primary_gid, desired_uid=opts.uid, profile=opts.profile, skel=opts.skel, login=login, gecos=gecos, system=opts.system, home=opts.home, batch=False, force=opts.force) except exceptions.AlreadyExistsException: logging.warning('User %s already exists on the system.' % login)
3e4d205ddfa5f4faf024d55a5c42576b7c58e75e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/3e4d205ddfa5f4faf024d55a5c42576b7c58e75e/add.py
shutil.rmtree(home)
try: shutil.rmtree(home) except (IOError, OSError), e: if e.errno == 2: logging.notice("Can't remove %s, it doesn't exist !" % \ styles.stylize(styles.ST_PATH, home)) else: raise e
def DeleteGroup(self, name, del_users, no_archive, bygid=None, batch=False): """ Delete an Licorn group """ if name is None and bygid is None: raise exceptions.BadArgumentError( "You must specify a name or a GID.")
fd3cbc8883536ea8f55f3aeb7eb396e5089fbcc4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/fd3cbc8883536ea8f55f3aeb7eb396e5089fbcc4/groups.py
logging.warning("Can't archive %s, it doesn't exist !" % \
logging.notice("Can't archive %s, it doesn't exist !" % \
def DeleteGroup(self, name, del_users, no_archive, bygid=None, batch=False): """ Delete an Licorn group """ if name is None and bygid is None: raise exceptions.BadArgumentError( "You must specify a name or a GID.")
fd3cbc8883536ea8f55f3aeb7eb396e5089fbcc4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/fd3cbc8883536ea8f55f3aeb7eb396e5089fbcc4/groups.py
(opts.gid, groups.confirm_gid) ])
(opts.gid, groups.confirm_gid), ], selection )
def del_group(opts, args): """ delete an Licorn group. """ configuration = LicornConfiguration() users = UsersController(configuration) groups = GroupsController(configuration, users, warnings=False) profiles = ProfilesController(configuration, groups, users) gids_to_del = cli_select(groups, 'group', args, [ (opts.name, groups.name_to_gid), (opts.gid, groups.confirm_gid) ]) for gid in gids_to_del: groups.DeleteGroup(gid=gid, del_users=opts.del_users, no_archive=opts.no_archive)
ed27e6b1e7125829b2896234c4c3746b508dda28 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/ed27e6b1e7125829b2896234c4c3746b508dda28/del.py
if users.user_exists(login = authorization[0]) \ and users.check_password(authorization[0], authorization[1]): if groups.group_exists(wmi_group): if authorization[0] in \ groups.auxilliary_members(wmi_group):
try : if users.user_exists(login = authorization[0]) \ and users.check_password(authorization[0], authorization[1]): if groups.group_exists(wmi_group): if authorization[0] in \ groups.auxilliary_members(wmi_group): self.http_user = authorization[0] return True else:
def user_authorized(self): """ Return True if authorization exists AND user is authorized."""
cb6c58a714751c7c15db22610596234f47738d42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/cb6c58a714751c7c15db22610596234f47738d42/wmi.py
else: self.http_user = authorization[0] return True
except exceptions.BadArgumentError: logging.warning('empty username or password sent as authentification string into WMI.') return False
def user_authorized(self): """ Return True if authorization exists AND user is authorized."""
cb6c58a714751c7c15db22610596234f47738d42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/cb6c58a714751c7c15db22610596234f47738d42/wmi.py
<title>%s WMI: %s</title>
<title>%s %s</title>
def head(title = _("administration %s") % configuration.app_name): """Build the HTML Page header. Bubble Tooltips come from: http://www.dustindiaz.com/sweet-titles Rounded Divs comme from : http://www.html.it/articoli/niftycube/index.html """ return """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
00a7c63aee2a4aa090cfef3676b7f9fe6fe8c0d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/00a7c63aee2a4aa090cfef3676b7f9fe6fe8c0d5/utils.py
""" % (configuration.app_name, title)
""" % (_("%s WMI:") %configuration.app_name, title)
def head(title = _("administration %s") % configuration.app_name): """Build the HTML Page header. Bubble Tooltips come from: http://www.dustindiaz.com/sweet-titles Rounded Divs comme from : http://www.html.it/articoli/niftycube/index.html """ return """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
00a7c63aee2a4aa090cfef3676b7f9fe6fe8c0d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/00a7c63aee2a4aa090cfef3676b7f9fe6fe8c0d5/utils.py
def test_profiles(context): """Test the applying feature of profiles.""" pname = 'profil_test' gname = 'group_test' #fix #271 ScenarioTest([ ADD + [ 'profile', '--name=%s' % pname, '-v' ], GET + [ 'profiles' ], ADD + [ 'group', '--name=%s' % gname, '--system', '-v' ], ADD + [ 'group', '--name=%s2' % gname, '--system', '-v' ], ADD + [ 'group', '--name=%s3' % gname, '--system', '-v' ], GET + [ 'privileges' ], ADD + [ 'privilege', '--name=%s' % gname ], GET + [ 'groups', '-a' ], GET + [ 'privileges' ], MOD + [ 'profile', '--name=%s' % pname, '--add-groups=%s,%s2,%s3' % (gname, gname, gname), '-v' ], GET + [ 'profiles' ], DEL + [ 'group', '--name=%s' % gname, '-v' ], GET + [ 'profiles' ], MOD + [ 'profile', '--name=%s' % pname, '--del-groups=%s' % gname, '-v' ], MOD + [ 'profile', '--name=%s' % pname, '--del-groups=%s2,%s3' % (gname, gname), '-v' ], GET + [ 'profiles' ], DEL + [ 'group', '--name=%s2' % gname, '-v' ], DEL + [ 'group', '--name=%s3' % gname, '-v' ], # don't work with --name option DEL + [ 'profile', '--group=%s' % pname, '-v' ], DEL + [ 'privilege', '--name=%s' % gname, '-v' ], ], context=context, descr='''scenario for ticket #271 - test some commands of mod profile --add-group and --del-groups''' ).Run() ScenarioTest([ ADD + [ 'profile', '--name=%s' % pname, '-v' ], GET + [ 'profiles' ], #should fail MOD + [ 'profile', '--name=%s' % pname, '--add-groups=%s' % gname, '-v' ], GET + [ 'profiles' ], DEL + [ 'profile', '--group=%s' % pname, '-v' ], ], context=context, descr='check if a error occurs when a non-existing group is added to a profile' ).Run() """ # start of old test_profiles() commands test_message('''starting profiles related tests.''') log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " user toto --profile utilisagers") log_and_exec(ADD + " user tutu --profile utilisagers") log_and_exec(ADD + " user tata --profile utilisagers") log_and_exec(MOD + " profile --group utilisagers --apply-groups --to-groups utilisagers") log_and_exec(MOD + " profile --group utilisagers --apply-groups --to-members") log_and_exec(MOD + " profile --group utilisagers --apply-skel --to-users toto --auto-no") log_and_exec(MOD + " profile --group utilisagers --apply-skel --to-users toto --batch") log_and_exec(MOD + " profile --group utilisagers --apply-group --to-users toto") log_and_exec(MOD + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MOD + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MOD + " profile --group utilisagers --apply-all --to-all") log_and_exec(DEL + " profile --group responsibilisateurs --no-archive") log_and_exec(DEL + " user toto --no-archive") log_and_exec(DEL + " profile --group utilisagers --del-users --no-archive") test_message('''profiles related tests finished.''') """ # ends of old test_profiles() commands
6f39ea46ad8784a0de6d5e432b3dd989d632dfa6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/6f39ea46ad8784a0de6d5e432b3dd989d632dfa6/core.py
descr='''scenario for ticket
descr='''scenario for ticket ''' --add-group and --del-groups & fix
def test_profiles(context): """Test the applying feature of profiles.""" pname = 'profil_test' gname = 'group_test' #fix #271 ScenarioTest([ ADD + [ 'profile', '--name=%s' % pname, '-v' ], GET + [ 'profiles' ], ADD + [ 'group', '--name=%s' % gname, '--system', '-v' ], ADD + [ 'group', '--name=%s2' % gname, '--system', '-v' ], ADD + [ 'group', '--name=%s3' % gname, '--system', '-v' ], GET + [ 'privileges' ], ADD + [ 'privilege', '--name=%s' % gname ], GET + [ 'groups', '-a' ], GET + [ 'privileges' ], MOD + [ 'profile', '--name=%s' % pname, '--add-groups=%s,%s2,%s3' % (gname, gname, gname), '-v' ], GET + [ 'profiles' ], DEL + [ 'group', '--name=%s' % gname, '-v' ], GET + [ 'profiles' ], MOD + [ 'profile', '--name=%s' % pname, '--del-groups=%s' % gname, '-v' ], MOD + [ 'profile', '--name=%s' % pname, '--del-groups=%s2,%s3' % (gname, gname), '-v' ], GET + [ 'profiles' ], DEL + [ 'group', '--name=%s2' % gname, '-v' ], DEL + [ 'group', '--name=%s3' % gname, '-v' ], # don't work with --name option DEL + [ 'profile', '--group=%s' % pname, '-v' ], DEL + [ 'privilege', '--name=%s' % gname, '-v' ], ], context=context, descr='''scenario for ticket #271 - test some commands of mod profile --add-group and --del-groups''' ).Run() ScenarioTest([ ADD + [ 'profile', '--name=%s' % pname, '-v' ], GET + [ 'profiles' ], #should fail MOD + [ 'profile', '--name=%s' % pname, '--add-groups=%s' % gname, '-v' ], GET + [ 'profiles' ], DEL + [ 'profile', '--group=%s' % pname, '-v' ], ], context=context, descr='check if a error occurs when a non-existing group is added to a profile' ).Run() """ # start of old test_profiles() commands test_message('''starting profiles related tests.''') log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " user toto --profile utilisagers") log_and_exec(ADD + " user tutu --profile utilisagers") log_and_exec(ADD + " user tata --profile utilisagers") log_and_exec(MOD + " profile --group utilisagers --apply-groups --to-groups utilisagers") log_and_exec(MOD + " profile --group utilisagers --apply-groups --to-members") log_and_exec(MOD + " profile --group utilisagers --apply-skel --to-users toto --auto-no") log_and_exec(MOD + " profile --group utilisagers --apply-skel --to-users toto --batch") log_and_exec(MOD + " profile --group utilisagers --apply-group --to-users toto") log_and_exec(MOD + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MOD + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MOD + " profile --group utilisagers --apply-all --to-all") log_and_exec(DEL + " profile --group responsibilisateurs --no-archive") log_and_exec(DEL + " user toto --no-archive") log_and_exec(DEL + " profile --group utilisagers --del-users --no-archive") test_message('''profiles related tests finished.''') """ # ends of old test_profiles() commands
6f39ea46ad8784a0de6d5e432b3dd989d632dfa6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/6f39ea46ad8784a0de6d5e432b3dd989d632dfa6/core.py
if opts.profile and opts.profile not in LMC.profiles: opts.profile = LMC.profiles.name_to_group(opts.profile)
if opts.profile: opts.profile = LMC.profiles.guess_identifier(opts.profile)
def add_user(self, opts, args): """ Add a user account on the system. """
ea1260748abd9311f9ea79803fd656aeb1a6f2ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/ea1260748abd9311f9ea79803fd656aeb1a6f2ae/rwi.py
def __init__(self, configuration, users=None, groups=None):
def __init__(self, configuration, users=None, groups=None, warnings=True):
def __init__(self, configuration, users=None, groups=None): """ Init the LDAP backend instance. """
b1159a5813ef33a6f84c221cee0bd138269a9ead /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b1159a5813ef33a6f84c221cee0bd138269a9ead/ldap_backend.py
except herror: hostaddr = self.server.server_address
except socket.herror: hostaddr = self.server.server_address[0]
def serve_virtual_uri(self): """ Serve dynamic URIs with our own code, and create pages on the fly. """
af9d2fddfd652e6d06f47693834f54a72046cb4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/af9d2fddfd652e6d06f47693834f54a72046cb4a/wmi.py
return __pyc_primitive__(__pyc_symbol__("index_object"), self, key)
return __pyc_primitive__(__pyc_symbol__("index_object"), self, __pyc_clone_constants__(key))
def __getitem__(self, key): return __pyc_primitive__(__pyc_symbol__("index_object"), self, key)
4300d8f5867fd3ff66f0f6069ebd9a691a0a4244 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6222/4300d8f5867fd3ff66f0f6069ebd9a691a0a4244/__pyc__.py
return __pyc_primitive__(__pyc_symbol__("set_index_object"), self, key, value)
return __pyc_primitive__(__pyc_symbol__("set_index_object"), self, __pyc_clone_constants__(key), value)
def __setitem__(self, key, value): return __pyc_primitive__(__pyc_symbol__("set_index_object"), self, key, value)
4300d8f5867fd3ff66f0f6069ebd9a691a0a4244 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6222/4300d8f5867fd3ff66f0f6069ebd9a691a0a4244/__pyc__.py
self.longTypes = set(('ACTI','ALCH','AMMO','FURN','MISC','MSTT','PROJ','WEAP','CONT','DOOR','LIGH','STAT', 'DEBR','EXPL','MGEF','SCPT','SPEL','SOUN','NPC_','WATR','TXST','ENCH','FLST','IPDS','STAT','NOTE','QUST'))
self.longTypes = set(('ACTI','ALCH','AMMO','ARMO','BOOK','CONT','CREA','DEBR','DIAL', 'DOOR','ENCH','EXPL','FACT','FLOR','FLST','FURN','INFO','INGR', 'IPDS','KEYM','LIGH','MGEF','MISC','MSTT','NOTE','NPC_','PROJ', 'QUST','SCPT','SOUN','SPEL','STAT','TERM','TXST','WATR','WEAP'))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreActi,MreAlch,MreAmmo,MreFurn,MreMisc,MreMstt,MreProj,MreWeap): recAttrs_class[recClass] = ('destructable',) for recClass in (MreCont,MreDoor,MreTerm): recAttrs_class[recClass] = ('destructable','script',) for recClass in (MreLigh,): recAttrs_class[recClass] = ('script',) for recClass in (MreStat,): recAttrs_class[recClass] = ('model',) self.longTypes = set(('ACTI','ALCH','AMMO','FURN','MISC','MSTT','PROJ','WEAP','CONT','DOOR','LIGH','STAT', 'DEBR','EXPL','MGEF','SCPT','SPEL','SOUN','NPC_','WATR','TXST','ENCH','FLST','IPDS','STAT','NOTE','QUST'))
6073e968e057113196b5f851cf9eca178ed7ea76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/6073e968e057113196b5f851cf9eca178ed7ea76/bosh.py
MelString('DESC','descriptio'),
MelString('DESC','description'),
def loadData(self,record,ins,type,size,readId): if size == 4: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 3: unpacked = ins.unpack('BBB',size,readId) else: raise "Unexpected size encountered for TERM:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
e5bcee9d25077a57f557ff191c68e98bfa16e3c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/e5bcee9d25077a57f557ff191c68e98bfa16e3c1/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def checkMasterCellBlockData(cellBlock): if not cellBlock.cell.flags1.ignored: fid = cellBlock.cell.fid if fid not in tempCellData: return if fid not in cellData: cellData[fid] = {} cellData[fid+('flags',)] = {} for attr in attrs: if tempCellData[fid][attr] != cellBlock.cell.__getattribute__(attr): cellData[fid][attr] = tempCellData[fid][attr] for flag in flags: if tempCellData[fid+('flags',)][flag] != cellBlock.cell.flags.__getattr__(flag): cellData[fid+('flags',)][flag] = tempCellData[fid+('flags',)][flag]
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get graphics from source files.""" if not self.isActive: return id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) cachedMasters = {} for index,srcMod in enumerate(self.sourceMods): temp_id_data = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) masters = srcInfo.header.masters srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) self.classestemp.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in masterFile.tops: continue if recClass not in self.classestemp: continue for record in masterFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() temp_id_data = None self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get graphics from source files.""" if not self.isActive: return id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,MreNpc,MreCrea) longTypes = self.longTypes & set(x.classType for x in self.actorClasses) progress.setFull(len(self.sourceMods)) cachedMasters = {} for index,srcMod in enumerate(self.sourceMods): temp_id_data = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) masters = srcInfo.header.masters srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for actorClass in self.actorClasses: if actorClass.classType not in srcFile.tops: continue self.srcClasses.add(actorClass) self.classestemp.add(actorClass) attrs = set(reduce(operator.add, (self.recAttrs_class[actorClass][bashKey] for bashKey in srcInfo.getBashTags() if bashKey in self.recAttrs_class[actorClass]))) for record in srcFile.tops[actorClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in attrs) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for actorClass in self.actorClasses: if actorClass.classType not in masterFile.tops: continue if actorClass not in self.classestemp: continue for record in masterFile.tops[actorClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() temp_id_data = None self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get graphics from source files.""" if not self.isActive: return id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) cachedMasters = {} for index,srcMod in enumerate(self.sourceMods): temp_id_data = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) masters = srcInfo.header.masters srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) self.classestemp.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in masterFile.tops: continue if recClass not in self.classestemp: continue for record in masterFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() temp_id_data = None self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.srcMods))
progress.setFull(1+len(self.srcMods))
def initData(self,progress): """Get data from source files.""" OOOandUOP = False if GPath("Oscuro's_Oblivion_Overhaul.esm") in self.srcMods or GPath("Oscuro's_Oblivion_Overhaul.esp") in self.srcMods: if GPath("Unofficial Oblivion Patch.esp") in self.srcMods: OOOandUOP = True longTypes = self.longTypes loadFactory = LoadFactory(False,MreCrea,MreNpc) progress.setFull(len(self.srcMods)) cachedMasters = {} data = self.data for index,srcMod in enumerate(self.srcMods): tempData = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) masters = srcInfo.header.masters bashTags = srcInfo.getBashTags() srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass in (MreNpc,MreCrea): if recClass.classType not in srcFile.tops: continue for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) tempData[fid] = list(record.aiPackages) for master in reversed(masters): if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for block in (MreNpc, MreCrea): if block.classType not in srcFile.tops: continue if block.classType not in masterFile.tops: continue for record in masterFile.tops[block.classType].getActiveRecords(): fid = mapper(record.fid) if not fid in tempData: continue if record.aiPackages == tempData[fid] and not 'Actors.AIPackagesForceAdd' in bashTags: # if subrecord is identical to the last master then we don't care about older masters. del tempData[fid] continue if fid in data: if tempData[fid] == data[fid]['merged']: continue recordData = {'deleted':[],'merged':tempData[fid]} for pkg in list(record.aiPackages): if not pkg in tempData[fid]: recordData['deleted'].append(pkg) if not fid in data: data[fid] = recordData else: for pkg in recordData['deleted']: if pkg in data[fid]['merged']: data[fid]['merged'].remove(pkg) data[fid]['deleted'].append(pkg) if data[fid]['merged'] == []: for pkg in recordData['merged']: if pkg in data[fid]['deleted'] and not 'Actors.AIPackagesForceAdd' in bashTags: continue data[fid]['merged'].append(pkg) continue for index, pkg in enumerate(recordData['merged']): if not pkg in data[fid]['merged']: # so needs to be added... (unless deleted that is) # find the correct position to add and add. if pkg in data[fid]['deleted'] and not 'Actors.AIPackagesForceAdd' in bashTags: continue #previously deleted if index == 0: data[fid]['merged'].insert(0,pkg) #insert as first item elif index == (len(recordData['merged'])-1): data[fid]['merged'].append(pkg) #insert as last item else: #figure out a good spot to insert it based on next or last recognized item (ugly ugly ugly) i = index - 1 while i >= 0: if recordData['merged'][i] in data[fid]['merged']: slot = data[fid]['merged'].index(recordData['merged'][i])+1 data[fid]['merged'].insert(slot, pkg) break i -= 1 else: i = index + 1 while i != len(recordData['merged']): if recordData['merged'][i] in data[fid]['merged']: slot = data[fid]['merged'].index(recordData['merged'][i]) data[fid]['merged'].insert(slot, pkg) break i += 1 continue # Done with this package elif index == data[fid]['merged'].index(pkg) or (len(recordData['merged'])-index) == (len(data[fid]['merged'])-data[fid]['merged'].index(pkg)): continue #pkg same in both lists. else: #this import is later loading so we'll assume it is better order data[fid]['merged'].remove(pkg) if index == 0: data[fid]['merged'].insert(0,pkg) #insert as first item elif index == (len(recordData['merged'])-1): data[fid]['merged'].append(pkg) #insert as last item else: i = index - 1 while i >= 0: if recordData['merged'][i] in data[fid]['merged']: slot = data[fid]['merged'].index(recordData['merged'][i]) + 1 data[fid]['merged'].insert(slot, pkg) break i -= 1 else: i = index + 1 while i != len(recordData['merged']): if recordData['merged'][i] in data[fid]['merged']: slot = data[fid]['merged'].index(recordData['merged'][i]) data[fid]['merged'].insert(slot, pkg) break i += 1 if OOOandUOP: for pkg in recordData['merged']: if pkg[0] == bolt.Path("Oscuro's_Oblivion_Overhaul.esm"): if pkg[1] in [12892,12893,12894,12895,23921,23922,23926,40669,40671]: if pkg in data[fid]['merged']: data[fid]['merged'].remove(pkg) progress.plus()
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get graphics from source files.""" if not self.isActive: return self.classestemp = set() id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) cachedMasters = {} for index,srcMod in enumerate(self.sourceMods): temp_id_data = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) masters = srcInfo.header.masters srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) self.classestemp.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in masterFile.tops: continue if recClass not in self.classestemp: continue for record in masterFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() temp_id_data = None self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.srcFiles))
progress.setFull(1+len(self.srcFiles))
def initData(self,progress): """Get names from source files.""" if not self.isActive: return actorFactions = ActorFactions(aliases=self.patchFile.aliases) progress.setFull(len(self.srcFiles)) for srcFile in self.srcFiles: srcPath = GPath(srcFile) patchesDir = dirs['patches'].list() if reModExt.search(srcFile.s): if srcPath not in modInfos: continue srcInfo = modInfos[GPath(srcFile)] actorFactions.readFromMod(srcInfo) else: if srcPath not in patchesDir: continue actorFactions.readFromText(dirs['patches'].join(srcFile)) progress.plus() #--Finish id_factions= self.id_factions for type,aFid_factions in actorFactions.type_id_factions.iteritems(): if type not in ('CREA','NPC_'): continue self.activeTypes.append(type) for longid,factions in aFid_factions.iteritems(): self.id_factions[longid] = factions self.isActive = bool(self.activeTypes)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.srcFiles))
progress.setFull(1+len(self.srcFiles))
def initData(self,progress): """Get names from source files.""" if not self.isActive: return factionRelations = FactionRelations(aliases=self.patchFile.aliases) progress.setFull(len(self.srcFiles)) for srcFile in self.srcFiles: srcPath = GPath(srcFile) patchesDir = dirs['patches'].list() if reModExt.search(srcFile.s): if srcPath not in modInfos: continue srcInfo = modInfos[GPath(srcFile)] factionRelations.readFromMod(srcInfo) else: if srcPath not in patchesDir: continue factionRelations.readFromText(dirs['patches'].join(srcFile)) progress.plus() #--Finish self.id_relations = factionRelations.id_relations self.isActive = bool(self.id_relations)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get script links from source files.""" if not self.isActive: return self.classestemp = set() id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) cachedMasters = {} for index,srcMod in enumerate(self.sourceMods): temp_id_data = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) masters = srcInfo.header.masters srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) self.classestemp.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in masterFile.tops: continue if recClass not in self.classestemp: continue for record in masterFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() temp_id_data = None self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get graphics from source files.""" if not self.isActive: return id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) cachedMasters = {} for index,srcMod in enumerate(self.sourceMods): temp_id_data = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) masters = srcInfo.header.masters srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) self.classestemp.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in masterFile.tops: continue if recClass not in self.classestemp: continue for record in masterFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() temp_id_data = None self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.srcMods))
progress.setFull(1+len(self.srcMods))
def initData(self,progress): """Get data from source files.""" if not self.isActive or not self.srcMods: return loadFactory = LoadFactory(False,'CREA','NPC_','CONT') progress.setFull(len(self.srcMods)) for index,srcMod in enumerate(self.srcMods): srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) srcFile.load(True) mapper = srcFile.getLongMapper() for block in (srcFile.CREA, srcFile.NPC_, srcFile.CONT): for record in block.getActiveRecords(): self.touched.add(mapper(record.fid)) progress.plus()
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.srcFiles))
progress.setFull(1+len(self.srcFiles))
def initData(self,progress): """Get names from source files.""" if not self.isActive: return fullNames = FullNames(aliases=self.patchFile.aliases) progress.setFull(len(self.srcFiles)) for srcFile in self.srcFiles: srcPath = GPath(srcFile) patchesDir = dirs['patches'].list() if reModExt.search(srcFile.s): if srcPath not in modInfos: continue srcInfo = modInfos[GPath(srcFile)] fullNames.readFromMod(srcInfo) else: if srcPath not in patchesDir: continue fullNames.readFromText(dirs['patches'].join(srcFile)) progress.plus() #--Finish id_full = self.id_full knownTypes = set(MreRecord.type_class.keys()) for type,id_name in fullNames.type_id_name.iteritems(): if type not in knownTypes: self.skipTypes.append(type) continue self.activeTypes.append(type) for longid,(eid,name) in id_name.iteritems(): if name != 'NO NAME': id_full[longid] = name self.isActive = bool(self.activeTypes)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.faceMods))
progress.setFull(1+len(self.faceMods))
def initData(self,progress): """Get faces from Project Beauty files.""" if not self.isActive: return faceData = self.faceData loadFactory = LoadFactory(False,MreNpc) progress.setFull(len(self.faceMods)) cachedMasters = {} for index,faceMod in enumerate(self.faceMods): if faceMod not in modInfos: continue temp_faceData = {} faceInfo = modInfos[faceMod] faceFile = ModFile(faceInfo,loadFactory) masters = faceInfo.header.masters faceFile.load(True) faceFile.convertToLongFids(('NPC_',)) for npc in faceFile.NPC_.getActiveRecords(): if npc.fid[0] != faceMod: temp_faceData[npc.fid] = {} for attr in ('fggs_p','fgga_p','fgts_p','eye','hair','hairLength','hairRed','hairBlue','hairGreen','unused3','headParts','race'): temp_faceData[npc.fid][attr] = npc.__getattribute__(attr) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(('NPC_',)) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() if 'NPC_' not in masterFile.tops: continue for npc in masterFile.NPC_.getActiveRecords(): if npc.fid not in temp_faceData: continue for attr, value in temp_faceData[npc.fid].iteritems(): if value == npc.__getattribute__(attr): continue if npc.fid not in faceData: faceData[npc.fid] = dict() try: faceData[npc.fid][attr] = temp_faceData[npc.fid][attr] except KeyError: faceData[npc.fid].setdefault(attr,value) progress.plus()
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get cells from source files.""" if not self.isActive: return loadFactory = LoadFactory(False,MreCell,MreWrld,MreRoad) progress.setFull(len(self.sourceMods)) for srcMod in self.sourceMods: if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) srcFile.load(True) srcFile.convertToLongFids(('WRLD','ROAD')) for worldBlock in srcFile.WRLD.worldBlocks: if worldBlock.road: worldId = worldBlock.world.fid road = worldBlock.road.getTypeCopy() self.world_road[worldId] = road self.isActive = bool(self.world_road)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get sounds from source files.""" if not self.isActive: return id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) cachedMasters = {} for index,srcMod in enumerate(self.sourceMods): temp_id_data = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) bashTags = srcFile.fileInfo.getBashTags() masters = srcInfo.header.masters srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) self.classestemp.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in masterFile.tops: continue if recClass not in self.classestemp: continue for record in masterFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() temp_id_data = None self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.srcFiles))
progress.setFull(1+len(self.srcFiles))
def initData(self,progress): """Get stats from source files.""" if not self.isActive: return itemStats = ItemStats(aliases=self.patchFile.aliases) progress.setFull(len(self.srcFiles)) for srcFile in self.srcFiles: srcPath = GPath(srcFile) patchesDir = dirs['patches'].list() if reModExt.search(srcFile.s): if srcPath not in modInfos: continue srcInfo = modInfos[GPath(srcFile)] itemStats.readFromMod(srcInfo) else: if srcPath not in patchesDir: continue itemStats.readFromText(dirs['patches'].join(srcFile)) progress.plus() #--Finish id_stat = self.id_stat for type in itemStats.type_stats: typeStats = itemStats.type_stats[type] if typeStats: self.activeTypes.append(type) id_stat.update(typeStats) self.typeFields[type] = itemStats.type_attrs[type][1:] self.isActive = bool(self.activeTypes)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.srcFiles))
progress.setFull(1+len(self.srcFiles))
def initData(self,progress): """Get stats from source files.""" if not self.isActive: return itemStats = SpellRecords(aliases=self.patchFile.aliases) progress.setFull(len(self.srcFiles)) for srcFile in self.srcFiles: srcPath = GPath(srcFile) patchesDir = dirs['patches'].list() if reModExt.search(srcFile.s): if srcPath not in modInfos: continue srcInfo = modInfos[GPath(srcFile)] itemStats.readFromMod(srcInfo) else: if srcPath not in patchesDir: continue itemStats.readFromText(dirs['patches'].join(srcFile)) progress.plus() #--Finish id_stat = self.id_stat for type in itemStats.type_stats: typeStats = itemStats.type_stats[type] if typeStats: self.activeTypes.append(type) id_stat.update(typeStats) self.typeFields[type] = itemStats.type_attrs[type][1:] self.isActive = bool(self.activeTypes)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get graphics from source files.""" if not self.isActive: return id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) cachedMasters = {} for index,srcMod in enumerate(self.sourceMods): temp_id_data = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) bashTags = srcFile.fileInfo.getBashTags() masters = srcInfo.header.masters srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) self.classestemp.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in masterFile.tops: continue if recClass not in self.classestemp: continue for record in masterFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() temp_id_data = None self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.srcFiles))
progress.setFull(1+len(self.srcFiles))
def initData(self,progress): """Get names from source files.""" if not self.isActive: return progress.setFull(len(self.srcFiles)) for srcFile in self.srcFiles: srcPath = GPath(srcFile) patchesDir = dirs['patches'].list() if srcPath not in patchesDir: continue self.readFromText(dirs['patches'].join(srcFile)) progress.plus()
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
progress.setFull(len(self.srcMods))
progress.setFull(1+len(self.srcMods))
def initData(self,progress): """Get data from source files.""" if not self.isActive or not self.srcMods: return loadFactory = LoadFactory(False,MreRace) progress.setFull(len(self.srcMods)) cachedMasters = {} for index,srcMod in enumerate(self.srcMods): if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) srcFile.load(True) masters = srcInfo.header.masters bashTags = srcInfo.getBashTags() if 'RACE' not in srcFile.tops: continue srcFile.convertToLongFids(('RACE',)) self.tempRaceData = {} #so as not to carry anything over! if 'R.ChangeSpells' in bashTags and 'R.AddSpells' in bashTags: raise BoltError(_('WARNING mod %s has both R.AddSpells and R.ChangeSpells tags - only one of those tags should be on a mod at one time') % (srcMod.s)) for race in srcFile.RACE.getActiveRecords(): tempRaceData = self.tempRaceData.setdefault(race.fid,{}) raceData = self.raceData.setdefault(race.fid,{}) if 'Hair' in bashTags: raceHair = raceData.setdefault('hairs',[]) for hair in race.hairs: if hair not in raceHair: raceHair.append(hair) if self.eyeKeys & bashTags: tempRaceData['femaleLeftEye'] = race.femaleLeftEye tempRaceData['femaleRightEye'] = race.femaleRightEye tempRaceData['maleLeftEye'] = race.maleLeftEye tempRaceData['maleRightEye'] = race.maleRightEye raceEyes = raceData.setdefault('eyes',[]) for eye in race.eyes: if eye not in raceEyes: raceEyes.append(eye) if 'Voice-M' in bashTags: tempRaceData['maleVoice'] = race.maleVoice if 'Voice-F' in bashTags: tempRaceData['femaleVoice'] = race.femaleVoice if 'Body-M' in bashTags: for key in ['male'+key for key in self.bodyKeys]: tempRaceData[key] = getattr(race,key) if 'Body-F' in bashTags: for key in ['female'+key for key in self.bodyKeys]: tempRaceData[key] = getattr(race,key) if 'R.Teeth' in bashTags: for key in ('maleTeethLower','femaleTeethLower','maleTeethUpper','femaleTeethUpper'): tempRaceData[key] = getattr(race,key) if 'R.Mouth' in bashTags: for key in ('maleMouth','femaleMouth','maleTongue','femaleTongue'): tempRaceData[key] = getattr(race,key) if 'R.Head' in bashTags: tempRaceData['head'] = race.head if 'R.Ears' in bashTags: for key in ('maleEars','femaleEars'): tempRaceData[key] = getattr(race,key) if 'R.Attributes-F' in bashTags: for key in ['female'+key for key in self.raceAttributes]: tempRaceData[key] = getattr(race,key) if 'R.Attributes-M' in bashTags: for key in ['male'+key for key in self.raceAttributes]: tempRaceData[key] = getattr(race,key) if 'R.Skills' in bashTags: for key in self.raceSkills: tempRaceData[key] = getattr(race,key) if 'R.Description' in bashTags: tempRaceData['text'] = race.text for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) if 'RACE' not in masterFile.tops: continue masterFile.convertToLongFids(('RACE',)) cachedMasters[master] = masterFile for race in masterFile.RACE.getActiveRecords(): if race.fid not in self.tempRaceData: continue tempRaceData = self.tempRaceData[race.fid] raceData = self.raceData[race.fid] if 'AddSpells' in tempRaceData: raceData.setdefault('AddSpells', []) for spell in tempRaceData['AddSpells']: if spell not in race.spells: if spell not in raceData['AddSpells']: raceData['AddSpells'].append(spell) del tempRaceData['AddSpells'] for key in tempRaceData: if not tempRaceData[key] == getattr(race,key): raceData[key] = tempRaceData[key] progress.plus()
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
MelString('ICON','iconPath'),
MelString('ICON','largeIconPath'), MelString('MICO','smallIconPath'),
def getEffectsSummary(self,mgef_school=None,mgef_name=None): """Return a text description of magic effects.""" mgef_school = mgef_school or bush.mgef_school mgef_name = mgef_name or bush.mgef_name buff = cStringIO.StringIO() avEffects = bush.actorValueEffects aValues = bush.actorValues buffWrite = buff.write if self.effects: school = mgef_school[self.effects[0].name] buffWrite(bush.actorValues[20+school] + '\n') for index,effect in enumerate(self.effects): if effect.scriptEffect: effectName = effect.scriptEffect.full or 'Script Effect' else: effectName = mgef_name[effect.name] if effect.name in avEffects: effectName = re.sub(_('(Attribute|Skill)'),aValues[effect.actorValue],effectName) buffWrite('o+*'[effect.recipient]+' '+effectName) if effect.magnitude: buffWrite(' '+`effect.magnitude`+'m') if effect.area: buffWrite(' '+`effect.area`+'a') if effect.duration > 1: buffWrite(' '+`effect.duration`+'d') buffWrite('\n') return buff.getvalue()
7e2669c9f6649a0409cbceae49f1be241db5fb53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/7e2669c9f6649a0409cbceae49f1be241db5fb53/bosh.py
MelStruct('ENIT','iB3s','value',(_flags,'flags',0L),('unused1',null3)),
MelStruct('ENIT','iB3sIfI','value',(_flags,'flags',0L),('unused1',null3), (FID,'withdrawalEffect',None),'addictionChance',(FID,'soundConsume',None)),
def getEffectsSummary(self,mgef_school=None,mgef_name=None): """Return a text description of magic effects.""" mgef_school = mgef_school or bush.mgef_school mgef_name = mgef_name or bush.mgef_name buff = cStringIO.StringIO() avEffects = bush.actorValueEffects aValues = bush.actorValues buffWrite = buff.write if self.effects: school = mgef_school[self.effects[0].name] buffWrite(bush.actorValues[20+school] + '\n') for index,effect in enumerate(self.effects): if effect.scriptEffect: effectName = effect.scriptEffect.full or 'Script Effect' else: effectName = mgef_name[effect.name] if effect.name in avEffects: effectName = re.sub(_('(Attribute|Skill)'),aValues[effect.actorValue],effectName) buffWrite('o+*'[effect.recipient]+' '+effectName) if effect.magnitude: buffWrite(' '+`effect.magnitude`+'m') if effect.area: buffWrite(' '+`effect.area`+'a') if effect.duration > 1: buffWrite(' '+`effect.duration`+'d') buffWrite('\n') return buff.getvalue()
7e2669c9f6649a0409cbceae49f1be241db5fb53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/7e2669c9f6649a0409cbceae49f1be241db5fb53/bosh.py
GmstTweak(_('VATS Playback Delay'),
GmstTweak(False,_('VATS Playback Delay'),
def buildPatch(self,patchFile,keep,log): """Build patch.""" eids = ((self.key,),self.key)[isinstance(self.key,tuple)] for eid,value in zip(eids,self.choiceValues[self.chosen]): gmst = MreGmst(('GMST',0,0,0,0,0)) gmst.eid,gmst.value,gmst.longFids = eid,value,True fid = gmst.fid = keep(gmst.getFallout3Fid()) patchFile.GMST.setRecord(gmst) if len(self.choiceLabels) > 1: if self.choiceLabels[self.chosen].startswith('Custom'): log('* %s: %s %4.2f' % (self.label,self.choiceLabels[self.chosen],self.choiceValues[self.chosen][0])) else: log('* %s: %s' % (self.label,self.choiceLabels[self.chosen])) else: log('* ' + self.label)
8bd1d21af52def8e28a6cc31d7c142eb0739a4d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/8bd1d21af52def8e28a6cc31d7c142eb0739a4d4/bosh.py
MelFid('CNAM','I','combatStyle'),
MelFid('CNAM','combatStyle'),
def mapFids(self,record,function,save=False): """Applies function to fids. If save is true, then fid is set to result of function.""" if self.subType == 'PLDT' and record.locType != 5: result = function(record.locId) if save: record.locId = result elif self.subType == 'PLD2' and record.locType2 != 5: result = function(record.locId2) if save: record.locId2 = result elif self.subType == 'PTDT' and record.targetType != 2: result = function(record.targetId) if save: record.targetId = result elif self.subType == 'PTD2' and record.targetType2 != 2: result = function(record.targetId2) if save: record.targetId2 = result
2966e2bef0582ca05777ea82e12d82e392119c97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/2966e2bef0582ca05777ea82e12d82e392119c97/bosh.py
record.entries = [x for x in record.entries if x.listId != empty]
record.fids = [x for x in record.fids if x != empty]
def buildPatch(self,log,progress): """Adds merged lists to patchfile.""" keep = self.patchFile.getKeeper() #--Reflsts/Deflsts List log.setHeader('= '+self.__class__.name,True) log.setHeader(_('=== Deflsters/Reflsters')) for leveler in (self.levelers or []): log('* '+self.getItemLabel(leveler)) #--Save to patch file for label, type in ((_('FormID'),'FLST'),): log.setHeader(_('=== Merged %s Lists') % label) patchBlock = getattr(self.patchFile,type) levLists = self.type_list[type] for record in sorted(levLists.values(),key=attrgetter('eid')): if not record.mergeOverLast: continue fid = keep(record.fid) patchBlock.setRecord(levLists[fid]) log('* '+record.eid) for mod in record.mergeSources: log(' * ' + self.getItemLabel(mod)) #--Discard empty sublists for label, type in ((_('FormID'),'FLST'),): patchBlock = getattr(self.patchFile,type) levLists = self.type_list[type] #--Empty lists empties = [] sub_supers = dict((x,[]) for x in levLists.keys()) for record in sorted(levLists.values()): listId = record.fid if not record.items: empties.append(listId) else: subLists = [x for x in record.items if x in sub_supers] for subList in subLists: sub_supers[subList].append(listId) #--Clear empties removed = set() cleaned = set() while empties: empty = empties.pop() if empty not in sub_supers: continue for super in sub_supers[empty]: record = levLists[super] record.entries = [x for x in record.entries if x.listId != empty] record.items.remove(empty) patchBlock.setRecord(record) if not record.items: empties.append(super) cleaned.add(record.eid) removed.add(levLists[empty].eid) keep(super) log.setHeader(_('=== Empty %s Sublists') % label) for eid in sorted(removed,key=string.lower): log('* '+eid) log.setHeader(_('=== Empty %s Sublists Removed') % label) for eid in sorted(cleaned,key=string.lower): log('* '+eid)
47e0596c6a74fd67dbccba1b4f01ae01379832dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/47e0596c6a74fd67dbccba1b4f01ae01379832dc/bosh.py
try: (isFid, value) = record.__getattribute__(self.attr) except AttributeError: value = None
value = record.__getattribute__(self.attr) if value is None: return (isFid, value) = value
def dumpData(self,record,out): try: (isFid, value) = record.__getattribute__(self.attr) except AttributeError: value = None if value is not None: if record.dataType == 1: # text (string) out.packSub0(self.subType,value) elif record.dataType == 3: # voice (fid:DIAL) out.packRef(self.subType,value) else: raise ModError(ins.inName,_('Unexpected type: %d') % record.type)
5b407d242e4b2cf20b3166a8b10177f3b047cc62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5b407d242e4b2cf20b3166a8b10177f3b047cc62/bosh.py
(isFid, value) = record.__getattribute__(self.attr)
value = record.__getattribute__(self.attr) if value is None: return (isFid, value) = value
def mapFids(self,record,function,save=False): (isFid, value) = record.__getattribute__(self.attr) if isFid: result = function(value) if save: record.__setattr__(self.attr,result)
5b407d242e4b2cf20b3166a8b10177f3b047cc62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5b407d242e4b2cf20b3166a8b10177f3b047cc62/bosh.py
try: (isFid, value) = record.__getattribute__(self.attr) except AttributeError: value = None
value = record.__getattribute__(self.attr) if value is None: return (isFid, value) = value
def dumpData(self,record,out): try: (isFid, value) = record.__getattribute__(self.attr) except AttributeError: value = None if value is not None: out.packRef(self.subType,value)
5b407d242e4b2cf20b3166a8b10177f3b047cc62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5b407d242e4b2cf20b3166a8b10177f3b047cc62/bosh.py
(isFid, value) = record.__getattribute__(self.attr)
value = record.__getattribute__(self.attr) if value is None: return (isFid, value) = value
def mapFids(self,record,function,save=False): (isFid, value) = record.__getattribute__(self.attr) if isFid: result = function(value) if save: record.__setattr__(self.attr,result)
5b407d242e4b2cf20b3166a8b10177f3b047cc62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5b407d242e4b2cf20b3166a8b10177f3b047cc62/bosh.py
for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree, MreNote):
for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree):
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree, MreNote): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bodyPartData','impactDataset') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','objectDisplayShader','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imageSpaceModifier','light','impactDataset','placedImpactObject') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','flags') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ'))
5b407d242e4b2cf20b3166a8b10177f3b047cc62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5b407d242e4b2cf20b3166a8b10177f3b047cc62/bosh.py
self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ'))
self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ','NOTE','NPC_','DIAL'))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree, MreNote): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bodyPartData','impactDataset') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','objectDisplayShader','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imageSpaceModifier','light','impactDataset','placedImpactObject') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','flags') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ'))
5b407d242e4b2cf20b3166a8b10177f3b047cc62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5b407d242e4b2cf20b3166a8b10177f3b047cc62/bosh.py
if groupFid != cell.fid: raise ModError(self.inName,'Cell subgroup (%s) does not match CELL <%s> %s.' % (hex(groupFid), hex(cell.fid), cell.eid))
def loadData(self,ins,endPos): """Loads data from input stream. Called by load().""" cellType_class = self.loadFactory.getCellTypeClass() recCellClass = self.loadFactory.getRecClass('CELL') errLabel = 'World Block' cell = None block = None subblock = None cellBlocks = self.cellBlocks unpackCellBlocks = self.loadFactory.getUnpackCellBlocks('WRLD') insAtEnd = ins.atEnd insRecHeader = ins.unpackRecHeader cellGet = cellType_class.get insSeek = ins.seek insTell = ins.tell selfLoadFactory = self.loadFactory cellBlocksAppend = cellBlocks.append structUnpack = struct.unpack structPack = struct.pack while not insAtEnd(endPos,errLabel): #--Get record info and handle it header = insRecHeader() recType = header[0] recClass = cellGet(recType) if recType == 'ROAD': if not recClass: insSeek(header[1],1) else: self.road = recClass(header,ins,True) elif recType == 'CELL': if cell: cellBlock = MobCell(header,selfLoadFactory,cell) if block: cellBlocksAppend(cellBlock) else: if self.worldCellBlock: raise ModError(self.inName,'Extra exterior cell <%s> %s before block group.' % (hex(cell.fid), cell.eid)) self.worldCellBlock = cellBlock cell = recClass(header,ins,True) if block: if insTell() > endBlockPos or insTell() > endSubblockPos: raise ModError(self.inName,'Exterior cell <%s> %s after block or' ' subblock.' % (hex(cell.fid), cell.eid)) elif recType == 'GRUP': size,groupFid,groupType = header[1:4] if groupType == 4: # Exterior Cell Block block = structUnpack('2h',structPack('I',groupFid)) block = (block[1],block[0]) endBlockPos = insTell() + size - 24 elif groupType == 5: # Exterior Cell Sub-Block subblock = structUnpack('2h',structPack('I',groupFid)) subblock = (subblock[1],subblock[0]) endSubblockPos = insTell() + size - 24 elif groupType == 6: # Cell Children if cell: if groupFid != cell.fid: raise ModError(self.inName,'Cell subgroup (%s) does not match CELL <%s> %s.' % (hex(groupFid), hex(cell.fid), cell.eid)) if unpackCellBlocks: cellBlock = MobCell(header,selfLoadFactory,cell,ins,True) else: cellBlock = MobCell(header,selfLoadFactory,cell) insSeek(header[1]-24,1) if block: cellBlocksAppend(cellBlock) else: if self.worldCellBlock: raise ModError(self.inName,'Extra exterior cell <%s> %s before block group.' % (hex(cell.fid), cell.eid)) self.worldCellBlock = cellBlock cell = None else: raise ModError(self.inName,'Extra cell children subgroup in world children group.') else: raise ModError(self.inName,'Unexpected subgroup %d in world children group.' % groupType) else: raise ModError(self.inName,'Unexpected %s record in world children group.' % recType) if block and insTell() == endBlockPos: cell = subblock = block = None elif subblock and insTell() == endSubblockPos: cell = subblock = None self.setChanged()
536035b8b2f5ce4ff087dfd95532b3bcb08fa52f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/536035b8b2f5ce4ff087dfd95532b3bcb08fa52f/bosh.py
MelStruct('DATA','2BH',(_flags,'flags',0L),'flags2','unknown'),
MelFactData('DATA','2BH',(_flags,'flags',0L),'flags2','unknown'),
def loadData(self,record,ins,type,size,readId): if size == 224: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 96: #--Else 96 byte record (skips particle variables, and color keys # Only used twice in test shaders (0004b6d5, 0004b6d6) unpacked = ins.unpack('B3s3I3Bs9f3Bs8fI',size,readId) else: raise "Unexpected size encountered for EFSH subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
731203d62589855fe8bd96a522bd833f52918903 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/731203d62589855fe8bd96a522bd833f52918903/bosh.py
for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree):
for recClass in (MreLigh,): recAttrs_class[recClass] = ('iconPath','model') for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreMisc, MreSgst, MreSlgm, MreTree):
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 self.classestemp = set() #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat, MreMstt): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreNote,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','texture') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bodyPartData','impactDataset') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','objectDisplayShader','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imageSpaceModifier','light','impactDataset','placedImpactObject') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','flags') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ','NOTE','NPC_','DIAL'))
839c6d1f58c2e904a1fec10c2efb7e588904ef29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/839c6d1f58c2e904a1fec10c2efb7e588904ef29/bosh.py
"""MISC (miscellaneous item) record."""
"""KEYM (key) record."""
def dumpData(self,record,out): if not record.schd_p: MelStruct.dumpData(self,record,out)
99172d4ed4977108c05b04adab7c91f861e1c635 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/99172d4ed4977108c05b04adab7c91f861e1c635/bosh.py
MelString('ICON','iconPath'),
MelString('ICON','largeIconPath'), MelString('MICO','smallIconPath'),
def dumpData(self,record,out): if not record.schd_p: MelStruct.dumpData(self,record,out)
99172d4ed4977108c05b04adab7c91f861e1c635 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/99172d4ed4977108c05b04adab7c91f861e1c635/bosh.py
bosh.dirs['app'].join('fomm.exe'),
bosh.dirs['app'].join('fomm\\fomm.exe'),
def InitStatusBar(): """Initialize status bar links.""" #--Bash Status/LinkBar #BashStatusBar.buttons.append(App_Fallout3()) BashStatusBar.buttons.append(Fose_Button()) BashStatusBar.buttons.append(AutoQuit_Button()) BashStatusBar.buttons.append( Fallout3_Button( bosh.dirs['app'].join('Fallout3.exe'), Image(r'images/fallout3.png'), _("Launch Fallout3"), _("Launch Fallout3 + FOSE"), '')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('GECK.exe'), Image(r'images/geck.png'), _("Launch GECK"), _("Launch GECK + FOSE"), '-editor')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('fomm.exe'), Image(r'images/database_connect.png'), _("Launch FOMM"))) BashStatusBar.buttons.append( App_Tes4Gecko(None, Image(r'images/cog.png'), _("Launch Tes4Gecko"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'), '-view'), Image(r'images/brick_edit.png'), _("Launch FO3View"))) BashStatusBar.buttons.append( App_Tes4View( bosh.dirs['app'].join('FO3Edit.exe'), Image(r'images/brick.png'), _("Launch FO3Edit"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'),'-translate'), Image(r'images/brick_error.png'), _("Launch FO3Trans"))) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('Tes4LodGen.exe'), Image(r'images/brick_go.png'), _("Launch Tes4LODGen"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/Boss1.png'), _("Launch BOSS"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/boss2.png'), _("Launch BOSS"))) BashStatusBar.buttons.append(App_BashMon()) BashStatusBar.buttons.append(App_DocBrowser()) BashStatusBar.buttons.append(App_ModChecker()) BashStatusBar.buttons.append(App_Help())
215be538ae6b957464ec5a1a8d5c9d22761dc890 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/215be538ae6b957464ec5a1a8d5c9d22761dc890/basher.py
BashStatusBar.buttons.append( App_Tes4Gecko(None, Image(r'images/cog.png'), _("Launch Tes4Gecko")))
def InitStatusBar(): """Initialize status bar links.""" #--Bash Status/LinkBar #BashStatusBar.buttons.append(App_Fallout3()) BashStatusBar.buttons.append(Fose_Button()) BashStatusBar.buttons.append(AutoQuit_Button()) BashStatusBar.buttons.append( Fallout3_Button( bosh.dirs['app'].join('Fallout3.exe'), Image(r'images/fallout3.png'), _("Launch Fallout3"), _("Launch Fallout3 + FOSE"), '')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('GECK.exe'), Image(r'images/geck.png'), _("Launch GECK"), _("Launch GECK + FOSE"), '-editor')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('fomm.exe'), Image(r'images/database_connect.png'), _("Launch FOMM"))) BashStatusBar.buttons.append( App_Tes4Gecko(None, Image(r'images/cog.png'), _("Launch Tes4Gecko"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'), '-view'), Image(r'images/brick_edit.png'), _("Launch FO3View"))) BashStatusBar.buttons.append( App_Tes4View( bosh.dirs['app'].join('FO3Edit.exe'), Image(r'images/brick.png'), _("Launch FO3Edit"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'),'-translate'), Image(r'images/brick_error.png'), _("Launch FO3Trans"))) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('Tes4LodGen.exe'), Image(r'images/brick_go.png'), _("Launch Tes4LODGen"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/Boss1.png'), _("Launch BOSS"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/boss2.png'), _("Launch BOSS"))) BashStatusBar.buttons.append(App_BashMon()) BashStatusBar.buttons.append(App_DocBrowser()) BashStatusBar.buttons.append(App_ModChecker()) BashStatusBar.buttons.append(App_Help())
215be538ae6b957464ec5a1a8d5c9d22761dc890 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/215be538ae6b957464ec5a1a8d5c9d22761dc890/basher.py
(bosh.dirs['app'].join('FO3Edit.exe'), '-view'),
(bosh.dirs['app'].join('FO3Edit\\FO3Edit.exe'), '-view'),
def InitStatusBar(): """Initialize status bar links.""" #--Bash Status/LinkBar #BashStatusBar.buttons.append(App_Fallout3()) BashStatusBar.buttons.append(Fose_Button()) BashStatusBar.buttons.append(AutoQuit_Button()) BashStatusBar.buttons.append( Fallout3_Button( bosh.dirs['app'].join('Fallout3.exe'), Image(r'images/fallout3.png'), _("Launch Fallout3"), _("Launch Fallout3 + FOSE"), '')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('GECK.exe'), Image(r'images/geck.png'), _("Launch GECK"), _("Launch GECK + FOSE"), '-editor')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('fomm.exe'), Image(r'images/database_connect.png'), _("Launch FOMM"))) BashStatusBar.buttons.append( App_Tes4Gecko(None, Image(r'images/cog.png'), _("Launch Tes4Gecko"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'), '-view'), Image(r'images/brick_edit.png'), _("Launch FO3View"))) BashStatusBar.buttons.append( App_Tes4View( bosh.dirs['app'].join('FO3Edit.exe'), Image(r'images/brick.png'), _("Launch FO3Edit"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'),'-translate'), Image(r'images/brick_error.png'), _("Launch FO3Trans"))) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('Tes4LodGen.exe'), Image(r'images/brick_go.png'), _("Launch Tes4LODGen"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/Boss1.png'), _("Launch BOSS"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/boss2.png'), _("Launch BOSS"))) BashStatusBar.buttons.append(App_BashMon()) BashStatusBar.buttons.append(App_DocBrowser()) BashStatusBar.buttons.append(App_ModChecker()) BashStatusBar.buttons.append(App_Help())
215be538ae6b957464ec5a1a8d5c9d22761dc890 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/215be538ae6b957464ec5a1a8d5c9d22761dc890/basher.py
bosh.dirs['app'].join('FO3Edit.exe'),
bosh.dirs['app'].join('FO3Edit\\FO3Edit.exe'),
def InitStatusBar(): """Initialize status bar links.""" #--Bash Status/LinkBar #BashStatusBar.buttons.append(App_Fallout3()) BashStatusBar.buttons.append(Fose_Button()) BashStatusBar.buttons.append(AutoQuit_Button()) BashStatusBar.buttons.append( Fallout3_Button( bosh.dirs['app'].join('Fallout3.exe'), Image(r'images/fallout3.png'), _("Launch Fallout3"), _("Launch Fallout3 + FOSE"), '')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('GECK.exe'), Image(r'images/geck.png'), _("Launch GECK"), _("Launch GECK + FOSE"), '-editor')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('fomm.exe'), Image(r'images/database_connect.png'), _("Launch FOMM"))) BashStatusBar.buttons.append( App_Tes4Gecko(None, Image(r'images/cog.png'), _("Launch Tes4Gecko"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'), '-view'), Image(r'images/brick_edit.png'), _("Launch FO3View"))) BashStatusBar.buttons.append( App_Tes4View( bosh.dirs['app'].join('FO3Edit.exe'), Image(r'images/brick.png'), _("Launch FO3Edit"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'),'-translate'), Image(r'images/brick_error.png'), _("Launch FO3Trans"))) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('Tes4LodGen.exe'), Image(r'images/brick_go.png'), _("Launch Tes4LODGen"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/Boss1.png'), _("Launch BOSS"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/boss2.png'), _("Launch BOSS"))) BashStatusBar.buttons.append(App_BashMon()) BashStatusBar.buttons.append(App_DocBrowser()) BashStatusBar.buttons.append(App_ModChecker()) BashStatusBar.buttons.append(App_Help())
215be538ae6b957464ec5a1a8d5c9d22761dc890 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/215be538ae6b957464ec5a1a8d5c9d22761dc890/basher.py
(bosh.dirs['app'].join('FO3Edit.exe'),'-translate'),
(bosh.dirs['app'].join('FO3Edit\\FO3Edit.exe'),'-translate'),
def InitStatusBar(): """Initialize status bar links.""" #--Bash Status/LinkBar #BashStatusBar.buttons.append(App_Fallout3()) BashStatusBar.buttons.append(Fose_Button()) BashStatusBar.buttons.append(AutoQuit_Button()) BashStatusBar.buttons.append( Fallout3_Button( bosh.dirs['app'].join('Fallout3.exe'), Image(r'images/fallout3.png'), _("Launch Fallout3"), _("Launch Fallout3 + FOSE"), '')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('GECK.exe'), Image(r'images/geck.png'), _("Launch GECK"), _("Launch GECK + FOSE"), '-editor')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('fomm.exe'), Image(r'images/database_connect.png'), _("Launch FOMM"))) BashStatusBar.buttons.append( App_Tes4Gecko(None, Image(r'images/cog.png'), _("Launch Tes4Gecko"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'), '-view'), Image(r'images/brick_edit.png'), _("Launch FO3View"))) BashStatusBar.buttons.append( App_Tes4View( bosh.dirs['app'].join('FO3Edit.exe'), Image(r'images/brick.png'), _("Launch FO3Edit"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'),'-translate'), Image(r'images/brick_error.png'), _("Launch FO3Trans"))) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('Tes4LodGen.exe'), Image(r'images/brick_go.png'), _("Launch Tes4LODGen"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/Boss1.png'), _("Launch BOSS"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/boss2.png'), _("Launch BOSS"))) BashStatusBar.buttons.append(App_BashMon()) BashStatusBar.buttons.append(App_DocBrowser()) BashStatusBar.buttons.append(App_ModChecker()) BashStatusBar.buttons.append(App_Help())
215be538ae6b957464ec5a1a8d5c9d22761dc890 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/215be538ae6b957464ec5a1a8d5c9d22761dc890/basher.py
BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('Tes4LodGen.exe'), Image(r'images/brick_go.png'), _("Launch Tes4LODGen")))
def InitStatusBar(): """Initialize status bar links.""" #--Bash Status/LinkBar #BashStatusBar.buttons.append(App_Fallout3()) BashStatusBar.buttons.append(Fose_Button()) BashStatusBar.buttons.append(AutoQuit_Button()) BashStatusBar.buttons.append( Fallout3_Button( bosh.dirs['app'].join('Fallout3.exe'), Image(r'images/fallout3.png'), _("Launch Fallout3"), _("Launch Fallout3 + FOSE"), '')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('GECK.exe'), Image(r'images/geck.png'), _("Launch GECK"), _("Launch GECK + FOSE"), '-editor')) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('fomm.exe'), Image(r'images/database_connect.png'), _("Launch FOMM"))) BashStatusBar.buttons.append( App_Tes4Gecko(None, Image(r'images/cog.png'), _("Launch Tes4Gecko"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'), '-view'), Image(r'images/brick_edit.png'), _("Launch FO3View"))) BashStatusBar.buttons.append( App_Tes4View( bosh.dirs['app'].join('FO3Edit.exe'), Image(r'images/brick.png'), _("Launch FO3Edit"))) BashStatusBar.buttons.append( App_Tes4View( (bosh.dirs['app'].join('FO3Edit.exe'),'-translate'), Image(r'images/brick_error.png'), _("Launch FO3Trans"))) BashStatusBar.buttons.append( App_Button( bosh.dirs['app'].join('Tes4LodGen.exe'), Image(r'images/brick_go.png'), _("Launch Tes4LODGen"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/Boss1.png'), _("Launch BOSS"))) BashStatusBar.buttons.append( App_BOSS( bosh.dirs['app'].join('Data\\BOSS-F.bat'), Image(r'images/boss2.png'), _("Launch BOSS"))) BashStatusBar.buttons.append(App_BashMon()) BashStatusBar.buttons.append(App_DocBrowser()) BashStatusBar.buttons.append(App_ModChecker()) BashStatusBar.buttons.append(App_Help())
215be538ae6b957464ec5a1a8d5c9d22761dc890 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/215be538ae6b957464ec5a1a8d5c9d22761dc890/basher.py
record.damage = ins.unpack('H',size,readId)
(record.damage,) = ins.unpack('H',size,readId)
def loadData(self,record,ins,type,size,readId): if size == 186: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 2: record.damage = ins.unpack('H',size,readId) return else: raise "Unexpected size encountered for WATR subrecord: %s" % size
884c237cd878effa1c2c0d117ff08f03730ae91a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/884c237cd878effa1c2c0d117ff08f03730ae91a/bosh.py
('Fallout - Meshes.bsa',1138575220), ('Fallout - Misc.bsa',1139433736), ('Fallout - Sounds.bsa',1138660560), ('Fallout - Textures - Compressed.bsa',1138162634), ('Fallout - Voices1.bsa',1138162934), ('Fallout - Voices2.bsa',1138166742),
('Fallout - MenuVoices.bsa',1138575220), ('Fallout - Meshes.bsa',1139433736), ('Fallout - Misc.bsa',1138660560), ('Fallout - Sounds.bsa',1138162634), ('Fallout - Textures.bsa',1138162934), ('Fallout - Voices.bsa',1138166742),
def resetMTimes(self): """Reset dates of bsa files to 'correct' values.""" #--Fix the data of a few archive files bsaTimes = ( ('Fallout - Meshes.bsa',1138575220), ('Fallout - Misc.bsa',1139433736), ('Fallout - Sounds.bsa',1138660560), ('Fallout - Textures - Compressed.bsa',1138162634), ('Fallout - Voices1.bsa',1138162934), ('Fallout - Voices2.bsa',1138166742), ) for bsaFile,mtime in bsaTimes: dirs['mods'].join(bsaFile).mtime = mtime
2e6db0ec4099b9682b5a69f3ca23782f6cc992b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/2e6db0ec4099b9682b5a69f3ca23782f6cc992b2/bosh.py
if flags.head or flags.hair or flags.headband or flags.hat: type = head elif flags.upperBody: type = body
if flags.upperBody: type = body elif flags.head or flags.hair or flags.headband or flags.hat: type = head
def buildPatch(self,log,progress,patchFile): """Edits patch file as desired. Will write to log.""" count = {} format = self.choiceValues[self.chosen][0] showStat = '%02d' in format keep = patchFile.getKeeper() codes = getattr(patchFile,'bodyTags','HAGPBFE') head,body,gloves,pipboy,backpack,fancy,accessory = [ x for x in codes] for record in getattr(patchFile,self.key).records: if not record.full: continue if record.full[0] in '+-=()[]<>': continue flags = record.bipedFlags if flags.head or flags.hair or flags.headband or flags.hat: type = head elif flags.upperBody: type = body elif flags.leftHand or flags.rightHand: type = gloves elif flags.pipboy: type = pipboy elif flags.backpack: type = backpack elif flags.necklace or flags.eyeGlasses or flags.noseRing or flags.earrings or flags.mask or flags.choker or flags.mouthObject: type = fancy elif flags.bodyAddOn1 or flags.bodyAddOn2 or flags.bodyAddOn3: type = accessory else: continue if record.recType == 'ARMO': if record.generalFlags.powerArmor: type += 'P' if record.generalFlags.heavyArmor: type += 'H' if showStat: record.full = format % (type,record.ar/100) + record.full else: record.full = format % type + record.full keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log(_('* %s: %d') % (self.label,sum(count.values()))) for srcMod in modInfos.getOrdered(count.keys()): log(' * %s: %d' % (srcMod.s,count[srcMod]))
2e6db0ec4099b9682b5a69f3ca23782f6cc992b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/2e6db0ec4099b9682b5a69f3ca23782f6cc992b2/bosh.py
elif flags.backpack: type = backpack elif flags.necklace or flags.eyeGlasses or flags.noseRing or flags.earrings or flags.mask or flags.choker or flags.mouthObject: type = fancy elif flags.bodyAddOn1 or flags.bodyAddOn2 or flags.bodyAddOn3: type = accessory
def buildPatch(self,log,progress,patchFile): """Edits patch file as desired. Will write to log.""" count = {} format = self.choiceValues[self.chosen][0] showStat = '%02d' in format keep = patchFile.getKeeper() codes = getattr(patchFile,'bodyTags','HAGPBFE') head,body,gloves,pipboy,backpack,fancy,accessory = [ x for x in codes] for record in getattr(patchFile,self.key).records: if not record.full: continue if record.full[0] in '+-=()[]<>': continue flags = record.bipedFlags if flags.head or flags.hair or flags.headband or flags.hat: type = head elif flags.upperBody: type = body elif flags.leftHand or flags.rightHand: type = gloves elif flags.pipboy: type = pipboy elif flags.backpack: type = backpack elif flags.necklace or flags.eyeGlasses or flags.noseRing or flags.earrings or flags.mask or flags.choker or flags.mouthObject: type = fancy elif flags.bodyAddOn1 or flags.bodyAddOn2 or flags.bodyAddOn3: type = accessory else: continue if record.recType == 'ARMO': if record.generalFlags.powerArmor: type += 'P' if record.generalFlags.heavyArmor: type += 'H' if showStat: record.full = format % (type,record.ar/100) + record.full else: record.full = format % type + record.full keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log(_('* %s: %d') % (self.label,sum(count.values()))) for srcMod in modInfos.getOrdered(count.keys()): log(' * %s: %d' % (srcMod.s,count[srcMod]))
2e6db0ec4099b9682b5a69f3ca23782f6cc992b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/2e6db0ec4099b9682b5a69f3ca23782f6cc992b2/bosh.py
'QUST','SCPT','SOUN','SPEL','STAT','TERM','TXST','WATR','WEAP'))
'QUST','REFR','SCPT','SOUN','SPEL','STAT','TERM','TXST','WATR', 'WEAP'))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreActi,MreAlch,MreAmmo,MreFurn,MreMisc,MreMstt,MreProj,MreWeap): recAttrs_class[recClass] = ('destructable',) for recClass in (MreCont,MreDoor,MreTerm): recAttrs_class[recClass] = ('destructable','script',) for recClass in (MreLigh,): recAttrs_class[recClass] = ('script',) for recClass in (MreStat,): recAttrs_class[recClass] = ('model',) self.longTypes = set(('ACTI','ALCH','AMMO','ARMO','BOOK','CONT','CREA','DEBR','DIAL', 'DOOR','ENCH','EXPL','FACT','FLOR','FLST','FURN','INFO','INGR', 'IPDS','KEYM','LIGH','MGEF','MISC','MSTT','NOTE','NPC_','PROJ', 'QUST','SCPT','SOUN','SPEL','STAT','TERM','TXST','WATR','WEAP'))
6772dcb0e8bcefdf0b6731eed865a577649ca1c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/6772dcb0e8bcefdf0b6731eed865a577649ca1c0/bosh.py
MelString('ICON','iconPath'),
MelString('ICON','largeIconPath'), MelString('MICO','smallIconPath'),
def dumpData(self,record,out): """Conditionally dumps data.""" if record.entryType == 7 and self.subType == 'RDMD': MelOptStruct.dumpData(self,record,out)
7af65d5cb8642d4a7ed7404ec0d1375620c3647e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/7af65d5cb8642d4a7ed7404ec0d1375620c3647e/bosh.py
MelRegnStructA('RDWT', '2I', 'weather', (FID, 'weather'), 'chance')),
MelRegnStructA('RDWT', '3I', 'weather', (FID, 'weather', None), 'chance', (FID, 'global', None))),
def dumpData(self,record,out): """Conditionally dumps data.""" if record.entryType == 7 and self.subType == 'RDMD': MelOptStruct.dumpData(self,record,out)
7af65d5cb8642d4a7ed7404ec0d1375620c3647e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/7af65d5cb8642d4a7ed7404ec0d1375620c3647e/bosh.py
__slots__ = MelRecord.__slots__ + melSet.getSlotsUsed() + ['infoStamp','infos']
__slots__ = MelRecord.__slots__ + melSet.getSlotsUsed() + ['infoStamp','infoStamp2','infos']
def loadData(self,record,ins,type,size,readId): if size == 124: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 120: #--Else 120 byte record (skips flagsB unpacked = ins.unpack('2B2s8f2B2s3fB3s2f5B3s2f2B2s7fB3sf',size,readId) elif size == 112: #--112 byte record (skips flagsB, rushChance, unused6, rushMult unpacked = ins.unpack('2B2s8f2B2s3fB3s2f5B3s2f2B2s7f',size,readId) elif size == 104: #--104 byte record (skips flagsB, rushChance, unused6, rushMult, rStand, groupStand #-- only one occurence (AndragilTraining unpacked = ins.unpack('2B2s8f2B2s3fB3s2f5B3s2f2B2s5f',size,readId) elif size == 92: #--92 byte record (skips flagsB, rushChance, unused6, rushMult, rStand, groupStand #-- mDistance, rDistance, buffStand #-- These records keep getting shorter and shorter... #-- This one is used by quite a few npcs unpacked = ins.unpack('2B2s8f2B2s3fB3s2f5B3s2f2B2s2f',size,readId) elif size == 84: #--84 byte record (skips flagsB, rushChance, unused6, rushMult, rStand, groupStand #-- mDistance, rDistance, buffStand, rMultOpt, rMultMax #-- This one is present once: VidCaptureNoAttacks and it isn't actually used. unpacked = ins.unpack('2B2s8f2B2s3fB3s2f5B3s2f2B2s',size,readId) else: raise "Unexpected size encountered for CSTD subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flagsA.getTrueAttrs()
4f3c3521e6decae3aa6f97efc42bb421033759ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/4f3c3521e6decae3aa6f97efc42bb421033759ee/bosh.py
out.pack('4sIIII','GRUP',size,self.fid,7,self.infoStamp)
out.pack('4sIIIII','GRUP',size,self.fid,7,self.infoStamp,self.infoStamp2)
def dump(self,out): """Dumps self., then group header and then records.""" MreRecord.dump(self,out) if not self.infos: return size = 20 + sum([20 + info.getSize() for info in self.infos]) out.pack('4sIIII','GRUP',size,self.fid,7,self.infoStamp) for info in self.infos: info.dump(out)
4f3c3521e6decae3aa6f97efc42bb421033759ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/4f3c3521e6decae3aa6f97efc42bb421033759ee/bosh.py
for recClass in (MreActi,MreLigh):
for recClass in (MreActi,):
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 self.classestemp = set() #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreMgef,): recAttrs_class[recClass] = ('castingSound','boltSound','hitSound','areaSound') for recClass in (MreActi,MreLigh): recAttrs_class[recClass] = ('soundLooping','soundActivation') for recClass in (MreWthr,): recAttrs_class[recClass] = ('sound','sounds') for recClass in (MreCont,): recAttrs_class[recClass] = ('soundOpen','soundClose') for recClass in (MreDoor,): recAttrs_class[recClass] = ('soundOpen','soundClose','soundLoop') for recClass in (MreExpl,MreIpct,): recAttrs_class[recClass] = ('soundLevel','sound1','sound2') for recClass in (MreProj,): recAttrs_class[recClass] = ('sound','soundCountDown','soundDisable','soundLevel') #--Needs Longs self.longTypes = set(('MGEF','ACTI','LIGH','WTHR','CONT','DOOR','EXPL','IPCT','PROJ'))
5935b8483f13976a5220d49b0ee7a6ac7971f4f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5935b8483f13976a5220d49b0ee7a6ac7971f4f0/bosh.py
recAttrs_class[recClass] = ('sound','sounds')
recAttrs_class[recClass] = ('sounds',)
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 self.classestemp = set() #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreMgef,): recAttrs_class[recClass] = ('castingSound','boltSound','hitSound','areaSound') for recClass in (MreActi,MreLigh): recAttrs_class[recClass] = ('soundLooping','soundActivation') for recClass in (MreWthr,): recAttrs_class[recClass] = ('sound','sounds') for recClass in (MreCont,): recAttrs_class[recClass] = ('soundOpen','soundClose') for recClass in (MreDoor,): recAttrs_class[recClass] = ('soundOpen','soundClose','soundLoop') for recClass in (MreExpl,MreIpct,): recAttrs_class[recClass] = ('soundLevel','sound1','sound2') for recClass in (MreProj,): recAttrs_class[recClass] = ('sound','soundCountDown','soundDisable','soundLevel') #--Needs Longs self.longTypes = set(('MGEF','ACTI','LIGH','WTHR','CONT','DOOR','EXPL','IPCT','PROJ'))
5935b8483f13976a5220d49b0ee7a6ac7971f4f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5935b8483f13976a5220d49b0ee7a6ac7971f4f0/bosh.py
GmstTweak(_('UOP Vampire Aging and Face Fix.esp'), _("Duplicate of UOP component that disables vampire aging (fixes a bug). Use instead of 'UOP Vampire Aging & Face Fix.esp' to save an esp slot."), 'iVampirismAgeOffset', ('Fix it!',0),
GmstTweak(_('PipBoy Light Keypress-Delay'), _("Seconds of delay until the PipBoy Light switches on."), ('fPlayerPipBoyLightTimer'), (_('0.3'),0.3), (_('0.4'),0.4), (_('0.5'),0.5), (_('0.6'),0.6), (_('0.7'),0.7), (_('[0.8]'),0.8), (_('1.0'),1.0), ), GmstTweak(_('VATS Playback Delay'), _("Seconds of delay after the VATS Camera finished playback."), ('fVATSPlaybackDelay'), (_('0.01'),0.01), (_('0.05'),0.05), (_('0.10'),0.1), (_('[0.17]'),0.17), (_('0.25'),0.25),
def buildPatch(self,patchFile,keep,log): """Build patch.""" eids = ((self.key,),self.key)[isinstance(self.key,tuple)] for eid,value in zip(eids,self.choiceValues[self.chosen]): gmst = MreGmst(('GMST',0,0,0,0,0)) gmst.eid,gmst.value,gmst.longFids = eid,value,True fid = gmst.fid = keep(gmst.getFallout3Fid()) patchFile.GMST.setRecord(gmst) if len(self.choiceLabels) > 1: log('* %s: %s' % (self.label,self.choiceLabels[self.chosen])) else: log('* ' + self.label)
5935b8483f13976a5220d49b0ee7a6ac7971f4f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5935b8483f13976a5220d49b0ee7a6ac7971f4f0/bosh.py
NamesTweak_Dwarven(),
def buildPatch(self,log,progress,patchFile): count = {} keep = patchFile.getKeeper() for type in self.activeTypes: if type not in patchFile.tops: continue for record in patchFile.tops[type].records: if not record.full: continue if not 'dwar' in record.full.lower(): continue if 'dwarven' in record.full: record.full = record.full.replace('dwarven','dwemer') elif 'Dwarven' in record.full: record.full = record.full.replace('Dwarven','Dwemer') elif 'Dwarf' in record.full: record.full = record.full.replace('Dwarf','Dwemer') elif 'dwarf' in record.full: record.full = record.full.replace('dwarf','dwemer') keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log(_('* %s: %d') % (self.label,sum(count.values()))) for srcMod in modInfos.getOrdered(count.keys()): log(' * %s: %d' % (srcMod.s,count[srcMod]))
5935b8483f13976a5220d49b0ee7a6ac7971f4f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5935b8483f13976a5220d49b0ee7a6ac7971f4f0/bosh.py