Ignore:
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Data/OWDataTable.py

    r10601 r10703  
    150150                  self.index(len(self.examples) - 1, len(self.all_attrs) - 1) 
    151151                  ) 
    152              
     152 
     153 
     154class TableViewWithCopy(QTableView): 
     155    def keyPressEvent(self, event): 
     156        if event == QKeySequence.Copy: 
     157            sel_model = self.selectionModel() 
     158            try: 
     159                self.copy_selection_to_clipboard(sel_model) 
     160            except Exception: 
     161                import traceback 
     162                traceback.print_exc(file=sys.stderr) 
     163        else: 
     164            return QTableView.keyPressEvent(self, event) 
     165             
     166    def copy_selection_to_clipboard(self, selection_model): 
     167        """Copy table selection to the clipboard. 
     168        """ 
     169        # TODO: html/rtf table 
     170        import csv 
     171        from StringIO import StringIO 
     172        rows = selection_model.selectedRows(0) 
     173        lines = [] 
     174        csv_str = StringIO() 
     175        csv_writer = csv.writer(csv_str, dialect="excel") 
     176        tsv_str = StringIO() 
     177        tsv_writer = csv.writer(tsv_str, dialect="excel-tab") 
     178        for row in rows: 
     179            line = [] 
     180            for i in range(self.model().columnCount()): 
     181                index = self.model().index(row.row(), i) 
     182                val = index.data(Qt.DisplayRole) 
     183                line.append(unicode(val.toString())) 
     184 
     185            csv_writer.writerow(line) 
     186            tsv_writer.writerow(line) 
     187 
     188        csv_lines = csv_str.getvalue() 
     189        tsv_lines = tsv_str.getvalue() 
     190 
     191        mime = QMimeData() 
     192        mime.setData("text/csv", QByteArray(csv_lines)) 
     193        mime.setData("text/tab-separated-values", QByteArray(tsv_lines)) 
     194        mime.setData("text/plain", QByteArray(tsv_lines)) 
     195        QApplication.clipboard().setMimeData(mime, QClipboard.Clipboard) 
     196 
    153197 
    154198class OWDataTable(OWWidget): 
     
    275319            self.showMetas[id] = (True, []) 
    276320 
    277             table = QTableView() 
     321            table = TableViewWithCopy() #QTableView() 
    278322            table.setSelectionBehavior(QAbstractItemView.SelectRows) 
    279323            table.setSortingEnabled(True) 
  • Orange/OrangeWidgets/Visualize/OWLinProjGraph.py

    r10476 r10705  
    221221            shownSubsetCount = 0 
    222222            subsetIdsToDraw = dict([(example.id,1) for example in self.rawSubsetData]) 
    223  
     223            subsetIdsAlreadyDrawn = set() 
    224224            # draw the rawData data set. examples that exist also in the subset data draw full, other empty 
    225225            for i in range(dataSize): 
    226                 if not validData[i]: continue 
     226                if not validData[i]: 
     227                    continue 
    227228                if subsetIdsToDraw.has_key(self.rawData[i].id): 
    228                     continue 
     229                    instance_filled = 1 
     230                    subsetIdsAlreadyDrawn.add(self.rawData[i].id) 
     231                else: 
     232                    instance_filled = 0 
    229233 
    230234                if self.dataHasDiscreteClass and self.useDifferentColors: 
     
    240244                    curveSymbol = self.curveSymbols[0] 
    241245 
    242                 if not xPointsToAdd.has_key((newColor, curveSymbol,0)): 
    243                     xPointsToAdd[(newColor, curveSymbol,0)] = [] 
    244                     yPointsToAdd[(newColor, curveSymbol,0)] = [] 
    245                 xPointsToAdd[(newColor, curveSymbol,0)].append(x_positions[i]) 
    246                 yPointsToAdd[(newColor, curveSymbol,0)].append(y_positions[i]) 
     246                if not xPointsToAdd.has_key((newColor, curveSymbol, instance_filled)): 
     247                    xPointsToAdd[(newColor, curveSymbol, instance_filled)] = [] 
     248                    yPointsToAdd[(newColor, curveSymbol, instance_filled)] = [] 
     249                xPointsToAdd[(newColor, curveSymbol, instance_filled)].append(x_positions[i]) 
     250                yPointsToAdd[(newColor, curveSymbol, instance_filled)].append(y_positions[i]) 
    247251                if self.showValueLines: 
    248252                    self.addValueLineCurve(x_positions[i], y_positions[i], newColor, i, indices) 
     
    260264 
    261265            for i in range(len(self.rawSubsetData)): 
    262                 if not validSubData[i]: continue    # check if has missing values 
     266                if not validSubData[i]: # check if has missing values 
     267                    continue 
     268                if self.rawSubsetData[i].id in subsetIdsAlreadyDrawn: 
     269                    continue 
    263270 
    264271                if not self.dataHasClass or self.rawSubsetData[i].getclass().isSpecial(): 
  • Orange/OrangeWidgets/Visualize/OWScatterPlotGraph.py

    r9671 r10705  
    228228            xPointsToAdd = {} 
    229229            yPointsToAdd = {} 
     230            subsetIdsAlreadyDrawn = set() 
    230231            for i in range(len(self.rawData)): 
    231232                if not validData[i]: continue 
    232233                if subsetIdsToDraw.has_key(self.rawData[i].id): 
    233                     continue 
     234                    instanceFilled = 1 
     235                    subsetIdsAlreadyDrawn.add(self.rawData[i].id) 
     236                else: 
     237                    instanceFilled = showFilled 
    234238 
    235239                if colorIndex != -1: 
     
    246250                if sizeIndex != -1: size = MIN_SHAPE_SIZE + round(self.noJitteringScaledData[sizeIndex][i] * self.pointWidth) 
    247251 
    248                 if not xPointsToAdd.has_key((newColor, size, Symbol, showFilled)): 
    249                     xPointsToAdd[(newColor, size, Symbol, showFilled)] = [] 
    250                     yPointsToAdd[(newColor, size, Symbol, showFilled)] = [] 
    251                 xPointsToAdd[(newColor, size, Symbol, showFilled)].append(xData[i]) 
    252                 yPointsToAdd[(newColor, size, Symbol, showFilled)].append(yData[i]) 
     252                if not xPointsToAdd.has_key((newColor, size, Symbol, instanceFilled)): 
     253                    xPointsToAdd[(newColor, size, Symbol, instanceFilled)] = [] 
     254                    yPointsToAdd[(newColor, size, Symbol, instanceFilled)] = [] 
     255                xPointsToAdd[(newColor, size, Symbol, instanceFilled)].append(xData[i]) 
     256                yPointsToAdd[(newColor, size, Symbol, instanceFilled)].append(yData[i]) 
    253257                self.tips.addToolTip(xData[i], yData[i], i)     # we add a tooltip for this point 
    254258 
     
    268272                xData, yData = self.getXYSubsetDataPositions(xAttr, yAttr) 
    269273                for i in range(len(self.rawSubsetData)): 
    270                     if not validSubData[i]: continue 
     274                    if not validSubData[i]: 
     275                        continue 
     276                    if self.rawSubsetData[i].id in subsetIdsAlreadyDrawn: 
     277                        continue 
    271278 
    272279                    if colorIndex != -1 and self.validSubsetDataArray[colorIndex][i]: 
  • Orange/data/preprocess/scaling.py

    r10651 r10705  
    195195        self.jitter_size = 10 
    196196        self.jitter_continuous = 0 
     197        self.jitter_seed = 0 
    197198 
    198199        self.attr_values = {} 
     
    269270 
    270271        len_data = data and len(data) or 0 
    271         numpy.random.seed(1)     # we always reset the random generator, so that if we receive the same data again we will add the same noise 
    272272 
    273273        self.attribute_names = [attr.name for attr in full_data.domain] 
     
    362362                                         self.no_jittering_scaled_subset_data], 
    363363                                         axis = 1) 
    364         for index in range(len(data.domain)): 
     364 
     365        # Random generators for jittering  
     366        random = numpy.random.RandomState(seed=self.jitter_seed) 
     367        rand_seeds = random.random_integers(0, sys.maxint - 1, size=len(data.domain)) 
     368        for index, rseed in zip(range(len(data.domain)), rand_seeds): 
     369            # Need to use a different seed for each feature 
     370            random = numpy.random.RandomState(seed=rseed) 
    365371            attr = data.domain[index] 
    366372            if attr.var_type == Orange.core.VarTypes.Discrete: 
    367373                scaled_data[index] += (self.jitter_size/(50.0*max(1,len(attr.values))))*\ 
    368                                       (numpy.random.random(len(full_data)) - 0.5) 
     374                                      (random.rand(len(full_data)) - 0.5) 
    369375                 
    370376            elif attr.var_type == Orange.core.VarTypes.Continuous and self.jitter_continuous: 
    371                 scaled_data[index] += self.jitter_size/50.0 * (0.5 - numpy.random.random(len(full_data))) 
     377                scaled_data[index] += self.jitter_size/50.0 * (0.5 - random.rand(len(full_data))) 
    372378                scaled_data[index] = numpy.absolute(scaled_data[index])       # fix values below zero 
    373379                ind = numpy.where(scaled_data[index] > 1.0, 1, 0)     # fix values above 1 
    374380                numpy.putmask(scaled_data[index], ind, 2.0 - numpy.compress(ind, scaled_data[index])) 
     381 
     382        if self.have_subset_data: 
     383            # Fix all subset instances which are also in the main data 
     384            # to have the same jittered values 
     385            ids_to_indices = dict((inst.id, i) \ 
     386                                  for i, inst in enumerate(self.raw_data)) 
     387 
     388            subset_ids_map = [[i, ids_to_indices[s.id]] \ 
     389                               for i, s in enumerate(self.raw_subset_data)\ 
     390                               if s.id in ids_to_indices] 
     391            if len(subset_ids_map): 
     392                subset_ids_map = numpy.array(subset_ids_map) 
     393                subset_ids_map[:, 0] += len_data 
     394                scaled_data[:, subset_ids_map[:, 0]] = \ 
     395                        scaled_data[:, subset_ids_map[:, 1]] 
     396 
    375397        self.scaled_data = scaled_data[:,:len_data]; self.scaled_subset_data = scaled_data[:,len_data:] 
    376398     
  • Orange/feature/selection.py

    r10523 r10709  
    77from Orange.feature.scoring import score_all 
    88 
    9  
    10 def best_n(scores, n): 
    11     """Return the best features (without scores) from the list 
     9def top_rated(scores, n, highest_best=True): 
     10    """Return n top-rated features from the list of scores. 
    1211 
    1312    :param scores: a list such as the one returned by 
     
    1716    :type n: int 
    1817    :rtype: :obj:`list` 
    19  
     18    :param highest_best: if true, the features that are scored higher are preferred 
     19    :type highest_best: bool 
    2020    """ 
    2121    return [x[0] for x in \ 
     
    2323            ] 
    2424 
    25 bestNAtts = best_n 
    26  
     25bestNAtts = top_rated 
    2726 
    2827def above_threshold(scores, threshold=0.0): 
     
    4443 
    4544 
    46 def select_best_n(data, scores, n): 
     45def select(data, scores, n): 
    4746    """Construct and return a new data table that includes a 
    4847    class and only the best features from a list scores. 
     
    5756    :rtype: :obj:`Orange.data.Table` 
    5857    """ 
    59     return data.select(best_n(scores, n) + [data.domain.classVar.name]) 
    60  
    61 selectBestNAtts = select_best_n 
     58    return data.select(top_rated(scores, n) + [data.domain.classVar.name]) 
     59 
     60selectBestNAtts = select 
     61select_best_n = select 
    6262 
    6363 
     
    6565    """Construct and return a new data table that includes a class and 
    6666    features from the list returned by 
    67     :obj:`~Orange.feature.scoring.score_all` that have the score above or 
    68     equal to a specified threshold. 
     67    :obj:`~Orange.feature.scoring.score_all` with higher or equal score 
     68    to a given threshold. 
    6969 
    7070    :param data: a data table 
     
    100100    measl = score_all(data, measure) 
    101101    while len(data.domain.attributes) > 0 and measl[-1][1] < margin: 
    102         data = select_best_n(data, measl, len(data.domain.attributes) - 1) 
     102        data = select(data, measl, len(data.domain.attributes) - 1) 
    103103        measl = score_all(data, measure) 
    104104    return data 
     
    108108 
    109109class FilterAboveThreshold(object): 
    110     """A class wrapper around :obj:`select_above_threshold`; the 
    111     constructor stores the filter parameters that are applied when the 
    112     function is called. 
     110    """A wrapper around :obj:`select_above_threshold`; the 
     111    constructor stores the parameters of the feature selection 
     112    procedure that are then applied when the the selection 
     113    is called with the actual data. 
    113114 
    114115    :param measure: a feature scorer 
     
    116117    :param threshold: threshold for selection. Defaults to 0. 
    117118    :type threshold: float 
    118  
    119     Some examples of how to use this class:: 
    120  
    121         filter = Orange.feature.selection.FilterAboveThreshold(threshold=.15) 
    122         new_data = filter(data) 
    123         new_data = Orange.feature.selection.FilterAboveThreshold(data) 
    124         new_data = Orange.feature.selection.FilterAboveThreshold(data, threshold=.1) 
    125         new_data = Orange.feature.selection.FilterAboveThreshold(data, threshold=.1, 
    126                    measure=Orange.feature.scoring.Gini()) 
    127  
    128     """ 
     119    """ 
     120 
    129121    def __new__(cls, data=None, 
    130122                measure=orange.MeasureAttribute_relief(k=20, m=50), 
     
    158150 
    159151class FilterBestN(object): 
    160     """A class wrapper around :obj:`select_best_n`; the 
     152    """A wrapper around :obj:`select`; the 
    161153    constructor stores the filter parameters that are applied when the 
    162154    function is called. 
     
    187179        ma = score_all(data, self.measure) 
    188180        self.n = min(self.n, len(data.domain.attributes)) 
    189         return select_best_n(data, ma, self.n) 
     181        return select(data, ma, self.n) 
    190182 
    191183FilterBestNAtts = FilterBestN 
     
    230222 
    231223class FilteredLearner(object): 
    232     """A learner that applies the given features selection method and 
    233     then calls the base learner. This learner is needed to properly cross-validate a combination of feature selection and learning. 
     224    """A feature selection wrapper around base learner. When provided data, 
     225     this learner applies a given feature selection method and then calls 
     226     the base learner. 
    234227 
    235228    Here is an example of how to build a wrapper around naive Bayesian learner 
  • Orange/testing/regression/results_reference/freeviz-classify.py.txt

    r10474 r10706  
    1 (<orange.Value 'type'='mammal'>, <0.019, 0.083, 0.069, 0.039, 0.048, 0.712, 0.030>) 
    2 (<orange.Value 'type'='mammal'>, <0.041, 0.176, 0.254, 0.056, 0.115, 0.303, 0.055>) 
    3 (<orange.Value 'type'='bird'>, <0.032, 0.419, 0.119, 0.092, 0.161, 0.143, 0.034>) 
    4 (<orange.Value 'type'='bird'>, <0.028, 0.453, 0.092, 0.114, 0.134, 0.148, 0.031>) 
    5 (<orange.Value 'type'='mammal'>, <0.019, 0.078, 0.068, 0.037, 0.046, 0.721, 0.030>) 
    6 (<orange.Value 'type'='bird'>, <0.036, 0.350, 0.157, 0.082, 0.173, 0.165, 0.038>) 
    7 (<orange.Value 'type'='mammal'>, <0.018, 0.072, 0.063, 0.035, 0.043, 0.741, 0.028>) 
    8 (<orange.Value 'type'='mammal'>, <0.029, 0.285, 0.080, 0.153, 0.105, 0.313, 0.037>) 
    9 (<orange.Value 'type'='fish'>, <0.017, 0.029, 0.860, 0.008, 0.033, 0.037, 0.017>) 
    10 (<orange.Value 'type'='mammal'>, <0.020, 0.089, 0.071, 0.043, 0.051, 0.695, 0.031>) 
    11 (<orange.Value 'type'='insect'>, <0.003, 0.037, 0.005, 0.923, 0.014, 0.014, 0.004>) 
     1(<orange.Value 'type'='mammal'>, <0.019, 0.083, 0.068, 0.039, 0.046, 0.716, 0.029>) 
     2(<orange.Value 'type'='mammal'>, <0.042, 0.176, 0.253, 0.055, 0.117, 0.302, 0.055>) 
     3(<orange.Value 'type'='bird'>, <0.033, 0.402, 0.123, 0.094, 0.170, 0.143, 0.036>) 
     4(<orange.Value 'type'='bird'>, <0.028, 0.439, 0.094, 0.120, 0.139, 0.147, 0.033>) 
     5(<orange.Value 'type'='mammal'>, <0.019, 0.079, 0.067, 0.036, 0.045, 0.726, 0.028>) 
     6(<orange.Value 'type'='bird'>, <0.037, 0.337, 0.160, 0.081, 0.181, 0.163, 0.041>) 
     7(<orange.Value 'type'='mammal'>, <0.017, 0.073, 0.062, 0.034, 0.041, 0.746, 0.026>) 
     8(<orange.Value 'type'='mammal'>, <0.028, 0.284, 0.080, 0.157, 0.104, 0.309, 0.037>) 
     9(<orange.Value 'type'='fish'>, <0.020, 0.033, 0.840, 0.009, 0.037, 0.040, 0.022>) 
     10(<orange.Value 'type'='mammal'>, <0.020, 0.090, 0.070, 0.042, 0.050, 0.699, 0.029>) 
     11(<orange.Value 'type'='insect'>, <0.000, 0.004, 0.000, 0.992, 0.001, 0.001, 0.000>) 
  • Orange/testing/unit/tests/test_feature_selection.py

    r10655 r10708  
    2727         
    2828        # test best_n function 
    29         self.assertEqual(selection.best_n(self.scores, 3), best_3) 
     29        self.assertEqual(selection.top_rated(self.scores, 3), best_3) 
    3030         
    31         self.assertTrue(len(selection.best_n(self.scores, 3)) == 3) 
     31        self.assertTrue(len(selection.top_rated(self.scores, 3)) == 3) 
    3232         
    3333        # all returned values should be strings. 
    3434        self.assertTrue(all(isinstance(item, basestring) for item in \ 
    35                             selection.best_n(self.scores, 3))) 
     35                            selection.top_rated(self.scores, 3))) 
    3636         
    37         new_data = selection.select_best_n(self.data, self.scores, 3) 
     37        new_data = selection.select(self.data, self.scores, 3) 
    3838        self.assertEqual(best_3, [a.name for a in new_data.domain.attributes]) 
    3939        self.assertEqual(new_data.domain.class_var, self.data.domain.class_var) 
  • docs/reference/rst/Orange.feature.selection.rst

    r10172 r10708  
    1010   single: feature; feature selection 
    1111 
    12 Feature selection module contains several functions for selecting features based on they scores. A typical example is the function :obj:`select_best_n` that returns the best n features: 
     12Feature selection module contains several utility functions for selecting features based on they scores normally 
     13obtained in classification or regression problems. A typical example is the function :obj:`select` 
     14that returns a subsets of highest-scored features features: 
    1315 
    14     .. literalinclude:: code/selection-best3.py 
    15         :lines: 7- 
     16.. literalinclude:: code/selection-best3.py 
     17    :lines: 7- 
    1618 
    17     The script outputs:: 
     19The script outputs:: 
    1820 
    19         Best 3 features: 
    20         physician-fee-freeze 
    21         el-salvador-aid 
    22         synfuels-corporation-cutback 
     21    Best 3 features: 
     22    physician-fee-freeze 
     23    el-salvador-aid 
     24    synfuels-corporation-cutback 
    2325 
    2426The module also includes a learner that incorporates feature subset 
     
    2931-------------------------------------- 
    3032 
    31 .. automethod:: Orange.feature.selection.best_n 
     33.. automethod:: Orange.feature.selection.top_rated 
    3234 
    3335.. automethod:: Orange.feature.selection.above_threshold 
    3436 
    35 .. automethod:: Orange.feature.selection.select_best_n 
     37.. automethod:: Orange.feature.selection.select 
    3638 
    3739.. automethod:: Orange.feature.selection.select_above_threshold 
     
    5658.. autoclass:: Orange.feature.selection.FilterAboveThreshold(data=None, measure=Orange.feature.scoring.Relief(k=20, m=50), threshold=0.0) 
    5759   :members: 
     60 
     61Below are few examples of utility of this class:: 
     62 
     63    >>> filter = Orange.feature.selection.FilterAboveThreshold(threshold=.15) 
     64    >>> new_data = filter(data) 
     65    >>> new_data = Orange.feature.selection.FilterAboveThreshold(data) 
     66    >>> new_data = Orange.feature.selection.FilterAboveThreshold(data, threshold=.1) 
     67    >>> new_data = Orange.feature.selection.FilterAboveThreshold(data, threshold=.1, \ 
     68        measure=Orange.feature.scoring.Gini()) 
    5869 
    5970.. autoclass:: Orange.feature.selection.FilterBestN(data=None, measure=Orange.feature.scoring.Relief(k=20, m=50), n=5) 
  • docs/reference/rst/code/selection-best3.py

    r10171 r10708  
    1010n = 3 
    1111ma = Orange.feature.scoring.score_all(voting) 
    12 best = Orange.feature.selection.best_n(ma, n) 
     12best = Orange.feature.selection.top_rated(ma, n) 
    1313print 'Best %d features:' % n 
    1414for s in best: 
  • install-scripts/mac/dailyrun-finkonly.sh

    r10622 r10702  
    1 #!/bin/bash -e 
     1#!/bin/bash 
    22# 
    33# $1 workdir 
     
    9797fi 
    9898 
     99# Remove any old remaining local .info files 
     100rm -f $FINK_INFO_DIR/orange-*.info 
     101 
    99102# Directory where fink .info templates are stored 
    100103FINK_TEMPLATES=$WORK_DIR/fink 
     
    112115    curl --silent -o $FINK_TEMPLATES/orange-gui-dev-py.info https://bitbucket.org/biolab/orange/raw/tip/install-scripts/mac/fink/orange-gui-dev-py.info 
    113116    ./fink-register-info.sh "$FINK_TEMPLATES/orange-gui-dev-py.info" $BASE_URL/$FINK_ORANGE_SOURCE_TEMPLATE $ORANGE_SOURCE_MD5 $ORANGE_VERSION $FINK_INFO_DIR/orange-gui-dev-py.info >> $FINK_LOG 2>&1 
     117    FINK_ORANGE_INFO_EXIT_VALUE=$? 
    114118fi 
    115119 
     
    118122    curl --silent -o $FINK_TEMPLATES/orange-bioinformatics-gui-dev-py.info https://bitbucket.org/biolab/orange/raw/tip/install-scripts/mac/fink/orange-bioinformatics-gui-dev-py.info 
    119123    ./fink-register-info.sh "$FINK_TEMPLATES/orange-bioinformatics-gui-dev-py.info" $BASE_URL/$FINK_BIOINFORMATICS_SOURCE_TEMPLATE $BIOINFORMATICS_SOURCE_MD5 $BIOINFORMATICS_VERSION $FINK_INFO_DIR/orange-bioinformatics-gui-dev-py.info >> $FINK_LOG 2>&1 
     124    FINK_BIOINFORMATICS_INFO_EXIT_VALUE=$? 
    120125fi 
    121126 
     
    124129    curl --silent -o $FINK_TEMPLATES/orange-text-gui-dev-py.info https://bitbucket.org/biolab/orange/raw/tip/install-scripts/mac/fink/orange-text-gui-dev-py.info 
    125130    ./fink-register-info.sh "$FINK_TEMPLATES/orange-text-gui-dev-py.info" $BASE_URL/$FINK_TEXT_SOURCE_TEMPLATE $TEXT_SOURCE_MD5 $TEXT_VERSION $FINK_INFO_DIR/orange-text-gui-dev-py.info >> $FINK_LOG 2>&1 
     131    FINK_TEXT_INFO_EXIT_VALUE=$? 
    126132fi 
    127133 
     
    130136fi 
    131137 
     138EXIT_VALUE=$(($FINK_ORANGE_INFO_EXIT_VALUE + $FINK_BIOINFORMATICS_INFO_EXIT_VALUE + $FINK_TEXT_INFO_EXIT_VALUE)) 
     139if (($EXIT_VALUE)); then 
     140    echo "Running fink-register-info.sh failed" 
     141    rm -f $FINK_INFO_DIR/orange-*.info 
     142fi 
    132143 
    133144## daily fink build 
  • install-scripts/mac/dailyrun.sh

    r10625 r10702  
    1 #!/bin/bash -e 
     1#!/bin/bash 
    22# 
    33# Should be run as: sudo ./dailyrun.sh 
     
    131131fi 
    132132 
     133# Remove any old remaining local .info files 
     134rm -f $FINK_INFO_DIR/orange-*.info 
     135 
    133136# Directory where fink .info templates are 
    134137FINK_TEMPLATES=$WORK_DIR/orange/install-scripts/mac/fink 
     
    140143    FINK_ORANGE_SOURCE_TEMPLATE="Orange-%v.tar.gz" 
    141144    ./fink-register-info.sh "$FINK_TEMPLATES/orange-gui-dev-py.info" $BASE_URL/$FINK_ORANGE_SOURCE_TEMPLATE $ORANGE_SOURCE_MD5 $ORANGE_VERSION $FINK_INFO_DIR/orange-gui-dev-py.info >> $FINK_LOG 2>&1 
     145    FINK_ORANGE_INFO_EXIT_VALUE=$? 
    142146fi 
    143147 
     
    145149    FINK_BIOINFORMATICS_SOURCE_TEMPLATE="Orange-Bioinformatics-%v.tar.gz" 
    146150    ./fink-register-info.sh "$FINK_TEMPLATES/orange-bioinformatics-gui-dev-py.info" $BASE_URL/$FINK_BIOINFORMATICS_SOURCE_TEMPLATE $BIOINFORMATICS_SOURCE_MD5 $BIOINFORMATICS_VERSION $FINK_INFO_DIR/orange-bioinformatics-gui-dev-py.info >> $FINK_LOG 2>&1 
     151    FINK_BIOINFORMATICS_INFO_EXIT_VALUE=$? 
    147152fi 
    148153 
     
    150155    FINK_TEXT_SOURCE_TEMPLATE="Orange-Text-Mining-%v.tar.gz" 
    151156    ./fink-register-info.sh "$FINK_TEMPLATES/orange-text-gui-dev-py.info" $BASE_URL/$FINK_TEXT_SOURCE_TEMPLATE $TEXT_SOURCE_MD5 $TEXT_VERSION $FINK_INFO_DIR/orange-text-gui-dev-py.info >> $FINK_LOG 2>&1 
     157    FINK_TEXT_INFO_EXIT_VALUE=$? 
    152158fi 
    153159 
     
    156162fi 
    157163 
     164EXIT_VALUE=$(($FINK_ORANGE_INFO_EXIT_VALUE + $FINK_BIOINFORMATICS_INFO_EXIT_VALUE + $FINK_TEXT_INFO_EXIT_VALUE)) 
     165if (($EXIT_VALUE)); then 
     166    echo "Running fink-register-info.sh failed" 
     167    rm -f $FINK_INFO_DIR/orange-*.info 
     168fi 
    158169 
    159170## daily fink build 
  • install-scripts/mac/fink-daily-build-packages.sh

    r10622 r10702  
    7575rm -f $FINK_ROOT/fink/dists/biolab/main/finkinfo/all.tgz 
    7676 
    77 # Move info files from local/main/finkinfo (put there by dailyru[-finkonly].sh 
    78 if [ -e $FINK_ROOT/fink/dists/local/main/finkinfo/*.info ]; then 
     77# Move info files from local/main/finkinfo (put there by dailyrun[-finkonly].sh 
     78if [[ $(ls -A $FINK_ROOT/fink/dists/local/main/finkinfo/ | grep "\.info") ]]; then 
    7979    echo "Updating new fink info files." 
    8080    mv $FINK_ROOT/fink/dists/local/main/finkinfo/*.info $FINK_ROOT/fink/dists/biolab/main/finkinfo/ 
Note: See TracChangeset for help on using the changeset viewer.