Changeset 118 for trunk/lib/utility.cc


Ignore:
Timestamp:
Jul 3, 2006, 9:44:49 AM (15 years ago)
Author:
Peter Johansson
Message:

fixes #46 #45 #26 #40

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/utility.cc

    r115 r118  
    3939  int blame(const std::string& path)
    4040  {
    41     std::string system_call="svn blame " + path + " 1> svnstat.tmp 2> /dev/null";
     41    std::string mod_path = mod_str(path);
     42    std::string system_call="svn blame " + mod_path +
     43      " 1> /tmp/svnstat.tmp 2> /dev/null";
    4244    int system_return = system(system_call.c_str());
    4345    if (system_return)
     
    6567  std::map<std::string, std::string> info(const std::string& path)
    6668  {
    67     std::string system_call="svn info " + path + " 1> svnstat.tmp 2> /dev/null";
     69    std::string mod_path=mod_str(path);
     70    std::string system_call="svn info " + mod_path +
     71      " 1> /tmp/svnstat.tmp 2> /dev/null";
    6872    int system_return = system(system_call.c_str());
    6973    if (system_return)
    7074      return std::map<std::string, std::string>();
    7175
    72     std::ifstream is("svnstat.tmp");
     76    std::ifstream is("/tmp/svnstat.tmp");
    7377    std::string line;
    7478    std::map<std::string, std::string> svn_info;
     
    8286  }
    8387
     88  std::string mod_str(const std::string& str)
     89  {
     90    std::string mod_str="";
     91    for (size_t i=0; i<str.size(); ++i){
     92      if (str[i]==' ')
     93        mod_str+="\\ ";
     94      else
     95        mod_str+=str[i];
     96    }
     97    return mod_str;
     98  }
     99
    84100  void print_css(std::ostream& s)
    85101  {
     
    87103    s << " background: #fff; \n";
    88104    s << " color: #000; \n";
    89     s << " margin: 10px; \n";
     105    s << " margin: 0px; \n";
    90106    s << " padding: 0; \n";
    91107    s << "} \n";
     108    s << "\n";
     109    s << "#menu {\n";
     110    s << " background: #eee;\n";
     111    s << " width: 100%;\n";
     112    s << " margin: 0px;\n";
     113    s << " padding: 0px;\n";
     114    s << "}\n\n";
     115    s << "#menu ul\n";
     116    s << "{ \n";
     117    s << "padding: 0px;\n";
     118    s << "margin: 0px;list-style-type: none; text-align: center;"
     119      << "border-bottom: 1px solid black;}\n";
     120    s << "#menu ul li { display: inline; border-right: 1px solid black;}\n";
     121    s << "#menu ul li a {text-decoration: none; padding-right: 1em;"
     122      << "padding-left: 1em; margin: 0px;}\n";
     123    s << "#menu ul li a:hover{ color: #000; background: #ddd;}\n";
     124    s << "\n";
     125    s << "#main {\n";
     126    s << " margin: 10px; \n";
     127    s << "}\n";
    92128    s << "\n";
    93129    s << "body, th, td {\n";
     
    141177    s << "table.listings tbody tr.light { background-color: #fcfcfc }\n";
    142178    s << "table.listings tbody tr.dark { background-color: #f7f7f7 }\n";
    143     s << "table.listings tbody tr.hover { background: #eed }\n";
     179    s << "table.listings tbody tr:hover { background: #eed }\n";
    144180    s << "\n";
    145181    s << "\n";
Note: See TracChangeset for help on using the changeset viewer.