Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a special Edition class with handles exceptions, such as BioN…
…ode, without resorting to boolean checking.
- Loading branch information
Showing
5 changed files
with
83 additions
and
23 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
from fabric.api import * | ||
|
||
from edition import * | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.DEBUG) | ||
ch = logging.StreamHandler() | ||
ch.setLevel(logging.DEBUG) | ||
# create formatter | ||
formatter = logging.Formatter('%(name)s %(levelname)s: %(message)s') | ||
# add formatter to ch | ||
ch.setFormatter(formatter) | ||
logger.addHandler(ch) | ||
|
||
class BioNode(Edition): | ||
"""BioNode specialization of BioLinux | ||
""" | ||
def __init__(self, env): | ||
self.name = "BioNode Edition" | ||
self.env = env | ||
self.include_oracle_virtualbox = False | ||
self.include_freenx = False | ||
|
||
def check_packages_source(self): | ||
# Bionode removes sources, just to be sure | ||
logger.debug("Clearing %s" % self.env.sources_file) | ||
sudo("cat /dev/null > %s" % self.env.sources_file) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.DEBUG) | ||
ch = logging.StreamHandler() | ||
ch.setLevel(logging.DEBUG) | ||
# create formatter | ||
formatter = logging.Formatter('%(name)s %(levelname)s: %(message)s') | ||
# add formatter to ch | ||
ch.setFormatter(formatter) | ||
logger.addHandler(ch) | ||
|
||
|
||
class Edition: | ||
"""Base class. Every edition derives from this | ||
""" | ||
def __init__(self): | ||
self.name = "BioLinux base Edition" | ||
"""Base class. Every edition derives from this | ||
""" | ||
def __init__(self, env): | ||
self.name = "BioLinux base Edition" | ||
self.env = env | ||
self.include_oracle_virtualbox = True | ||
self.include_freenx = True | ||
|
||
def check_packages_source(self): | ||
"""Override for check package definition file before updating | ||
""" | ||
logger.debug("check_packages_source not implemented") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters