Skip to content

Commit

Permalink
Remove leftover theme files.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 27, 2014
1 parent 6d9cff1 commit b907798
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,34 @@ def install_manpages(root, prefix):
except Exception as e:
print("Not installing the man pages:", e)

def remove_old_files(self):
base = os.path.join(self.install_lib, 'nikola')
to_remove = ['data/themes/bootstrap/templates/bootstrap_helper.tmpl',
'data/themes/bootstrap-jinja/templates/bootstrap_helper.tmpl',
'data/themes/bootstrap3/templates/bootstrap_helper.tmpl',
'data/themes/bootstrap3/templates/list.tmpl',
'data/themes/bootstrap3/templates/list_post.tmpl',
'data/themes/bootstrap3/templates/post.tmpl',
'data/themes/bootstrap3/templates/tags.tmpl',
'data/themes/bootstrap3-jinja/templates/bootstrap_helper.tmpl',
'data/themes/bootstrap3-jinja/templates/list.tmpl',
'data/themes/bootstrap3-jinja/templates/list_post.tmpl',
'data/themes/bootstrap3-jinja/templates/post.tmpl',
'data/themes/bootstrap3-jinja/templates/tags.tmpl',
]
for f in to_remove:
try:
os.remove(os.path.join(base, f))
except:
pass
else:
print('removing', os.path.join(base, f))

class nikola_install(install):
def run(self):
copy_symlinked_for_windows()
install.run(self)
remove_old_files(self)
install_manpages(self.root, self.prefix)


Expand Down

4 comments on commit b907798

@da2x
Copy link
Contributor

@da2x da2x commented on b907798 Mar 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kwpolska what about the various renamed plugin helpers in base? they wouldn’t break anything but since we’re cleaning up anyways … .

@ralsina
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just remove the whole data tree before installing? Everything there that's not in the new version is useless.

@Kwpolska
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that kinda too hardcore, but so be it.

1c90250 is Aeyoun-compatible, while 3a16131 is ralsina-compatible. If any problems arise, we can just revert the latter and have a more stable solution around.

@da2x
Copy link
Contributor

@da2x da2x commented on b907798 Mar 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way we don’t have to maintain a list of old crap.

Please sign in to comment.