summaryrefslogtreecommitdiff
path: root/src/backend/branchreset.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/branchreset.py')
-rw-r--r--src/backend/branchreset.py41
1 files changed, 19 insertions, 22 deletions
diff --git a/src/backend/branchreset.py b/src/backend/branchreset.py
index 6168a25..def225a 100644
--- a/src/backend/branchreset.py
+++ b/src/backend/branchreset.py
@@ -3,36 +3,33 @@
import animation
import os
import shutil
-
-gentooEbuildDir = '/usr/ports/gentoo'
-redcoreEbuildDir = '/usr/ports/redcore'
-portageConfigDir = '/opt/redcore-build'
+import sisyphus.filesystem
@animation.wait('resetting branch configuration')
def start():
- if os.path.isdir(gentooEbuildDir):
- for files in os.listdir(gentooEbuildDir):
- if os.path.isfile(os.path.join(gentooEbuildDir, files)):
- os.remove(os.path.join(gentooEbuildDir, files))
+ if os.path.isdir(sisyphus.filesystem.gentooEbuildDir):
+ for files in os.listdir(sisyphus.filesystem.gentooEbuildDir):
+ if os.path.isfile(os.path.join(sisyphus.filesystem.gentooEbuildDir, files)):
+ os.remove(os.path.join(sisyphus.filesystem.gentooEbuildDir, files))
else:
- shutil.rmtree(os.path.join(gentooEbuildDir, files))
+ shutil.rmtree(os.path.join(sisyphus.filesystem.gentooEbuildDir, files))
else:
- os.makedirs(gentooEbuildDir)
+ os.makedirs(sisyphus.filesystem.gentooEbuildDir)
- if os.path.isdir(redcoreEbuildDir):
- for files in os.listdir(redcoreEbuildDir):
- if os.path.isfile(os.path.join(redcoreEbuildDir, files)):
- os.remove(os.path.join(redcoreEbuildDir, files))
+ if os.path.isdir(sisyphus.filesystem.redcoreEbuildDir):
+ for files in os.listdir(sisyphus.filesystem.redcoreEbuildDir):
+ if os.path.isfile(os.path.join(sisyphus.filesystem.redcoreEbuildDir, files)):
+ os.remove(os.path.join(sisyphus.filesystem.redcoreEbuildDir, files))
else:
- shutil.rmtree(os.path.join(redcoreEbuildDir, files))
+ shutil.rmtree(os.path.join(sisyphus.filesystem.redcoreEbuildDir, files))
else:
- os.makedirs(redcoreEbuildDir)
+ os.makedirs(sisyphus.filesystem.redcoreEbuildDir)
- if os.path.isdir(portageConfigDir):
- for files in os.listdir(portageConfigDir):
- if os.path.isfile(os.path.join(portageConfigDir, files)):
- os.remove(os.path.join(portageConfigDir, files))
+ if os.path.isdir(sisyphus.filesystem.portageConfigDir):
+ for files in os.listdir(sisyphus.filesystem.portageConfigDir):
+ if os.path.isfile(os.path.join(sisyphus.filesystem.portageConfigDir, files)):
+ os.remove(os.path.join(sisyphus.filesystem.portageConfigDir, files))
else:
- shutil.rmtree(os.path.join(portageConfigDir, files))
+ shutil.rmtree(os.path.join(sisyphus.filesystem.portageConfigDir, files))
else:
- os.makedirs(portageConfigDir)
+ os.makedirs(sisyphus.filesystem.portageConfigDir)