Update browse history
12226
def update_history(self, directory):
        """"""
        try:
            directory = osp.abspath(to_text_string(directory))
            if directory in self.history:
                self.histindex = self.history.index(directory)
        except Exception:
            user_directory = get_home_dir()
            self.chdir(directory=user_directory, browsing_history=True)
843443
function(url) {
      if (!isSupportHistoryAPI && ('' + url).indexOf('#') === 0) {
        changeState(null, url, true);
      } else {
        windowLocation.replace(url);
      }
    }
1035857
def refresh(self, new_path=None, force_current=False):
        """"""
        if new_path is None:
            new_path = getcwd_or_home()
        if force_current:
            index = self.set_current_folder(new_path)
            self.expand(index)
            self.setCurrentIndex(index)
        self.set_previous_enabled.emit(
                             self.histindex is not None and self.histindex > 0)
        self.set_next_enabled.emit(self.histindex is not None and \
                                   self.histindex < len(self.history)-1)
        # Disable the view of .spyproject. 
        self.filter_directories()
520588
def go_to_previous_tab(self):
        
        self.active_tab_index = (self.active_tab_index - 1 +
                                 len(self.tab_pages)) % len(self.tab_pages)
539540
def _select_other_window(history):
    "  "
    current_buffer = history.app.current_buffer
    layout = history.history_layout.layout

    if current_buffer == history.history_buffer:
        layout.current_control = history.history_layout.default_buffer_control

    elif current_buffer == history.default_buffer:
        layout.current_control = history.history_layout.history_buffer_control
905859
function update() {
    var element = this.element,
        options = this.options,
        isImg = this.isImg;

    // Destroy viewer if the target image was deleted

    if (isImg && !element.parentNode) {
      return this.destroy();
    }

    var images = [];

    forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
      if (options.filter) {
        if (options.filter(image)) {
          images.push(image);
        }
      } else {
        images.push(image);
      }
    });

    if (!images.length) {
      return this;
    }

    this.images = images;
    this.length = images.length;

    if (this.ready) {
      var indexes = [];

      forEach(this.items, function (item, i) {
        var img = item.querySelector('img');
        var image = images[i];

        if (image) {
          if (image.src !== img.src) {
            indexes.push(i);
          }
        } else {
          indexes.push(i);
        }
      });

      setStyle(this.list, {
        width: 'auto'
      });

      this.initList();

      if (this.isShown) {
        if (this.length) {
          if (this.viewed) {
            var index = indexes.indexOf(this.index);

            if (index >= 0) {
              this.viewed = false;
              this.view(Math.max(this.index - (index + 1), 0));
            } else {
              addClass(this.items[this.index], CLASS_ACTIVE);
            }
          }
        } else {
          this.image = null;
          this.viewed = false;
          this.index = 0;
          this.imageData = null;
          this.canvas.innerHTML = '';
          this.title.innerHTML = '';
        }
      }
    } else {
      this.build();
    }

    return this;
  }
494716
def upgrade():
    """"""
    op.create_table(
        'userprofiles_userprofile',
        sa.Column('user_id', sa.Integer(), nullable=False),
        sa.Column('username', sa.String(length=255), nullable=True),
        sa.Column('displayname', sa.String(length=255), nullable=True),
        sa.Column('full_name', sa.String(length=255), nullable=False),
        sa.ForeignKeyConstraint(['user_id'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('user_id'),
        sa.UniqueConstraint('username')
    )
1213898
def update_views(self):
        """"""
        # Call the father's method
        super(Plugin, self).update_views()

        # Add specifics informations
        # Alert on signal thresholds
        for i in self.stats:
            self.views[i[self.get_key()]]['signal']['decoration'] = self.get_alert(i['signal'])
            self.views[i[self.get_key()]]['quality']['decoration'] = self.views[i[self.get_key()]]['signal']['decoration']
953148
def _toggle_help(history):
    "  "
    help_buffer_control = history.history_layout.help_buffer_control

    if history.app.layout.current_control == help_buffer_control:
        history.app.layout.focus_previous()
    else:
        history.app.layout.current_control = help_buffer_control
190394
def update_views(self):
        """"""
        # Call the father's method
        super(Plugin, self).update_views()

        # Add specifics informations
        # Alert and log
        for key in ['user', 'system', 'iowait']:
            if key in self.stats:
                self.views[key]['decoration'] = self.get_alert_log(self.stats[key], header=key)
        # Alert only
        for key in ['steal', 'total']:
            if key in self.stats:
                self.views[key]['decoration'] = self.get_alert(self.stats[key], header=key)
        # Alert only but depend on Core number
        for key in ['ctx_switches']:
            if key in self.stats:
                self.views[key]['decoration'] = self.get_alert(self.stats[key], maximum=100 * self.stats['cpucore'], header=key)
        # Optional
        for key in ['nice', 'irq', 'iowait', 'steal', 'ctx_switches', 'interrupts', 'soft_interrupts', 'syscalls']:
            if key in self.stats:
                self.views[key]['optional'] = True
726104
def step_prev(self):
        """"""
        window_start = around(self.parent.value('window_start') -
                              self.parent.value('window_length') /
                              self.parent.value('window_step'), 2)
        if window_start < 0:
            return
        self.parent.overview.update_position(window_start)
1145879
def page_prev(self):
        """"""
        window_start = (self.parent.value('window_start') -
                        self.parent.value('window_length'))
        if window_start < 0:
            return
        self.parent.overview.update_position(window_start)
644511
def updated(self, user):
        
        for who, what, old, new in self.history(user):
            if (what == "comment" or what == "description") and new != "":
                return True
        return False
798697
function () {
			// Remove the `selected` class from the old link and add it to the link for the current location hash
			this.element.find('#filters').find('a').removeClass('selected')
				.end().find('[href="' + window.location.hash + '"]').addClass('selected');
		}
885903
def refresh(self):
        """"""
        self._update_id_list()
        for _id in self.history[:]:
            if _id not in self.id_list:
                self.history.remove(_id)
150805
def add_to_current_action(self, controller):
        """"""
        item = self.current_item
        self._history[self._index] = item + (controller,)
691468
def prev_page(self):
        
        if self.history.position > self.lines and self.history.top:
            mid = min(len(self.history.top),
                      int(math.ceil(self.lines * self.history.ratio)))

            self.history.bottom.extendleft(
                self.buffer[y]
                for y in range(self.lines - 1, self.lines - mid - 1, -1))
            self.history = self.history \
                ._replace(position=self.history.position - mid)

            for y in range(self.lines - 1, mid - 1, -1):
                self.buffer[y] = self.buffer[y - mid]
            for y in range(mid - 1, -1, -1):
                self.buffer[y] = self.history.top.pop()

            self.dirty = set(range(self.lines))