Create the history of certain post.
333026
def create_post_history(raw_data):
        '''
        
        '''
        uid = tools.get_uuid()
        TabPostHist.create(
            uid=uid,
            title=raw_data.title,
            post_id=raw_data.uid,
            user_name=raw_data.user_name,
            cnt_md=raw_data.cnt_md,
            time_update=tools.timestamp(),
            logo=raw_data.logo,
        )
        return True
919971
protected function PostLoginHookMergeTemporaryHistoryWithDatabaseHistory()
    {
        // merge current data with user data
        $aHistory = $this->GetArticleViewHistory();
        $aTmpList = array_reverse($aHistory, true);
        foreach (array_keys($aTmpList) as $histKey) {
            if (is_null($aTmpList[$histKey]->id)) {
                $aData = $aTmpList[$histKey]->sqlData;
                $aData['data_extranet_user_id'] = $this->id;
                $aTmpList[$histKey]->LoadFromRow($aData);
                $aTmpList[$histKey]->AllowEditByAll(true);
                $aTmpList[$histKey]->Save();
            }
        }
        $this->aArticleViewHistory = null;
        $this->GetArticleViewHistory();
        // remove items from cookie...
        $domain = TCMSSmartURLData::GetActive()->sOriginalDomainName;
        if ('www.' == substr($domain, 0, 4)) {
            $domain = substr($domain, 4);
        }
        setcookie(TdbDataExtranetUser::COOKIE_NAME_HISTORY, '', time() - 3600, '/', '.'.$domain, false, true);
    }
811097
function(data) {
      // Keep the last n states (e.g. - defaults 5)
      var historyLength = _options.historyLength || 5;

      if(data) {
        _history.push(data);
      }

      // Update length
      if(_history.length > historyLength) {
        _history.splice(0, _history.length - historyLength);
      }
    }
827777
private void logOriginalResponseHistory(
        PluginResponse httpServletResponse, History history) throws URIException {
        RequestInformation requestInfo = requestInformation.get();
        if (requestInfo.handle && requestInfo.client.getIsActive()) {
            logger.info("Storing original response history");
            history.setOriginalResponseHeaders(HttpUtilities.getHeaders(httpServletResponse));
            history.setOriginalResponseCode(Integer.toString(httpServletResponse.getStatus()));
            history.setOriginalResponseContentType(httpServletResponse.getContentType());
            history.setOriginalResponseData(httpServletResponse.getContentString());
            logger.info("Done storing");
        }
    }
217503
def set_historylog(self, historylog):
        """"""
        historylog.add_history(self.shell.history_filename)
        self.shell.append_to_history.connect(historylog.append_to_history)
347403
def results(context, history_log):
    """"""
    if context.obj is None:
        context.obj = {}
    context.obj['history_log'] = history_log

    if context.invoked_subcommand is None:
        context.invoke(show, item=1)
1019964
def create_reply(post_data):
        '''
        
        '''
        uid = tools.get_uuid()
        TabReply.create(
            uid=uid,
            post_id=post_data['post_id'],
            user_name=post_data['user_name'],
            user_id=post_data['user_id'],
            timestamp=tools.timestamp(),
            date=datetime.datetime.now(),
            cnt_md=tornado.escape.xhtml_escape(post_data['cnt_reply']),
            cnt_html=tools.markdown2html(post_data['cnt_reply']),
            vote=0
        )
        return uid
798247
def set_history_file(self, path):
        """"""
        if path:
            self.history = prompt_toolkit.history.FileHistory(fixpath(path))
        else:
            self.history = prompt_toolkit.history.InMemoryHistory()
686440
def previous_history(self, e):  # (C-p)
         '''
        self._history.previous_history(self.l_buffer)
        self.l_buffer.point = lineobj.EndOfLine
        self.finalize()
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)
1231451
private void logRequestHistory(HttpMethod httpMethodProxyRequest, PluginResponse httpServletResponse,
                                   History history) {
        try {
            if (requestInformation.get().handle && requestInformation.get().client.getIsActive()) {
                logger.info("Storing history");
                String createdDate;
                SimpleDateFormat sdf = new SimpleDateFormat();
                sdf.setTimeZone(new SimpleTimeZone(0, "GMT"));
                sdf.applyPattern("dd MMM yyyy HH:mm:ss");
                createdDate = sdf.format(new Date()) + " GMT";

                history.setCreatedAt(createdDate);
                history.setRequestURL(HttpUtilities.getURL(httpMethodProxyRequest.getURI().toString()));
                history.setRequestParams(httpMethodProxyRequest.getQueryString() == null ? ""
                                             : httpMethodProxyRequest.getQueryString());
                history.setRequestHeaders(HttpUtilities.getHeaders(httpMethodProxyRequest));
                history.setResponseHeaders(HttpUtilities.getHeaders(httpServletResponse));
                history.setResponseCode(Integer.toString(httpServletResponse.getStatus()));
                history.setResponseContentType(httpServletResponse.getContentType());
                history.setResponseData(httpServletResponse.getContentString());
                history.setResponseBodyDecoded(httpServletResponse.isContentDecoded());
                HistoryService.getInstance().addHistory(history);
                logger.info("Done storing");
            }
        } catch (URIException e) {
            e.printStackTrace();
        }
    }
1211794
def OnBackView(self, event):
        """"""
        self.historyIndex -= 1
        try:
            self.RestoreHistory(self.history[self.historyIndex])
        except IndexError, err:
            self.SetStatusText(_('No further history available'))
544992
def post(request):
    """"""
    data = request.POST or json.loads(request.body)['body']
    guid = data.get('guid', None)
    res = Result()

    if guid:
        obj = getObjectsFromGuids([guid,])[0]
        comment = Comment()
        comment.comment = data.get('comment', 'No comment')
        comment.user = request.user
        comment.user_name = request.user.get_full_name()
        comment.user_email = request.user.email
        comment.content_object = obj
        # For our purposes, we never have more than one site
        comment.site_id = 1
        comment.save()

        obj.comment_count += 1
        obj.save()

        emailComment(comment, obj, request)

        res.append(commentToJson(comment))

    return JsonResponse(res.asDict())
127082
function (to, createHistoryEntry, triggerRoute, force, callback) {
                return this.history.navigate(to, createHistoryEntry, triggerRoute, force, callback);
            }
731331
def scan_posts(self, really=True, ignore_quit=False, quiet=True):
        """"""
        while (self.db.exists('site:lock') and
               int(self.db.get('site:lock')) != 0):
            self.logger.info("Waiting for DB lock...")
            time.sleep(0.5)
        self.db.incr('site:lock')
        self.logger.info("Lock acquired.")
        self.logger.info("Scanning site...")

        self._site.scan_posts(really, ignore_quit, quiet)

        timeline = []
        for post in self._site.timeline:
            data = [post.source_path, post.folder, post.is_post,
                    post._template_name, post.compiler.name]
            timeline.append(json.dumps(data))
        self.db.delete('site:timeline')
        if timeline:
            self.db.rpush('site:timeline', *timeline)

        self._write_indexlist('posts')
        self._write_indexlist('all_posts')
        self._write_indexlist('pages')

        self.db.incr('site:rev')

        self.db.decr('site:lock')
        self.logger.info("Lock released.")
        self.logger.info("Site scanned.")
        self.reload_site()
1142179
def get_urls(self):
        """"""
        urls = super(SimpleHistoryAdmin, self).get_urls()
        admin_site = self.admin_site
        opts = self.model._meta
        info = opts.app_label, opts.model_name
        history_urls = [
            url(
                "^([^/]+)/history/([^/]+)/$",
                admin_site.admin_view(self.history_form_view),
                name="%s_%s_simple_history" % info,
            )
        ]
        return history_urls + urls
213567
def go_to_history(self, index):
        
        if index < len(self._working_lines):
            self.working_index = index
            self.cursor_position = len(self.text)